/* Layout: one long scroll story — hero, anatomy, mapping, landmarks, nav stack, progress.
   Three switchable design directions share the content; each is a deliberate single look. */
:root, :root[data-direction="gallery"] {
  --bg: #f3f4f1; --surface: #ffffff; --ink: #16191d; --muted: #5d636b; --line: #d9dcd6;
  --accent: #d9480f; --accent-ink: #ffffff; --accent2: #1f6f6b; --soft: #eceee8;
  --code-bg: #1b1f24; --code-ink: #e6e8e3;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --body: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius: 14px; --display-weight: 800; --display-track: -0.03em; --display-case: none;
  --grid-bg: none;
  color-scheme: light;
}
:root[data-direction="grid"] {
  --bg: #e7e8ea; --surface: #f7f7f8; --ink: #101114; --muted: #4f545c; --line: #b9bcc2;
  --accent: #b5167a; --accent-ink: #ffffff; --accent2: #0b7a8a; --soft: #dcdde0;
  --code-bg: #101114; --code-ink: #e7e8ea;
  --display: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius: 2px; --display-weight: 600; --display-track: -0.02em; --display-case: none;
  --grid-bg: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 24px 24px;
  color-scheme: light;
}
:root[data-direction="scan"] {
  /* honey / plum / dusty blue / sage */
  --bg: #f4e2a6; --surface: #fbf1d2; --ink: #34173f; --muted: #6a5470; --line: #dcc585;
  --accent: #4f6c99; --accent-ink: #fbf1d2; --accent2: #66713f; --soft: #efd993;
  --code-bg: #2e1538; --code-ink: #f4e2a6;
  --display: "Unbounded", "Avenir Next", sans-serif;
  --body: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius: 10px; --display-weight: 700; --display-track: -0.02em; --display-case: none;
  --grid-bg: radial-gradient(circle at 80% -10%, rgba(181,186,138,.28), transparent 45%);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.6;
  transition: background-color .3s, color .3s;
}
body::before { content: ""; position: fixed; inset: 0; background: var(--grid-bg); opacity: .45; pointer-events: none; z-index: 0; }
:root[data-direction="scan"] body::before { opacity: 1; }
main, header.top, footer { position: relative; z-index: 1; }

