/* MBPrep public site and focus pages: the layer on top of shell.css (tokens, themes, accents, buttons, faces are
   shell.css's and are never redrawn here). Two layouts:
   - .site  : the public site bar, the page, the footer and the menu sheet (from app/(home) and app/(site));
   - .focus : joining and paying, no sidebar: a slim top bar, the work in the centre, companions either side.
   Rules: role colours only, no gradients, no side stripes, icons not emoji, cards in a row share one height. */

/* ---------- the brand and the deep surfaces ---------- */
:root {
  --brand-lime: #D4F53C; --brand-ink: #0C0D0E; --brand-paper: #FAFAFA;
  --lime: var(--accent); --lime-ink: var(--accent-ink);
  --hero-bg: #0C0D0E; --hero-fg: #FAFAFA; --hero-fg-2: #B4B7BC; --hero-line: rgb(250 250 250 / 0.14);
  --font-display: var(--font);
  --display-track: -0.03em;
  --wrap: 1680px;
  --gutter: clamp(16px, 2.2vw, 32px);
  --bar-h: 72px;
  --t-story: 18s;
}
:root[data-mode="dark"] { --hero-bg: var(--surface-2); --hero-fg: var(--ink); --hero-fg-2: var(--ink-2); --hero-line: color-mix(in srgb, var(--ink) 14%, transparent); }
:root[data-theme="contrast"] { --hero-bg: #000; }
/* on ink, the brand action is always lime when the student hasn't chosen an accent; a chosen accent wins */
.on-ink { --focus: var(--hero-fg); }

/* ---------- type ---------- */
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: var(--display-track); line-height: 1.02; font-size: var(--fs-display); }
.title { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; font-size: clamp(28px, 2.6vw, 40px); }
.h3 { font-size: var(--fs-lead); font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; }
.lead { font-size: var(--fs-lead); line-height: 1.45; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-small); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.strike { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--ink-3); }
.hi { color: var(--accent-strong); }
.on-ink .hi { color: var(--accent); }
:root[data-accent="deepblue"]:not([data-mode="dark"]) .on-ink .hi, :root[data-accent="deepgreen"]:not([data-mode="dark"]) .on-ink .hi { color: var(--brand-lime); }

/* ---------- shared pieces ---------- */
.card { position: relative; display: grid; align-content: start; gap: var(--s4); padding: var(--s6); border-radius: var(--r-lg); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.card.soft { background: var(--surface); box-shadow: none; }
.card.pad-l { padding: var(--s7); }
.ink { position: relative; isolation: isolate; overflow: hidden; background: var(--hero-bg); color: var(--hero-fg); border-radius: var(--r-lg); }
.ink .muted, .ink .lead { color: var(--hero-fg-2); }
.ink .btn-ghost { color: var(--hero-fg); border-color: var(--hero-line); }
@media (hover: hover) { .ink .btn-ghost:hover { background: color-mix(in srgb, var(--hero-fg) 8%, transparent); border-color: var(--hero-fg-2); } }
canvas.ht { position: absolute !important; inset: 0; z-index: -1 !important; display: block; width: 100%; height: 100%; border-radius: inherit; pointer-events: none; }
.clay { display: block; width: var(--clay, 112px); height: auto; filter: drop-shadow(0 18px 24px rgb(0 0 0 / 0.28)); pointer-events: none; user-select: none; }
.ink-dots { position: absolute; inset: 0; z-index: -1; }

.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 var(--s3); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2); font-size: var(--fs-small); font-weight: 600; white-space: nowrap; }
.chip .od-icon { --od-icon-size: 16px; }
.chip.on { background: var(--ink); color: var(--bg); }
.chip.acc { background: var(--accent); color: var(--accent-ink); }
.chip.line { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.ink .chip { background: color-mix(in srgb, var(--hero-fg) 10%, transparent); color: var(--hero-fg); }
.sample { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.ink .sample { box-shadow: inset 0 0 0 1px var(--hero-line); color: var(--hero-fg-2); }

.btn .od-icon { --od-icon-size: 18px; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[aria-busy="true"] { pointer-events: none; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } }

.seg { position: relative; display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface); }
.seg button { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 var(--s4); border-radius: var(--r-pill); font-size: var(--fs-small); font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: background-color 140ms var(--ease-out), color 140ms var(--ease-out); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg.sliding button[aria-pressed="true"] { background: transparent; }
.seg-ghost { position: absolute; z-index: 0; border-radius: var(--r-pill); background: var(--ink); pointer-events: none; }
@media (hover: hover) { .seg button:not([aria-pressed="true"]):hover { color: var(--ink); background: var(--surface-2); } }

/* fields: a label always shown, the error beside the field, never a placeholder standing in */
.field { display: grid; gap: var(--s2); }
.field > label, .field > .lbl { font-size: var(--fs-small); font-weight: 600; color: var(--ink-2); }
.input { width: 100%; min-height: 52px; padding: 0 var(--s4); border-radius: var(--r); border: 1px solid var(--line); background: var(--raised); color: var(--ink); font-size: 16px; transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out); }
textarea.input { min-height: 132px; padding: var(--s3) var(--s4); resize: vertical; line-height: 1.5; }
select.input { appearance: none; padding-right: 44px; background-image: none; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent); }
.err { display: flex; align-items: flex-start; gap: var(--s2); font-size: var(--fs-small); font-weight: 600; color: var(--danger); }
.err .od-icon { --od-icon-size: 18px; margin-top: 1px; }
.okline { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-small); font-weight: 600; color: var(--accent-strong); }
.select-wrap { position: relative; }
.select-wrap .od-icon { position: absolute; right: 16px; top: 50%; translate: 0 -50%; --od-icon-size: 18px; color: var(--ink-3); pointer-events: none; }

