/* MT Member Portal — branded to mentalitytoday.com ("the doorway"):
   warm cream / cocoa / clay / sage, Fraunces + Karla, arched frames, paper grain,
   with the logo's mint, amber and periwinkle as accents. Fonts are self-hosted. */

@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin-full-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Karla"; src: url("/fonts/karla-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }

:root {
  /* website palette (data/site.json) */
  --cream: #FAF6EF; --cream-warm: #F5EAE0; --cream-deep: #F0E0D4; --cream-sage: #E8E8DD;
  --cocoa: #3B2E28; --ink: #241C18; --clay: #C4795A; --clay-text: #8E5944;
  --sage: #7C8F6F; --sage-text: #606A53; --rule: #DBD6CF; --muted: #6E655F;
  /* logo accents */
  --mint: #6FD3A8; --amber: #F2A541; --violet: #8D8BE8;
  --surface: #FFFDF9;
  --danger: #A8432C; --danger-soft: #F8E4DD;
  --shadow-1: 0 2px 5px color-mix(in srgb, var(--ink) 5%, transparent), 0 14px 30px -20px color-mix(in srgb, var(--ink) 45%, transparent);
  --shadow-2: 0 6px 14px color-mix(in srgb, var(--ink) 6%, transparent), 0 34px 60px -34px color-mix(in srgb, var(--ink) 55%, transparent);
  --shadow-3: 0 10px 24px color-mix(in srgb, var(--ink) 10%, transparent), 0 50px 90px -40px color-mix(in srgb, var(--ink) 60%, transparent);
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --arch: 50% 50% 14px 14px / 40% 40% 14px 14px;
  --arch-tall: 50% 50% 18px 18px / 30% 30% 18px 18px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--cocoa); font-family: var(--body); font-size: 16.5px; line-height: 1.6;
  background:
    radial-gradient(900px 520px at 88% -8%, color-mix(in srgb, var(--clay) 16%, transparent), transparent 70%),
    radial-gradient(760px 480px at -6% 18%, color-mix(in srgb, var(--sage) 16%, transparent), transparent 70%),
    var(--cream);
  background-attachment: fixed; min-height: 100vh; -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: var(--clay-text); text-underline-offset: .22em; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); line-height: 1.1; letter-spacing: -.012em; margin: 0 0 .45em; font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 72; }
h1 { font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.7rem); font-weight: 500; font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 120; }
h2 { font-size: clamp(1.35rem, 1.2rem + .6vw, 1.7rem); font-weight: 500; }
h3 { font-size: 1.22rem; font-weight: 600; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--clay-text); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--clay); color: var(--cream); }
.eyebrow { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--clay-text); margin-bottom: .6rem; }
.eyebrow.light { color: color-mix(in srgb, var(--cream) 78%, var(--clay)); }
.lede { font-size: 1.08rem; color: var(--cocoa); }
.muted { color: var(--muted); font-size: .92rem; }
.fine { color: var(--muted); font-size: .86rem; }
.center { text-align: center; }
.icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.grain { position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .05; mix-blend-mode: multiply; }
.grain svg { width: 100%; height: 100%; }

.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.main { padding: 1.5rem 0 3.5rem; }
.main.narrow { width: min(560px, 100% - 2rem); }
.loading { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: .8rem; color: var(--muted); }
.loading img { width: 48px; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.92); opacity: .7; } }

