/* Clarity, phase 3: the kitchen table. Paper, two lenses, sober numbers, warm everything else. */

/* ---------- Fonts: Fraunces (display, self-hosted) with a metric-matched Georgia fallback ---------- */
@font-face { font-family: "Fraunces"; src: url("/static/fonts/fraunces-var.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces Fallback"; src: local("Georgia"), local("Times New Roman"); size-adjust: 104%; ascent-override: 92%; descent-override: 24%; line-gap-override: 0%; }

/* ---------- Tokens ---------- */
:root {
  --paper: #f6f1e8; --sheet: #fffdf8; --sheet-2: #efe9dd; --ink: #28251f; --muted: #6b665c; --faint: #9c9588;
  --border: rgba(40, 37, 31, 0.1); --border-strong: rgba(40, 37, 31, 0.18);
  --sage: #6f8f72; --sage-deep: #4e6f54; --sage-soft: #e2ebe0;
  --lake: #5f84a8; --lake-deep: #44617f; --lake-soft: #e1e9f1;
  --maple: #c0603e; --maple-soft: #f4e1d8;
  --birch: #d9cfbd; --birch-deep: #b7ab95;
  --honey-soft: #f1e3c4; --honey-deep: #7d5a1e;
  --rose-soft: #f1e1dd; --rose-deep: #8a4b40;
  --art-sky-1: #e6edf2; --art-sky-2: #f3eee3; --art-sun: #f3dfbd; --art-wood: #b9a07c;
  --radius: 20px; --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(40, 37, 31, 0.04), 0 10px 30px rgba(40, 37, 31, 0.07);
  --shadow-lift: 0 2px 4px rgba(40, 37, 31, 0.05), 0 18px 40px rgba(40, 37, 31, 0.12);
  --display: "Fraunces", "Fraunces Fallback", Georgia, serif;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  /* legacy aliases used across components */
  --bg: var(--paper); --surface: var(--sheet); --surface-2: var(--sheet-2); --text: var(--ink);
  --blue: var(--lake); --blue-deep: var(--lake-deep); --blue-soft: var(--lake-soft); --stone: var(--birch-deep);
  --amber-soft: var(--honey-soft); --amber-deep: var(--honey-deep);
  color-scheme: light;
}
.dark-tokens, :root[data-theme="dark"] {
  --paper: #1b1a17; --sheet: #262420; --sheet-2: #2f2c27; --ink: #efe9df; --muted: #aaa397; --faint: #7d776c;
  --border: rgba(239, 233, 223, 0.1); --border-strong: rgba(239, 233, 223, 0.2);
  --sage: #8fae92; --sage-deep: #b5cdb7; --sage-soft: #2d3a2f;
  --lake: #86a6c6; --lake-deep: #b4cbe2; --lake-soft: #2a3542;
  --maple: #e08a6a; --maple-soft: #402a22;
  --birch: #514a40; --birch-deep: #7a7265;
  --honey-soft: #3f3420; --honey-deep: #e2c48e;
  --rose-soft: #40302d; --rose-deep: #e3a99e;
  --art-sky-1: #23282d; --art-sky-2: #2a2924; --art-sun: #6d5a3a; --art-wood: #6b5c47;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 40px rgba(0, 0, 0, 0.45);
  --bg: var(--paper); --surface: var(--sheet); --surface-2: var(--sheet-2); --text: var(--ink);
  --blue: var(--lake); --blue-deep: var(--lake-deep); --blue-soft: var(--lake-soft); --stone: var(--birch-deep);
  --amber-soft: var(--honey-soft); --amber-deep: var(--honey-deep);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1a17; --sheet: #262420; --sheet-2: #2f2c27; --ink: #efe9df; --muted: #aaa397; --faint: #7d776c;
    --border: rgba(239, 233, 223, 0.1); --border-strong: rgba(239, 233, 223, 0.2);
    --sage: #8fae92; --sage-deep: #b5cdb7; --sage-soft: #2d3a2f;
    --lake: #86a6c6; --lake-deep: #b4cbe2; --lake-soft: #2a3542;
    --maple: #e08a6a; --maple-soft: #402a22;
    --birch: #514a40; --birch-deep: #7a7265;
    --honey-soft: #3f3420; --honey-deep: #e2c48e;
    --rose-soft: #40302d; --rose-deep: #e3a99e;
    --art-sky-1: #23282d; --art-sky-2: #2a2924; --art-sun: #6d5a3a; --art-wood: #6b5c47;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 40px rgba(0, 0, 0, 0.45);
    --bg: var(--paper); --surface: var(--sheet); --surface-2: var(--sheet-2); --text: var(--ink);
    --blue: var(--lake); --blue-deep: var(--lake-deep); --blue-soft: var(--lake-soft); --stone: var(--birch-deep);
    --amber-soft: var(--honey-soft); --amber-deep: var(--honey-deep);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--paper); color: var(--ink); line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; position: relative; overflow-x: hidden; }