/* the one info control: explanations live here, not on the page */
.info { display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -10px; border-radius: 50%; color: var(--ink-3); }
.info .od-icon { --od-icon-size: 18px; }
@media (hover: hover) { .info:hover { color: var(--ink); } }
.ink .info { color: var(--hero-fg-2); }
.info-pop { position: fixed; z-index: 90; width: min(340px, calc(100vw - 32px)); padding: var(--s4) var(--s5); border-radius: var(--r); background: var(--ink); color: var(--bg); font-size: var(--fs-small); line-height: 1.5; box-shadow: var(--shadow); }
.info-pop b { display: block; margin-bottom: 4px; font-size: var(--fs-ui); }

/* the toast */
.toast { position: fixed; z-index: 95; left: 50%; bottom: 24px; translate: -50% 0; max-width: calc(100vw - 32px); padding: var(--s3) var(--s5); border-radius: var(--r-pill); background: var(--ink); color: var(--bg); font-size: var(--fs-small); font-weight: 600; box-shadow: var(--shadow); animation: toast-in 240ms var(--ease-out) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* things that aren't ready look it: a frosted preview, never an outlined box */
.frost { position: relative; overflow: hidden; }
.frost > .frost-under { filter: blur(6px) saturate(0.9); opacity: 0.7; pointer-events: none; user-select: none; }
.frost > .frost-over { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: var(--s2); background: color-mix(in srgb, var(--raised) 40%, transparent); backdrop-filter: blur(2px); text-align: center; font-weight: 700; }

/* reveal: cards settle in, text goes from muted to bold as it comes into view */
.rv { opacity: 0; transform: translateY(14px); transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out); transition-delay: calc(var(--i, 0) * 40ms); }
.rv.in { opacity: 1; transform: none; }
.words .w { color: color-mix(in srgb, currentColor 26%, transparent); transition: color 300ms var(--ease-out); }
.words .w.on { color: inherit; }
.words { color: var(--ink); }
.ink .words { color: var(--hero-fg); }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } .words .w { color: inherit; } }

/* ---------- the mark ---------- */
.mark { display: block; width: 40px; height: 32px; color: var(--ink); flex: none; }
.mark path { fill: currentColor; }
.ink .mark { color: var(--hero-fg); }