/* ---------- Top bar (frosted) ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--cream) 82%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 1px 0 color-mix(in srgb, var(--cocoa) 10%, transparent); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.brand-logo { height: 40px; width: auto; filter: drop-shadow(0 4px 8px color-mix(in srgb, var(--ink) 18%, transparent)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-family: var(--display); font-weight: 600; font-size: 1.16rem; font-variation-settings: "SOFT" 45, "WONK" 1, "opsz" 36; }
.brand-text span { font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--clay-text); font-weight: 700; margin-top: 3px; }
.brand-lg .brand-logo { height: 52px; }
.brand-lg .brand-text b { font-size: 1.4rem; }
.who { display: flex; align-items: center; gap: .75rem; }
.who-id { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.who-name { font-weight: 700; font-size: .93rem; color: var(--ink); }
.who-role { font-size: .78rem; color: var(--muted); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: var(--cream); background: linear-gradient(145deg, var(--clay), var(--cocoa)); box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,.25); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; border: 0; cursor: pointer; font: inherit; font-weight: 700; text-decoration: none; padding: .85rem 1.5rem; border-radius: 999px 999px 10px 10px; background: linear-gradient(180deg, color-mix(in srgb, var(--cocoa) 88%, var(--clay)), var(--cocoa)); color: var(--cream); box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,.14); transition: transform .25s ease, box-shadow .25s ease, filter .25s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255,255,255,.14); color: var(--cream); filter: brightness(1.06); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.btn-wide { width: 100%; border-radius: 999px; }
.btn-sm { padding: .5rem .95rem; font-size: .88rem; border-radius: 999px; }
.btn-quiet { background: transparent; color: var(--cocoa); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--cocoa) 22%, transparent); }
.btn-quiet:hover { background: var(--cream-warm); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--clay); filter: none; }
.btn-link { border: 0; background: none; color: var(--clay-text); font: inherit; font-weight: 600; padding: .6rem 0 0; cursor: pointer; text-decoration: underline; text-underline-offset: .22em; }
.tag { display: inline-flex; align-items: center; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .28rem .65rem; border-radius: 999px; background: var(--cream-sage); color: var(--sage-text); white-space: nowrap; }

/* ---------- Support header ---------- */
.support { display: flex; align-items: center; gap: 1rem; background: linear-gradient(120deg, var(--surface), color-mix(in srgb, var(--cream-sage) 70%, var(--surface))); border-radius: 20px; padding: .95rem 1.2rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-1), inset 0 0 0 1px color-mix(in srgb, var(--sage) 22%, transparent); }
.support-arch { flex: none; width: 46px; height: 56px; border-radius: var(--arch); display: grid; place-items: center; padding-top: 6px; font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--cream); background: linear-gradient(165deg, var(--sage), var(--sage-text)); box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,.25); }
.support-text { display: flex; flex-direction: column; min-width: 0; }
.support-text .eyebrow { margin: 0 0 .1rem; color: var(--sage-text); font-size: .66rem; }
.support-name { font-family: var(--display); font-size: 1.2rem; font-weight: 600; color: var(--ink); line-height: 1.2; }
.support-sub { font-size: .86rem; color: var(--muted); }