/* paper grain, light touch */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.045; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>"); mix-blend-mode: multiply; }
:root[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: 0.05; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::before { mix-blend-mode: screen; opacity: 0.05; } }
main, header, footer { position: relative; z-index: 1; }
main { flex: 1; }
h1, h2, h3, .display { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.12; margin: 0 0 0.4em; font-variation-settings: "opsz" 48; }
h1 { font-size: clamp(1.9rem, 3.6vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.65rem); }
h3 { font-size: 1.15rem; font-weight: 500; }
h4 { font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--lake-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .muted { color: var(--muted); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 42rem; }
:focus-visible { outline: 3px solid var(--lake); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--sheet); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
img, svg { max-width: 100%; }

.shell { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.shell.narrow { max-width: 640px; }
main.shell { padding-top: 32px; padding-bottom: 56px; animation: rise var(--dur-slow) var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(var(--dist-sm)); } to { opacity: 1; transform: none; } }
/* Reduced motion is handled once, in the motion tokens: distances go to zero and durations to near zero. */

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand { color: var(--ink); display: inline-flex; align-items: center; gap: 9px; }
.brand:hover { text-decoration: none; }
.wordmark { font-family: var(--display); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; font-variation-settings: "opsz" 24; }
.mark { flex: none; }
.topbar nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: nowrap; white-space: nowrap; }
.topbar nav a { display: inline-block; padding: 7px 13px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.topbar nav a:hover { background: var(--sheet-2); text-decoration: none; color: var(--ink); }
.topbar nav a[aria-current="page"] { background: var(--sheet-2); color: var(--ink); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { color: var(--muted); font-size: 0.95rem; display: inline-flex; align-items: center; gap: 8px; }
.theme-toggle { border: 1px solid var(--border); background: var(--sheet); color: var(--muted); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; display: grid; place-items: center; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .moon, :root:not([data-theme="light"]) .theme-toggle .moon { display: inline; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .sun { display: none; } }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .theme-toggle .moon { display: none; } :root:not([data-theme="dark"]) .theme-toggle .sun { display: inline; } }
@media (max-width: 720px) {
  .topbar nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 6px; }
  .who { display: none; }
}

/* ---------- Avatars ---------- */
.avatar { --av: 36px; display: inline-grid; place-items: center; width: var(--av); height: var(--av); border-radius: 50%; font-weight: 700; font-size: calc(var(--av) * 0.4); color: #fff; flex: none; letter-spacing: 0.02em; }
.avatar-student { background: var(--lake-deep); }
.avatar-parent { background: var(--sage-deep); }
:root[data-theme="dark"] .avatar { color: #1b1a17; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { color: #1b1a17; } }
.avatar-xs { --av: 24px; }

/* ---------- Cards, surfaces ---------- */
.card { background: var(--sheet); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid-2 > .card + .card, .grid-3 > .card + .card, .journey > .card + .card, .entry-grid > .card + .card { margin-top: 0; }
.card.soft { background: var(--sheet-2); box-shadow: none; }
.stack > * + * { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.section { margin-top: 40px; }
hr.soft { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.eyebrow { display: inline-block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--sage-deep); font-weight: 700; margin-bottom: 10px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); text-decoration: none; min-height: 44px; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--sage-deep); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #1b1a17; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #1b1a17; } }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(78, 111, 84, 0.3); }
.btn-secondary { background: var(--sheet); border-color: var(--border-strong); color: var(--ink); }
.btn-secondary:hover { background: var(--sheet-2); }
.btn-quiet { background: transparent; color: var(--muted); padding: 8px 12px; min-height: 36px; }
.btn-quiet:hover { color: var(--ink); background: var(--sheet-2); }
.btn-danger { background: transparent; border-color: var(--border-strong); color: var(--rose-deep); }
.btn-danger:hover { background: var(--rose-soft); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }

/* ---------- Forms ---------- */
label, .label { display: block; font-weight: 600; margin-bottom: 6px; }
.help { color: var(--muted); font-size: 0.95rem; margin: -2px 0 12px; }
input[type="text"], input[type="number"], input[type="password"], textarea, select { width: 100%; font: inherit; color: var(--ink); background: var(--sheet); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 12px 14px; min-height: 48px; }
input:focus, textarea:focus, select:focus { border-color: var(--lake); outline: none; box-shadow: 0 0 0 4px var(--lake-soft); }
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 18px; }
.error { color: var(--rose-deep); font-size: 0.95rem; margin-top: 6px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--sage-deep); flex: none; }

/* ---------- Choice cards ---------- */
.choices { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.choices.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .choices.cols-2 { grid-template-columns: 1fr; } }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice > label { margin: 0; }
.choice span.box { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 14px; border: 1.5px solid var(--border-strong); background: var(--sheet); cursor: pointer; transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring); min-height: 56px; font-weight: 500; }
.choice span.box:hover { transform: translateY(-1px); border-color: var(--sage); }
.choice span.box::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--birch-deep); flex: none; transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.choice.multi span.box::before { border-radius: 6px; }
.choice input:checked + label span.box { border-color: var(--sage-deep); background: var(--sage-soft); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sage) 25%, transparent); }
.choice input:checked + label span.box::before { border-color: var(--sage-deep); background: var(--sage-deep); box-shadow: inset 0 0 0 3px var(--sheet); }
.choice input:focus-visible + label span.box { outline: 3px solid var(--lake); outline-offset: 2px; }
.choice small { display: block; color: var(--muted); font-weight: 400; }
.choices.pair { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.choices.cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.choice.choice-card span.box { flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px; min-height: 120px; }
.choice.choice-card span.box::before { position: absolute; top: 14px; right: 14px; }
.choice.choice-card { position: relative; }
.choice .ico { color: var(--sage-deep); flex: none; }
.choice-text { display: flex; flex-direction: column; }
.choice-label { font-weight: 600; }
.scale { display: flex; gap: 8px; }
.scale .choice { flex: 1; }
.scale .choice span.box { justify-content: center; padding: 14px 6px; }
.scale .choice span.box::before { display: none; }
.scale-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.9rem; margin-top: 6px; }
.grades-grid { display: grid; grid-template-columns: 1fr 120px; gap: 10px 14px; align-items: center; }
.grades-grid label { margin: 0; font-weight: 500; }

/* Rank list */
.rank-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--sheet); border: 1.5px solid var(--border-strong); border-radius: 14px; transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.rank-item .ico { color: var(--sage-deep); }
.rank-label { flex: 1; margin: 0; font-weight: 500; }
.rank-select { width: 72px; min-height: 40px; padding: 6px 8px; }
.rank-tools { display: inline-flex; gap: 4px; }
.rank-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--sheet); color: var(--ink); cursor: pointer; font-size: 1rem; }
.rank-btn:hover { background: var(--sheet-2); }
.rank-btn[disabled] { opacity: .35; cursor: default; }
.rank-item.ranked { border-color: var(--sage); background: var(--sage-soft); }

