 /* EconStax. Light only. White, ink, deep green for structure, signal orange for action. Square edges, hairlines. */
:root {
  color-scheme: light;
  --forest: #0d5c3f; --forest-2: #08402c; --leaf: #cfe6da;
  --orange: #c2410c; --orange-2: #9a330a; --tang: #ff5a1f; --peach: #fff0e8;
  --paper: #fbfcfb; --surface: #ffffff; --surface-2: #f1f5f3;
  --line: #dfe5e1; --line-2: #bcc7c0;
  --ink: #0a1410; --ink-2: #34423b; --ink-3: #5a6860;
  --good-bg: #e5f2eb; --good: #0d5c3f; --bad-bg: #fff0e8; --bad: #c2410c;
  --sans: 'Geist', system-ui, sans-serif; --serif: 'Geist', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, monospace;
  --r: 4px; --r-s: 3px; --nav-h: 68px; --tab-h: 62px; --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font: 400 1.03rem/1.6 var(--sans); color: var(--ink); background: var(--paper); min-height: 100dvh; display: flex; flex-direction: column; overflow-wrap: break-word; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
img { max-width: 100%; display: block; }
svg { display: block; }
::selection { background: var(--peach); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: var(--r-s); z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--tang); outline-offset: 2px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
main.wrap { flex: 1; padding-top: 36px; padding-bottom: 88px; }

h1, h2, h3 { font-family: var(--serif); color: var(--forest-2); line-height: 1.12; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.4rem + 2.8vw, 3.2rem); font-weight: 600; }
h2 { font-size: 1.55rem; font-weight: 600; }
h3 { font-size: 1.12rem; font-weight: 600; }
h4 { font-size: 1rem; }
p + p { margin-top: .8em; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 58ch; }
.muted { color: var(--ink-3); }
.fine { font-size: .9rem; color: var(--ink-3); }
.mono { font-size: .9rem; }
.section { margin-top: 56px; }
.section > h2 { margin-bottom: 14px; }
.section-head, .band-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------- header and footer ---------- */
.topbar { position: sticky; top: 0; z-index: 20; height: var(--nav-h); background: var(--surface); border-bottom: 1px solid var(--line); }
.progress-line { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--tang); transform-origin: left; transform: scaleX(0); }
@supports (animation-timeline: scroll()) { .progress-line { animation: grow linear both; animation-timeline: scroll(root); } }
@keyframes grow { to { transform: scaleX(1); } }
.topbar-in { height: 100%; display: flex; align-items: center; gap: 40px; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark svg { width: 26px; height: 26px; }
.m1 { fill: var(--tang); } .m2 { fill: var(--forest); }
.brand-mark path { transition: transform .35s var(--ease); }
.brand:hover .m1 { transform: translateX(2px); }
.brand-name { font-weight: 600; font-size: 1.15rem; letter-spacing: -.03em; color: var(--ink); }
.topnav { display: flex; gap: 28px; }
.topnav a { position: relative; color: var(--ink-3); font-size: .95rem; padding: 6px 0; }
.topnav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.topnav a:hover, .topnav a.active { color: var(--ink); }
.topnav a:hover::after, .topnav a.active::after { transform: scaleX(1); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.streak-pill { font: .85rem var(--mono); white-space: nowrap; color: var(--ink-3); display: inline-flex; gap: 6px; }
.streak-pill.on { color: var(--orange); }
.streak-pill:empty, .account-pill[hidden] { display: none; }
.account-pill { font-size: .92rem; font-weight: 500; padding: 7px 16px; border: 1px solid var(--ink); border-radius: var(--r-s); white-space: nowrap; }
.account-pill:hover { background: var(--ink); color: var(--surface); }

.footer { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: .92rem; color: var(--ink-3); background: var(--surface); }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: baseline; }
.footer-brand { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.footer-brand strong { font-weight: 600; color: var(--ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a:hover { color: var(--ink); }

.tabbar { display: none; }
@media (max-width: 760px) {
  .topnav { display: none; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .74rem; color: var(--ink-3); }
  .tabbar a.active { color: var(--forest); font-weight: 600; }
  .tabbar a.active .tab-ic { background: var(--leaf); border-radius: var(--r-s); padding: 1px 12px; }
  .tab-ic { padding: 1px 12px; }
  .tab-ic svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .footer { padding-bottom: calc(var(--tab-h) + 32px); }
  main.wrap { padding-top: 24px; padding-bottom: 56px; }
  .wrap { padding: 0 18px; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 22px; border-radius: var(--r-s); border: 2px solid transparent; font-weight: 600; text-align: center; transition: background .2s var(--ease), transform .2s var(--ease); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--forest); color: var(--paper); }
.btn-primary:hover { background: var(--forest-2); }
.btn-accent { background: var(--tang); color: var(--ink); }
.btn-accent:hover { background: var(--ink); color: var(--surface); }
.btn-ghost { background: transparent; border-color: var(--forest); color: var(--forest); }
.btn-ghost:hover { background: var(--good-bg); }
.btn-lg { min-height: 54px; padding: 13px 30px; font-size: 1.1rem; }
.btn-sm { min-height: 36px; padding: 5px 14px; font-size: .9rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.link { color: var(--orange); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link:hover { text-decoration-thickness: 2px; }
.btn-text { background: none; border: 0; color: var(--orange); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.card-link { display: block; transition: border-color .2s; }
.card-link:hover { border-color: var(--forest); }
.card h3, .card h2 { margin-bottom: 6px; }
.chip { display: inline-flex; font-size: .88rem; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.bar { height: 8px; background: var(--line); border-radius: 0; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--forest); border-radius: 0; transition: width .5s var(--ease); }
.page-head { margin-bottom: 36px; }
.page-head p { margin-top: 10px; color: var(--ink-2); font-size: 1.12rem; max-width: 60ch; }

/* ---------- home ---------- */
.hero { min-height: calc(100dvh - var(--nav-h) - 130px); display: flex; flex-direction: column; justify-content: center; gap: 48px; padding: 24px 0 56px; }
.hero h1 { font-size: clamp(3rem, 1rem + 8.4vw, 8.2rem); font-weight: 500; line-height: .95; letter-spacing: -.055em; }
.hero h1 span { display: block; overflow: hidden; padding-bottom: .08em; }
.hero h1 span::after { content: ''; }
.hero h1 em { font-style: normal; color: var(--orange); }
@media (prefers-reduced-motion: no-preference) {
  .hero h1 span { animation: wipe 1s var(--ease) both; } .hero h1 span + span { animation-delay: .12s; }
  .hero-foot { animation: lift .9s var(--ease) .35s both; }
}
@keyframes wipe { from { clip-path: inset(0 100% 0 0); transform: translateX(-24px); } to { clip-path: inset(0 0 0 0); transform: none; } }
@keyframes lift { from { opacity: 0; transform: translateY(18px); } }
.hero-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 24px; border-top: 1px solid var(--ink); padding-top: 22px; }
.hero-foot p { font-size: 1.15rem; color: var(--ink-2); max-width: 34ch; }

.stack-scene { height: 300vh; }
.stack-pin { position: sticky; top: var(--nav-h); height: calc(100dvh - var(--nav-h)); display: grid; grid-template-columns: 3fr 2fr; align-items: center; gap: 40px; }
.stack3d { height: 100%; display: grid; place-items: center; perspective: 1800px; }
.stack-world { position: relative; width: min(340px, 30vw); min-width: 290px; aspect-ratio: 1; transform-style: preserve-3d; transform: rotateX(50deg) rotateZ(-36deg); }
.plate { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 4.5%; padding: 6%; overflow: hidden; background: var(--surface); border: 1px solid var(--forest); font-size: 13px; line-height: 1.35; transform: translateZ(var(--z, 0px)); transition: transform .5s var(--ease), border-color .35s, box-shadow .35s; box-shadow: -10px 14px 0 rgba(10, 20, 16, .05); }
.p0 { --z: 70px; } .p1 { --z: 0px; } .p2 { --z: -70px; }
.plate.gone { opacity: .1; }
.plate { transition-property: transform, border-color, box-shadow, opacity !important; }
.plate.on { border-color: var(--tang); box-shadow: -14px 20px 0 rgba(255, 90, 31, .14); }
.plate ul { list-style: none; }
.plate-head { display: flex; justify-content: space-between; border-bottom: 1px solid var(--ink); padding-bottom: 7px; }
.plate-head b { font-weight: 600; font-size: 16px; } .plate-head small { font-family: var(--mono); color: var(--orange); }
.plate i { font-style: normal; font: 11px var(--mono); width: 20px; height: 20px; flex: none; display: grid; place-items: center; border: 1px solid var(--line-2); }
.face-units li, .face-opts li { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.face-units span { flex: 1; } .face-units em { width: 46px; height: 5px; background: var(--line); }
.face-units .done i { background: var(--forest); border-color: var(--forest); color: #fff; } .face-units .done em { background: var(--forest); }
.face-units .now i { background: var(--tang); border-color: var(--tang); } .face-units .now em { background: linear-gradient(90deg, var(--tang) 40%, var(--line) 40%); }
.face-opts li { padding: 6px 8px; border: 1px solid var(--line); margin-bottom: 5px; }
.face-opts .pick { border-color: var(--tang); background: var(--peach); } .face-opts .pick i { background: var(--tang); border-color: var(--tang); }
.face-title { font-weight: 600; font-size: 17px; line-height: 1.25; }
.face-lines { display: grid; gap: 9px; margin-top: 4px; } .face-lines span { height: 6px; background: var(--line); }
.plate.on .face-lines span:nth-child(-n+2) { background: var(--tang); }
.layer-notes { display: grid; }
.layer-note { grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateY(26px); transition: opacity .45s, transform .6s var(--ease), visibility .45s; }
.layer-note.on { opacity: 1; visibility: visible; transform: none; }
.layer-note h2 { font-size: clamp(2.4rem, 4vw, 3.8rem); font-weight: 500; letter-spacing: -.045em; }
.layer-note p { font-size: 1.18rem; color: var(--ink-2); margin: 14px 0 20px; max-width: 34ch; }

.rail-pin { position: sticky; top: var(--nav-h); height: calc(100dvh - var(--nav-h)); display: flex; flex-direction: column; justify-content: center; }
.rail-window { overflow: hidden; }
.rail-track { position: relative; display: flex; width: max-content; will-change: transform; border: 1px solid var(--line); }
.slab { width: min(420px, 78vw); display: flex; flex-direction: column; padding: 22px; background: var(--surface); border-right: 1px solid var(--line); transition: background .3s; }
.slab:last-child { border-right: 0; }
.slab:hover { background: var(--surface-2); }
.slab-art { display: block; margin-bottom: 18px; }
.slab b { font-size: 1.35rem; font-weight: 500; letter-spacing: -.025em; line-height: 1.2; min-height: 2.4em; }
.slab > span:not(.slab-art) { color: var(--ink-3); margin-top: 6px; }
.slab small { font: .85rem var(--mono); color: var(--orange); margin-top: 16px; }
.rail-meter { height: 2px; background: var(--line); margin-top: 26px; }
.rail-meter span { display: block; height: 100%; background: var(--ink); transform-origin: left; transform: scaleX(.04); }

.isofield { width: 100%; height: auto; }
.iso path, .iso ellipse { stroke: var(--forest); stroke-width: 1; stroke-linejoin: round; }
.iso-t { fill: var(--surface); } .iso-l { fill: #e3efe9; } .iso-r { fill: #c6ded2; }
.iso.hot path, .iso.hot ellipse { stroke: #a8330a; } .iso.hot .iso-t { fill: #ff8a5c; } .iso.hot .iso-l { fill: #ff5a1f; } .iso.hot .iso-r { fill: #d9430f; }
.iso { transition: transform .5s var(--ease); }
a:hover .iso.hot, button:hover .iso.hot { transform: translateY(-8px); }
.iso-line { fill: none; stroke: var(--line-2); stroke-width: 1; }
.iso-beam { fill: none; stroke: var(--forest); stroke-width: 4; stroke-linecap: square; }
.iso-flow { fill: none; stroke: var(--forest); stroke-width: 1.2; stroke-dasharray: 4 5; }
@media (prefers-reduced-motion: no-preference) { .iso-flow { animation: flow 1.6s linear infinite; } }
@keyframes flow { to { stroke-dashoffset: -18; } }

.band { margin-top: 120px; }
.rv { opacity: 0; transform: translateY(44px); transition: opacity .7s var(--ease), transform .9s var(--ease); }
.rv.in { opacity: 1; transform: none; }
.try { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 64px; align-items: start; }
.try h2 { border-bottom: 1px solid var(--ink); padding-bottom: 12px; }
.try-text { font-size: 1.3rem; line-height: 1.5; margin: 20px 0 22px; max-width: 52ch; letter-spacing: -.01em; }
.try-why { margin-top: 14px; min-height: 3.2em; }
.try-why.good { color: var(--good); } .try-why.bad { color: var(--bad); }
.try-side ul { list-style: none; }
.try-side li a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); transition: padding .3s var(--ease), color .2s; }
.try-side li a:hover { padding-left: 14px; color: var(--orange); }
.try-side small { font: .82rem var(--mono); color: var(--ink-3); }
.closer { border-top: 1px solid var(--ink); padding: 56px 0 20px; }
.closer h2 { font-size: clamp(2.6rem, 6vw, 5.4rem); font-weight: 500; letter-spacing: -.05em; }
.closer p { margin: 12px 0 28px; color: var(--ink-2); }

/* ---------- courses map ---------- */
.cat { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 52px; align-items: start; }
.map > h2 { font-size: 1.15rem; margin-bottom: 16px; }
.route { list-style: none; margin-bottom: 40px; }
.route li { position: relative; padding: 0 0 18px 54px; }
.route li::before { content: ''; position: absolute; left: 17px; top: 36px; bottom: -22px; width: 4px; background: var(--leaf); }
.route li:last-child::before { display: none; }
.route .stop { position: absolute; left: 0; top: 24px; }
.stop { flex: none; width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface); border: 3px solid var(--forest); color: var(--forest-2); font-family: var(--serif); font-weight: 600; z-index: 1; }
.later { font-size: .9rem; color: var(--ink-3); margin-top: 10px; }
.node { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; width: 100%; text-align: left; padding: 10px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); transition: border-color .2s, background .2s; }
.node:hover { border-color: var(--line-2); }
.node[aria-pressed="true"] { border-color: var(--forest); background: var(--surface-2); }
.node-art { display: block; height: 72px; border-radius: var(--r-s); overflow: hidden; }
.node-t b { display: block; font-family: var(--serif); font-size: 1.08rem; line-height: 1.2; font-weight: 600; }
.node-t small { display: block; color: var(--ink-3); font-size: .88rem; margin-top: 4px; }
.node.locked .node-art, .node.soon .node-art { filter: saturate(.35); opacity: .75; }
.node.going small, .node.done small { color: var(--orange); font-weight: 600; }
.side-route { display: grid; gap: 14px; }
.peek { position: sticky; top: calc(var(--nav-h) + 20px); background: var(--surface-2); border-radius: var(--r); overflow: hidden; scroll-margin-top: 80px; }
.peek-art { height: 168px; overflow: hidden; }
.peek-body { padding: 24px 28px 28px; }
.peek-body > p { margin-top: 10px; }
.peek-body .bar { margin-top: 12px; }
.peek-body .btn-row { margin: 18px 0 22px; }
.syllabus { list-style: none; counter-reset: u; columns: 2; column-gap: 28px; border-top: 2px solid var(--forest); padding-top: 12px; }
.syllabus li { counter-increment: u; break-inside: avoid; display: flex; gap: 10px; padding: 5px 0; line-height: 1.4; font-size: .96rem; }
.syllabus li::before { content: counter(u); font-family: var(--serif); font-weight: 600; color: var(--orange); min-width: 1.2em; }

/* ---------- course page ---------- */
.course-hero { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 28px 40px; align-items: start; }
.course-art { grid-column: 1 / -1; height: 200px; border-radius: var(--r); overflow: hidden; }
.course-copy .lede { margin: 12px 0 8px; }
.course-prog { background: var(--surface-2); border-radius: var(--r); padding: 22px; }
.course-prog h2 { font-size: 1.1rem; }
.course-prog .prog-row { margin-top: 12px; }
.course-prog .bar { margin-top: 6px; }
.course-prog .btn { width: 100%; margin-top: 18px !important; }
.unit-path { list-style: none; }
.unit-path li { position: relative; }
.unit-path li::before { content: ''; position: absolute; left: 27px; top: 0; bottom: 0; width: 4px; background: var(--leaf); }
.unit-path li:first-child::before { top: 50%; } .unit-path li:last-child::before { bottom: 50%; }
.unit-path a { position: relative; display: grid; grid-template-columns: 38px 1fr auto; gap: 20px; align-items: center; padding: 15px 14px 15px 10px; border-radius: var(--r); }
.unit-path a:hover { background: var(--surface-2); }
.unit-path li.done .stop { background: var(--forest); color: var(--paper); }
.unit-path li.going .stop { background: var(--tang); border-color: var(--tang); color: var(--ink); }
.u-t b { display: block; font-family: var(--serif); font-size: 1.18rem; font-weight: 600; line-height: 1.25; }
.u-t small { display: block; color: var(--ink-3); font-size: .9rem; }
.u-skills { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; max-width: 220px; font-size: .9rem; color: var(--ink-3); }

/* ---------- practice ---------- */
.setup { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; }
.topic-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; align-content: start; }
.topic-pick { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-content: start; text-align: left; padding: 14px; background: transparent; border: 2px solid transparent; border-bottom: 2px solid var(--line); }
.topic-pick b { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.topic-pick small { color: var(--ink-3); grid-column: 2; grid-row: 1; font-variant-numeric: tabular-nums; }
.topic-pick span { grid-column: 1 / -1; font-size: .9rem; color: var(--ink-3); line-height: 1.45; }
.topic-pick:hover { background: var(--surface-2); }
.topic-pick.on { border-color: var(--forest); border-radius: var(--r); background: var(--good-bg); }
.ticket { position: sticky; top: calc(var(--nav-h) + 20px); background: var(--peach); border-radius: var(--r); padding: 26px; }
.ticket .field { margin-top: 18px; }
.ticket .btn { width: 100%; margin: 22px 0 12px; background: var(--forest); color: var(--paper); }
.ticket .fine { color: var(--ink-2); margin-top: 8px; }
.field > label { display: block; font-weight: 600; margin-bottom: 8px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 40px; padding: 6px 16px; background: var(--surface); border: 2px solid transparent; border-radius: var(--r-s); font-weight: 600; }
.seg button.on { background: var(--forest); color: var(--paper); }

.runner { max-width: 760px; margin: 0 auto; }
.runner-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.runner-top .bar { flex: 1; max-width: 320px; }
.q-where { color: var(--ink-3); margin-bottom: 14px; font-size: .95rem; }
.q-where b { color: var(--orange); margin-right: 6px; }
.q-scenario { font-size: 1.22rem; line-height: 1.6; margin-bottom: 18px; }
.q-prompt { font-weight: 600; font-size: 1.12rem; margin-bottom: 18px; }
.opts { display: grid; gap: 10px; }
.opt { display: grid; grid-template-columns: 30px 1fr; gap: 14px; align-items: center; text-align: left; width: 100%; padding: 13px 16px; border: 2px solid var(--line); border-radius: var(--r); background: var(--surface); line-height: 1.45; transition: border-color .15s, background .15s; }
.opt:hover:not([disabled]) { border-color: var(--forest); }
.opt .key { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-weight: 600; font-size: .9rem; }
.opt.sel { border-color: var(--forest); background: var(--surface-2); }
.opt.sel .key { background: var(--forest); color: var(--paper); }
.opt.right { border-color: var(--good); background: var(--good-bg); }
.opt.right .key { background: var(--good); color: var(--paper); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.wrong .key { background: var(--bad); color: var(--paper); }
.opt[disabled] { cursor: default; }
textarea.answer { width: 100%; min-height: 170px; padding: 16px; border: 2px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; resize: vertical; }
textarea.answer:focus { border-color: var(--forest); }
.answer-hint { font-size: .9rem; color: var(--ink-3); margin-top: 8px; }
.q-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 22px; }
.q-actions .kbd { margin-left: auto; font-size: .85rem; color: var(--ink-3); }
.kbd kbd { font-family: var(--mono); font-size: .78rem; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 5px; }
.result { margin-top: 20px; padding: 18px 20px; border-radius: var(--r); }
.result.good { background: var(--good-bg); } .result.bad { background: var(--bad-bg); }
.result h4 { margin-bottom: 6px; }
.model { margin-top: 20px; }
.model h4 { margin-bottom: 8px; }
.model .text { padding: 16px 18px; background: var(--surface-2); border-radius: var(--r); }
.checklist { display: grid; gap: 8px; margin-top: 12px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--r-s); cursor: pointer; background: var(--surface); }
.check input { accent-color: var(--forest); width: 18px; height: 18px; margin-top: 4px; flex: none; }
.check.on { border-color: var(--forest); background: var(--good-bg); }
.summary { text-align: center; }
.summary .score { font-family: var(--serif); font-size: 4.4rem; font-weight: 600; color: var(--forest); line-height: 1; margin: 10px 0 8px; }
.summary .score small { font-size: 1.5rem; color: var(--ink-3); }
.summary-list { text-align: left; margin: 26px 0; border-top: 2px solid var(--forest); }
.summary-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.summary-row .dot { width: 11px; height: 11px; border-radius: 50%; }
.summary-row .dot.g { background: var(--good); } .summary-row .dot.b { background: var(--tang); } .summary-row .dot.n { background: var(--line-2); }

.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 60px 0; color: var(--ink-2); }
.spinner { width: 20px; height: 20px; border: 3px solid var(--leaf); border-top-color: var(--forest); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- paths ---------- */
.path-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.path-card p { color: var(--ink-3); margin-bottom: 14px; }
.stage-list { display: grid; gap: 12px; }
.stage { display: grid; grid-template-columns: 40px 1fr auto; gap: 16px; align-items: center; }
.stage .num { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 600; }
.stage.done .num { background: var(--forest); color: var(--paper); }
.stage.locked { opacity: .6; }
.stage b { display: block; } .stage > div > span { font-size: .9rem; color: var(--ink-3); }
.stage .bar { margin-top: 8px; max-width: 240px; }

/* ---------- library and articles ---------- */
.search { width: 100%; min-height: 46px; padding: 10px 18px; border: 2px solid var(--line-2); border-radius: var(--r-s); background: var(--surface); color: var(--ink); font: inherit; }
.search:focus { border-color: var(--forest); }
.split { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 52px; align-items: start; }
.rail { position: sticky; top: calc(var(--nav-h) + 20px); max-height: calc(100dvh - var(--nav-h) - 40px); overflow-y: auto; padding: 3px; }
.rail-list { margin-top: 14px; display: grid; gap: 2px; }
.rail-list button { display: flex; justify-content: space-between; gap: 10px; text-align: left; border: 0; background: none; padding: 7px 12px; border-radius: var(--r-s); }
.rail-list button:hover { background: var(--surface-2); }
.rail-list button.on { background: var(--forest); color: var(--paper); font-weight: 600; }
.rail-list small { opacity: .75; }
.shelf-group { margin-bottom: 46px; }
.shelf-group .band-head { border-bottom: 3px solid var(--forest); padding-bottom: 8px; margin-bottom: 0; }
.read-row { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 17px 4px; border-bottom: 1px solid var(--line); }
.read-row h3 { margin-bottom: 3px; }
.read-row p { color: var(--ink-3); font-size: .96rem; max-width: 68ch; }
.read-row > span { color: var(--ink-3); font-size: .88rem; white-space: nowrap; }
.read-row:hover h3 { color: var(--orange); }
.article { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 56px; align-items: start; }
.article-body { max-width: 68ch; }
.article-body h1 { margin: 14px 0 12px; }
.article-meta { display: flex; gap: 8px; font-size: .92rem; color: var(--ink-3); }
.article-body .summary-text { font-size: 1.2rem; color: var(--ink-2); margin-bottom: 30px; padding-bottom: 22px; border-bottom: 3px solid var(--leaf); }
.prose { font-size: 1.1rem; line-height: 1.75; }
.prose h2 { font-size: 1.5rem; margin: 2em 0 .6em; scroll-margin-top: 90px; }
.prose h3 { font-size: 1.18rem; margin: 1.6em 0 .5em; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1em 1.3em; }
.prose li { margin-bottom: .35em; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: 0 0 1.2em; font-size: .96rem; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { border-bottom: 2px solid var(--forest); }
.prose blockquote { background: var(--surface-2); border-radius: var(--r); padding: 14px 18px; margin: 0 0 1em; }
.toc { position: sticky; top: calc(var(--nav-h) + 24px); font-size: .93rem; }
.toc h4 { margin-bottom: 8px; font-family: var(--serif); }
.toc a { display: block; padding: 5px 10px; border-radius: var(--r-s); color: var(--ink-3); line-height: 1.4; }
.toc a:hover, .toc a.on { background: var(--good-bg); color: var(--forest-2); }
.practice-cta { margin-top: 44px; padding: 26px; border-radius: var(--r); background: var(--peach); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.practice-cta b { display: block; font-family: var(--serif); font-size: 1.2rem; }

/* ---------- progress ---------- */
.stat-row { display: flex; flex-wrap: wrap; gap: 10px 44px; margin: 22px 0 24px; padding: 20px 26px; background: var(--surface-2); border-radius: var(--r); }
.stat { background: none; border: 0; padding: 0; }
.stat b { display: block; font-family: var(--serif); font-size: 1.8rem; color: var(--forest); }
.stat span { font-size: .9rem; color: var(--ink-3); }
.topic-table, .session-list { border-top: 2px solid var(--forest); }
.topic-line { display: grid; grid-template-columns: 220px 1fr 80px 70px; gap: 16px; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.session { display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.hub-list { border-top: 2px solid var(--forest); }
.hub-list a { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.hub-list a:hover b { color: var(--orange); }
.hub-list span { color: var(--ink-3); font-size: .9rem; white-space: nowrap; }

/* ---------- about, legal, account ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; }
.about img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r); }
.about figcaption { font-size: .9rem; color: var(--ink-3); margin-top: 10px; }
.empty { text-align: center; padding: 60px 20px; color: var(--ink-2); }
.notice { padding: 12px 16px; border-radius: var(--r-s); background: var(--surface-2); }
.notice.good { background: var(--good-bg); color: var(--good); } .notice.bad { background: var(--bad-bg); color: var(--bad); }
.narrow { max-width: 620px; margin: 0 auto; }
.narrow.prose { max-width: 68ch; }
.legal h2 { font-size: 1.2rem; }
.auth-form { display: grid; gap: 10px; margin-top: 24px; background: var(--surface-2); border-radius: var(--r); padding: 26px; }
.auth-form label, .age-pick legend { font-weight: 600; }
.auth-form .age-pick label { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.auth-form input[type=radio] { accent-color: var(--forest); width: 18px; height: 18px; }
.auth-form .btn { margin-top: 8px; justify-self: start; }
.google { width: 100%; max-width: 420px; }
.gate { background: var(--surface-2); border-radius: var(--r); padding: 32px; }
.gate > p { margin: 8px 0 18px; }
.captcha:empty { display: none; }

/* AP landing pages */
.sample-answer { margin: 20px 0; border-block: 1px solid var(--line); padding: 14px 0; }
.sample-answer summary { cursor: pointer; color: var(--forest); font-weight: 600; }
.sample-answer p { margin-top: 12px; color: var(--ink-2); }
.card.sample { background: var(--surface-2); border: 0; }

/* ---------- minimal pass: flat surfaces, hairlines ---------- */
h1, h2, h3 { color: var(--ink); letter-spacing: -.03em; }
h1 { font-weight: 500; }
.btn { font-weight: 500; border-width: 1px; }
.btn-primary { background: var(--ink); } .btn-primary:hover { background: var(--forest); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); } .btn-ghost:hover { border-color: var(--ink); background: transparent; }
.peek, .course-prog, .auth-form, .gate, .stat-row { background: var(--surface); border: 1px solid var(--line); }
.ticket, .practice-cta { background: var(--surface); border: 1px solid var(--ink); }
.ticket .btn { background: var(--tang); color: var(--ink); } .ticket .btn:hover { background: var(--ink); color: var(--surface); }
.ticket .seg button, .seg button { border: 1px solid var(--line-2); }
.seg button.on { background: var(--ink); border-color: var(--ink); }
.topic-pick, .node, .opt, .check, textarea.answer, .search { border-width: 1px; }
.topic-pick { border-color: transparent; border-bottom-color: var(--line); }
.topic-pick.on { border-color: var(--forest); }
.node:not([aria-pressed="true"]) { border-color: var(--line); }
.rail-list button.on { background: var(--ink); }
.shelf-group .band-head, .syllabus, .topic-table, .session-list, .hub-list { border-width: 1px; border-color: var(--ink); }
.shelf-group .band-head { border-bottom-style: solid; }
.article-body .summary-text { border-bottom: 1px solid var(--ink); }
.stop { border-width: 1px; border-radius: var(--r-s); font: 500 .9rem var(--mono); }
.route li::before, .unit-path li::before { width: 1px; background: var(--line-2); }
.route li::before { left: 19px; }
.node-art { height: auto; }
.node-art svg { height: auto; }
.peek-art { height: auto; padding: 18px 60px 0; border-bottom: 1px solid var(--line); }
.course-art { height: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 10px 30px; }
.course-art svg { max-height: 220px; }
.about img { filter: saturate(.8); }

@media (max-width: 980px) {
  .try { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .topic-list { grid-template-columns: 1fr; }
}
@media (max-width: 900px), (prefers-reduced-motion: reduce) {
  .stack-scene { height: auto; }
  .stack-pin { position: static; height: auto; grid-template-columns: minmax(0, 1fr); gap: 0; }
  .stack3d { height: 400px; overflow: hidden; }
  .stack-world { width: 290px; min-width: 0; zoom: .78; }
  .layer-notes { display: block; }
  .layer-note { opacity: 1; visibility: visible; transform: none; border-top: 1px solid var(--line); padding: 24px 0; }
  .layer-note h2 { font-size: 2rem; }
  .rail-pin { position: static; height: auto; display: block; margin-top: 64px; }
  .rail-window { overflow-x: auto; scroll-snap-type: x mandatory; }
  .slab { scroll-snap-align: start; }
  .rail-meter { display: none; }
}
@media (max-width: 900px) {
  .cat, .setup, .split, .article, .about, .course-hero { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .peek, .ticket, .rail { position: static; max-height: none; }
  .rail-list { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 6px; }
  .rail-list button { flex: none; border: 1px solid var(--line-2); }
  .about img { max-width: 340px; }
}
@media (max-width: 600px) {
  .band { margin-top: 60px; }
  .syllabus { columns: 1; }
  .peek-body { padding: 20px; }
  .node { grid-template-columns: 78px 1fr; gap: 12px; }
  .node-art { height: 62px; }
  .route li { padding-left: 46px; }
  .stop { width: 34px; height: 34px; }
  .route li::before { left: 17px; }.route li::before { left: 15px; }
  .unit-path a { grid-template-columns: 38px 1fr; }
  .u-skills { grid-column: 2; justify-content: flex-start; }
  .q-actions .kbd { display: none; }
  .topic-line { grid-template-columns: 1fr 64px auto; } .topic-line .bar { display: none; }
  .read-row { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 420px) { .streak-pill { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* course page header: words and drawing side by side, progress as one strip */
.course-hero { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; }
.course-copy { grid-row: 1; grid-column: 1; }
.course-art { grid-row: 1; grid-column: 2; }
.course-prog { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 24px; align-items: center; }
.course-prog .prog-row { margin: 0; }
.course-prog .btn { width: auto; margin-top: 0 !important; }
@media (max-width: 900px) {
  .course-hero, .course-prog { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .course-art { grid-row: auto; grid-column: auto; order: -1; }
  .course-copy { grid-row: auto; }
}

/* accounts */
.auth > * + * { margin-top: 16px; }
.auth .auth-form { margin-top: 16px; }
#au-creds { display: grid; gap: 10px; }
.field-in { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface); color: var(--ink); font: inherit; }
.field-in:focus { border-color: var(--ink); }
.google { width: 100%; max-width: none; gap: 10px; margin-top: 8px; }
.google svg { width: 18px; height: 18px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: .88rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.skip-test { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r-s); }
.course-hero + .skip-test { margin-top: 24px; }

/* hero: larger line and a scroll arrow */
.hero { min-height: calc(100dvh - var(--nav-h)); position: relative; padding-bottom: 96px; }
.hero-foot p { font-size: clamp(1.3rem, 1rem + .9vw, 1.75rem); line-height: 1.4; max-width: 30ch; }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; margin-left: -24px; width: 48px; height: 48px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s); }
.scroll-cue:hover { border-color: var(--ink); }
.scroll-cue svg { width: 22px; height: 22px; fill: none; stroke: var(--orange); stroke-width: 1.8; }
@media (prefers-reduced-motion: no-preference) { .scroll-cue svg { animation: nudge 1.8s var(--ease) infinite; } }
@keyframes nudge { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(4px); } }
@media (max-width: 760px) { .hero { min-height: calc(100dvh - var(--nav-h) - var(--tab-h)); } }

/* course cards */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.ccard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.ccard-art { display: block; padding: 14px 30px 4px; border-bottom: 1px solid var(--line); }
.ccard-body { padding: 18px 20px 20px; }
.ccard-body > * + * { margin-top: 10px; }
.ccard h3 { font-size: 1.2rem; }
.ccard.locked .ccard-art { filter: grayscale(1); opacity: .55; }
.ccard details summary { cursor: pointer; font-weight: 500; }
.ccard .syllabus { columns: 1; margin-top: 10px; }
.nothing { padding: 22px; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--ink-3); }

/* article blocks */
.prose h4 { font-size: 1.05rem; margin-bottom: 8px; }
.prose .box { margin: 1.6em 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.prose .box > :last-child { margin-bottom: 0; }
.prose .box-objectives { border-color: var(--ink); }
.prose .box-example { background: var(--surface-2); }
.prose .box-case { border-color: var(--tang); background: var(--peach); }
.prose .equation { text-align: center; font-size: 1.15rem; padding: 12px; margin: 1.2em 0; border-block: 1px solid var(--line); overflow-x: auto; }
.prose sub, .prose sup { font-size: .72em; line-height: 0; }
.box-check { border-bottom: 1px solid var(--line); padding: 12px 0; }
.box-check summary { cursor: pointer; font-weight: 500; }
.box-check p { margin-top: 10px; }
