/* LEARN PLATFORM — design system v2 "electric lab"
   Dark-first glass with live gradients; a light mode with the same energy. Nothing tenant-specific here:
   an academy overrides --g1/--g2/--g3 (its gradient) and the fonts from its brand row. */

/* Futura where the machine has it (every Mac does), Jost as the web stand-in — geometric, no curls. */
@import url('https://fonts.googleapis.com/css2?family=Jost:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --font-display: "Futura", "Jost", "Century Gothic", system-ui, sans-serif;
  --font-body: "Futura", "Jost", "Century Gothic", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* the gradient — three stops, used everywhere something should feel alive */
  --g1: #22d3ee;   /* electric cyan */
  --g2: #f472b6;   /* hot pink */
  --g3: #fb923c;   /* amber */
  --grad: linear-gradient(120deg, var(--g1), var(--g2) 55%, var(--g3));
  --grad-soft: linear-gradient(120deg, color-mix(in oklab, var(--g1) 30%, transparent), color-mix(in oklab, var(--g2) 30%, transparent), color-mix(in oklab, var(--g3) 30%, transparent));

  --bg: #06070d;
  --bg-2: #0b0d17;
  --surface: rgba(255,255,255,.045);
  --surface-2: rgba(255,255,255,.07);
  --surface-solid: #10121c;
  --ink: #f3f4fa;
  --ink-2: #c9cde0;
  --muted: #8b90a8;
  --line: rgba(255,255,255,.09);
  --line-2: rgba(255,255,255,.16);
  --accent: #22d3ee;
  --accent-ink: #06121a;
  --accent-2: #a3e635;
  --accent-3: #fbbf24;
  --link: #67e8f9;
  --danger: #fb7185;
  --ok: #34d399;
  --warn: #fbbf24;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 50px -24px rgba(0,0,0,.8);
  --shadow-2: 0 1px 0 rgba(255,255,255,.06) inset, 0 40px 80px -30px rgba(0,0,0,.9);
  --glow: 0 0 0 3px color-mix(in oklab, var(--accent) 35%, transparent), 0 0 30px -6px color-mix(in oklab, var(--accent) 70%, transparent);
  --r: 16px; --r-lg: 24px; --r-xl: 32px;
  --ease: cubic-bezier(.22,.8,.26,.99);
  --spring: cubic-bezier(.34,1.56,.64,1);
  --ambient-dot: 210,225,255;
  --ambient-line: 34,211,238;
  --ambient-line-2: 244,114,182;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f6fb;
  --bg-2: #eef0f8;
  --surface: rgba(255,255,255,.72);
  --surface-2: rgba(255,255,255,.92);
  --surface-solid: #ffffff;
  --ink: #0b0d17;
  --ink-2: #363a4f;
  --muted: #6b7088;
  --line: rgba(11,13,23,.08);
  --line-2: rgba(11,13,23,.16);
  --accent: #0891b2;
  --accent-ink: #ffffff;
  --accent-2: #65a30d;
  --accent-3: #d97706;
  --link: #0e7490;
  --danger: #e11d48;
  --ok: #059669;
  --warn: #d97706;
  --shadow: 0 1px 2px rgba(11,13,23,.05), 0 24px 50px -28px rgba(11,13,23,.28);
  --shadow-2: 0 2px 6px rgba(11,13,23,.06), 0 40px 80px -30px rgba(11,13,23,.35);
  --ambient-dot: 40,44,70;
  --ambient-line: 8,145,178;
  --ambient-line-2: 219,39,119;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body { margin: 0; min-height: 100dvh; font-family: var(--font-body); font-size: 16.5px; line-height: 1.65; letter-spacing: .005em; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E"); }
:root[data-theme="light"] body::before { opacity: .22; }
body.no-scroll { overflow: hidden; }
::selection { background: color-mix(in oklab, var(--g2) 45%, transparent); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
img, video, canvas, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -.015em; line-height: 1.08; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2.4rem, 5vw, 5.2rem); letter-spacing: -.035em; font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3vw, 3rem); font-weight: 800; }
h3 { font-size: clamp(1.15rem, 1.6vw, 1.5rem); }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .875rem; }
.tiny { font-size: .78rem; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: .9em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-anim { background: linear-gradient(120deg, var(--g1), var(--g2), var(--g3), var(--g1)); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: gradmove 8s linear infinite; }
@keyframes gradmove { to { background-position: 300% 0; } }
code, kbd, pre { font-family: var(--font-mono); }
code { background: color-mix(in oklab, var(--ink) 9%, transparent); padding: .12em .45em; border-radius: 6px; font-size: .9em; }
pre { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; overflow: auto; font-size: .86rem; line-height: 1.55; box-shadow: var(--shadow); }
pre code { background: none; padding: 0; font-size: inherit; }
kbd { font-size: .8em; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: .1em .45em; background: var(--surface); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- ambient canvas + glow field ---------- */
#ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 1; }
.above { position: relative; z-index: 1; }

/* ---------- layout ---------- */
.wrap { width: 100%; padding-inline: clamp(16px, 3vw, 48px); }
.shell { display: grid; min-height: 100dvh; grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; position: relative; z-index: 1; }
.shell > * { min-width: 0; }
@media (min-width: 1000px) { .shell { grid-template-columns: 256px 1fr; grid-template-rows: 1fr; } .shell > .rail { grid-row: 1 / -1; } }
.rail { position: sticky; top: 0; height: 100dvh; display: none; flex-direction: column; gap: 4px; padding: 18px 14px; border-right: 1px solid var(--line); background: color-mix(in oklab, var(--bg) 70%, transparent); backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%); }
@media (min-width: 1000px) { .rail { display: flex; } }
.rail .brand { display: flex; align-items: center; gap: 10px; padding: 6px 4px 22px; font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; letter-spacing: .02em; color: var(--ink); text-transform: uppercase; }
.rail .brand > span { line-height: 1.15; }
.mark { width: 34px; height: 34px; border-radius: 11px; background: var(--grad); color: #0a0a12; display: grid; place-items: center; font-size: .78rem; font-weight: 800; font-family: var(--font-display); overflow: hidden; flex: none; box-shadow: 0 8px 20px -8px color-mix(in oklab, var(--g2) 70%, transparent); }
.mark img { width: 100%; height: 100%; object-fit: cover; }
.rail nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 600; font-size: .93rem; transition: background .2s var(--ease), color .2s, transform .2s var(--ease); position: relative; }
.rail nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); transform: translateX(2px); }
.rail nav a.active { background: var(--grad); color: #0a0a12; box-shadow: 0 10px 24px -10px color-mix(in oklab, var(--g2) 80%, transparent); }
.rail nav a.active .ico { opacity: 1; }
.rail nav a .ico { width: 18px; height: 18px; flex: none; opacity: .8; }
.rail .grow { flex: 1; }
.rail .foot { padding: 8px 6px 0; display: flex; flex-direction: column; gap: 10px; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px clamp(14px, 3vw, 32px); background: color-mix(in oklab, var(--bg) 62%, transparent); backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%); border-bottom: 1px solid var(--line); flex-wrap: nowrap; overflow: hidden; }
.topbar .brand { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; display: flex; align-items: center; gap: 10px; color: var(--ink); text-transform: uppercase; letter-spacing: .02em; }
.topbar .brand .mark { width: 30px; height: 30px; border-radius: 9px; font-size: .72rem; }
.topbar .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw; }
.topbar .spacer { flex: 1; }
@media (min-width: 1000px) { .topbar .brand { display: none; } }
@media (max-width: 640px) { .topbar .seg { display: none; } .topbar .btn.sm { padding: 6px 10px; } }
.main { min-width: 0; padding: clamp(14px, 2.5vw, 36px) clamp(14px, 3vw, 44px) 110px; position: relative; }
@media (min-width: 1000px) { .main { padding-bottom: 60px; } }
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: color-mix(in oklab, var(--bg) 78%, transparent); backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%); border-top: 1px solid var(--line); }
.bottombar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; font-size: .68rem; color: var(--muted); border-radius: 10px; font-weight: 600; }
.bottombar a.active { color: var(--ink); }
.bottombar a.active .ico { color: var(--g1); filter: drop-shadow(0 0 8px color-mix(in oklab, var(--g1) 80%, transparent)); }
.bottombar a .ico { width: 22px; height: 22px; }
@media (min-width: 1000px) { .bottombar { display: none; } }