/* ================================================================== */
/* ---------- SITE: bar, page, footer, menu ---------- */
/* ================================================================== */
.site main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gutter); padding: 0 var(--gutter) var(--gutter); max-width: var(--wrap); margin: 0 auto; min-height: calc(100dvh - var(--bar-h)); align-content: start; }
.site-bar { position: sticky; top: 0; z-index: 40; height: var(--bar-h); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid transparent; transition: border-color var(--t) var(--ease-out); }
.site-bar.scrolled { border-bottom-color: var(--line); }
.site-bar .wrap { display: flex; align-items: center; gap: var(--s5); height: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.site-bar .home-link { display: inline-flex; align-items: center; gap: var(--s3); min-height: 44px; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.site-nav { display: flex; align-items: center; gap: 2px; margin: 0 auto; }
.site-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s4); border-radius: var(--r-pill); font-size: var(--fs-ui); font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
.site-nav a[aria-current="page"] { background: var(--surface); color: var(--ink); }
@media (hover: hover) { .site-nav a:hover { color: var(--ink); background: var(--surface); } }
.bar-end { display: flex; align-items: center; gap: var(--s2); }
.bar-end .sign { font-size: var(--fs-ui); font-weight: 600; padding: 0 var(--s3); min-height: 44px; display: inline-flex; align-items: center; color: var(--ink-2); white-space: nowrap; }
.mode-btn, .burger { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink-2); }
.mode-btn .od-icon, .burger .od-icon { --od-icon-size: 20px; }
@media (hover: hover) { .mode-btn:hover, .burger:hover { background: var(--surface); color: var(--ink); } }
.burger { display: none; }
@media (max-width: 1100px) { .site-nav { display: none; } .burger { display: inline-grid; } .bar-end { margin-left: auto; } }
@media (max-width: 600px) { .bar-end .sign { display: none; } .site-bar .wrap { gap: var(--s3); } .bar-end { gap: 4px; } .bar-end .btn { padding: 0 16px; } }
@media (max-width: 420px) { .site-bar .home-link span { display: none; } }

/* the menu sheet: every page numbered, as the live menu */
.menu-sheet { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--ink); }
.menu-sheet::backdrop { background: var(--scrim); }
.menu-in { display: grid; grid-template-rows: auto 1fr auto; height: 100%; padding: var(--s4) var(--gutter) var(--s6); }
.menu-top { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.menu-list { display: grid; align-content: center; gap: 0; }
.menu-list a { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--line); font-size: clamp(28px, 7vw, 44px); font-weight: 700; letter-spacing: -0.03em; }
.menu-list a small { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.menu-list a[aria-current="page"] { color: var(--accent-strong); }
.menu-foot { display: grid; gap: var(--s3); }

/* the page hero on sub pages */
.page-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--gutter); min-height: clamp(360px, 46vh, 520px); }
.page-hero .ink { display: grid; align-content: space-between; gap: var(--s6); padding: clamp(28px, 4vw, 64px); }
.page-hero .ink .display { max-width: 14ch; }
.page-hero .side-card { display: grid; align-content: space-between; gap: var(--s5); }
@media (max-width: 1023px) { .page-hero { grid-template-columns: minmax(0, 1fr); } }

.sec-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s5); padding: var(--s6) 0 var(--s2); }
.sec-head .title { max-width: 22ch; }
.row { display: grid; gap: var(--gutter); grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); align-items: stretch; }
@media (max-width: 1023px) { .row { --cols: 2 !important; } }
@media (max-width: 600px) { .row { --cols: 1 !important; } }
.feat { display: grid; grid-template-rows: auto auto 1fr; gap: var(--s3); }
.feat .ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--surface); color: var(--ink); }
.feat .ic .od-icon { --od-icon-size: 24px; }