.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--display); font-weight: var(--display-weight); letter-spacing: var(--display-track); text-wrap: balance; margin: 0; line-height: 1.05; }
h2 { font-size: clamp(30px, 4.4vw, 48px); }
h3 { font-size: 20px; letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0; }
a { color: var(--accent); }
code, .mono { font-family: var(--mono); font-size: .88em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lede { color: var(--muted); font-size: 18px; max-width: 62ch; }

/* top bar */
header.top { position: sticky; top: env(safe-area-inset-top, 0px); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); z-index: 20; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.brand { font-family: var(--display); font-weight: var(--display-weight); font-size: 18px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
nav.links { display: flex; gap: 22px; font-size: 14px; }
nav.links a { color: var(--muted); text-decoration: none; }
nav.links a:hover { color: var(--ink); }
@media (max-width: 860px) { nav.links { display: none; } }

/* direction switcher */
.switch { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.switch button { font: 500 12px var(--mono); border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.switch-label { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.switch-wrap { display: flex; align-items: center; gap: 10px; }
@media (max-width: 560px) { .switch-label { display: none; } }

section { padding-block: clamp(56px, 8vw, 104px); border-bottom: 1px solid var(--line); }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: end; margin-bottom: 40px; }
.sec-head > div { display: grid; gap: 14px; }
@media (max-width: 860px) { .sec-head { grid-template-columns: 1fr; gap: 16px; } }

/* HERO */
.hero { padding-block: clamp(40px, 6vw, 80px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(44px, 7.6vw, 96px); }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-copy { display: grid; gap: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--mono); font-size: 12.5px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); }
.hero-figure { position: relative; margin: 0; }
.hero-figure img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; border-radius: var(--radius); }
.hero-figure figcaption { position: absolute; left: 12px; bottom: 12px; right: 12px; display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 11.5px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 16px 16px 16px 0; display: grid; gap: 2px; }
.stat + .stat { padding-left: 16px; border-left: 1px solid var(--line); }
.stat b { font-family: var(--display); font-weight: var(--display-weight); font-size: 26px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .stat-row { grid-template-columns: repeat(2, minmax(0,1fr)); } .stat:nth-child(3) { border-left: 0; padding-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* 3D STAGE: deliberately dark in every direction */
:root { --stage-bg: #22102c; --stage-glow: #4a2a5c; --stage-ink: #f6e6ad; --stage-muted: #cbb8cf; --stage-line: rgba(244,226,166,.18); --stage-accent: #f2d98d; --stage-accent2: #b5ba8a; --stage-panel: rgba(34,16,44,.78); }
.stage-sec { padding-block: 0; }
.stage { position: relative; background: radial-gradient(ellipse 55% 70% at 64% 58%, var(--stage-glow) 0%, var(--stage-bg) 72%); color: var(--stage-ink); height: clamp(620px, 90vh, 940px); overflow: hidden; }
.stage-view { position: absolute; inset: 0; z-index: 1; }
.stage-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.stage-view canvas:active { cursor: grabbing; }
/* wide screens: keep the draggable 3D area to the right of the headline so the left side scrolls normally */
@media (min-width: 861px) {
  .stage-view { left: 48%; }
  .stage-view canvas { -webkit-mask-image: linear-gradient(to right, transparent, #000 14%); mask-image: linear-gradient(to right, transparent, #000 14%); }
  .stage-poster { right: 12%; max-width: 76%; }
}
.stage-poster { position: absolute; right: 8%; top: 9%; height: 78%; width: auto; max-width: 42%; object-fit: cover; border-radius: 16px; transition: opacity .6s; }
.stage-view.ready .stage-poster { opacity: 0; pointer-events: none; }
.stage-view.no3d canvas, .stage-view.no3d .sbtn, .stage-view.no3d .stage-badge, .stage-view.no3d .stage-hint { display: none; }
.stage-copy { position: absolute; left: 0; right: 0; top: 0; z-index: 2; pointer-events: none; padding-block: clamp(48px, 10vh, 120px) 0; }
.stage-copy .inner { max-width: 520px; display: grid; gap: 22px; pointer-events: auto; }
.stage-copy .eyebrow { color: var(--stage-muted); }
.stage h1 { font-size: clamp(42px, 6vw, 82px); color: var(--stage-ink); }
.stage h1 em { font-style: normal; color: var(--stage-accent); }
.stage .lede { color: var(--stage-muted); font-size: 17px; }
.stage .chip { background: rgba(255,255,255,.04); border-color: var(--stage-line); color: var(--stage-ink); }
.stage-labels { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.slabel { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--stage-ink); font: 600 12px var(--mono); pointer-events: auto; transition: opacity .25s; will-change: transform; }
.slabel .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--stage-panel); border: 1.5px solid var(--stage-ink); font-size: 11px; flex: none; }
.slabel .nm { opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .2s; background: var(--stage-panel); padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.slabel:hover .nm, .slabel:focus-visible .nm, .slabel[aria-pressed="true"] .nm { opacity: 1; transform: none; }
.slabel[aria-pressed="true"] .dot { background: var(--stage-accent); border-color: var(--stage-accent); color: var(--stage-bg); }
.slabel.back { opacity: .3; }
.stage-badge { position: absolute; z-index: 3; top: 16px; right: max(16px, env(safe-area-inset-right, 0px)); font: 11px var(--mono); letter-spacing: .06em; color: var(--stage-muted); border: 1px dashed var(--stage-line); padding: 5px 10px; border-radius: 999px; }
.stage-bottom { position: absolute; left: 0; right: 0; bottom: 22px; z-index: 3; pointer-events: none; }
.stage-bottom .wrap { display: flex; justify-content: flex-end; align-items: flex-end; gap: 16px; }
.stage-ui { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; pointer-events: auto; max-width: 520px; }
.sbtn { font: 600 12.5px var(--mono); padding: 9px 14px; border-radius: 999px; border: 1px solid var(--stage-line); background: var(--stage-panel); color: var(--stage-ink); backdrop-filter: blur(8px); cursor: pointer; }
.sbtn:hover { border-color: var(--stage-ink); }
.sbtn[aria-pressed="true"] { background: var(--stage-ink); color: var(--stage-bg); border-color: var(--stage-ink); }
.stage-hint { font: 12px var(--mono); color: var(--stage-muted); padding-left: 4px; transition: opacity .4s; }
.stage-card { width: min(340px, 100%); background: var(--stage-panel); border: 1px solid var(--stage-line); border-radius: 14px; padding: 16px 18px; backdrop-filter: blur(10px); display: grid; gap: 4px; pointer-events: auto; }
.stage-card .num { font: 600 11px var(--mono); color: var(--stage-muted); letter-spacing: .1em; text-transform: uppercase; }
.stage-card h3 { color: var(--stage-ink); font-size: 18px; }
.stage-card .tag { font: 12px var(--mono); color: var(--stage-accent2); }
.stage-card p { color: var(--stage-muted); font-size: 14px; margin-top: 4px; }
.stage-stats { padding-block: 28px; }
@media (max-width: 860px) {
  .stage { height: auto; }
  .stage-copy { position: relative; padding-block: 40px 0; }
  .stage-view { position: relative; height: 68vh; min-height: 460px; }
  .stage-poster { max-width: 70%; right: 15%; }
  .stage-bottom { bottom: 14px; }
  .stage-bottom .wrap { flex-direction: column; align-items: stretch; gap: 10px; }
  .stage-card { width: 100%; padding: 12px 14px; }
}
@media (max-width: 560px) { .stage-card p { display: none; } .stage-hint { display: none; } }

/* ANATOMY */
.anatomy { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 860px) { .anatomy { grid-template-columns: 1fr; } }
.annot { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--soft); }
.annot img { display: block; width: 100%; height: auto; }
.hotspot { position: absolute; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: var(--accent); color: var(--accent-ink); font: 600 12px var(--mono); cursor: pointer; display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0,0,0,.35); transition: transform .15s; }
.hotspot:hover, .hotspot[aria-pressed="true"] { transform: translate(-50%, -50%) scale(1.18); }
.hotspot[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.hotspot[aria-pressed="true"]::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--accent); animation: ping 1.6s ease-out infinite; }
@keyframes ping { from { opacity: 1; transform: scale(.8); } to { opacity: 0; transform: scale(1.5); } }
.parts { display: grid; gap: 0; border-top: 1px solid var(--line); }
.part { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; padding: 16px 4px; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; color: inherit; font: inherit; width: 100%; }
.part .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--mono); border: 1px solid var(--line); color: var(--muted); }
.part[aria-pressed="true"] .n { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.part h3 { font-size: 17px; }
.part p { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.part .tag { font-family: var(--mono); font-size: 12px; color: var(--accent2); }
.part:not([aria-pressed="true"]) p.detail { display: none; }

/* Reachy videos */
.reels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; margin-top: 48px; align-items: stretch; }
@media (max-width: 860px) { .reels { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } .reel-note { grid-column: 1 / -1; } }
.reel { margin: 0; display: grid; gap: 8px; }
.reel video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: var(--radius); background: #000; display: block; }
.reel figcaption { font-size: 13px; color: var(--muted); }
.reel-note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 14px; align-content: start; align-self: start; }
.reel-note img { width: 100%; border-radius: calc(var(--radius) - 4px); aspect-ratio: 4/3; object-fit: cover; }
/* note card on its own (no videos): image beside the text */
.reels--note-only { grid-template-columns: minmax(0, 1fr); }
.reels--note-only .reel-note { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; column-gap: 24px; max-width: 860px; }
.reels--note-only .reel-note img { grid-row: span 2; }
@media (max-width: 760px) { .reels--note-only .reel-note { grid-template-columns: 1fr; } .reels--note-only .reel-note img { grid-row: auto; } }

/* MAPPING */
.maps { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 960px) { .maps { grid-template-columns: 1fr; } }
.viewer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { font: 500 12.5px var(--mono); padding: 6px 10px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { border-color: var(--line); background: var(--soft); color: var(--ink); }
.viewer img { width: 100%; display: block; aspect-ratio: 1400 / 843; object-fit: cover; background: #f2f2f2; }
.viewer-cap { padding: 12px 14px; font-size: 13.5px; color: var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.25); }

.graph-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; align-content: start; }
.graph-card svg { width: 100%; height: auto; display: block; }
.btn { font: 600 13px var(--mono); padding: 10px 14px; border-radius: 8px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); cursor: pointer; justify-self: start; }
.btn.ghost { background: transparent; color: var(--ink); }
.formula { font-family: "Times New Roman", "STIX Two Text", Georgia, serif; font-size: 19px; padding: 14px 16px; background: var(--soft); border-radius: 8px; overflow-x: auto; white-space: nowrap; }
.formula i { font-style: italic; }
.formula .big { font-size: 1.4em; vertical-align: -0.12em; }
.small { font-size: 14px; color: var(--muted); }