/* Slider */
.slider { padding: 14px 6px 36px; position: relative; }
.slider input[type="range"] { width: 100%; accent-color: var(--sage-deep); height: 32px; }
.slider-anchors { position: relative; height: 22px; margin-top: 6px; }
.slider-anchors span { position: absolute; transform: translateX(-50%); font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.slider-anchors span:first-child { transform: none; }
.slider-anchors span:last-child { transform: translateX(-100%); }
.slider-out { display: block; margin-top: 10px; font-weight: 600; color: var(--sage-deep); text-align: center; font-family: var(--display); font-size: 1.1rem; }

/* ---------- Questionnaire: trail, steps, reveal ---------- */
.step-label { color: var(--muted); font-size: 0.9rem; }
.section-tag { color: var(--sage-deep); font-weight: 600; }
.trail { width: 100%; height: auto; display: block; margin: 6px 0 4px; overflow: visible; }
.trail-line { stroke: var(--birch); stroke-width: 2; fill: none; }
.trail-line.done { stroke: var(--sage-deep); stroke-width: 3; }
.trail-dot .dot { fill: var(--sheet); stroke: var(--birch-deep); stroke-width: 2; }
.trail-dot.done .dot { fill: var(--sage-deep); stroke: var(--sage-deep); }
.trail-dot.now .dot { fill: var(--maple); stroke: var(--maple); }
.trail-dot .tick { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trail-labels { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin: 0 0 18px; }
.trail-labels span.now { color: var(--maple); font-weight: 700; }
.trail-labels span.done { color: var(--sage-deep); }
@media (max-width: 480px) { .trail-labels span:not(.now):not(.done) { visibility: hidden; } }
.progress { height: 6px; background: var(--sheet-2); border-radius: 999px; overflow: hidden; margin: 8px 0 28px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--sage), var(--sage-deep)); border-radius: 999px; transition: width var(--dur-slow) var(--ease-spring); }
.q-step { animation: stepIn var(--dur-base) var(--ease-out) both; }
@keyframes stepIn { from { opacity: 0; transform: translateX(var(--dist-md)); } to { opacity: 1; transform: none; } }
.q-title { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-top: 6px; }
.q-actions { display: flex; gap: 10px; align-items: center; margin-top: 28px; flex-wrap: wrap; }
.q-actions .spacer { flex: 1; }
.cheer { display: flex; align-items: center; gap: 12px; background: var(--sage-soft); color: var(--sage-deep); border-radius: 14px; padding: 10px 14px; margin: 0 0 16px; font-weight: 600; }
.cheer .mark { flex: none; }
.cheer small { font-weight: 400; color: var(--muted); }
.section-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 8px; list-style: none; counter-reset: s; }
.section-list li { background: var(--sheet-2); border-radius: 999px; padding: 6px 12px; font-size: 0.9rem; color: var(--muted); counter-increment: s; }
.section-list li::before { content: counter(s) " · "; color: var(--faint); }
.done-art { display: flex; justify-content: center; margin: 8px 0 12px; }
.reveal { text-align: center; }
.reveal-art { display: block; margin: 0 auto 8px; }
.reveal-art .env-flap { transform-origin: 110px 72px; animation: flap var(--dur-crawl) calc(var(--dur-base)) var(--ease-out) both; }
@keyframes flap { from { transform: rotateX(0deg); } to { transform: rotateX(180deg); opacity: 0.2; } }
.reveal-art .env-sheet { animation: sheetUp var(--dur-crawl) var(--dur-slow) var(--ease-spring) both; }
@keyframes sheetUp { from { transform: translateY(40px); } to { transform: translateY(-14px); } }
.reveal-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; text-align: left; }
.reveal-item { display: flex; align-items: center; gap: 14px; background: var(--sheet); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); animation: fadeUp var(--dur-slow) calc(var(--dur-crawl) + var(--dur-base)) var(--ease-spring) both; }
.reveal-item:nth-child(2) { animation-delay: calc(var(--dur-crawl) + var(--dur-base) + var(--stagger) * 2); } .reveal-item:nth-child(3) { animation-delay: calc(var(--dur-crawl) + var(--dur-base) + var(--stagger) * 4); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(var(--dist-md)); } to { opacity: 1; transform: none; } }
.reveal-item .rank-num { font-family: var(--display); font-weight: 600; font-size: 1.3rem; color: var(--maple); width: 32px; text-align: center; }
.reveal-item .ri-text { flex: 1; min-width: 0; }
.reveal-item .ri-text strong { display: block; }
.reveal-item .ri-text small { color: var(--muted); }