/* ---------- Cards & forms ---------- */
.card { position: relative; background: var(--surface); border-radius: 22px; padding: clamp(1.4rem, 1rem + 1.5vw, 2rem); box-shadow: var(--shadow-2), inset 0 0 0 1px color-mix(in srgb, var(--cocoa) 6%, transparent); }
.stack { display: flex; flex-direction: column; gap: .5rem; margin: 1.2rem 0 .4rem; }
label { font-weight: 700; font-size: .88rem; color: var(--ink); }
input { font: inherit; padding: .85rem 1rem; border: 0; border-radius: 14px; background: var(--cream); color: var(--ink); width: 100%; box-shadow: inset 0 0 0 1.5px var(--rule), inset 0 2px 4px color-mix(in srgb, var(--ink) 5%, transparent); transition: box-shadow .2s ease, background .2s ease; }
input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:focus { outline: none; background: var(--surface); box-shadow: inset 0 0 0 2px var(--clay), 0 0 0 5px color-mix(in srgb, var(--clay) 16%, transparent); }
.code-input { font-size: 1.5rem; letter-spacing: .5em; text-align: center; font-weight: 700; padding: .7rem 1rem; }
.stack .btn { margin-top: .6rem; }
.msg { padding: .75rem 1rem; border-radius: 14px; background: var(--cream-sage); font-size: .92rem; }
.msg.error { background: var(--danger-soft); color: var(--danger); }
code.secret { word-break: break-all; font-size: .85rem; background: var(--cream-warm); padding: .15rem .45rem; border-radius: 8px; color: var(--ink); }
.steps { padding-left: 1.3em; color: var(--cocoa); }
.steps li { margin-bottom: .35rem; padding-left: .2rem; }
.steps li::marker { color: var(--clay); font-weight: 700; }
.qr { display: flex; justify-content: center; margin: 1rem 0 .8rem; }
.qr img { display: block; box-sizing: content-box; width: 220px; height: 220px; background: #fff; padding: 18px; border-radius: 14px; border: 1px solid var(--rule); box-shadow: var(--shadow-2); image-rendering: pixelated; }

/* ---------- Sign-in: the doorway ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(2rem, 5vw, 5rem); width: min(1120px, 100% - 2rem); margin-inline: auto; padding: 2.5rem 0; }
.doorway { display: flex; justify-content: center; }
.doorway-arch { position: relative; width: min(100%, 420px); aspect-ratio: 4 / 5.2; border-radius: var(--arch-tall); overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6rem; padding: 3rem 2rem 2.2rem; background: linear-gradient(170deg, #4a3a32 0%, var(--cocoa) 45%, var(--ink) 100%); box-shadow: var(--shadow-3), inset 0 0 0 10px color-mix(in srgb, var(--cream) 8%, transparent); }
.doorway-glow { position: absolute; inset: 0; background: radial-gradient(60% 45% at 50% 38%, color-mix(in srgb, var(--mint) 38%, transparent), transparent 70%), radial-gradient(70% 40% at 50% 100%, color-mix(in srgb, var(--clay) 55%, transparent), transparent 70%); }
.doorway-logo { position: relative; width: 46%; filter: drop-shadow(0 18px 30px rgba(0,0,0,.35)); }
.doorway-line { position: relative; margin: 0; text-align: center; font-family: var(--display); font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); line-height: 1.25; color: var(--cream); font-variation-settings: "SOFT" 80, "WONK" 1, "opsz" 72; max-width: 15ch; }
.auth-panel { max-width: 460px; width: 100%; }
.auth-brand { margin-bottom: 1.4rem; }
.auth-card h1 { margin-bottom: .3rem; }
.auth-panel .fine { margin-top: 1rem; }

/* ---------- Home hero ---------- */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 1.5rem; border-radius: 28px; padding: clamp(1.6rem, 1rem + 3vw, 2.8rem); margin-bottom: 2.2rem; color: var(--cream); background: radial-gradient(70% 90% at 100% 0%, color-mix(in srgb, var(--clay) 45%, transparent), transparent 60%), radial-gradient(60% 80% at 0% 100%, color-mix(in srgb, var(--sage) 45%, transparent), transparent 60%), linear-gradient(160deg, #46362e, var(--ink)); box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255,255,255,.08); }
.hero h1 { color: var(--cream); font-size: clamp(2rem, 1.4rem + 2.4vw, 3.2rem); margin-bottom: .35em; }
.hero h1 em { font-style: normal; color: var(--mint); font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; }
.hero p { color: color-mix(in srgb, var(--cream) 82%, transparent); font-size: 1.08rem; max-width: 46ch; }
.hero-arch { width: 150px; height: 190px; border-radius: var(--arch-tall); display: grid; place-items: center; background: linear-gradient(175deg, color-mix(in srgb, var(--cream) 16%, transparent), color-mix(in srgb, var(--cream) 4%, transparent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cream) 22%, transparent); }
.hero-arch img { width: 64%; filter: drop-shadow(0 14px 22px rgba(0,0,0,.4)); }
.chips { list-style: none; padding: 0; margin: 1.2rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li { display: inline-flex; gap: .45rem; align-items: baseline; padding: .4rem .85rem; border-radius: 999px; font-size: .86rem; background: color-mix(in srgb, var(--cream) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cream) 20%, transparent); backdrop-filter: blur(6px); }
.chips li strong { color: var(--cream); }
.chips li span { color: color-mix(in srgb, var(--cream) 70%, transparent); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 1rem; }
.section-head h2 { margin: 0; }

/* ---------- Tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); gap: 1.1rem; }
.tile { --tone: var(--clay); --tone-deep: var(--clay-text); position: relative; display: flex; flex-direction: column; gap: .25rem; padding: 1.35rem 1.4rem 1.2rem; border-radius: 22px; text-decoration: none; color: var(--cocoa); background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--tone) 5%, var(--surface))); box-shadow: var(--shadow-1), inset 0 0 0 1px color-mix(in srgb, var(--cocoa) 6%, transparent); transition: transform .3s ease, box-shadow .3s ease; animation: rise .5s ease both; animation-delay: calc(var(--i, 0) * 60ms); overflow: hidden; }
.tile::before { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tone) 22%, transparent), transparent 70%); transition: transform .4s ease; }
.tile:hover { transform: translateY(-5px); box-shadow: var(--shadow-2), inset 0 0 0 1px color-mix(in srgb, var(--tone) 35%, transparent); color: var(--cocoa); }
.tile:hover::before { transform: scale(1.35); }
.tile h3 { margin: .7rem 0 .15rem; }
.tile p { margin: 0; font-size: .95rem; color: var(--muted); }
.tile-head { display: flex; align-items: flex-start; justify-content: space-between; position: relative; }
.tile-badge { width: 48px; height: 58px; border-radius: var(--arch); display: grid; place-items: center; padding-top: 6px; color: #fff; background: linear-gradient(165deg, var(--tone), var(--tone-deep)); box-shadow: 0 10px 20px -8px color-mix(in srgb, var(--tone-deep) 70%, transparent), inset 0 1px 0 rgba(255,255,255,.3); }
.tile-badge .icon { width: 22px; height: 22px; stroke-width: 1.9; }
.tile-badge.big { width: 64px; height: 78px; }
.tile-badge.big .icon { width: 28px; height: 28px; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed color-mix(in srgb, var(--cocoa) 14%, transparent); }
.tile-scope { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tone-deep); }
.tile-go { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--tone-deep); background: color-mix(in srgb, var(--tone) 14%, transparent); transition: transform .3s ease, background .3s ease, color .3s ease; }
.tile:hover .tile-go { transform: translateX(3px); background: var(--tone-deep); color: #fff; }
.tone-clay { --tone: var(--clay); --tone-deep: var(--clay-text); }
.tone-sage { --tone: var(--sage); --tone-deep: var(--sage-text); }
.tone-cocoa { --tone: #8a6e60; --tone-deep: var(--cocoa); }
.tone-amber { --tone: var(--amber); --tone-deep: #A8661A; }
.tone-mint { --tone: var(--mint); --tone-deep: #2F8A66; }
.tone-violet { --tone: var(--violet); --tone-deep: #5552B8; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Module page ---------- */
.crumbs { display: flex; gap: .5rem; font-size: .9rem; color: var(--muted); margin-bottom: 1rem; }
.module-hero { --tone: var(--clay); --tone-deep: var(--clay-text); display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1.4rem; }
.module-hero h1 { margin: 0 0 .2rem; }
.module-hero .lede { margin: 0; color: var(--muted); }
.card.empty { text-align: center; padding-block: 2.6rem; background: radial-gradient(60% 80% at 50% 0%, var(--cream-warm), var(--surface)); }
.card.empty .tag { margin-bottom: .9rem; }
.card.empty p { color: var(--muted); margin: 0; }

/* ---------- Footer ---------- */
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; color: var(--muted); font-size: .84rem; padding: 1.2rem 0 2.5rem; border-top: 1px solid color-mix(in srgb, var(--cocoa) 10%, transparent); }
.foot-note { display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; padding-top: 1.5rem; gap: 1.5rem; }
  .doorway-arch { width: min(100%, 300px); aspect-ratio: auto; padding: 2.2rem 1.5rem 1.6rem; gap: 1rem; }
  .doorway-logo { width: 90px; }
  .auth-panel { margin-inline: auto; }
  .auth-brand { display: none; }
}
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero-arch { display: none; }
  .who-id, .hide-sm { display: none; }
  .btn-sm { padding: .55rem; }
  .brand-text b { font-size: 1.02rem; }
  .support { padding: .8rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