/* LANDMARKS */
.tagmap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 960px) { .tagmap { grid-template-columns: 1fr; } }
.tagmap--plot-only { grid-template-columns: minmax(0, 1fr); }
.plot { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; overflow-x: auto; }
.plot svg { display: block; width: 100%; min-width: 720px; height: auto; }
.plot .axis { stroke: var(--line); }
.plot .tick { fill: var(--muted); font: 11px var(--mono); }
.plot .tagbox { cursor: pointer; }
.plot .tagbox rect.t { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.plot .tagbox text { fill: var(--ink); font: 600 12px var(--mono); }
.plot .tagbox.on rect.t { fill: var(--accent); stroke: var(--accent); }
.plot .tagbox.on text.id { fill: var(--accent-ink); }
.plot .lbl { fill: var(--muted); font: 12px var(--body); }
.plot .origin { stroke: var(--accent2); stroke-width: 2.5; }
.tag-info { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 12px; }
.tag-info dl { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 6px 16px; margin: 0; font-family: var(--mono); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tag-info dt { color: var(--muted); }
.tag-info dd { margin: 0; }
.tag-info img { width: 100%; border-radius: 6px; border: 1px solid var(--line); }
.tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-list button { font: 600 12px var(--mono); padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--soft); color: var(--ink); cursor: pointer; }
.tag-list button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.sub-head { margin: 72px 0 0; }
.sub-head h3 { font-size: clamp(24px, 3vw, 32px); }
.sub-head .lede { font-size: 17px; }
.semantic { margin-top: 32px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .semantic { grid-template-columns: 1fr; } }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 10px; align-content: start; }
.step .k { font-family: var(--mono); font-size: 12px; color: var(--accent2); letter-spacing: .06em; text-transform: uppercase; }
.step p { color: var(--muted); font-size: 14.5px; }
.matrix { font-family: var(--mono); font-size: 12px; display: inline-grid; grid-template-columns: repeat(6, auto); gap: 2px 10px; padding: 8px 12px; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); border-radius: 4px; font-variant-numeric: tabular-nums; justify-self: start; }
.matrix span { text-align: right; color: var(--muted); }
.matrix span.d { color: var(--ink); font-weight: 600; }
.matrix span.hi { color: var(--accent); font-weight: 600; }