/* ---------- Landing / hero ---------- */
.hero { text-align: center; padding: 48px 0 24px; }
.hero-split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: center; text-align: left; padding: 24px 0 8px; }
.hero-split h1 { font-size: clamp(2.2rem, 4.8vw, 3.4rem); font-weight: 500; font-variation-settings: "opsz" 144; }
.hero-split h1 em { font-style: italic; color: var(--sage-deep); }
.hero-visual { min-width: 0; }
.hero-art { width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 30px rgba(40, 37, 31, 0.14)); animation: float 9s var(--ease-in-out) infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(calc(var(--dist-sm) * -1)); } }
@media (max-width: 760px) { .hero-split { grid-template-columns: 1fr; text-align: center; gap: 20px; } .hero-copy .lede { margin: 0 auto; } }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }
@media (max-width: 640px) { .entry-grid { grid-template-columns: 1fr; } }
.entry-card { display: block; text-align: left; padding: 26px 28px; border-radius: var(--radius); background: var(--sheet); border: 1.5px solid var(--border); box-shadow: var(--shadow); color: var(--ink); transition: transform var(--dur-base) var(--ease-spring), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); position: relative; }
.entry-card:hover, .entry-card:focus-visible { transform: translateY(calc(var(--dist-sm) * -0.5)); border-color: var(--sage); text-decoration: none; box-shadow: var(--shadow-lift); }
.entry-card h2 { margin-bottom: 6px; }
.entry-card p { color: var(--muted); margin: 0; }
.entry-card.student { border-top: 4px solid var(--lake); } .entry-card.parent { border-top: 4px solid var(--sage-deep); }
.entry-go { display: inline-block; margin-top: 14px; color: var(--sage-deep); font-weight: 600; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 36px 0 8px; }
@media (max-width: 760px) { .how { grid-template-columns: 1fr; } }
.how-step { padding: 18px 20px; border-radius: var(--radius-sm); background: var(--sheet-2); }
.how-step .n { font-family: var(--display); font-size: 1.6rem; font-weight: 600; color: var(--maple); line-height: 1; margin-bottom: 8px; }
.how-step strong { display: block; margin-bottom: 4px; }
.how-step p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.example { margin-top: 36px; }
.example-head { display: flex; align-items: baseline; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.example .program-card { pointer-events: auto; }
.example-tag { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }

/* ---------- Gate ---------- */
.gate { min-height: 72vh; display: grid; place-items: center; }
.gate .card { width: 100%; max-width: 440px; text-align: center; padding: 36px 28px 30px; }
.gate .gate-art { display: block; margin: 0 auto 10px; width: 220px; height: auto; }
.gate .wordmark { font-size: 2rem; display: inline-flex; align-items: center; gap: 10px; }

/* ---------- Home journey ---------- */
.journey { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .journey { grid-template-columns: 1fr; } }
.journey .card { position: relative; padding-top: 28px; }
.journey .step-no { position: absolute; top: -14px; left: 20px; background: var(--maple); color: #fff; font-family: var(--display); font-weight: 600; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 0.95rem; }
.journey .card.done .step-no { background: var(--sage-deep); }

/* ---------- Banners, badges ---------- */
.banner { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 0.95rem; }
.banner-sample { background: var(--honey-soft); color: var(--honey-deep); }
.banner-ok { background: var(--sage-soft); color: var(--sage-deep); }
.banner-warn { background: var(--honey-soft); color: var(--honey-deep); }
.banner-error { background: var(--rose-soft); color: var(--rose-deep); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: var(--sheet-2); color: var(--muted); white-space: nowrap; }
.badge-sage { background: var(--sage-soft); color: var(--sage-deep); }
.badge-blue { background: var(--lake-soft); color: var(--lake-deep); }
.badge-amber { background: var(--honey-soft); color: var(--honey-deep); }
.badge-rose { background: var(--rose-soft); color: var(--rose-deep); }
.stat .what .badge, .lens .badge { white-space: normal; line-height: 1.3; }

/* ---------- Provenance ---------- */
.prov { color: var(--faint); font-size: 0.8rem; display: block; margin-top: 2px; }
.prov a { color: inherit; text-decoration: underline dotted; }
details.cite { display: inline-block; vertical-align: baseline; margin: 2px 6px 0 0; font-size: 0.78rem; max-width: 100%; }
details.cite[open] { display: block; }
details.cite > summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; border-radius: 999px; padding: 2px 8px; background: var(--sheet-2); color: var(--muted); border: 1px solid var(--border); }
details.cite > summary::-webkit-details-marker { display: none; }
details.cite > summary:hover { color: var(--ink); border-color: var(--border-strong); }
details.cite > summary:focus-visible { outline: 3px solid var(--lake); outline-offset: 2px; }
details.cite[open] > summary { background: var(--lake-soft); color: var(--lake-deep); }
.cite-chip { white-space: nowrap; }
.cite-flag { font-size: 0.68rem; padding: 0 5px; border-radius: 999px; background: var(--honey-soft); color: var(--honey-deep); font-weight: 600; }
.cite-flag.flag-low { background: var(--rose-soft); color: var(--rose-deep); }
.cite-flag.flag-sample { background: var(--birch-deep); color: #fff; }
.cite-body { display: block; margin: 6px 0 4px; padding: 10px 12px; border-radius: 10px; background: var(--sheet); border: 1px solid var(--border); color: var(--ink); font-size: 0.85rem; line-height: 1.45; max-width: min(60ch, 100%); overflow-wrap: anywhere; }
.cite-body a { overflow-wrap: anywhere; }
.cite-body > div { margin-bottom: 3px; }
.cite-k { display: inline-block; min-width: 48px; color: var(--muted); font-weight: 600; }
.stat .cite, .fact-line .cite, .claim .cite, .drivers .cite, .exp-pill .cite, .kv .cite { margin-top: 2px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .num { font-family: var(--display); font-size: 1.6rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; font-variation-settings: "opsz" 48; }
.stat .what { color: var(--muted); font-size: 0.9rem; }
.fact-line { font-size: 0.95rem; line-height: 1.5; }
.fact-sep { display: inline-block; width: 10px; }
.lens-sub { margin: 0 0 6px; font-weight: 600; font-size: 0.9rem; }
.claims { border-left: 3px solid var(--honey-deep); padding-left: 10px; }
.claim { font-size: 0.93rem; margin-bottom: 6px; }
.lens-empty { margin: 0; font-size: 0.95rem; }
details.more > summary { cursor: pointer; color: var(--lake-deep); font-weight: 500; font-size: 0.95rem; margin-top: 4px; }
details.more[open] > summary { margin-bottom: 6px; }

/* ---------- Odds band ---------- */
.band { margin: 10px 0 4px; }
.band-track { position: relative; height: 10px; border-radius: 999px; background: var(--sheet-2); overflow: hidden; }
.band-fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, var(--lake), var(--lake-deep)); opacity: 0.9; }
.band-ticks { display: flex; justify-content: space-between; color: var(--faint); font-size: 0.75rem; margin-top: 4px; }
.band-text { font-weight: 600; }

/* ---------- Program cards ---------- */
.program-card { padding: 0; overflow: hidden; transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base) var(--ease-out); }
.program-card:hover, .program-card:focus-within { transform: translateY(calc(var(--dist-sm) * -0.5)); box-shadow: var(--shadow-lift); }
.card-media { position: relative; height: 170px; background: var(--sheet-2); }
.card-media.tall { height: 260px; }
.card-media .hero-img, .card-media .placeholder-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(18, 20, 18, 0.55) 100%); pointer-events: none; }
.card-media .logo { position: absolute; left: 16px; bottom: 14px; height: 40px; max-width: 160px; width: auto; object-fit: contain; background: rgba(255,253,248,0.94); border-radius: 10px; padding: 6px 10px; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.card-media .logo-text { display: inline-flex; align-items: center; font-family: var(--display); font-weight: 600; color: #28251f; font-size: 1rem; letter-spacing: 0.01em; }
.rank-badge { position: absolute; top: 14px; left: 16px; background: rgba(255,253,248,0.95); color: var(--ink); font-family: var(--display); font-weight: 600; padding: 5px 12px; border-radius: 999px; font-size: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
:root[data-theme="dark"] .rank-badge { background: rgba(38,36,32,0.95); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rank-badge { background: rgba(38,36,32,0.95); } }
.credit { position: absolute; right: 12px; bottom: 10px; max-width: 48%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.7rem; color: rgba(255,255,255,0.92); text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.credit a { color: inherit; text-decoration: underline dotted; }
@media (max-width: 560px) { .card-media .logo { height: 32px; max-width: 120px; padding: 5px 8px; } .credit { max-width: 52%; } }
.program-body { padding: 20px 24px 24px; display: grid; gap: 12px; }
.program-body > * { min-width: 0; }
.program-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; min-width: 0; }
.program-head h3 { margin: 0; font-size: 1.3rem; font-weight: 600; }
.program-head .inst { color: var(--muted); }
.program-title { display: flex; gap: 14px; align-items: center; min-width: 0; flex: 1 1 auto; }
.program-title > div:not(.match-ring) { min-width: 0; flex: 1; }
.program-card .inst { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inst.inst-full { white-space: normal; }
.match-line { color: var(--muted); font-size: 0.95rem; margin-top: 2px; }
.match-ring { position: relative; width: 64px; height: 64px; flex: none; }
.match-ring svg { width: 64px; height: 64px; }
.ring-track { fill: none; stroke: var(--sheet-2); stroke-width: 6; }
.ring-fill { fill: none; stroke-width: 6; stroke-linecap: round; animation: draw var(--dur-crawl) var(--ease-out) both; }
@keyframes draw { from { stroke-dasharray: 0 999; } }
.ring-sage .ring-fill { stroke: var(--sage-deep); } .ring-blue .ring-fill { stroke: var(--lake); } .ring-amber .ring-fill { stroke: var(--honey-deep); } .ring-rose .ring-fill { stroke: var(--rose-deep); } .ring-none .ring-fill { stroke: transparent; }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 1.15rem; }
details.why { background: var(--sheet-2); border-radius: var(--radius-sm); padding: 10px 14px; }
details.why summary { font-weight: 600; cursor: pointer; }
details.why p { margin: 8px 0 4px; }
.lens-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 760px) { .lens-grid { grid-template-columns: minmax(0, 1fr); } }
.lens { border-radius: var(--radius-sm); padding: 14px; background: var(--sheet-2); }
.lens-student { background: var(--lake-soft); }
.lens-parent { background: var(--sage-soft); }
.lens h4 { margin: 0 0 10px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.lens ul { padding-left: 18px; margin: 8px 0 0; }
.lens li { margin-bottom: 4px; font-size: 0.95rem; }
.drivers { list-style: none; padding: 0; margin: 8px 0 0; }
.drivers li { padding-left: 20px; position: relative; font-size: 0.95rem; margin-bottom: 4px; }
.drivers li::before { position: absolute; left: 0; font-weight: 700; }
.drivers li.up::before { content: "↑"; color: var(--sage-deep); }
.drivers li.down::before { content: "↓"; color: var(--rose-deep); }
.drivers li.wider::before { content: "↔"; color: var(--honey-deep); }
.drivers li.neutral::before { content: "·"; color: var(--muted); }
.drivers li.unknown::before { content: "○"; color: var(--faint); }
.diverge { border-left: 3px solid var(--honey-deep); padding: 8px 12px; background: var(--honey-soft); border-radius: 8px; margin-top: 10px; font-size: 0.95rem; }
.diverge strong { color: var(--honey-deep); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 8px; font-size: 0.85rem; } }
details summary { cursor: pointer; color: var(--lake-deep); font-weight: 500; }
details[open] summary { margin-bottom: 8px; }
@media (max-width: 560px) {
  .program-card .program-body { padding: 14px 14px 16px; gap: 10px; }
  .card-media { height: 136px; }
  .stat .num { font-size: 1.35rem; }
  .program-card .lens { padding: 12px; }
  .program-card .drivers li { margin-bottom: 2px; }
  details.why { padding: 8px 12px; }
}

/* Sort control */
.sort { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 20px; }
.pill { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--sheet); color: var(--ink); font-weight: 500; font-size: 0.95rem; }
.pill:hover { text-decoration: none; background: var(--sheet-2); }
.pill.on { background: var(--sage-deep); color: #fff; border-color: var(--sage-deep); }
:root[data-theme="dark"] .pill.on { color: #1b1a17; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.on { color: #1b1a17; } }

/* Fit breakdown */
.dims { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.dim-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.95rem; flex-wrap: wrap; }
.dim-bar { height: 8px; border-radius: 999px; background: var(--sheet); margin: 6px 0; overflow: hidden; }
.dim-bar span { display: block; height: 100%; border-radius: 999px; background: var(--sage-deep); }
.dim-bar span.neutral { background: var(--lake); } .dim-bar span.down { background: var(--rose-deep); }
.dim .p { margin: 0; font-size: 0.95rem; }
.dim-unknown .dim-bar span { background: var(--birch-deep); opacity: .6; }

/* Province panel */
.province-panel { margin-bottom: 20px; background: linear-gradient(180deg, var(--sheet), color-mix(in srgb, var(--sage-soft) 55%, var(--sheet))); }
.province-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 18px; }

/* Detail page */
.card.detail { padding: 0; overflow: hidden; }
.detail .card-media.tall { height: 320px; }
@media (max-width: 560px) { .detail .card-media.tall { height: 200px; } }
.section-nav { position: sticky; top: 62px; z-index: 4; display: flex; gap: 6px; padding: 8px 0; margin: 0 0 14px; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(10px); overflow-x: auto; scrollbar-width: none; }
.section-nav a { white-space: nowrap; padding: 7px 13px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 0.95rem; border: 1px solid transparent; }
.section-nav a:hover { background: var(--sheet-2); text-decoration: none; color: var(--ink); }
@media (max-width: 720px) { .section-nav { top: 0; } }
html { scroll-padding-top: 120px; scroll-behavior: smooth; }

/* Experience */
.experience { margin-top: 16px; }
.exp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 8px; }
@media (max-width: 760px) { .exp-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .exp-grid { grid-template-columns: 1fr; } }
.exp-pill { background: var(--sheet-2); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.exp-k { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.exp-gap { opacity: .75; border: 1px dashed var(--border-strong); background: transparent; }
.gap { color: var(--muted); font-style: italic; }
.timeline { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(180deg, var(--sage), var(--lake)); border-radius: 2px; }
.timeline li { display: flex; gap: 16px; align-items: flex-start; position: relative; }
.tl-year { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--sage-soft); color: var(--sage-deep); font-family: var(--display); font-weight: 600; display: grid; place-items: center; position: relative; z-index: 1; border: 2px solid var(--sheet); }
.timeline ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.95rem; }
.plain-list { margin: 6px 0 0; padding-left: 18px; }
.empty-art, .empty-sheet { display: flex; justify-content: center; margin: 12px auto; }

/* ---------- Shortlist: reorder, feed, prompts ---------- */
.reorder { display: inline-flex; align-items: center; gap: 4px; }
.drag-handle { cursor: grab; color: var(--faint); padding: 10px 10px; min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; font-size: 1.1rem; letter-spacing: -2px; user-select: none; -webkit-user-select: none; border-radius: 8px; touch-action: none; }
.drag-handle:hover { background: var(--sheet-2); color: var(--ink); }
.sortable.dragging { position: relative; z-index: 5; box-shadow: var(--shadow-lift); transition: box-shadow var(--dur-fast) var(--ease-out); cursor: grabbing; }
.sortable.dragging .drag-handle { cursor: grabbing; }
.sortable.shifting { transition: transform var(--dur-base) var(--ease-spring); }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feed li { display: flex; gap: 10px; align-items: flex-start; }
.feed .bubble { background: var(--sheet-2); border-radius: 14px 14px 14px 4px; padding: 8px 12px; font-size: 0.95rem; flex: 1; min-width: 0; }
.feed .bubble time { display: block; color: var(--faint); font-size: 0.8rem; margin-top: 2px; }
.feed li.parent .bubble { background: var(--sage-soft); }
.feed li.student .bubble { background: var(--lake-soft); }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.activity li:last-child { border-bottom: 0; }
.activity time { color: var(--faint); margin-left: auto; white-space: nowrap; font-size: 0.85rem; }
.table-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.table-cards li { background: var(--sheet); border: 1px solid var(--border); border-left: 4px solid var(--maple); border-radius: 12px; padding: 12px 14px; font-size: 0.97rem; box-shadow: var(--shadow); transform: rotate(-0.3deg); }
.table-cards li:nth-child(even) { transform: rotate(0.3deg); border-left-color: var(--lake); }
.table-cards li:nth-child(3n) { border-left-color: var(--sage-deep); }
.conversation { background: var(--sheet-2); border-radius: var(--radius-sm); padding: 16px 18px; }
.conversation li { margin-bottom: 6px; }
.members { display: flex; gap: 12px; flex-wrap: wrap; }
.member { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--sheet-2); }
.invite-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.6rem; letter-spacing: 0.08em; background: var(--sheet-2); padding: 12px 18px; border-radius: var(--radius-sm); display: inline-block; }

