/* ============ Tokens ============ */
:root {
  --bg: #f6f2ea;
  --surface: #ffffff;
  --surface-2: #efe9de;
  --text: #16131d;
  --muted: #625c6e;
  --border: #e0d9cc;
  --accent: #5b3cf5;
  --accent-ink: #ffffff;
  --accent-soft: #ebe5ff;
  --lime: #c6f03a;
  --coral: #ff6a3d;
  --ok: #12804f;
  --bad: #d03b36;
  --ink: #120f19;          /* always-dark surfaces (hero, demo) */
  --ink-2: #1d1827;
  --ink-text: #f3eff9;
  --ink-muted: #a8a1b6;
  --radius: 18px;
  --shadow: 0 1px 0 rgba(22, 19, 29, .04), 0 10px 30px -12px rgba(22, 19, 29, .18);
  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0b12; --surface: #17141f; --surface-2: #201b2b; --text: #f1edf7; --muted: #a49db2;
    --border: #2c2638; --accent: #9f8aff; --accent-ink: #0d0b12; --accent-soft: #261f3d;
    --lime: #d4ff4f; --coral: #ff8a63; --ok: #45d18f; --bad: #ff6b66;
    --ink: #08070c; --ink-2: #17131f;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .02);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0b12; --surface: #17141f; --surface-2: #201b2b; --text: #f1edf7; --muted: #a49db2;
  --border: #2c2638; --accent: #9f8aff; --accent-ink: #0d0b12; --accent-soft: #261f3d;
  --lime: #d4ff4f; --coral: #ff8a63; --ok: #45d18f; --bad: #ff6b66;
  --ink: #08070c; --ink-2: #17131f;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .02);
  color-scheme: dark;
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; letter-spacing: -.02em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 18px; }
h3 { font-size: 1.15rem; margin: 0 0 8px; }
code { font-family: var(--font-mono); background: var(--accent-soft); padding: .1em .4em; border-radius: 6px; font-size: .85em; }
::selection { background: var(--lime); color: #111; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
section.block { padding: 88px 0 0; }
.kicker {
  display: inline-block; font-family: var(--font-mono); font-size: .78rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.empty { color: var(--muted); }
.section-lead { color: var(--muted); font-size: 1.1rem; max-width: 60ch; margin: -6px 0 24px; }

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; text-decoration: none; color: var(--text); white-space: nowrap; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--ink); color: var(--lime); font-family: var(--font-mono); font-size: .8rem; font-weight: 700;
}
nav { display: flex; align-items: center; gap: 18px; }
nav a { color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; }
nav a:hover, nav a[aria-current="page"] { color: var(--text); }
.icon-btn { background: none; border: 1px solid var(--border); border-radius: 10px; padding: 5px 9px; cursor: pointer; color: var(--text); font-size: .95rem; }
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.lang-switch button { font: 600 .78rem var(--font-mono); background: none; border: 0; padding: 6px 10px; cursor: pointer; color: var(--muted); }
.lang-switch button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 .95rem var(--font-body); cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 12px; padding: 11px 18px;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -8px var(--accent); }
.btn.lime { background: var(--lime); color: #111; }
.btn.lime:hover { box-shadow: 0 8px 24px -8px var(--lime); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { box-shadow: none; border-color: var(--text); }
.btn.on-ink { background: transparent; color: var(--ink-text); border: 1px solid #3a3347; }
.btn.on-ink:hover { border-color: var(--ink-text); box-shadow: none; }
.btn.small { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }

/* ============ Hero ============ */
.hero {
  position: relative; overflow: hidden; background: var(--ink); color: var(--ink-text);
  padding: 72px 0 64px; isolation: isolate;
}
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(80px); opacity: .55;
}
.hero::before { width: 520px; height: 520px; background: #5b3cf5; top: -180px; right: -120px; }
.hero::after { width: 380px; height: 380px; background: #ff6a3d; bottom: -220px; left: -100px; opacity: .35; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero .kicker { color: var(--lime); }
.hero h1 { font-size: clamp(2.8rem, 7.5vw, 5.6rem); margin: 0 0 22px; letter-spacing: -.035em; line-height: .98; }
.hero h1 .hl {
  background: linear-gradient(transparent 74%, #c6f03a 74%, #c6f03a 90%, transparent 90%);
  padding: 0 .04em; color: #fff;
}
.hero h1 .soft { display: block; color: var(--ink-muted); font-size: .62em; margin-top: .25em; letter-spacing: -.02em; }
.hero .lead { font-size: 1.15rem; color: #cfc8dc; max-width: 560px; margin: 0 0 28px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Next-token demo */
.demo {
  background: color-mix(in srgb, var(--ink-2) 88%, transparent); border: 1px solid #2f2840;
  border-radius: 22px; padding: 22px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7);
  font-family: var(--font-mono);
}
.demo-label { display: flex; align-items: center; gap: 8px; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.demo-label .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.demo-text { font-size: 1.15rem; line-height: 1.5; color: #fff; min-height: 3.5em; margin: 14px 0 18px; font-family: var(--font-body); font-weight: 500; }
.demo-text .picked { background: #c6f03a; color: #111; border-radius: 6px; padding: 0 6px; animation: pop .35s ease-out; }
.demo-text .caret { display: inline-block; width: 2px; height: 1.1em; background: var(--lime); vertical-align: -0.15em; margin-left: 3px; animation: pulse 1s infinite; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.cands { display: grid; gap: 7px; }
.cand { display: grid; grid-template-columns: 110px 1fr 44px; gap: 10px; align-items: center; font-size: .82rem; color: #d8d1e4; }
.cand .bar { height: 10px; border-radius: 99px; background: #2a2337; overflow: hidden; }
.cand .bar > i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #7d63ff, #b7a6ff); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.cand.win { color: #fff; }
.cand.win .bar > i { background: linear-gradient(90deg, #a8e02a, #d4ff4f); }
.cand .p { text-align: right; color: var(--ink-muted); }
.demo-caption { margin: 16px 0 0; font-size: .78rem; color: var(--ink-muted); font-family: var(--font-body); }

/* Ticker */
.ticker { background: var(--lime); color: #111; overflow: hidden; border-block: 1px solid #111; }
.ticker-track { display: flex; gap: 0; width: max-content; animation: ticker 60s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker a { display: inline-flex; align-items: center; gap: 14px; padding: 12px 0 12px 14px; color: #111; text-decoration: none; font: 700 1rem var(--font-display); white-space: nowrap; }
.ticker a::after { content: "✦"; font-size: .8rem; }
.ticker a:hover { text-decoration: underline; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Facts */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fact { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.fact b { display: block; font: 800 2.6rem/1 var(--font-display); letter-spacing: -.03em; margin-bottom: 8px; }
.fact:nth-child(1) b { color: var(--coral); }
.fact:nth-child(2) b { color: var(--accent); }
.fact:nth-child(3) b { color: var(--ok); }
.fact p { margin: 0; color: var(--muted); }

/* ============ Cards & grids ============ */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; margin: 14px 0 6px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--coral)); border-radius: 99px; transition: width .5s; }
.progress-label { font-size: .82rem; color: var(--muted); }
.meta { font-size: .85rem; color: var(--muted); margin: 4px 0 0; }
.tag { display: inline-block; font: 600 .72rem var(--font-mono); padding: 3px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }

.topic-grid { grid-template-columns: 2fr 1fr; }
.topic { display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.topic.featured { background: linear-gradient(135deg, #241d36 0%, var(--ink) 60%); color: var(--ink-text); border-color: #2f2840; padding: 30px; }
.topic.featured p { color: #cfc8dc; }
.topic.featured .progress { background: #2a2337; }
.topic.featured .progress-label, .topic.featured .meta { color: var(--ink-muted); }
.topic-emoji { font-size: 2.6rem; line-height: 1; }
.topic h3 { font-size: 1.8rem; margin-top: 6px; }
.topic p { margin: 0; color: var(--muted); }
.topic .cta-row { margin-top: 14px; }
.topic.planned { border-style: dashed; box-shadow: none; background: transparent; justify-content: center; }

/* Sessions */
.sessions { display: grid; gap: 12px; }
.session { display: grid; grid-template-columns: 76px 1fr auto; gap: 18px; align-items: center; }
.date-badge { text-align: center; background: var(--ink); color: var(--lime); border-radius: 14px; padding: 10px 0; font-family: var(--font-mono); }
.date-badge b { display: block; font: 800 1.7rem/1 var(--font-display); color: #fff; }
.date-badge span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.session h4 { margin: 0 0 4px; font-size: 1.1rem; }
.session p { margin: 0; color: var(--muted); font-size: .92rem; }
details { margin-top: 20px; }
summary { cursor: pointer; color: var(--muted); }
details .sessions { margin-top: 12px; opacity: .7; }
h3.sub { font: 600 .8rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }

.contribute .card p { color: var(--muted); }
.contribute .card h3 { display: flex; gap: 10px; align-items: center; }

.footer { padding: 72px 16px 48px; color: var(--muted); font-size: .88rem; }

/* ============ Course ============ */
.course { display: grid; grid-template-columns: 290px 1fr; gap: 40px; padding-top: 32px; align-items: start; }
.course-nav { position: sticky; top: 80px; }
.course-title { font: 800 1.2rem var(--font-display); color: var(--text); text-decoration: none; }
#module-list { list-style: none; padding: 0; margin: 14px 0 0; counter-reset: m; }
#module-list a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; color: var(--text); text-decoration: none; font-size: .92rem; }
#module-list a:hover { background: var(--surface-2); }
#module-list li.active a { background: var(--ink); color: #fff; font-weight: 600; }
#module-list .check { width: 24px; text-align: center; flex: none; }
#module-list li.done .check { color: var(--ok); font-weight: 800; }
#module-list li.active.done .check { color: var(--lime); }
.nav-lexicon { display: block; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--lime); color: #111; text-decoration: none; font-weight: 700; font-size: .9rem; }
.course-main { min-width: 0; outline: none; padding-bottom: 20px; }
.course-main h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin: 6px 0 12px; letter-spacing: -.03em; }
.course-main h2 { font-size: clamp(1.4rem, 3vw, 1.75rem); margin-top: 40px; }
.course-main .lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 24px; max-width: 62ch; }
.module-hero { display: flex; gap: 18px; align-items: center; }
.module-emoji { width: 72px; height: 72px; flex: none; border-radius: 20px; background: var(--ink); display: grid; place-items: center; font-size: 2.2rem; }
.lesson { max-width: 68ch; font-size: 1.04rem; }
.lesson ul { padding-left: 0; list-style: none; }
.lesson li { position: relative; padding-left: 26px; margin: 10px 0; }
.lesson li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.aha {
  max-width: 68ch; margin: 36px 0 0; padding: 20px 22px; border-radius: var(--radius);
  background: var(--ink); color: var(--ink-text); position: relative; border: 1px solid #2f2840;
}
.aha b { display: inline-block; font: 700 .75rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: #111; background: var(--lime); padding: 3px 9px; border-radius: 99px; margin-bottom: 8px; }
.aha p { margin: 0; color: #e2dcec; }
.module-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.module-card { display: flex; gap: 14px; text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s; }
.module-card:hover { transform: translateY(-3px); border-color: var(--text); }
.module-card .track-icon { font-size: 1.8rem; }
.module-card h3 { margin: 4px 0 6px; }
.module-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.module-card.done { border-color: var(--ok); }
.callout { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; margin-top: 40px; background: var(--lime); color: #111; border: 0; }
.callout h3 { font-size: 1.4rem; }
.callout p { margin: 0; max-width: 56ch; }
.callout .btn { background: #111; color: var(--lime); }

.quiz { margin-top: 44px; max-width: 68ch; }
.quiz h2 { margin-top: 0; }
.quiz fieldset { border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; margin: 0 0 14px; transition: border-color .2s, background .2s; }
.quiz fieldset.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 7%, transparent); }
.quiz fieldset.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 7%, transparent); }
.quiz legend { font-weight: 700; padding: 0 6px; }
.quiz label { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.quiz input { margin-top: 5px; accent-color: var(--accent); }
.feedback { margin: 8px 0 0; font-size: .92rem; color: var(--muted); }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
#quiz-result { font-weight: 700; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 32px 0 0; max-width: 68ch; }
.banner { padding: 14px 18px; border-radius: 14px; background: var(--accent-soft); font-weight: 600; }
.banner.ok { color: var(--ok); }

/* Clickable terms inside course text */
.term {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: help;
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px;
  text-underline-offset: 3px; text-decoration-style: dotted;
}
.term:hover, .term[aria-expanded="true"] { background: var(--accent-soft); border-radius: 4px; text-decoration-style: solid; }
.popover {
  position: absolute; z-index: 50; width: min(340px, calc(100vw - 32px));
  background: var(--ink); color: var(--ink-text); border-radius: 16px; padding: 16px 18px;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .6); font-size: .93rem; line-height: 1.5;
  animation: pop .18s ease-out;
}
.popover strong { display: block; font: 800 1.05rem var(--font-display); margin-bottom: 4px; color: #fff; }
.popover p { margin: 0 0 10px; color: #ddd6e8; }
.popover a { color: var(--lime); font-weight: 600; text-decoration: none; }

/* ============ Lexicon ============ */
.lex-hero { background: var(--ink); color: var(--ink-text); padding: 56px 0 40px; position: relative; overflow: hidden; isolation: isolate; }
.lex-hero::before { content: ""; position: absolute; z-index: -1; width: 460px; height: 460px; border-radius: 50%; background: #5b3cf5; filter: blur(90px); opacity: .5; right: -120px; top: -200px; }
.lex-hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); margin: 0 0 12px; letter-spacing: -.035em; }
.lex-hero .lead { color: #cfc8dc; max-width: 620px; font-size: 1.12rem; margin: 0 0 26px; }
.lex-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lex-tools input {
  flex: 1 1 260px; max-width: 420px; font: inherit; padding: 12px 16px; border-radius: 14px;
  border: 1px solid #3a3347; background: #1b1724; color: #fff;
}
.lex-tools input::placeholder { color: #8f88a0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 600 .85rem var(--font-body); padding: 8px 14px; border-radius: 99px; border: 1px solid #3a3347; background: transparent; color: #ddd6e8; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--lime); color: #111; border-color: var(--lime); }
.lex-count { font: 600 .8rem var(--font-mono); color: var(--muted); margin: 28px 0 14px; }
.lex-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.term-card {
  text-align: left; font: inherit; color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: 8px;
  transition: transform .15s, border-color .15s;
}
.term-card:hover { transform: translateY(-3px); border-color: var(--text); }
.term-card h3 { font-size: 1.3rem; margin: 0; }
.term-card p { margin: 0; color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.term-card .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.tag.demo-tag { background: var(--lime); color: #111; }

dialog.term-dialog {
  width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 0;
  border-radius: 24px; background: var(--bg); color: var(--text); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6);
}
dialog.term-dialog::backdrop { background: rgba(10, 8, 15, .6); backdrop-filter: blur(4px); }
.dlg-head { background: var(--ink); color: var(--ink-text); padding: 26px 28px 22px; position: relative; }
.dlg-head h2 { margin: 6px 0 8px; font-size: clamp(1.8rem, 5vw, 2.6rem); padding-right: 40px; }
.dlg-head p { margin: 0; color: #d5cee2; font-size: 1.05rem; }
.dlg-close { position: absolute; top: 18px; right: 18px; background: #2a2337; color: #fff; border: 0; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; }
.dlg-body { padding: 24px 28px 28px; display: grid; gap: 14px; }
.dlg-box { border-radius: 16px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); }
.dlg-box h4 { margin: 0 0 6px; font: 700 .75rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.dlg-box p { margin: 0; }
.dlg-box.analogy { background: var(--accent-soft); border-color: transparent; }
.dlg-box.analogy p { font-size: 1.08rem; }
.dlg-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.related { display: flex; flex-wrap: wrap; gap: 8px; }
.related button { font: 600 .85rem var(--font-body); padding: 7px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.related button:hover { border-color: var(--text); }

/* Widgets */
.widget { border-radius: 16px; padding: 18px; background: var(--ink); color: var(--ink-text); border: 1px solid #2f2840; }
.widget h4 { margin: 0 0 12px; font: 700 .75rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--lime); }
.widget p.note { font-size: .8rem; color: var(--ink-muted); margin: 10px 0 0; }
.widget textarea, .widget input[type="text"] {
  width: 100%; font: 1rem var(--font-body); padding: 10px 12px; border-radius: 12px; border: 1px solid #3a3347;
  background: #1b1724; color: #fff; resize: vertical;
}
.widget input[type="range"] { width: 100%; accent-color: var(--lime); }
.widget .btn { margin-top: 10px; }
.tok-out { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 12px; font: .95rem var(--font-mono); }
.tok-out span { padding: 2px 4px; border-radius: 5px; white-space: pre; color: #111; }
.tok-stats { display: flex; gap: 18px; margin-top: 12px; font: .85rem var(--font-mono); color: var(--ink-muted); }
.tok-stats b { color: #fff; }
.temp-prompt { font-size: 1.05rem; margin-bottom: 10px; }
.temp-prompt b { background: var(--lime); color: #111; border-radius: 6px; padding: 0 6px; }
.temp-row { display: flex; justify-content: space-between; font: .8rem var(--font-mono); color: var(--ink-muted); margin-top: 4px; }
.history { font: .85rem var(--font-mono); color: var(--ink-muted); margin-top: 8px; min-height: 1.3em; }
.ctx-bar { display: flex; gap: 3px; height: 46px; margin: 12px 0 6px; padding: 4px; border-radius: 12px; border: 2px dashed #3a3347; }
.ctx-bar span { border-radius: 7px; display: grid; place-items: center; font: 600 .7rem var(--font-mono); color: #111; overflow: hidden; }
.ctx-sys { background: #b7a6ff; }
.ctx-msg { background: var(--lime); }
.ctx-q { background: var(--coral); }
.ctx-dropped { display: flex; gap: 4px; flex-wrap: wrap; min-height: 22px; font: .75rem var(--font-mono); color: var(--ink-muted); }
.ctx-dropped span { text-decoration: line-through; opacity: .6; }
.cnn-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.px-grid { display: grid; gap: 2px; }
.px-grid div { width: 22px; height: 22px; border-radius: 3px; background: #2a2337; }
.px-grid div.on { background: #f3eff9; }
.px-grid div.win { outline: 2px solid var(--lime); outline-offset: -1px; }
.px-grid.out div { background: #2a2337; }
.cnn-kernel { font: .78rem var(--font-mono); color: var(--ink-muted); text-align: center; }
.cnn-kernel table { border-collapse: collapse; margin: 4px auto; }
.cnn-kernel td { width: 24px; height: 22px; text-align: center; color: #fff; border: 1px solid #3a3347; }
.flow { display: grid; gap: 8px; counter-reset: s; }
.flow div { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #1b1724; border: 1px solid #2f2840; opacity: .45; transition: all .3s; }
.flow div.on { opacity: 1; border-color: var(--lime); }
.flow div b { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #2a2337; color: var(--lime); font: 700 .85rem var(--font-mono); }
.flow div.on b { background: var(--lime); color: #111; }
.emb svg { width: 100%; height: auto; display: block; }
.mcp-diagram { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.mcp-node { padding: 12px; border-radius: 12px; background: #1b1724; border: 1px solid #2f2840; text-align: center; font-size: .9rem; }
.mcp-node.app { border-color: #b7a6ff; }
.mcp-plug { font: 700 .8rem var(--font-mono); background: var(--lime); color: #111; padding: 6px 10px; border-radius: 99px; }
.mcp-tools { display: grid; gap: 8px; }
.halu p.q { margin: 0 0 10px; color: var(--ink-muted); font-size: .9rem; }
.halu .answer { display: grid; gap: 8px; }
.halu button { text-align: left; font: inherit; padding: 10px 12px; border-radius: 12px; background: #1b1724; border: 1px solid #2f2840; color: #fff; cursor: pointer; }
.halu button:hover { border-color: #fff; }
.halu button.right { border-color: var(--lime); background: #26301a; }
.halu button.wrong { border-color: var(--coral); opacity: .7; }
.halu .result { margin-top: 10px; font-size: .92rem; min-height: 1.4em; }

/* Burst */
.burst { position: fixed; z-index: 100; pointer-events: none; font-size: 1.6rem; animation: burst 1.1s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .topic-grid { grid-template-columns: 1fr; }
  .course { grid-template-columns: 1fr; gap: 20px; }
  .course-nav { position: static; }
}
@media (max-width: 700px) {
  nav a.hide-sm { display: none; }
  .facts { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .session { grid-template-columns: 60px 1fr; }
  .session .btn { grid-column: 2; justify-self: start; }
  .dlg-cols { grid-template-columns: 1fr; }
  .mcp-diagram { grid-template-columns: 1fr; }
  .cand { grid-template-columns: 92px 1fr 40px; }
  .hero { padding: 48px 0; }
  section.block { padding-top: 64px; }
  .module-emoji { width: 56px; height: 56px; font-size: 1.7rem; border-radius: 16px; }
  .brand-text { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