/* NAV STACK */
.stack { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (max-width: 960px) { .stack { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } }
@media (max-width: 560px) { .stack { grid-template-columns: 1fr; } }
.layer { padding: 20px; display: grid; gap: 12px; align-content: start; border-right: 1px solid var(--line); position: relative; }
.layer:last-child { border-right: 0; }
@media (max-width: 960px) { .layer { border-bottom: 1px solid var(--line); } .layer:nth-child(2n) { border-right: 0; } }
@media (max-width: 560px) { .layer { border-right: 0; } }
.layer .k { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.node { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--bg); display: grid; gap: 2px; }
.node b { font-size: 14.5px; font-weight: 600; }
.node code { color: var(--accent2); font-size: 12px; overflow-wrap: anywhere; }
.node.hl { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.flow-out { font-family: var(--mono); font-size: 12px; color: var(--accent); }

.under { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 860px) { .under { grid-template-columns: 1fr; } }
.term { background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius); padding: 18px; font: 12.5px/1.65 var(--mono); overflow-x: auto; white-space: pre; }
.term .c { opacity: .55; }
.term .w { color: #f5b74e; }
.term .e { color: #ff7a6e; }
.term .ok { color: #7ee0c3; }
.notes { display: grid; gap: 14px; align-content: start; }
.note { display: grid; grid-template-columns: 10px minmax(0,1fr); gap: 12px; }
.note::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--accent2); margin-top: 7px; }
.note.warn::before { background: var(--accent); }
.note p { color: var(--muted); font-size: 14.5px; }
.note b { color: var(--ink); }

/* PROGRESS */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .board { grid-template-columns: 1fr; } }
.col { display: grid; gap: 10px; align-content: start; }
.col-h { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 2px solid var(--ink); font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; }
.col-h .count { color: var(--muted); }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 6px; }
.item b { font-weight: 600; font-size: 15px; }
.item span { font-size: 13.5px; color: var(--muted); }
.pill { justify-self: start; font: 600 11px var(--mono); padding: 3px 8px; border-radius: 999px; letter-spacing: .04em; }
.pill.done { background: color-mix(in srgb, var(--accent2) 16%, transparent); color: var(--accent2); }
.pill.wip { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.pill.next { background: var(--soft); color: var(--muted); }

.stl { margin-top: 32px; border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 28px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; }
@media (max-width: 760px) { .stl { grid-template-columns: 1fr; } }
.stl img { width: 100%; border-radius: var(--radius); aspect-ratio: 4/3; object-fit: cover; object-position: 50% 40%; }
.stl .copy { display: grid; gap: 12px; }

footer { padding-block: 48px; }
footer .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
@media (max-width: 760px) { footer .wrap { grid-template-columns: 1fr; } }
footer h3 { font-size: 26px; }
footer p, footer li { color: var(--muted); font-size: 14.5px; }
footer ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
footer .eyebrow { margin-bottom: 4px; }

/* direction-specific accents */
:root[data-direction="grid"] .hero h1 { font-size: clamp(38px, 6.4vw, 80px); }
:root[data-direction="grid"] .hero-figure img { filter: grayscale(.15) contrast(1.05); }
:root[data-direction="grid"] .chip, :root[data-direction="grid"] .switch, :root[data-direction="grid"] .switch button { border-radius: 2px; }
:root[data-direction="scan"] .hero h1 { font-size: clamp(36px, 6.2vw, 76px); }
:root[data-direction="scan"] .hero-figure img { filter: saturate(.85); }
