:root {
  color-scheme: dark;
  --bg: #101210;
  --ink: #eeeee4;
  --dim: #a2aa9b;
  --acid: #c9fc67;
  --line: #353b32;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --header-height: 5rem;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-synthesis: none;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1.5rem);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: .125rem solid var(--acid); outline-offset: .25rem; }
::selection { background: var(--acid); color: var(--bg); }
.accent { color: var(--acid); }
.muted { color: var(--dim); }
.skip-link { position: fixed; top: .75rem; left: 1rem; z-index: 100; max-width: calc(100% - 2rem); background: var(--acid); color: var(--bg); padding: .75rem 1rem; transform: translateY(-180%); }
.skip-link:focus { transform: none; }
#world { position: fixed; z-index: 0; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.site-header { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: .0625rem solid var(--line); }
.header-inner { max-width: 94rem; margin-inline: auto; padding: .875rem clamp(1.25rem, 4vw, 4rem); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2rem; }
.wordmark { display: inline-flex; align-items: center; width: fit-content; font-size: 1.5rem; letter-spacing: -.06em; font-weight: 700; white-space: nowrap; }
.pixel-mark { width: .875rem; height: .875rem; background: var(--acid); margin-right: .75rem; clip-path: polygon(0 0,100% 0,100% 35%,65% 35%,65% 65%,35% 65%,35% 100%,0 100%,0 65%,35% 65%,35% 35%,0 35%); }
.chapter-nav { min-width: 0; display: flex; justify-content: center; align-items: center; gap: clamp(.625rem, 1.6vw, 1.625rem); font: .75rem/1.4 var(--mono); overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.chapter-nav a { position: relative; display: inline-flex; align-items: center; gap: .5rem; flex: 0 0 auto; min-height: 2.75rem; white-space: nowrap; }
.nav-number { color: var(--dim); }
.chapter-nav a:hover, .chapter-nav a[aria-current], .chapter-nav a[aria-current] .nav-number { color: var(--acid); }
.chapter-nav a[aria-current]::after { content: ""; position: absolute; height: .125rem; left: 0; right: 0; bottom: .25rem; background: var(--acid); }
.motion-button { display: inline-flex; align-items: center; justify-content: center; gap: .625rem; min-height: 2.75rem; min-width: 2.75rem; border: .0625rem solid var(--line); background: transparent; color: var(--ink); padding: .625rem .875rem; cursor: pointer; font: .75rem/1.4 var(--mono); }
.motion-button:hover { border-color: var(--acid); color: var(--acid); }
.motion-icon { font-size: 1rem; line-height: 1; min-width: .875rem; text-align: center; }
main { position: relative; z-index: 1; width: min(100%, 94rem); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 4rem); }
.chapter { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: center; gap: clamp(2rem, 4vw, 4.5rem); padding-block: clamp(4rem, 7vw, 7rem); border-bottom: .0625rem solid var(--line); }
.chapter:last-child { border-bottom: 0; }
.chapter-content, .visual-slot, .algorithm-lab { min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: .625rem; margin: 0 0 1.875rem; font: .75rem/1.6 var(--mono); letter-spacing: .025em; color: var(--dim); }
.tiny-cross { font-size: 1.125rem; line-height: 1; color: var(--acid); }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(4rem, 7.4vw, 7.875rem); line-height: .9; letter-spacing: -.075em; margin-bottom: 1.5rem; font-weight: 800; overflow-wrap: anywhere; }
h2 { font-size: clamp(2rem, 3.6vw, 3.75rem); line-height: 1.08; letter-spacing: -.045em; margin-bottom: 1.875rem; font-weight: 700; overflow-wrap: anywhere; }
.identity { font-size: 1.5rem; line-height: 1.35; letter-spacing: -.02em; margin-bottom: 2.5rem; }
.identity span { display: block; font-size: 1rem; letter-spacing: 0; color: var(--dim); margin-top: .375rem; }
.hero-line { font-size: clamp(2rem, 3vw, 3rem); margin-bottom: 1.25rem; }
.chapter-copy { font-size: 1.0625rem; line-height: 1.65; color: #c9cfbf; max-width: 39ch; margin-bottom: 1.25rem; overflow-wrap: anywhere; }
.secondary-copy { color: var(--dim); }
.next-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 2.75rem; margin-top: .5rem; border-bottom: .0625rem solid var(--line); font: .8125rem/1.5 var(--mono); }
.next-link span { color: var(--acid); font-size: 1.375rem; }
.next-link:hover { border-color: var(--acid); }
.visual-caption { display: flex; align-items: center; flex-wrap: wrap; gap: .625rem; margin-bottom: .75rem; color: var(--dim); font: .75rem/1.5 var(--mono); letter-spacing: .02em; }
.stage-dot, .status-dot { flex: 0 0 auto; width: .375rem; height: .375rem; background: var(--acid); }
.visual-kind { margin-left: auto; color: var(--ink); }
.world-viewport { position: relative; width: 100%; height: clamp(25rem, 43vw, 38rem); touch-action: pan-y; }
.world-viewport::before, .world-viewport::after { content: ""; position: absolute; width: .875rem; height: .875rem; border: solid var(--line); pointer-events: none; }
.world-viewport::before { top: 0; left: 0; border-width: .0625rem 0 0 .0625rem; }
.world-viewport::after { bottom: 0; right: 0; border-width: 0 .0625rem .0625rem 0; }
.visual-hint { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .625rem 0 0; color: var(--dim); font: .75rem/1.6 var(--mono); }
.visual-hint > span:last-child { font-size: 1.25rem; color: var(--acid); }
.touch-hint { display: none; }
.world-fallback { display: none; position: absolute; inset: 0; margin: 0; padding: 2rem; align-items: center; justify-content: center; flex-direction: column; text-align: center; gap: .75rem; color: var(--acid); font: 1.125rem/1.4 var(--mono); }
.world-fallback span { color: var(--dim); font-size: .875rem; }
.scene-unavailable .world-fallback { display: flex; }
.scene-unavailable .visual-kind, .scene-unavailable .visual-hint { visibility: hidden; }
.scene-unavailable #world { visibility: hidden; }
.complexity { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .75rem; max-width: 26rem; margin-block: 1.5rem; padding-block: .875rem; border-block: .0625rem solid var(--line); font: .8125rem/1.5 var(--mono); }
.complexity strong { color: var(--acid); font-size: 1.125rem; font-weight: 400; }
.achievement { display: flex; align-items: center; flex-wrap: wrap; gap: 1.25rem; margin-top: 2rem; }
.achievement-number { font-size: 4.5rem; font-weight: 700; letter-spacing: -.08em; line-height: 1; }
.achievement-number .accent { font-weight: 400; font-size: .7em; }
.achievement p { font-size: 1rem; line-height: 1.5; margin: 0; }
.achievement p span { display: block; color: var(--dim); font-size: .8125rem; line-height: 1.5; margin-top: .375rem; }
.margin-note { font: .8125rem/1.7 var(--mono); color: var(--dim); border-left: .125rem solid var(--acid); padding-left: .75rem; margin: 2rem 0 0; }
.outlined { -webkit-text-stroke: .0625rem var(--ink); color: transparent; }
.terminal-note { font: 1rem/1.6 var(--mono); margin: 1.875rem 0 0; overflow-wrap: anywhere; }
.terminal-note > span:first-child { color: var(--acid); margin-right: .625rem; }
.terminal-cursor { color: var(--acid); }
.token-line { display: flex; align-items: center; flex-wrap: wrap; gap: .625rem; margin-top: 1.75rem; font: .8125rem/1.4 var(--mono); }
.token-line span { border: .0625rem solid var(--line); padding: .5rem .625rem; }
.token-line b { font-weight: 400; color: var(--dim); }
.token-line .token-result { border-color: var(--acid); color: var(--acid); }
.company { display: flex; align-items: center; flex-wrap: wrap; gap: 1.5rem; font-size: 1.875rem; letter-spacing: -.03em; margin-bottom: 1.5rem; }
.company span { color: var(--acid); font-size: 1.5rem; }
.site-footer { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding: 2rem clamp(1.25rem, 4vw, 4rem); border-top: .0625rem solid var(--line); color: var(--dim); background: var(--bg); font: .75rem/1.6 var(--mono); }
.site-footer a { color: var(--ink); display: inline-flex; align-items: center; min-height: 2.75rem; }
.scroll-track { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: .1875rem; background: var(--line); pointer-events: none; }
#scroll-progress { display: block; height: 100%; width: 100%; background: var(--acid); transform-origin: left; transform: scaleX(0); }
body[data-motion="paused"] *, body[data-motion="paused"] *::before, body[data-motion="paused"] *::after { animation-play-state: paused !important; }
@media (max-width: 1120px) {
  .header-inner { gap: 1.25rem; }
  .nav-number { display: none; }
}
@media (max-width: 900px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; gap: .25rem 1rem; padding-block: .5rem .25rem; }
  .chapter-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; gap: 1.5rem; width: 100%; }
  .chapter-nav a { padding-inline: .125rem; }
  .motion-button { grid-column: 2; grid-row: 1; }
  .nav-number { display: inline; }
  .chapter { grid-template-columns: minmax(0, 1fr); gap: 2rem; padding-block: 3rem; }
  .chapter-content { width: 100%; max-width: 42rem; }
  h1 { font-size: clamp(4rem, 14vw, 7rem); }
  h2 { font-size: clamp(2rem, 7vw, 3rem); }
  .hero-line br { display: none; }
  .chapter-copy { max-width: 53ch; }
  .identity { margin-bottom: 1.75rem; }
  .world-viewport { height: clamp(16.25rem, 75vw, 26.25rem); }
  .visual-slot, .algorithm-lab { width: 100%; }
  .visual-caption { margin-bottom: .5rem; }
  .achievement { margin-top: 1.5rem; }
  .site-footer { gap: .5rem 1.5rem; }
}
@media (max-width: 420px) {
  .header-inner { padding-inline: 1.125rem; }
  main { padding-inline: 1.125rem; }
  .wordmark { font-size: 1.375rem; }
  .pixel-mark { display: none; }
  .chapter-nav { gap: 1.375rem; }
  .nav-number { display: none; }
  .motion-button { padding-inline: .75rem; }
  .motion-label { display: none; }
  .eyebrow { margin-bottom: 1.375rem; }
  h1 { font-size: clamp(3.75rem, 19vw, 5rem); }
  h2 { margin-bottom: 1.25rem; }
  .identity { font-size: 1.25rem; }
  .chapter-copy { font-size: 1rem; }
  .visual-kind { display: none; }
  .visual-caption { letter-spacing: 0; }
  .visual-hint { gap: .5rem; }
  .site-footer { padding-inline: 1.125rem; }
  .site-footer span:nth-child(2) { flex-basis: 100%; }
}
@media (pointer: coarse) {
  .pointer-hint { display: none; }
  .touch-hint { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
@media (prefers-contrast: more) {
  :root { --dim: #c6cebd; --line: #727c68; }
  .chapter-copy { color: var(--ink); }
}