/* ---------- Credits, footer, misc ---------- */
.credits { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.credits li { display: flex; gap: 14px; align-items: center; }
.credits img { border-radius: 10px; background: var(--sheet-2); }
.foot { padding: 28px 20px 36px; color: var(--faint); font-size: 0.85rem; text-align: center; border-top: 1px solid var(--border); }
.foot-brand { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 6px; }
.foot-brand .wordmark { font-size: 1rem; }
.foot .indep { display: block; margin-top: 6px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.inline-form { display: inline; }
table.plain { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.plain th, table.plain td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.plain th { color: var(--muted); font-weight: 600; }
.placeholder-art { display: block; }

/* =====================================================================
   Motion system (docs/motion.md). One set of tokens; every animation and
   transition in this file reads them, and app.js reads the same values.
   Reduced motion is a token change, not a list of exceptions.
   ===================================================================== */
:root {
  --dur-instant: 100ms; --dur-fast: 180ms; --dur-base: 280ms; --dur-slow: 480ms; --dur-crawl: 900ms;
  --stagger: 60ms;
  --dist-sm: 6px; --dist-md: 14px; --dist-lg: 28px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  /* A gentle spring (about 4% overshoot) for things that settle: cards, choices, the progress bar. */
  --ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);
}
@supports (transition-timing-function: linear(0, 1)) {
  :root { --ease-spring: linear(0, 0.05 2.5%, 0.2 6%, 0.45 11%, 0.7 17%, 0.87 23%, 0.98 30%, 1.03 36%, 1.04 42%, 1.03 49%, 1.01 58%, 0.998 70%, 1); }
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur-instant: 1ms; --dur-fast: 1ms; --dur-base: 1ms; --dur-slow: 1ms; --dur-crawl: 1ms; --stagger: 0ms; --dist-sm: 0px; --dist-md: 0px; --dist-lg: 0px; }
  .hero-art, .ov-lenses * { animation: none !important; }
  * { scroll-behavior: auto !important; }
}

/* Infinite loops pause when the tab is hidden or the art is off screen (app.js sets both classes). */
.tab-hidden .hero-art, .hero-art.offscreen { animation-play-state: paused; }

/* ---------- Cross-document view transitions (progressive: browsers without them just navigate) ---------- */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
.topbar { view-transition-name: topbar; }
.foot { view-transition-name: foot; }
.q-step { view-transition-name: q-body; }
.trail { view-transition-name: q-trail; }
.progress > span { view-transition-name: q-progress; }
/* A page arriving by view transition has already been animated; don't play the load animations twice. */
.vt-nav main.shell, .vt-nav .q-step { animation: none; }
::view-transition-group(*) { animation-duration: var(--dur-slow); animation-timing-function: var(--ease-spring); }
::view-transition-old(root) { animation: vt-fade-out var(--dur-fast) var(--ease-out) both; }
::view-transition-new(root) { animation: vt-rise var(--dur-base) var(--ease-out) both; }
::view-transition-old(topbar), ::view-transition-new(topbar), ::view-transition-old(q-trail), ::view-transition-new(q-trail) { animation-duration: var(--dur-fast); }
::view-transition-group(q-progress) { animation-duration: var(--dur-slow); }
::view-transition-old(q-progress), ::view-transition-new(q-progress) { height: 100%; animation: none; }
::view-transition-old(q-progress) { display: none; }
/* Questionnaire steps slide with the direction of travel. */
html:active-view-transition-type(forward)::view-transition-old(q-body) { animation: vt-out-left var(--dur-base) var(--ease-out) both; }
html:active-view-transition-type(forward)::view-transition-new(q-body) { animation: vt-in-right var(--dur-slow) var(--ease-spring) both; }
html:active-view-transition-type(back)::view-transition-old(q-body) { animation: vt-out-right var(--dur-base) var(--ease-out) both; }
html:active-view-transition-type(back)::view-transition-new(q-body) { animation: vt-in-left var(--dur-slow) var(--ease-spring) both; }
/* Cards keep their identity across pages: re-sorting and reordering glide instead of jumping. */
::view-transition-group(.card-vt) { animation-duration: var(--dur-slow); animation-timing-function: var(--ease-spring); }
::view-transition-old(.card-vt), ::view-transition-new(.card-vt) { height: 100%; object-fit: none; object-position: top; }
::view-transition-group(.ring-vt), ::view-transition-group(.title-vt) { animation-duration: var(--dur-slow); }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-rise { from { opacity: 0; transform: translateY(var(--dist-sm)); } }
@keyframes vt-out-left { to { opacity: 0; transform: translateX(calc(var(--dist-lg) * -1)); } }
@keyframes vt-out-right { to { opacity: 0; transform: translateX(var(--dist-lg)); } }
@keyframes vt-in-right { from { opacity: 0; transform: translateX(var(--dist-lg)); } }
@keyframes vt-in-left { from { opacity: 0; transform: translateX(calc(var(--dist-lg) * -1)); } }

/* ---------- Reveal on scroll: hidden only when JS is running, so no-JS pages are complete ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(var(--dist-md)); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-spring); transition-delay: calc(var(--i, 0) * var(--stagger)); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- Word-by-word headline ---------- */
.js [data-words] .w { display: inline-block; opacity: 0; transform: translateY(0.35em); animation: word-in var(--dur-slow) var(--ease-spring) both; animation-delay: calc(var(--i) * var(--stagger)); }
@keyframes word-in { to { opacity: 1; transform: none; } }

/* ---------- Match rings draw when they come into view, not all at once on load ---------- */
.js .match-ring .ring-fill { animation-play-state: paused; }
.js .match-ring.in .ring-fill { animation-play-state: running; }
.ring-num { font-variant-numeric: tabular-nums; }

/* ---------- Choosing an answer: the box presses, then settles ---------- */
.choice input:checked + label span.box { animation: press var(--dur-base) var(--ease-spring); }
@keyframes press { 0% { transform: scale(1); } 35% { transform: scale(0.97); } 100% { transform: scale(1); } }
.btn:active { transform: scale(0.97); }

/* ---------- Reveal sequence driven by app.js (falls back to the CSS delays above without JS) ---------- */
.js .reveal[data-sequence] .env-flap, .js .reveal[data-sequence] .env-sheet, .js .reveal[data-sequence] .reveal-item { animation: none; }
.js .reveal[data-sequence] .reveal-item { opacity: 0; }
.js .reveal[data-sequence].played .reveal-item { opacity: 1; }

/* =====================================================================
   Product overview (/about, /about/:role)
   ===================================================================== */
.overview { display: grid; gap: 8px; }
.ov-hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 32px; align-items: center; padding: 16px 0 24px; }
.ov-hero h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 500; font-variation-settings: "opsz" 144; line-height: 1.06; }
.ov-hero h1 em { font-style: italic; color: var(--maple); }
.ov-hero-art { display: grid; place-items: center; min-width: 0; }
@media (max-width: 760px) { .ov-hero { grid-template-columns: 1fr; gap: 8px; } .ov-hero-art { order: -1; } .ov-lenses { max-width: 280px; } }