/* ---------- grid helpers ---------- */
.grid { display: grid; gap: clamp(12px, 1.6vw, 22px); }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.split { display: grid; gap: clamp(16px, 2.5vw, 40px); grid-template-columns: 1fr; }
@media (min-width: 1100px) { .split { grid-template-columns: minmax(0, 1.6fr) minmax(300px, .9fr); } .split.even { grid-template-columns: 1fr 1fr; } }
.lesson-grid { display: grid; gap: clamp(16px, 2vw, 32px); grid-template-columns: 1fr; }
@media (min-width: 1200px) { .lesson-grid { grid-template-columns: 230px minmax(0, 1fr) 350px; } }
@media (min-width: 1700px) { .lesson-grid { grid-template-columns: 270px minmax(0, 1fr) 410px; } }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.right { margin-left: auto; }
.center { text-align: center; }
.bento { display: grid; gap: 14px; grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(150px, auto); }
.bento > * { grid-column: span 6; }
@media (min-width: 760px) { .bento > * { grid-column: span 3; } .bento > .span-2 { grid-column: span 4; } .bento > .span-3 { grid-column: span 6; } }
@media (min-width: 1200px) { .bento > * { grid-column: span 2; } .bento > .span-2 { grid-column: span 3; } .bento > .span-3 { grid-column: span 4; } .bento > .tall { grid-row: span 2; } }

/* ---------- reading ---------- */
.prose { max-width: 74ch; font-size: 1.06rem; line-height: 1.72; }
@media (min-width: 1400px) { .prose { font-size: 1.12rem; max-width: 82ch; } }
.prose h2 { margin-top: 2.2em; font-size: 1.7rem; letter-spacing: -.02em; }
.prose h2::before { content: ""; display: block; width: 44px; height: 4px; border-radius: 4px; background: var(--grad); margin-bottom: 14px; }
.prose h3 { margin-top: 1.6em; font-size: 1.22rem; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--g1); }
.prose blockquote { margin: 1.2em 0; padding: .8em 1.2em; border-left: 3px solid var(--g1); background: color-mix(in oklab, var(--g1) 8%, transparent); border-radius: 0 var(--r) var(--r) 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: .92rem; margin: 1em 0; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: .55em .75em; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 700; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.prose img { border-radius: var(--r); }
.prose .callout { padding: 1em 1.2em; border-radius: var(--r); background: var(--grad-soft); border: 1px solid var(--line-2); margin: 1.4em 0; position: relative; }
.prose .callout::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .6; pointer-events: none; }
.prose .term { border-bottom: 1px dashed var(--line-2); cursor: help; }
.prose strong { color: var(--ink); }
.prose ::selection { background: color-mix(in oklab, var(--g3) 55%, transparent); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(16px, 2vw, 26px); box-shadow: var(--shadow); position: relative; backdrop-filter: blur(16px) saturate(130%); -webkit-backdrop-filter: blur(16px) saturate(130%); }
.card.flat { box-shadow: none; }
.card.glass { background: var(--surface); }
.card.solid { background: var(--surface-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
.card.lift { transition: transform .4s var(--spring), box-shadow .4s var(--ease), border-color .4s; }
.card.lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: transparent; }
.card.lift::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .4s; pointer-events: none; }
.card.lift:hover::before { opacity: 1; }
.card.lift::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), color-mix(in oklab, var(--g1) 14%, transparent), transparent 40%); opacity: 0; transition: opacity .4s; pointer-events: none; }
.card.lift:hover::after { opacity: 1; }
.card.accent { border-color: transparent; }
.card.accent::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.card .eyebrow, .eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); font-weight: 800; margin-bottom: 10px; font-family: var(--font-display); }
.eyebrow.grad { color: transparent; }
.tile { display: block; color: inherit; }
.tile:hover { text-decoration: none; }
.panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }

/* ---------- buttons ---------- */
.btn { --b: var(--surface-2); --c: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--b); color: var(--c); font-weight: 700; font-size: .92rem; cursor: pointer; line-height: 1.2; white-space: nowrap; transition: transform .25s var(--spring), background .2s, border-color .2s, box-shadow .25s; text-decoration: none; user-select: none; position: relative; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn:hover { transform: translateY(-2px); text-decoration: none; border-color: var(--ink); }
.btn:active { transform: translateY(0) scale(.97); }
.btn.primary { --b: var(--grad); --c: #0a0a12; border-color: transparent; box-shadow: 0 12px 30px -12px color-mix(in oklab, var(--g2) 90%, transparent); }
.btn.primary:hover { box-shadow: 0 18px 40px -12px color-mix(in oklab, var(--g2) 100%, transparent), 0 0 0 3px color-mix(in oklab, var(--g1) 25%, transparent); border-color: transparent; }
.btn.accent { --b: var(--accent-3); --c: #1a1200; border-color: transparent; }
.btn.ghost { --b: transparent; border-color: transparent; backdrop-filter: none; }
.btn.ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn.sm { padding: 7px 13px; font-size: .82rem; }
.btn.lg { padding: 15px 26px; font-size: 1.02rem; }
.btn.danger { --c: var(--danger); border-color: color-mix(in oklab, var(--danger) 40%, var(--line)); }
.btn.icon { padding: 8px; width: 40px; height: 40px; border-radius: 13px; }
.btn.icon.sm { width: 30px; height: 30px; padding: 5px; }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }
.btn .ico { width: 16px; height: 16px; }
.btn.busy::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.accent { background: color-mix(in oklab, var(--g2) 18%, transparent); color: color-mix(in oklab, var(--g2) 75%, var(--ink)); border-color: color-mix(in oklab, var(--g2) 35%, transparent); }
.chip.ok { background: color-mix(in oklab, var(--ok) 16%, transparent); color: color-mix(in oklab, var(--ok) 80%, var(--ink)); border-color: color-mix(in oklab, var(--ok) 35%, transparent); }
.chip.warn { background: color-mix(in oklab, var(--warn) 18%, transparent); color: color-mix(in oklab, var(--warn) 80%, var(--ink)); border-color: color-mix(in oklab, var(--warn) 35%, transparent); }
.chip.mint { background: color-mix(in oklab, var(--g1) 16%, transparent); color: color-mix(in oklab, var(--g1) 80%, var(--ink)); border-color: color-mix(in oklab, var(--g1) 35%, transparent); }
.chip.outline { background: transparent; border-color: var(--line-2); }
.chip.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.chip.click { cursor: pointer; transition: transform .2s var(--spring), border-color .2s; }
.chip.click:hover { border-color: var(--ink); transform: translateY(-1px); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--grad); color: #0a0a12; font-size: .7rem; font-weight: 800; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .lbl { font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.input, textarea.input, select.input { width: 100%; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: .95rem; transition: border-color .2s, box-shadow .2s, background .2s; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); background: var(--surface-2); }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
select.input option { background: var(--surface-solid); color: var(--ink); }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }
textarea.input.code { font-family: var(--font-mono); font-size: .86rem; min-height: 180px; }
.input.sm { padding: 8px 11px; font-size: .86rem; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .92rem; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.switch { position: relative; width: 46px; height: 27px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .25s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: transform .25s var(--spring); }
.switch input:checked + i { background: var(--grad); }
.switch input:checked + i::after { transform: translateX(19px); }
.switch input:focus-visible + i { box-shadow: var(--glow); }
.help { font-size: .8rem; color: var(--muted); }
.err { color: var(--danger); font-size: .85rem; }
.ok-text { color: var(--ok); font-size: .85rem; }

/* ---------- the two UI laws: folds + ⓘ eyes ---------- */
.fold { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: border-color .2s; }
.fold[open] { border-color: var(--line-2); }
.fold + .fold { margin-top: 8px; }
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 13px 15px; font-weight: 700; font-size: .93rem; user-select: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .val { margin-left: auto; font-weight: 500; color: var(--muted); font-size: .84rem; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold > summary .chev { width: 16px; height: 16px; transition: transform .3s var(--spring); flex: none; opacity: .6; }
.fold[open] > summary .chev { transform: rotate(90deg); opacity: 1; color: var(--g1); }
.fold > .body { padding: 4px 15px 16px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.fold.quiet { border-color: transparent; background: transparent; backdrop-filter: none; }
.eye { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-2); font-size: .68rem; font-weight: 800; color: var(--muted); cursor: help; position: relative; vertical-align: middle; margin-left: 4px; font-family: var(--font-body); font-style: normal; }
.eye:hover, .eye:focus-visible { border-color: var(--g1); color: var(--g1); }
.eye .tip { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(4px); width: max-content; max-width: min(320px, 80vw); padding: 10px 12px; border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--line-2); color: var(--ink); font-size: .8rem; font-weight: 400; line-height: 1.45; text-align: left; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s var(--ease); z-index: 50; box-shadow: var(--shadow-2); white-space: normal; }
.eye:hover .tip, .eye:focus-visible .tip, .eye.open .tip { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ---------- tabs / segmented ---------- */
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: .86rem; cursor: pointer; color: var(--muted); transition: background .25s, color .25s, box-shadow .25s; }
.seg button.active { background: var(--grad); color: #0a0a12; box-shadow: 0 6px 16px -8px color-mix(in oklab, var(--g2) 80%, transparent); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 700; font-size: .9rem; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .2s; }
.tabs button.active { color: var(--ink); border-image: var(--grad) 1; border-bottom: 2px solid; }

/* ---------- lists / tables ---------- */
.list { display: flex; flex-direction: column; }
.list > .item { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--line); color: inherit; border-radius: 10px; transition: background .2s, transform .2s var(--ease); }
.list > .item:last-child { border-bottom: 0; }
.list > a.item:hover { text-decoration: none; background: var(--surface-2); transform: translateX(3px); }
.list .t { font-weight: 700; }
.list .s { font-size: .84rem; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.num { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.9rem, 3.2vw, 3rem); letter-spacing: -.03em; line-height: 1; }
.num.grad, .stat .num { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- meters ---------- */
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: inherit; transition: width .9s var(--ease); box-shadow: 0 0 14px color-mix(in oklab, var(--g2) 70%, transparent); }
.cost-meter { display: inline-flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--line-2); color: var(--ink); font-family: var(--font-mono); font-size: .82rem; box-shadow: var(--shadow); }
.cost-meter b { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cost-meter .lbl { color: var(--muted); font-family: var(--font-body); font-size: .72rem; }
.cost-meter.live { border-color: var(--g1); box-shadow: 0 0 0 3px color-mix(in oklab, var(--g1) 20%, transparent); }
.cost-meter.live b { animation: tick .6s var(--ease) infinite alternate; }
@keyframes tick { from { opacity: .7; } to { opacity: 1; } }

/* ---------- sheets, dialogs, toasts ---------- */
.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(2,3,8,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.scrim.on { opacity: 1; }
.sheet { position: fixed; z-index: 95; background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow-2); display: flex; flex-direction: column; max-height: 92dvh; left: 0; right: 0; bottom: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; transform: translateY(100%); transition: transform .4s var(--ease); }
.sheet.on { transform: translateY(0); }
@media (min-width: 900px) { .sheet { left: auto; top: 0; bottom: 0; width: min(580px, 92vw); border-radius: var(--r-xl) 0 0 var(--r-xl); max-height: none; transform: translateX(105%); } .sheet.on { transform: translateX(0); } .sheet.center { left: 50%; top: 50%; bottom: auto; right: auto; width: min(640px, 92vw); max-height: 88dvh; border-radius: var(--r-xl); transform: translate(-50%, -50%) scale(.96); opacity: 0; } .sheet.center.on { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.sheet > header { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.sheet > header h3 { margin: 0; font-size: 1.15rem; }
.sheet > .body { padding: 18px 20px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.sheet > footer { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.toasts { position: fixed; z-index: 120; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (min-width: 1000px) { .toasts { bottom: 24px; } }
.toast { pointer-events: auto; padding: 12px 18px; border-radius: 999px; background: var(--surface-solid); border: 1px solid var(--line-2); color: var(--ink); font-size: .88rem; font-weight: 600; box-shadow: var(--shadow-2); animation: pop .4s var(--spring); display: flex; gap: 10px; align-items: center; }
.toast.ok { background: var(--ok); color: #05130c; border-color: transparent; }
.toast.bad { background: var(--danger); color: #fff; border-color: transparent; }
@keyframes pop { from { transform: translateY(14px) scale(.94); opacity: 0; } }

/* ---------- motion ---------- */
.rise { animation: rise .7s var(--ease) both; }
.rise[data-i="1"] { animation-delay: .07s; } .rise[data-i="2"] { animation-delay: .14s; } .rise[data-i="3"] { animation-delay: .21s; } .rise[data-i="4"] { animation-delay: .28s; } .rise[data-i="5"] { animation-delay: .35s; } .rise[data-i="6"] { animation-delay: .42s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.shimmer { position: relative; overflow: hidden; border-radius: 12px; background: var(--surface-2); }
.shimmer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, color-mix(in oklab, var(--ink) 8%, transparent) 50%, transparent 70%); transform: translateX(-100%); animation: shimmer 1.6s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.blink { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.pulse { animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--g1) 45%, transparent); } 60% { box-shadow: 0 0 0 14px transparent; } }
.count { font-variant-numeric: tabular-nums; }
.float { animation: float 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---------- lesson specifics ---------- */
.outline { position: sticky; top: 84px; align-self: start; font-size: .86rem; }
.outline a { display: block; padding: 6px 12px; border-left: 2px solid var(--line); color: var(--muted); transition: color .2s, border-color .2s; }
.outline a.active { color: var(--ink); border-image: var(--grad) 1; border-left: 2px solid; }
.outline a:hover { text-decoration: none; color: var(--ink); }
.thread { position: relative; }
.thread::before { content: ""; position: absolute; left: -22px; top: 0; bottom: 0; width: 2px; background: var(--line); border-radius: 2px; }
.thread::after { content: ""; position: absolute; left: -22px; top: 0; height: var(--read, 0%); width: 2px; background: var(--grad); border-radius: 2px; box-shadow: 0 0 14px color-mix(in oklab, var(--g2) 70%, transparent); transition: height .2s linear; }
.tools { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 12px; }
.tutor { display: flex; flex-direction: column; min-height: 280px; max-height: calc(100dvh - 120px); }
.tutor .log { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.msg { max-width: 92%; padding: 11px 14px; border-radius: 18px; font-size: .92rem; line-height: 1.5; }
.msg.me { align-self: flex-end; background: var(--grad); color: #0a0a12; border-bottom-right-radius: 6px; font-weight: 600; }
.msg.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.ai .working { font-size: .74rem; color: var(--muted); border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 6px; }
.msg .cite { font-size: .74rem; color: var(--muted); }
.ask-line { position: absolute; z-index: 40; transform: translate(-50%, -110%); }
.q-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; background: var(--surface); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.q-card .fmt { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--g1); font-weight: 800; font-family: var(--font-display); }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .2s, background .2s, transform .2s var(--spring); background: var(--surface); }
.opt:hover { border-color: var(--line-2); transform: translateX(3px); }
.opt.sel { border-color: var(--g1); background: color-mix(in oklab, var(--g1) 10%, transparent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--g1) 18%, transparent); }
.opt.right { border-color: var(--ok); background: color-mix(in oklab, var(--ok) 12%, transparent); }
.opt.wrong { border-color: var(--danger); background: color-mix(in oklab, var(--danger) 10%, transparent); }
.opt .k { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: .78rem; background: var(--surface-2); border: 1px solid var(--line); flex: none; font-family: var(--font-display); }
.opt.sel .k { background: var(--grad); color: #0a0a12; border-color: transparent; }
.side-by-side { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.answer { white-space: pre-wrap; font-size: .92rem; line-height: 1.55; max-height: 420px; overflow: auto; }
.answer .cursor { display: inline-block; width: 8px; height: 1em; background: var(--g1); vertical-align: text-bottom; margin-left: 2px; box-shadow: 0 0 10px var(--g1); animation: blink 1s steps(2) infinite; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.task .tick { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; cursor: pointer; transition: all .25s var(--spring); background: transparent; }
.task .tick:hover { border-color: var(--g1); transform: scale(1.08); }
.task.done .tick { background: var(--grad); border-color: transparent; color: #0a0a12; box-shadow: 0 0 16px color-mix(in oklab, var(--g2) 60%, transparent); }
.task .tick svg { width: 14px; height: 14px; }
.wall { padding: 28px; border-radius: var(--r-lg); background: var(--grad-soft); border: 1px solid var(--line-2); position: relative; overflow: hidden; }
.wall::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }

/* ---------- skill map ---------- */
.skillmap { width: 100%; height: auto; aspect-ratio: 16 / 10; }
.skillmap circle.node { transition: r .4s var(--spring), fill .4s, filter .4s; cursor: pointer; }
.skillmap text { font-family: var(--font-body); font-size: 11px; fill: var(--ink-2); pointer-events: none; }
.skillmap line { stroke: color-mix(in oklab, var(--g1) 30%, transparent); stroke-width: 1; }
.skillmap .weak { filter: drop-shadow(0 0 8px color-mix(in oklab, var(--danger) 80%, transparent)); }
.skillmap .strong { filter: drop-shadow(0 0 12px color-mix(in oklab, var(--ok) 90%, transparent)); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; box-shadow: 0 0 8px currentColor; }

/* ---------- study area / board ---------- */
.board-wrap { position: relative; border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; background: var(--surface-solid); height: min(72dvh, 820px); touch-action: none; box-shadow: var(--shadow); }
.board-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.board-tools { position: absolute; left: 12px; top: 12px; z-index: 5; display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 16px; background: color-mix(in oklab, var(--surface-solid) 85%, transparent); border: 1px solid var(--line-2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.board-tools button { width: 36px; height: 36px; border-radius: 11px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); transition: background .2s, transform .2s var(--spring); }
.board-tools button:hover { background: var(--surface-2); transform: scale(1.06); }
.board-tools button.active { background: var(--grad); color: #0a0a12; }
.board-tools .sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface-solid); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.board-tools .sw.active { box-shadow: 0 0 0 2px var(--g1); }
.sticky { position: absolute; width: 170px; min-height: 120px; padding: 12px 12px 14px; border-radius: 8px; box-shadow: 0 14px 30px -10px rgba(0,0,0,.5); font-size: .86rem; line-height: 1.4; color: #1a1a1a; cursor: grab; transform: rotate(var(--rot, -1deg)); z-index: 3; }
.sticky textarea { width: 100%; height: 100%; min-height: 90px; border: 0; background: transparent; font: inherit; resize: none; outline: none; color: inherit; }
.sticky .x { position: absolute; top: 4px; right: 6px; border: 0; background: transparent; font-size: 14px; cursor: pointer; opacity: .5; }
.sticky:hover .x { opacity: 1; }
.notes-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .notes-grid { grid-template-columns: 240px minmax(0, 1fr); } }
@media (min-width: 1400px) { .notes-grid { grid-template-columns: 260px minmax(0, 1fr) 380px; } }
.note-list a { display: block; padding: 10px 12px; border-radius: 12px; color: inherit; transition: background .2s; }
.note-list a.active, .note-list a:hover { background: var(--surface-2); text-decoration: none; }
.note-list a.active { box-shadow: inset 3px 0 0 var(--g1); }

/* ---------- search ---------- */
.search-bar { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 18px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); transition: box-shadow .25s, border-color .25s; }
.search-bar:focus-within { border-color: var(--g1); box-shadow: var(--glow); }
.search-bar input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 1.05rem; min-width: 0; outline: none; color: var(--ink); }
.search-bar .mic { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--grad); color: #0a0a12; cursor: pointer; display: grid; place-items: center; }
.search-bar .mic.on { animation: pulse 1.2s infinite; }
.search-bar > .ico { width: 18px; height: 18px; color: var(--muted); }
.hit { display: block; padding: 14px 16px; border-radius: 14px; color: inherit; border: 1px solid transparent; transition: background .2s, border-color .2s, transform .2s var(--spring); }
.hit:hover { background: var(--surface); border-color: var(--line); text-decoration: none; transform: translateX(3px); }
.hit mark { background: color-mix(in oklab, var(--g3) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.hit .path { font-size: .76rem; color: var(--muted); }

/* ---------- landing ---------- */
.hero { padding: clamp(24px, 5vw, 80px) 0 clamp(20px, 3vw, 40px); display: grid; gap: clamp(20px, 3vw, 48px); grid-template-columns: 1fr; align-items: center; position: relative; }
@media (min-width: 1100px) { .hero { grid-template-columns: 1.1fr .9fr; min-height: 78dvh; } }
.hero h1 { font-size: clamp(2.6rem, 5.6vw, 6rem); line-height: .98; }
.hero h1 .hi { position: relative; display: inline-block; }
.hero .lede { font-size: clamp(1.05rem, 1.4vw, 1.3rem); color: var(--ink-2); max-width: 58ch; }
.aurora { position: absolute; inset: -30% -20% auto -20%; height: 140%; z-index: -1; pointer-events: none; filter: blur(80px); opacity: .7; }
.aurora i { position: absolute; border-radius: 50%; width: 48vw; height: 48vw; max-width: 760px; max-height: 760px; animation: drift 24s var(--ease) infinite alternate; mix-blend-mode: screen; }
:root[data-theme="light"] .aurora i { mix-blend-mode: multiply; }
.aurora i:nth-child(1) { left: -6%; top: -10%; background: color-mix(in oklab, var(--g1) 55%, transparent); }
.aurora i:nth-child(2) { right: -4%; top: -6%; background: color-mix(in oklab, var(--g2) 45%, transparent); animation-delay: -9s; animation-duration: 30s; }
.aurora i:nth-child(3) { left: 32%; bottom: -30%; background: color-mix(in oklab, var(--g3) 45%, transparent); animation-delay: -17s; animation-duration: 36s; }
:root[data-theme="light"] .aurora { opacity: .35; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(7vw, 5vh) scale(1.18); } }
.orb-wrap { position: relative; aspect-ratio: 1; max-width: 640px; margin: 0 auto; width: 100%; }
.orb-wrap canvas { width: 100%; height: 100%; }
.orb-wrap .orb-glow { position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle, color-mix(in oklab, var(--g1) 35%, transparent), color-mix(in oklab, var(--g2) 18%, transparent) 45%, transparent 70%); filter: blur(30px); z-index: -1; animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.96); opacity: .8; } 50% { transform: scale(1.06); opacity: 1; } }
.orb-wrap .tag { position: absolute; padding: 8px 12px; border-radius: 999px; background: var(--surface-solid); border: 1px solid var(--line-2); font-size: .76rem; font-weight: 700; box-shadow: var(--shadow); white-space: nowrap; animation: float 6s ease-in-out infinite; }
.orb-wrap .tag b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee .track { display: flex; gap: 12px; width: max-content; animation: marquee 40s linear infinite; }
.marquee .chip { font-size: .86rem; padding: 8px 16px; }
@keyframes marquee { to { transform: translateX(-50%); } }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 6px 0 34px; }
.stat { padding: 18px 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: transform .3s var(--spring), border-color .3s; }
.stat:hover { transform: translateY(-3px); border-color: var(--line-2); }
.stat .num { font-size: clamp(1.8rem, 2.6vw, 2.6rem); }
.feature { display: grid; gap: 10px; align-content: start; }
.feature .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--grad); color: #0a0a12; box-shadow: 0 10px 24px -10px color-mix(in oklab, var(--g2) 80%, transparent); }
.feature .ico svg { width: 22px; height: 22px; }
.feature h3 { margin: 4px 0 0; }
.step { display: grid; gap: 8px; }
.step .n { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.6rem, 5vw, 4.4rem); line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: -.04em; }
.demo-window { border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--surface-solid); box-shadow: var(--shadow-2); overflow: hidden; }
.demo-window .bar { height: auto; background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 10px 14px; display: flex; gap: 6px; border-radius: 0; }
.demo-window .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); display: inline-block; }
.demo-window .bar i:nth-child(1) { background: #ff5f57; } .demo-window .bar i:nth-child(2) { background: #febc2e; } .demo-window .bar i:nth-child(3) { background: #28c840; }
.demo-window .body { padding: 16px; font-family: var(--font-mono); font-size: .82rem; line-height: 1.6; }
.demo-window .body .ln { opacity: 0; animation: rise .4s var(--ease) forwards; }
.demo-window .body .ln.k { color: var(--g1); }
.demo-window .body .ln.m { color: var(--muted); }
.tilt { transform-style: preserve-3d; transition: transform .35s var(--ease); will-change: transform; }
.price { font-family: var(--font-display); font-size: clamp(2.6rem, 4.4vw, 4rem); font-weight: 800; letter-spacing: -.04em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block; }
.price small { font-size: 1rem; color: var(--muted); font-weight: 600; letter-spacing: 0; -webkit-text-fill-color: var(--muted); }
footer.site { padding: 40px 0 120px; font-size: .84rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: 30px; }
@media (min-width: 1000px) { footer.site { padding-bottom: 40px; } }

/* ---------- admin bits ---------- */
.kpi { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi .card { padding: 16px 18px; }
.kpi .num { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kanban { display: grid; gap: 12px; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); overflow-x: auto; padding-bottom: 8px; max-width: 100%; }
.kanban .col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; min-height: 200px; }
.kanban .col h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 4px 6px 10px; }
.kcard { background: var(--surface-solid); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: .9rem; cursor: grab; transition: transform .2s var(--spring), border-color .2s; }
.kcard:hover { transform: translateY(-2px); border-color: var(--line-2); }
.kcard.dragging { opacity: .4; }
.tree { font-size: .92rem; }
.tree .node { display: flex; align-items: center; gap: 8px; padding: 8px 8px; border-radius: 10px; }
.tree .node:hover { background: var(--surface-2); }
.tree .node .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .kids { margin-left: 18px; border-left: 1px solid var(--line); padding-left: 6px; }
.dot:not(.chip) { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 8px currentColor; }
.dot.draft { background: var(--warn); color: var(--warn); } .dot.published { background: var(--ok); color: var(--ok); }
.diff ins { background: color-mix(in oklab, var(--ok) 18%, transparent); text-decoration: none; }
.diff del { background: color-mix(in oklab, var(--danger) 18%, transparent); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.empty .big { font-size: 2rem; margin-bottom: 8px; }

/* ---------- guards + icons ---------- */
.card, .panel, .q-card, .hit, .msg { min-width: 0; overflow-wrap: anywhere; }
.prose pre { max-width: 100%; }
.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; }
.board-tools button .ico { width: 18px; height: 18px; }

/* ---------- v2 refinements ---------- */
.stack > .chip { align-self: flex-start; }
.num { font-family: var(--font-body); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.stats .num { font-family: var(--font-display); }
.hero h1 { text-wrap: balance; }

/* an unanswered question in the path builder */
.q-row { padding: 10px 12px; border-radius: 14px; border: 1px solid transparent; transition: border-color .3s, background .3s; }
.q-row.needed { border-color: var(--danger); background: color-mix(in oklab, var(--danger) 8%, transparent); }

/* ---------- the floating study widget ---------- */
.study-fab { position: fixed; right: 20px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 70; display: inline-flex; align-items: center; gap: 9px; padding: 12px 18px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 800; font-size: .9rem; font-family: var(--font-display); background: var(--grad); color: #0a0a12; box-shadow: 0 14px 34px -12px color-mix(in oklab, var(--g2) 90%, transparent); transition: transform .25s var(--spring), box-shadow .25s; }
.study-fab:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 20px 44px -12px color-mix(in oklab, var(--g2) 100%, transparent); }
.study-fab .ico { width: 18px; height: 18px; }
@media (min-width: 1000px) { .study-fab { bottom: 24px; } }

.study-widget { position: fixed; z-index: 75; display: flex; flex-direction: column; background: color-mix(in oklab, var(--surface-solid) 94%, transparent); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-2); backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%); overflow: hidden; animation: pop .35s var(--spring); }
.study-widget.moving { transition: none; user-select: none; }
.study-widget::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .5; pointer-events: none; }
.w-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: grab; }
.study-widget.moving .w-head { cursor: grabbing; }
.w-head .spacer { flex: 1; }
.w-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: .92rem; min-width: 0; }
.w-title .ico { width: 16px; height: 16px; color: var(--g1); }
.w-title .ctx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.w-tabsrow { padding: 10px 12px 0; }
.w-tabs button { padding: 6px 12px; font-size: .8rem; }
.w-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 12px; overflow: auto; }
.w-bar { gap: 8px; }
.w-bar select.input { flex: 1; min-width: 0; }
.w-board { position: relative; flex: 1; min-height: 240px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface-solid); touch-action: none; }
.w-board .board-tools { left: 8px; top: 8px; padding: 4px; border-radius: 12px; }
.w-board .board-tools button { width: 28px; height: 28px; border-radius: 8px; }
.w-board .board-tools button .ico { width: 15px; height: 15px; }
.w-board .board-tools .sw { width: 16px; height: 16px; }
.w-board .board-tools input[type=range] { width: 28px; }
.w-notes { flex: 1; min-height: 0; display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px; }
.w-notelist { overflow: auto; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); padding-right: 6px; }
.w-noteitem { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; border: 0; background: transparent; cursor: pointer; padding: 7px 8px; border-radius: 9px; color: inherit; font-size: .82rem; font-weight: 600; }
.w-noteitem:hover { background: var(--surface-2); }
.w-noteitem.active { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--g1); }
.w-noteitem span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.w-noteedit { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.w-log { flex: 1; min-height: 160px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.w-log .msg { max-width: 100%; font-size: .86rem; }
.w-send { gap: 8px; }
.w-send textarea { flex: 1; min-height: 44px; }
.w-grip { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, var(--line-2) 50%, var(--line-2) 60%, transparent 60%, transparent 72%, var(--line-2) 72%, var(--line-2) 82%, transparent 82%); }
@media (max-width: 860px) {
  .study-widget { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto !important; height: 82dvh !important; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .w-grip { display: none; }
  .w-head { cursor: default; }
  .w-notes { grid-template-columns: 1fr; grid-template-rows: 92px minmax(0, 1fr); }
  .w-notelist { border-right: 0; border-bottom: 1px solid var(--line); padding-right: 0; padding-bottom: 6px; }
}

/* ---------- the syllabus: everything visible, no folds ---------- */
.syllabus { display: grid; gap: clamp(16px, 2.2vw, 34px); grid-template-columns: 1fr; align-items: start; margin-top: 18px; }
@media (min-width: 1000px) { .syllabus { grid-template-columns: 250px minmax(0, 1fr); } }
@media (min-width: 1600px) { .syllabus { grid-template-columns: 290px minmax(0, 1fr); } }
.syl-index { display: flex; flex-direction: column; gap: 2px; }
@media (min-width: 1000px) { .syl-index { position: sticky; top: 84px; max-height: calc(100dvh - 110px); overflow: auto; padding-right: 6px; } }
@media (max-width: 999px) { .syl-index { flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 8px; scrollbar-width: none; }
  .syl-index .eyebrow { display: none; }
  .syl-ix { flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; }
  .syl-ix .bar, .syl-ix .tiny { display: none; } }
.syl-ix { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 12px; color: var(--ink-2); font-size: .88rem; font-weight: 600; transition: background .2s, color .2s; }
.syl-ix:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.syl-ix.active { background: var(--surface-2); color: var(--ink); box-shadow: inset 2px 0 0 var(--g1); }
.syl-ix .n { font-family: var(--font-display); font-weight: 800; font-size: .78rem; color: var(--muted); flex: none; }
.syl-ix.active .n { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.syl-ix .t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.syl-ix .bar { height: 4px; margin-top: 5px; }
.syl-body { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 52px); min-width: 0; }
.chapter { scroll-margin-top: 84px; }
.ch-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.ch-head h2 { margin: 4px 0 8px; }
.ch-head p { max-width: 80ch; margin-bottom: 10px; }
.ch-head .bar { margin-top: 12px; max-width: 420px; }
.module { margin-bottom: 26px; }
.module h3 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 4px; font-size: 1.15rem; }
.module .mn { font-family: var(--font-display); font-weight: 800; font-size: .85rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; flex: none; }
.module > p.small { margin: 0 0 10px; max-width: 80ch; }
.lessons { display: flex; flex-direction: column; }
a.lesson { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 12px; border-radius: 12px; color: inherit; border-bottom: 1px solid var(--line); transition: background .2s, transform .2s var(--ease); }
a.lesson:last-child { border-bottom: 0; }
a.lesson:hover { background: var(--surface-2); text-decoration: none; transform: translateX(3px); }
a.lesson.done .title { color: var(--muted); }
a.lesson .ln { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }
a.lesson .lt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
a.lesson .title { font-weight: 700; }
a.lesson .sum { font-size: .84rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.lesson .lmeta { display: flex; align-items: center; gap: 8px; flex: none; }
@media (max-width: 700px) { a.lesson { grid-template-columns: 40px minmax(0, 1fr); }
  a.lesson .lmeta { grid-column: 2; }
  a.lesson .sum { white-space: normal; } }
/* admin tree reuses the same shapes */
.admin-chapter .ch-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.admin-chapter .ch-head h2 { margin: 0; font-size: 1.5rem; }
.admin-module { border-left: 2px solid var(--line); padding-left: 14px; margin: 0 0 20px; }
.admin-module h3 { font-size: 1.02rem; }
.mod-empty { font-size: .8rem; color: var(--warn); }

/* ---------- read aloud ---------- */
.reader { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.reader .bar { height: 6px; }
.reader select.input { padding: 5px 26px 5px 9px; font-size: .8rem; background-position: calc(100% - 12px) 50%, calc(100% - 8px) 50%; }
.reader .rd-hint { width: 100%; }
@media (max-width: 700px) { .reader .rd-hint { display: none; } }
.prose .readable { border-radius: 8px; transition: background .3s, box-shadow .3s; }
.prose .reading { background: color-mix(in oklab, var(--g1) 14%, transparent); box-shadow: 0 0 0 8px color-mix(in oklab, var(--g1) 14%, transparent); }

/* The wordmark replaces the square mark and the typed name when an academy supplies one. */
.brand.has-wordmark { padding: 2px 0; gap: 10px; align-items: center; }
.brand.has-wordmark .mark { background: none; box-shadow: none; border-radius: 0; }
.rail .brand.has-wordmark .mark { width: 44px; height: 44px; }
.topbar .brand.has-wordmark .mark { width: 30px; height: 30px; }
.brand.has-wordmark .mark img { object-fit: contain; }
.wordmark { display: block; flex: none; line-height: 0; }
.wordmark img { display: block; height: auto; width: 100%; max-width: 190px; object-fit: contain; }
.brand.has-wordmark { width: 100%; }
.topbar .brand .wordmark img { max-width: 100px; }
.rail .brand .wordmark img { max-width: 150px; }
@media (max-width: 720px) { .wordmark img { max-width: 118px; } }

/* The academy's own wordmark, full size, at the top of the landing hero. */
.hero-wordmark { display: block; width: min(100%, 460px); height: auto; margin: 0 0 22px; filter: drop-shadow(0 18px 44px color-mix(in oklab, var(--g2) 40%, transparent)); }
@media (max-width: 720px) { .hero-wordmark { width: min(100%, 300px); margin-bottom: 16px; } }

/* The one-line install and its code, on the account page. */
pre.code { background: var(--panel-2, rgba(255,255,255,.04)); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; overflow-x: auto; margin: 8px 0; }
pre.code code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; white-space: pre; }
.code-big { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.5rem; letter-spacing: .22em;
  font-weight: 700; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--grad-soft); color: var(--ink); display: inline-block; margin: 6px 0 4px; }

/* ---- the menu ------------------------------------------------------------
   One hamburger on every screen. It holds the whole navigation, the light and
   dark switch and the text size, so nothing is reachable only on a desktop. */
.burger { display: inline-flex; }
@media (min-width: 1000px) { .burger { display: inline-flex; } }
.menu-scrim { position: fixed; inset: 0; z-index: 90; background: color-mix(in oklab, #05050a 62%, transparent);
  backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
.menu-scrim.on { opacity: 1; pointer-events: auto; }
.menu { position: fixed; z-index: 91; inset: 0 auto 0 0; width: min(340px, 86vw);
  display: flex; flex-direction: column; gap: 6px; padding: 16px 14px 22px;
  background: var(--bg); border-right: 1px solid var(--line);
  transform: translateX(-102%); transition: transform .26s cubic-bezier(.2,.7,.2,1);
  overflow-y: auto; overscroll-behavior: contain; }
.menu.on { transform: none; }
body.menu-open { overflow: hidden; }
.menu-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 12px; }
.menu-nav { display: flex; flex-direction: column; gap: 2px; }
.menu-nav a, .menu-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  color: var(--ink); font-size: 1rem; font-weight: 600; border: 0; background: transparent;
  width: 100%; text-align: left; cursor: pointer; font-family: inherit; }
.menu-nav a:hover, .menu-row:hover { background: var(--panel-2, color-mix(in oklab, var(--ink) 8%, transparent)); }
.menu-nav a.active { background: var(--grad-soft); color: var(--ink); }
.menu-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.menu-size { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; }
@media (prefers-reduced-motion: reduce) { .menu, .menu-scrim { transition: none; } }
