/* "Heat" visual layer, shared by the GDD Builder and the Unity Guide.
   Look: a near-black photo surface with heavy film grain and soft, out-of-focus glows.
   Solid colours only (no multi-colour gradients). Nothing here animates while scrolling,
   so scrolling stays cheap: no backdrop-filter, no animated full-screen layers. */

:root {
  --ease-out: cubic-bezier(.19, 1, .22, 1);
  --hot: #ff6b4a;            /* the one accent: thermal coral */
  --hot-soft: rgba(255, 107, 74, .14);
  --hair: rgba(246, 245, 255, .09);
  --hair-strong: rgba(246, 245, 255, .2);
  --card: #0e0e12;
  --card-raised: #15151b;
  --title-glow: 0 0 34px rgba(255, 107, 74, .28);
  --grain-opacity: .09;
}
[data-theme="light"] {
  --hot: #c7401c;
  --hot-soft: rgba(199, 64, 28, .1);
  --hair: rgba(18, 16, 42, .1);
  --hair-strong: rgba(18, 16, 42, .22);
  --card: #fbfaf7;
  --card-raised: #f1efea;
  --title-glow: none;
  --grain-opacity: .05;
}
[data-theme="dark"] { --bg: #08080a; }
[data-theme="light"] { --bg: #ecebe6; }

/* ── atmosphere: static thermal glows + photographic grain ─ */
html, body { background: var(--bg); }
.root { position: relative; z-index: 1; overflow-x: clip; }
body::before { /* out-of-focus lights: each one a single colour fading out */
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(34% 30% at 4% 102%, rgba(84, 70, 255, .42), transparent 72%),
    radial-gradient(26% 26% at 50% 108%, rgba(255, 107, 74, .34), transparent 72%),
    radial-gradient(28% 28% at 98% 98%, rgba(255, 61, 127, .26), transparent 72%),
    radial-gradient(22% 20% at 92% -4%, rgba(84, 70, 255, .16), transparent 72%);
}
[data-theme="light"] body::before { opacity: .45; }
body::after { /* film grain: one static texture on its own layer */
  content: ""; position: fixed; inset: 0; z-index: 2000; pointer-events: none;
  opacity: var(--grain-opacity); transform: translateZ(0);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='1.9' intercept='-.45'/%3E%3CfeFuncG type='linear' slope='1.9' intercept='-.45'/%3E%3CfeFuncB type='linear' slope='1.9' intercept='-.45'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

/* ── type ────────────────────────────────────────────────── */
.title, .question-text, .intro-title, .ch-title, .summary-title, .mod-title, .g-title, .guide-cta-title { font-family: var(--font-display); color: var(--ink); }
::selection { background: var(--hot); color: #fff; }

/* ── chrome: one solid bar ───────────────────────────────── */
.header, .progress-wrap { background: var(--bg); border-bottom: 1px solid var(--hair); }
.header { border-bottom: 0; }
.header-inner { gap: 14px; }
.pixel-icon { width: 64px; height: 30px; opacity: .92; }
.header-text { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.title::before { content: ""; display: inline-block; width: 1px; height: 16px; margin-right: 14px; background: var(--hair-strong); vertical-align: -2px; }
.subtitle { font-size: 13px; color: var(--ink-subtle); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-toggle { width: 38px; height: 38px; background: transparent; border: 1px solid var(--hair-strong); color: var(--ink); transition: border-color .3s; }
.theme-toggle:hover { border-color: var(--ink); }

.progress-wrap { height: 34px; }
.progress-label, .progress-pct { font-size: 11px; letter-spacing: .14em; color: var(--ink-subtle); }
.progress-pct { color: var(--ink); }
.progress-track { height: 2px; background: var(--hair); overflow: visible; }
.progress-fill { background: var(--hot); box-shadow: 0 0 10px rgba(255, 107, 74, .7); position: relative; transition: width .6s var(--ease-out); }
.progress-fill::after { content: ""; position: absolute; right: -3px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px var(--hot); }
.g-progress__bar { background: var(--hot); }

/* ── buttons: solid white + outlined ─────────────────────── */
.btn-next, .btn-exp, .btn, .g-btn, .btn-back, .btn-restart { border-radius: var(--radius-pill); font-family: var(--font-body); font-weight: 600; letter-spacing: -0.005em; text-transform: none; }
.btn-next, .btn-exp.primary, .btn, .g-btn--primary {
  background: var(--btn-bg); color: var(--btn-ink); border: 1px solid transparent;
  transition: box-shadow .35s ease, transform .3s var(--ease-out);
}
.btn-next:hover:not(:disabled), .btn-exp.primary:hover, .btn:hover, .g-btn--primary:hover { background: var(--btn-bg); box-shadow: 0 0 22px rgba(255, 255, 255, .28); transform: translateY(-1px); }
[data-theme="light"] .btn-next:hover:not(:disabled), [data-theme="light"] .btn-exp.primary:hover, [data-theme="light"] .btn:hover { box-shadow: 0 8px 20px rgba(18, 16, 42, .25); }
.btn-back, .btn-exp.sec, .btn.sec, .g-btn--secondary, .btn-restart { background: transparent; color: var(--ink); border: 1px solid var(--hair-strong); transition: border-color .3s ease, background-color .3s ease; }
.btn-back:hover:not(:disabled), .btn-exp.sec:hover, .btn.sec:hover, .g-btn--secondary:hover, .btn-restart:hover { background: var(--hair); border-color: var(--ink); box-shadow: none; transform: none; }
.btn-back:disabled { opacity: .35; }
.btn-next:disabled { opacity: .3; }
.btn-next svg, .btn-back svg { transition: transform .3s var(--ease-out); }
.btn-next:hover:not(:disabled) svg { transform: translateX(3px); }
.btn-back:hover:not(:disabled) svg { transform: translateX(-3px); }

/* ── "New | …" pill badges ───────────────────────────────── */
.intro-kicker, .ch-num, .step-badge, .summary-kicker, .multi-hint {
  display: inline-flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%;
  padding: 4px 14px 4px 4px; border-radius: var(--radius-pill); border: 1px solid var(--hair-strong); background: var(--card);
  color: var(--ink-muted); font-family: var(--font-body); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; line-height: 1.4;
}
.intro-kicker::before, .step-badge::before, .summary-kicker::before { content: "New"; padding: 2px 10px; border-radius: var(--radius-pill); background: var(--btn-bg); color: var(--btn-ink); font-weight: 600; font-size: 12px; flex-shrink: 0; }
.step-badge::before { content: "Step"; }
.summary-kicker::before { content: "Done"; }
.ch-num::before { content: ""; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 10px var(--hot); flex-shrink: 0; }
.multi-hint { padding-left: 14px; background: transparent; border-style: dashed; }

/* ── solid cards ─────────────────────────────────────────── */
.mod, .side-col, .final-desc-box, .g-question { background: var(--card); border: 1px solid var(--hair); box-shadow: 0 30px 60px -34px rgba(0, 0, 0, .75); }
[data-theme="light"] .mod, [data-theme="light"] .side-col, [data-theme="light"] .final-desc-box { box-shadow: 0 1px 2px rgba(18, 16, 42, .05), 0 24px 50px -30px rgba(18, 16, 42, .3); }

/* ═════════════ GDD BUILDER ═════════════ */
.nav-row {
  /* sticky, not fixed: it floats at the bottom of the screen while you read, then stops
     right above the footer instead of covering it */
  position: sticky; top: auto; bottom: 22px; z-index: 1100;
  width: fit-content; margin: 8px auto 28px; align-self: center; gap: 6px; padding: 6px; border: 1px solid var(--hair-strong); border-radius: var(--radius-pill);
  background: var(--card-raised); box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
[data-theme="light"] .nav-row { box-shadow: 0 18px 40px rgba(18, 16, 42, .2); }
.nav-row .btn-back, .nav-row .btn-next { min-height: 46px; padding: 10px 22px; font-size: 15px; }
.nav-row .btn-next { min-width: 132px; }
.nav-row .btn-back { border-color: transparent; }
.nav-row .btn-back:hover:not(:disabled) { border-color: var(--hair-strong); }
#next-btn[style*="hidden"] { display: none; }
#main-content { padding-bottom: 110px; }

.main-col { position: relative; padding-top: clamp(32px, 6vh, 64px); }
.step-badge { margin-bottom: 22px; }
.question-text { font-size: clamp(32px, 4.6vw, 56px); font-weight: 600; line-height: 1.02; letter-spacing: -0.045em; max-width: 16ch; margin-bottom: 14px; text-shadow: var(--title-glow); }
.question-hint { font-size: 17px; color: var(--ink-muted); margin-bottom: 26px; }
.suggest-hint { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; background: var(--hot-soft); border: 1px solid color-mix(in srgb, var(--hot) 35%, transparent); border-radius: 14px; color: var(--ink); }
.suggest-hint::before { content: "✦"; color: var(--hot); }

/* answer cards with line-art icons (js/choice-icons.js) */
.options-grid { gap: 14px; }
.option-btn { border-radius: 20px; border: 1px solid var(--hair); background: var(--card); transition: border-color .3s ease, transform .4s var(--ease-out), box-shadow .4s ease; }
.option-btn:hover { border-color: var(--hair-strong); transform: translateY(-2px); }
.option-btn:active { transform: translateY(0) scale(.995); }
.opt-preview { background: var(--card-raised); height: clamp(76px, 9vw, 96px); border-bottom: 1px solid var(--hair); }
.opt-preview.opt-icon { display: grid; place-items: center; color: var(--ink-muted); }
.opt-preview.opt-icon svg { width: 44px; height: 44px; overflow: visible; transition: color .3s ease, transform .5s var(--ease-out); }
.option-btn:hover .opt-icon svg { color: var(--ink); transform: translateY(-2px); }
.options-grid.cols-1 .option-btn { flex-direction: row; align-items: stretch; }
.options-grid.cols-1 .opt-preview { width: 92px; height: auto; min-height: 76px; flex-shrink: 0; border-bottom: 0; border-right: 1px solid var(--hair); }
.options-grid.cols-1 .opt-preview.opt-icon svg { width: 36px; height: 36px; }
.options-grid.cols-1 .opt-text { flex: 1; justify-content: center; }
.options-grid.cols-1 .opt-hover-info { display: none; }
.opt-hover-info { background: rgba(8, 8, 10, .94); color: #f6f5ff; font-size: 13.5px; }
.opt-text { padding: 14px 18px 16px; }
.option-label { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; padding-right: 30px; }
.sel-dot { top: 14px; right: 16px; width: 20px; height: 20px; border: 1.5px solid var(--hair-strong); background: transparent; transition: background-color .25s, border-color .25s; }
.option-btn.selected { border-color: var(--hot); background: var(--card); box-shadow: 0 0 0 1px var(--hot), 0 0 34px -6px rgba(255, 107, 74, .45); }
.option-btn.selected .opt-icon { color: var(--hot); }
.option-btn.selected .opt-icon svg { filter: drop-shadow(0 0 6px rgba(255, 107, 74, .55)); }
.option-btn.selected .sel-dot {
  background: var(--hot) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat !important;
  border-color: var(--hot) !important;
}
.custom-input { background: var(--card); border-color: var(--hair-strong); border-radius: 16px; }
.custom-input:focus { border-color: var(--hot); box-shadow: 0 0 0 4px var(--hot-soft); }

/* question entrance (js/builder-motion.js adds .q-enter only when the question changes) */
@keyframes rise { from { opacity: 0; transform: translate3d(0, 22px, 0); } to { opacity: 1; transform: none; } }
.q-enter .main-col > * { animation: rise .8s var(--ease-out) both; }
.q-enter .main-col > :nth-child(2) { animation-delay: .05s; }
.q-enter .main-col > :nth-child(3) { animation-delay: .1s; }
.q-enter .main-col > :nth-child(n+4) { animation-delay: .15s; }
.q-enter .options-grid { animation: none !important; }
.q-enter .option-btn { animation: rise .8s var(--ease-out) both; }
.q-enter .option-btn:nth-child(1) { animation-delay: .12s; } .q-enter .option-btn:nth-child(2) { animation-delay: .17s; }
.q-enter .option-btn:nth-child(3) { animation-delay: .22s; } .q-enter .option-btn:nth-child(4) { animation-delay: .27s; }
.q-enter .option-btn:nth-child(n+5) { animation-delay: .32s; }
.q-enter .side-col { animation: rise .9s var(--ease-out) .15s both; }
.q-enter .summary-screen > * { animation: rise .9s var(--ease-out) both; }
.q-enter .summary-screen > :nth-child(2) { animation-delay: .06s; } .q-enter .summary-screen > :nth-child(n+3) { animation-delay: .12s; }

/* codex sidebar */
.side-col { top: calc(var(--nav-offset) + 24px); margin-top: clamp(32px, 6vh, 64px); border-radius: 24px; }
.codex-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-body); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 8px var(--hot); }
.game-desc { font-size: 15px; line-height: 1.6; border-left: 0; padding-left: 0; color: var(--ink); }
.game-desc.empty { color: var(--ink-subtle); }
.s-tag { border-radius: var(--radius-pill); font-family: var(--font-mono); font-size: 10.5px; padding: 3px 10px; background: transparent; border: 1px dashed var(--hair-strong); color: var(--ink-subtle); }
.s-tag.filled { border: 1px solid color-mix(in srgb, var(--hot) 45%, transparent); background: var(--hot-soft); color: var(--ink); }
.sdivider { background: var(--hair); }
.missing-lbl { font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-subtle); }
.missing-lbl.all-filled { color: var(--moss); }
.missing-dot { background: transparent; border: 1px solid var(--ink-subtle); }

/* summary */
.summary-screen { padding-top: clamp(40px, 8vh, 80px); }
.summary-kicker { margin-bottom: 22px; }
.summary-title { font-size: clamp(40px, 7vw, 80px); font-weight: 600; letter-spacing: -0.05em; line-height: .98; text-shadow: var(--title-glow); margin-bottom: 14px; }
.summary-sub { font-size: 18px; }
.final-desc-box { border-radius: 24px; padding: 28px; position: relative; border-color: var(--hair) !important; border-left: 2px solid var(--hot) !important; }
.final-desc-box::before { font-family: var(--font-body); font-weight: 600; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--hot); }
.final-desc-text { font-size: clamp(18px, 2vw, 21px); line-height: 1.55; letter-spacing: -0.01em; }
.gdd-sec { border-top: 1px solid var(--hair); }
.gdd-sec-title { font-size: 11px; letter-spacing: .14em; color: var(--ink-subtle); }
.gdd-row { border-bottom: 1px solid var(--hair); }
.gdd-val { font-weight: 500; }
.tag { background: var(--hot-soft); border: 1px solid color-mix(in srgb, var(--hot) 35%, transparent); font-weight: 500; }
.export-row .btn-exp { min-height: 50px; }
.btn-restart { border-color: transparent; color: var(--ink-muted); }
.guide-cta { position: relative; overflow: hidden; isolation: isolate; border-radius: 28px; padding: clamp(28px, 4vw, 44px); gap: 16px; border: 1px solid var(--hair-strong); background: var(--card); }
.guide-cta::before { content: ""; position: absolute; z-index: -1; right: -10%; bottom: -60%; width: 60%; height: 120%; pointer-events: none; background: radial-gradient(closest-side, rgba(255, 107, 74, .3), transparent); }
.guide-cta-title { font-size: clamp(26px, 3.4vw, 40px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; text-shadow: var(--title-glow); }
.guide-cta .btn-exp.primary { min-height: 52px; padding: 14px 26px; }

.footer-logo-name { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; text-transform: none; }
.footer-section-title { font-size: 11px; letter-spacing: .14em; }
.footer-links li::before { width: 5px; height: 5px; background: var(--hot); box-shadow: 0 0 6px var(--hot); }
.footer-bottom { border-top-color: var(--hair); }

/* ═════════════ SHARED FOOTER ═════════════ */
.site-footer { background: transparent; border-top: 1px solid var(--hair); position: relative; overflow: hidden; padding-bottom: 0; }
/* the big soft glowing wordmark: crisp letters over a blurred coral copy */
.footer-mark {
  position: relative; isolation: isolate; flex-basis: 100%; width: 100%; margin: clamp(24px, 4vw, 48px) auto 0; text-align: center; user-select: none; pointer-events: none;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(64px, 17vw, 260px); line-height: .78; letter-spacing: -0.06em;
  height: .62em; overflow: hidden; white-space: nowrap; color: var(--ink); opacity: .92;
}
.footer-mark::before { content: attr(data-text); position: absolute; inset: 0; z-index: -1; color: var(--hot); filter: blur(26px); opacity: .9; }
[data-theme="light"] .footer-mark::before { opacity: .4; }

/* flickering engine logos */
.engine-logos-wrap { max-width: 1200px; margin: 0 auto var(--space-8); width: 100%; flex-basis: 100%; }
.engine-logos-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: var(--space-3); font-size: 13px; color: var(--ink-subtle); }
.engine-logos { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--hair); border-radius: 24px; overflow: hidden; background: #060608; }
.flick { position: relative; height: 128px; display: grid; place-items: center; padding: 0 22px; border-right: 1px solid rgba(246, 245, 255, .09); overflow: hidden; outline: none; cursor: default; isolation: isolate; }
.flick:last-child { border-right: 0; }
.flick:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.flick img {
  max-height: 34px; max-width: 100%; width: auto; height: auto;
  mix-blend-mode: screen; /* the logo files are white on black: "screen" drops the black */
  filter: grayscale(1) contrast(1.8) brightness(.5) sepia(1) hue-rotate(195deg) saturate(3); /* off: cold, dim filament */
  opacity: .55; transition: filter .6s ease, opacity .6s ease;
}
.flick .flick-bloom { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(1.04); pointer-events: none; mix-blend-mode: screen; opacity: 0;
  filter: grayscale(1) contrast(1.8) brightness(1.6) sepia(1) hue-rotate(-25deg) saturate(5) blur(9px); }
.flick::before { content: ""; position: absolute; inset: -40%; z-index: -1; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 50%, rgba(255, 140, 100, .22), transparent 60%); }
.flick::after { content: ""; position: absolute; left: 25%; right: 25%; bottom: 0; height: 1px; opacity: 0; pointer-events: none; background: #ffb385; box-shadow: 0 0 12px var(--hot); }
.flick.lit img:not(.flick-bloom) { opacity: 1; filter: grayscale(1) contrast(1.8) brightness(1.15) sepia(.45) hue-rotate(-15deg) saturate(2.2); }
.flick.lit .flick-bloom, .flick.lit::before, .flick.lit::after { opacity: 1; }
.flick.lit.dim img:not(.flick-bloom) { opacity: .75; filter: grayscale(1) contrast(1.8) brightness(.85) sepia(.6) hue-rotate(-15deg) saturate(2); }
.flick.lit.dim .flick-bloom { opacity: .35; }
.flick.lit.dim::before, .flick.lit.dim::after { opacity: .4; }
.flick.lit img, .flick.lit::before, .flick.lit::after { transition: none; }
.flick.steady img:not(.flick-bloom), .flick.steady .flick-bloom { animation: flick-hum 2.8s infinite; }
@keyframes flick-hum { 0%, 46%, 49%, 82%, 85%, 100% { opacity: 1; } 47% { opacity: .66; } 48% { opacity: .95; } 83% { opacity: .85; } }
.flick .flick-tag { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #ffd2b0; opacity: 0; transform: translateY(6px); transition: opacity .3s ease, transform .4s ease; }
.flick.lit .flick-tag { opacity: 1; transform: none; }
@media (max-width: 760px) {
  .engine-logos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flick { height: 104px; border-bottom: 1px solid rgba(246, 245, 255, .09); }
  .flick:nth-child(2n) { border-right: 0; }
  .flick:last-child { grid-column: span 2; border-bottom: 0; }
}
/* light theme: no black box. The white-on-black logo files are inverted to dark ink and
   "multiply" drops their white background, so they sit straight on the light page. */
[data-theme="light"] .engine-logos { background: var(--surface, #fff); }
[data-theme="light"] .flick { border-color: var(--hair); }
[data-theme="light"] .flick img { mix-blend-mode: multiply; opacity: .7;
  filter: invert(1) grayscale(1) contrast(1.6) brightness(1.35); }
[data-theme="light"] .flick .flick-bloom { display: none; } /* a tinted blur would show the image box on a light page */
[data-theme="light"] .flick.lit img:not(.flick-bloom) { opacity: 1; filter: invert(1) grayscale(1) brightness(.9) contrast(2); }
[data-theme="light"] .flick.lit.dim img:not(.flick-bloom) { opacity: .55; filter: invert(1) grayscale(1) contrast(1.6) brightness(1.3); }
[data-theme="light"] .flick .flick-tag { color: #c2410c; }

/* two-logo footer: The Hub + Game Development Unit */
.engine-logos.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.engine-logos.two .flick { height: 140px; }
.engine-logos.two .flick img { max-height: 48px; }
.footer-contact { margin: var(--space-3) 0 0; font-size: 14px; color: var(--ink-subtle); text-align: center; }
.footer-contact b { color: var(--ink); font-weight: 600; }
.footer-contact a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.footer-contact a:hover { color: var(--hot); }
@media (max-width: 760px) {
  .engine-logos.two { grid-template-columns: 1fr; }
  .engine-logos.two .flick { height: 110px; border-right: 0; grid-column: auto; }
  .engine-logos.two .flick:first-child { border-bottom: 1px solid rgba(246, 245, 255, .09); }
  .engine-logos.two .flick img { max-height: 40px; }
}

/* ═════════════ UNITY GUIDE (static look; card stacking lives in guide-motion.css) ═════════════ */
.layout:has(> .toc) { grid-template-columns: 264px minmax(0, 1fr); }
.toc { border-right: 1px solid var(--hair); padding-top: 28px; counter-reset: tch; scrollbar-width: thin; }
.toc-ch { margin-bottom: 22px; }
.toc-ch-title { counter-increment: tch; display: flex; gap: 8px; align-items: baseline; padding-left: 0; margin-bottom: 8px; font-size: 11px; letter-spacing: .12em; color: var(--ink-subtle); }
.toc-ch-title::before { content: counter(tch, decimal-leading-zero); color: var(--hot); }
.toc-item { position: relative; padding: 6px 10px 6px 16px; border-radius: 0; font-size: 13.5px; color: var(--ink-muted); border-left: 1px solid var(--hair); transition: color .25s, border-color .25s; }
.toc-item:hover { background: transparent; color: var(--ink); border-left-color: var(--hair-strong); }
.toc-item.active { background: var(--hot-soft); color: var(--ink); font-weight: 600; box-shadow: none; border-left: 1px solid transparent; }
.toc-item.active::before { content: ""; position: absolute; left: -1px; top: 4px; bottom: 4px; width: 2px; background: var(--hot); box-shadow: 0 0 8px var(--hot); border-radius: 2px; }

.main { max-width: 920px; padding-left: clamp(16px, 4vw, 56px); padding-right: clamp(16px, 4vw, 56px); }

/* intro as a hero */
.intro { position: relative; background: none !important; border: 0; box-shadow: none; border-radius: 0; padding: clamp(32px, 9vh, 110px) 0 clamp(48px, 10vh, 120px); margin-bottom: clamp(24px, 4vh, 48px); gap: 22px; min-height: calc(100svh - var(--nav-offset) - 40px); align-content: center; }
.intro-title { font-size: clamp(42px, 6.6vw, 96px); font-weight: 600; line-height: .96; letter-spacing: -0.055em; max-width: 13ch; text-shadow: var(--title-glow); }
.intro-text { font-size: 18px; line-height: 1.6; max-width: 58ch; color: var(--ink-muted); }
.intro-text b { color: var(--ink); font-weight: 600; }
.chip { background: var(--card); border: 1px solid var(--hair-strong); font-weight: 500; padding: 5px 14px; }
.chip b { color: var(--hot); }
.toolbar { gap: 10px; margin-top: 6px; }
.btn { min-height: 46px; padding: 10px 22px; }
.note.warn { background: var(--hot-soft); border: 1px solid color-mix(in srgb, var(--hot) 35%, transparent); border-radius: 14px; }
.sample { background: var(--card); border: 1px solid var(--hair); border-radius: 16px; transition: border-color .3s, transform .4s var(--ease-out); }
.sample:hover { border-color: var(--hot); transform: translateX(4px); }

/* chapters */
.chapter { margin-bottom: clamp(72px, 12vh, 140px); position: relative; }
.ch-big { /* giant outlined numeral with a soft coral bloom behind it */
  display: block; width: fit-content; padding: .04em .08em .02em 0; position: relative; isolation: isolate; user-select: none;
  font-family: var(--font-display); font-weight: 200; font-size: clamp(96px, 15vw, 210px); line-height: .8; letter-spacing: -0.07em;
  color: transparent; -webkit-text-stroke: 1.5px var(--ink); margin: 0 0 10px -0.05em;
}
.ch-big::before { content: attr(data-n); position: absolute; inset: 0; padding: inherit; z-index: -1; -webkit-text-stroke: 0; font-weight: 700; color: var(--hot); filter: blur(28px); opacity: .55; }
[data-theme="light"] .ch-big::before { opacity: .25; }
.ch-title { font-size: clamp(34px, 5.2vw, 68px); font-weight: 600; line-height: 1; letter-spacing: -0.05em; border-bottom: 1px solid var(--hair-strong); padding-bottom: 28px; margin-bottom: 36px; text-shadow: var(--title-glow); }
.ch-num { display: flex; margin-bottom: 18px; text-shadow: none; letter-spacing: .02em; }

/* lessons (cards) */
.mod { border-radius: 26px; padding: clamp(20px, 3vw, 36px); margin-bottom: 28px; }
.mod.done { border-color: color-mix(in srgb, var(--moss) 45%, transparent); }
.mod-num { background: transparent; border: 1px solid var(--hair-strong); color: var(--ink); border-radius: var(--radius-pill); font-size: 12px; padding: 4px 11px; }
[data-theme="light"] .mod-num { color: var(--ink); }
.mod.done .mod-num { border-color: transparent; }
.mod-title { font-size: clamp(21px, 2.3vw, 26px); font-weight: 600; letter-spacing: -0.03em; }
.mod-done { border-radius: var(--radius-pill); background: transparent; border: 1px solid var(--hair-strong); font-size: 11px; transition: border-color .25s, color .25s; }
.mod-done:hover { border-color: var(--ink); color: var(--ink); }

.steps { position: relative; gap: 30px; }
.steps::before { content: ""; position: absolute; left: 14.5px; top: 8px; bottom: 8px; width: 1px; background: var(--hair-strong); }
.step { padding-left: 50px; }
.step::before { width: 30px; height: 30px; font-size: 12px; background: var(--card); border: 1px solid var(--hair-strong); z-index: 1; transition: background-color .4s, color .4s, box-shadow .4s, border-color .4s; }
.step.is-current::before { background: var(--hot); color: #fff; border-color: transparent; box-shadow: 0 0 14px rgba(255, 107, 74, .6); }
.step-title { font-weight: 600; font-size: 18px; letter-spacing: -0.015em; }
.step-text li::marker { color: var(--hot); }
.step-text a, .docs a, .intro-text a { color: var(--hot); }
code { background: var(--hair); }
.menu { background: var(--hair); border-color: var(--hair-strong); }
.menu-sep { color: var(--hot); }

.fig { border-radius: 16px; border-color: var(--hair); background: #0a0a0d; }
.fig figcaption { background: var(--card); border-top-color: var(--hair); color: var(--ink-subtle); }
.code { border-radius: 16px; border-color: #1f1f26; }
.box { border-radius: 16px; border: 1px solid var(--hair); background: var(--card-raised); }
.box-title { font-size: 11px; letter-spacing: .14em; }
.box.tips { background: var(--hot-soft); border-color: color-mix(in srgb, var(--hot) 30%, transparent); }
.box.tips .box-title, .box.tips li::marker { color: var(--hot); }
.box.pitfalls { background: transparent; border-style: dashed; border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.box.check { background: color-mix(in srgb, var(--moss) 8%, var(--card)); border-color: color-mix(in srgb, var(--moss) 30%, transparent); }

:root { --code-bg: #08080b; --code-head: #0f0f14; --code-line: #22222b; --code-ink: #ecebf2; }
.tk-k { color: #ff8a70; } .tk-t { color: #c9c3ff; } .tk-s { color: #ffc49a; } .tk-c { color: #7d7c90; } .tk-n { color: #ffb070; } .tk-a { color: #9fd8ff; }
.code-lang { color: #8f8ea0; } .code-btn { color: #b9b8c8; border-radius: var(--radius-pill); } .code-btn:hover { color: #fff; border-color: #4a4a58; }
.site-footer .footer-version { max-width: 60ch; }

/* ── responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .layout:has(> .toc) { grid-template-columns: minmax(0, 1fr); }
  .toc { border-right: 0; border-bottom: 1px solid var(--hair); }
  .intro { min-height: 0; }
}
@media (max-width: 760px) {
  .subtitle { display: none; }
  .title::before { margin-right: 10px; }
  .nav-row { bottom: 14px; }
  .nav-row .btn-back, .nav-row .btn-next { min-height: 44px; padding: 10px 18px; }
  .question-text { max-width: none; }
}
@media (max-width: 520px) {
  .step { padding-left: 42px; }
  .steps::before { left: 13.5px; }
  .step::before { width: 28px; height: 28px; }
}
@media print {
  body::before, body::after, .footer-mark, .nav-row { display: none !important; }
  /* paper has no dark background: print code dark on light, and drop the title glow */
  .code, .code pre, .code pre code { background: #f6f6f6 !important; color: #111 !important; border-color: #ccc !important; }
  .tk-k { color: #9a4a00 !important; } .tk-t { color: #2f6a20 !important; } .tk-s { color: #7a5600 !important; }
  .tk-c { color: #555 !important; } .tk-n { color: #8a2a8a !important; } .tk-a { color: #2a4a9a !important; }
  .intro-title, h1, h2, h3 { text-shadow: none !important; filter: none !important; }
}
/* "Beta" pill next to the site title */
.beta-tag { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: var(--radius-pill); background: var(--btn-bg); color: var(--btn-ink); font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; vertical-align: middle; text-shadow: none; }