/* The mark, told as a story: two lenses meet; where they overlap is the shortlist. */
.ov-lenses { width: 100%; max-width: 380px; height: auto; overflow: visible; }
/* Large text (19px bold) on the lens colours: AA for large text in both themes (sheet is light by day, dark by night). */
.ov-lens-t { fill: var(--sheet); font-family: var(--display); font-size: 19px; font-weight: 600; }
.ov-overlap-t { fill: var(--sheet); font-family: var(--display); font-size: 19px; font-style: italic; font-weight: 600; }
.ov-caption { fill: var(--muted); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.ov-lens, .ov-overlap, .ov-overlap-t { transform-box: fill-box; transform-origin: center; }
.ov-lens-s { animation: lens-in-l var(--dur-crawl) var(--ease-spring) both; }
.ov-lens-p { animation: lens-in-r var(--dur-crawl) var(--ease-spring) both; }
.ov-overlap { animation: overlap-bloom var(--dur-slow) calc(var(--dur-crawl) * 0.7) var(--ease-spring) both; }
.ov-overlap-t { animation: fade-in var(--dur-base) calc(var(--dur-crawl) * 0.7 + var(--dur-base)) var(--ease-out) both; }
@keyframes lens-in-l { from { transform: translateX(-46px); opacity: 0; } }
@keyframes lens-in-r { from { transform: translateX(46px); opacity: 0; } }
@keyframes overlap-bloom { from { transform: scale(0.6); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

.ov-section { padding: 36px 0 8px; }
.ov-section > h2 { max-width: 40rem; }
.ov-for { display: grid; grid-template-columns: 1fr 1fr 0.8fr; gap: 16px; margin-top: 8px; }
@media (max-width: 860px) { .ov-for { grid-template-columns: 1fr; } }
.ov-for-card { position: relative; background: var(--sheet); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.ov-for-card p { color: var(--muted); margin: 0; }
.ov-for-card.student { border-top: 4px solid var(--lake); } .ov-for-card.parent { border-top: 4px solid var(--sage-deep); }
.ov-for-card.scope { background: var(--sheet-2); box-shadow: none; }
.ov-for-card.is-you { border-color: var(--border-strong); box-shadow: var(--shadow-lift); }
.ov-for-card .badge { position: absolute; top: 16px; right: 16px; }

.ov-why .lede { max-width: 44rem; }
.ov-why-list { display: grid; gap: 14px; margin-top: 20px; }
.ov-why-item { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; background: var(--sheet); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.ov-why-item h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 8px; }
.ov-why-item p { margin: 0 0 10px; }
.ov-why-item p:last-child { margin-bottom: 0; }
.ov-why-n { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--maple-soft); color: var(--maple); font-family: var(--display); font-weight: 600; font-size: 1.25rem; }
.ov-caveat { font-size: 0.95rem; color: var(--muted); border-left: 3px solid var(--honey-soft); padding-left: 12px; }
.ov-synthesis { font-family: var(--display); font-size: clamp(1.25rem, 2.4vw, 1.55rem); line-height: 1.35; max-width: 44rem; margin: 28px 0 0; padding-left: 18px; border-left: 4px solid var(--maple); }
@media (max-width: 560px) { .ov-why-item { grid-template-columns: 1fr; gap: 8px; padding: 18px; } }

.ov-commit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 8px; }
@media (max-width: 860px) { .ov-commit { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ov-commit { grid-template-columns: 1fr; } }
.ov-commit-card { background: var(--sheet); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base) var(--ease-out); }
.ov-commit-card:hover { transform: translateY(calc(var(--dist-sm) * -0.5)); box-shadow: var(--shadow-lift); }
.ov-commit-card h3 { font-size: 1.08rem; font-weight: 600; margin: 4px 0 0; }
.ov-commit-card p { color: var(--muted); font-size: 0.95rem; margin: 0; flex: 1; }
.ov-commit-card .ico { color: var(--sage-deep); }
.refs { display: inline; }

/* How it works: a trail that draws itself as you read down the steps. */
.ov-steps { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.ov-trail { width: 40px; height: 100%; position: absolute; left: 0; top: 0; }
.ov-trail path { fill: none; stroke: var(--sage); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0.012 0.018; opacity: 0.8; }
.js .ov-trail path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset calc(var(--dur-crawl) * 2) var(--ease-out); }
.js .ov-steps.in .ov-trail path { stroke-dashoffset: 0; }
@supports (animation-timeline: view()) {
  .js .ov-trail path { transition: none; animation: trail-draw linear both; animation-timeline: view(); animation-range: entry 10% cover 65%; }
}
@keyframes trail-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .js .ov-trail path { animation: none; stroke-dashoffset: 0; } }
.ov-step-list { grid-column: 2; list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.ov-step-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start; }
.ov-step-list h3 { font-size: 1.2rem; font-weight: 600; margin: 6px 0 4px; }
.ov-step-list p { color: var(--muted); margin: 0; }
.ov-step-list strong { color: var(--ink); }
.ov-step-n { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--sheet); border: 2px solid var(--sage); color: var(--sage-deep); font-family: var(--display); font-weight: 600; font-size: 1.2rem; position: relative; margin-left: -50px; }
@media (max-width: 560px) { .ov-steps { grid-template-columns: 24px minmax(0, 1fr); } .ov-trail { width: 24px; } .ov-step-n { margin-left: -34px; width: 38px; height: 38px; } .ov-step-list li { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; } }
[data-count] { font-variant-numeric: tabular-nums; }