/* the footer: the live one, block for block */
.site-foot { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter) var(--gutter); }
.foot { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s7); padding: clamp(28px, 4vw, 64px); border-radius: var(--r-lg); background: var(--hero-bg); color: var(--hero-fg); overflow: hidden; position: relative; isolation: isolate; }
.foot-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: var(--s6); align-items: end; }
.foot-top h2 { font-family: var(--font-display); font-size: clamp(32px, 3.6vw, 56px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.foot-top h2 a { color: var(--hero-fg-2); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--hero-line); }
@media (hover: hover) { .foot-top h2 a:hover { color: var(--hero-fg); text-decoration-color: currentColor; } }
.foot-signup { display: grid; gap: var(--s3); }
.foot-signup .lbl { font-size: var(--fs-small); font-weight: 600; color: var(--hero-fg-2); }
.foot-signup .od-row { --od-gap: 8px; }
.foot-signup .input { background: color-mix(in srgb, var(--hero-fg) 6%, transparent); border-color: var(--hero-line); color: var(--hero-fg); }
.foot-signup .input:focus { border-color: var(--hero-fg); box-shadow: none; }
.foot-signup .okline { color: var(--hero-fg); }
.foot-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); }
.foot-links h4 { margin: 0 0 var(--s3); font-size: var(--fs-small); font-weight: 600; color: var(--hero-fg-2); }
.foot-links a { display: flex; align-items: center; min-height: 36px; font-size: var(--fs-ui); color: var(--hero-fg); white-space: nowrap; }
@media (hover: hover) { .foot-links a:hover { text-decoration: underline; text-underline-offset: 4px; } }
.wordmark { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5); font-family: var(--font-display); font-weight: 800; font-size: clamp(52px, 14vw, 240px); letter-spacing: -0.06em; line-height: 0.8; color: var(--hero-fg); }
.wordmark .mark { width: clamp(52px, 13vw, 220px); height: auto; aspect-ratio: 5 / 4; color: var(--accent); }
:root:not([data-mode="dark"]) .foot .wordmark .mark { color: var(--brand-lime); }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); padding-top: var(--s4); border-top: 1px solid var(--hero-line); font-size: 13px; color: var(--hero-fg-2); }
.foot-base a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1023px) { .foot-top { grid-template-columns: minmax(0, 1fr); } .foot-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* reading pages: contents on one side, the text in the centre, key points on the other */
.read { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 720px) minmax(220px, 1fr); gap: var(--gutter); align-items: start; }
.read-toc, .read-aside { position: sticky; top: calc(var(--bar-h) + var(--gutter)); max-height: calc(100dvh - var(--bar-h) - 2 * var(--gutter)); overflow: auto; scrollbar-width: none; }
.read-toc a { display: flex; align-items: center; gap: var(--s3); min-height: 40px; padding: 0 var(--s3); border-radius: var(--r-sm); font-size: var(--fs-small); color: var(--ink-3); }
.read-toc a.on { background: var(--surface); color: var(--ink); font-weight: 700; }
@media (hover: hover) { .read-toc a:hover { color: var(--ink); } }
.read-toc .prog-line { height: 4px; border-radius: 4px; background: var(--surface); overflow: hidden; margin: var(--s3) var(--s3) 0; }
.read-toc .prog-line > span { display: block; height: 100%; width: var(--p, 0%); background: var(--accent); }
.prose { font-size: 17px; line-height: 1.7; color: var(--ink-2); }
.prose h2 { margin: var(--s7) 0 var(--s3); font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; color: var(--ink); scroll-margin-top: calc(var(--bar-h) + 24px); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: var(--s5) 0 var(--s2); font-size: 19px; color: var(--ink); }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--s4); }
.prose ul { padding-left: 1.2em; list-style: disc; }
.prose ol { padding-left: 1.3em; list-style: decimal; }
.prose li { margin-bottom: var(--s2); }
.prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--ink); }
@media (max-width: 1180px) { .read { grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); } .read-toc { display: none; } }
@media (max-width: 860px) { .read { grid-template-columns: 1fr; } .read-aside { position: static; max-height: none; } }

/* ================================================================== */
/* ---------- FOCUS: joining and paying ---------- */
/* ================================================================== */
.focus { min-height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.focus > .focus-bar { position: relative; inset: auto; z-index: 2; display: flex; align-items: center; gap: var(--s4); height: var(--bar-h); padding: 0 var(--gutter); background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0; } /* shell.css's .focus-bar is the mock timer's fixed bar; this one sits in flow */
.focus-bar .home-link { display: inline-flex; align-items: center; gap: var(--s3); min-height: 44px; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.focus-bar .end { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.focus-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--gutter); padding: 0 var(--gutter) var(--gutter); min-height: calc(100dvh - var(--bar-h)); }
.focus-main > * { min-width: 0; }
.focus-center { display: grid; align-content: center; }
.focus-side { display: flex; flex-direction: column; gap: var(--gutter); }
.focus-side > :last-child { flex: 1 1 auto; } /* the last companion meets the bottom; the others keep their own height */
@media (max-width: 1180px) { .focus-main { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } .focus-main > .focus-side.left { display: none; } }
@media (max-width: 860px) {
  .focus-main { grid-template-columns: 1fr; min-height: 0; }
  .focus-side > :last-child { flex: none; }
}

/* ---------- phone ---------- */
@media (max-width: 600px) {
  :root { --fs-display: clamp(40px, 11vw, 52px); --bar-h: 64px; }
  .card { padding: var(--s5); }
  .card.pad-l { padding: var(--s5); }
  .sec-head { flex-direction: column; align-items: flex-start; }
  .foot-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-links a { white-space: normal; line-height: 1.3; min-height: 40px; }
  .foot-signup .od-row { flex-direction: column; align-items: stretch; }
}