.ov-not { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 8px 0 0; }
@media (max-width: 640px) { .ov-not { grid-template-columns: 1fr; } }
.ov-not > div { padding: 14px 0; border-top: 1px solid var(--border); }
.ov-not dt { font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.ov-not dt::before { content: "Not "; color: var(--maple); font-style: italic; font-weight: 500; }
.ov-not dd { margin: 4px 0 0; color: var(--muted); }
.ov-privacy p { max-width: 44rem; }
.ov-cta { text-align: center; padding: 40px 20px; margin: 24px 0 8px; background: var(--sheet); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.ov-cta h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.ov-sources { margin-top: 16px; }
.ov-sources > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.ov-sources > summary::-webkit-details-marker { display: none; }
.ov-sources > summary h2 { margin: 0; font-size: 1.3rem; }
.ov-sources > summary h2::before { content: "▸ "; color: var(--faint); display: inline-block; transition: transform var(--dur-fast) var(--ease-out); }
.ov-sources[open] > summary h2::before { content: "▾ "; }

.reading-list { padding-left: 1.4em; display: grid; gap: 12px; margin: 12px 0 0; }
.reading-list li { font-size: 0.95rem; }
.reading-list li p { margin: 4px 0 0; color: var(--muted); }
.rl-cite { font-weight: 600; }
.rl-design { display: inline-block; font-size: 0.78rem; padding: 1px 8px; border-radius: 999px; background: var(--sheet-2); color: var(--muted); }
.cite-ref > summary { background: var(--honey-soft); color: var(--honey-deep); border-color: transparent; }
details.cite-ref[open] { display: block; margin: 8px 0; }

/* ---------- Learning hook: the student lens leads with what you'd learn ---------- */
.hook-k { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--lake-deep); margin: 0 0 6px; display: inline-block; }
.hook-line .hook-k { margin-bottom: 4px; }
.hook-chips, .lens .hook-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.hook-chips li { background: var(--sheet); color: var(--lake-deep); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 0.88rem; font-weight: 600; }
.hook-none, .hook-miss { font-size: 0.9rem; margin: 6px 0 0; }
.hook { display: grid; gap: 10px; }
.hook p { margin: 0; }
.hook-spark { margin: 0; padding: 14px 16px; background: var(--sheet); border-radius: var(--radius-sm); border-left: 4px solid var(--lake); }
.hook-spark blockquote { margin: 0; font-family: var(--display); font-size: 1.12rem; line-height: 1.4; }
.hook-spark blockquote::before { content: "“"; } .hook-spark blockquote::after { content: "”"; }
.hook-spark figcaption { margin-top: 6px; font-size: 0.82rem; color: var(--muted); }
.hook-draws .badge { margin: 2px 4px 2px 0; white-space: normal; background: var(--sheet); border: 1px solid var(--border); }
.hook-ask { font-style: italic; color: var(--muted); }

/* ---------- Shortlist: the family's reasons, in their own words ---------- */
.voices { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 640px) { .voices { grid-template-columns: 1fr; } }
.voice { border-radius: var(--radius-sm); padding: 16px 18px; display: grid; gap: 8px; align-content: start; }
.voice.student { background: var(--lake-soft); } .voice.parent { background: var(--sage-soft); }
.voice-who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.voice blockquote { margin: 0; font-family: var(--display); font-size: 1.08rem; line-height: 1.4; }
.voice blockquote::before { content: "“"; } .voice blockquote::after { content: "”"; }
.voice .badge { background: var(--sheet); margin: 2px 4px 2px 0; white-space: normal; }
.voice .q { font-size: 0.82rem; color: var(--muted); margin: 0; }
.voice-empty { color: var(--muted); font-size: 0.95rem; margin: 0; }
/* Inline-block words lose the italic overhang the browser normally absorbs; give it back. */
[data-words] em .w { padding-right: 0.07em; }
.ov-hero h1, .hero-split h1 { word-spacing: 0.04em; }
