/* How to Fly: NES-manual look. Hard edges, stepped shadows, color = meaning.
 * Depth rule: real, running things are raised blocks with a black shadow.
 * Planned things are flat, dashed "ghosts". */

@font-face { font-family: 'Press Start 2P'; src: url('fonts/pressstart2p.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Pixelify Sans'; src: url('fonts/pixelifysans.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --ink: #000;
  --paper: #fff;
  --page: #EDF1FA;
  --dot: #D2D9EA;
  --sky: #5C94FC;
  --sky-deep: #3A6DDF;
  --px: 'Press Start 2P', ui-monospace, monospace;
  --body: 'Pixelify Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'JetBrainsMono Nerd Font', ui-monospace, monospace;
  --top: 68px;
  --nav: 300px;
  --k: #A0A6AD;
  --kl: #E8EAED;
  --kd: #50565D;
  --kt: #000;
  --raise: inset 4px 4px 0 rgba(255, 255, 255, .42), inset -4px -4px 0 rgba(0, 0, 0, .2);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 16px); }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--page);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.3px);
  background-size: 18px 18px;
  font: 400 18px/1.55 var(--body);
}
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: #fff; padding: 8px 12px; border: 3px solid #000; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.px { display: inline-block; vertical-align: middle; flex: none; shape-rendering: crispEdges; }
.loading { font-family: var(--px); font-size: 12px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: var(--sky);
  border-bottom: 4px solid var(--ink);
  box-shadow: inset 0 -6px 0 var(--sky-deep);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand-mark {
  width: 40px; height: 40px; flex: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 11h2v2H2zm2-2h2v2H4zm2-2h2v2H6zm2-2h2v2H8zm2-2h12v2H10zM20 5h2v14h-2zM4 13h6v2H4zm6 0h2v6h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm-4 10h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2z'/%3E%3C/svg%3E") center/26px no-repeat;
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.brand-text { font-family: var(--px); font-size: 15px; letter-spacing: 1px; text-shadow: 3px 3px 0 var(--ink); white-space: nowrap; }
.search { position: relative; margin-left: auto; width: min(420px, 45vw); }
.search input {
  width: 100%; height: 42px; padding: 0 14px;
  font: 500 17px var(--body); color: var(--ink);
  background: #fff; border: 3px solid var(--ink); border-radius: 0;
  box-shadow: inset 3px 3px 0 #D5DCEB;
}
.search input::placeholder { color: #5A6273; }
.results {
  position: absolute; top: 52px; right: 0;
  width: min(520px, 92vw); max-height: 70vh; overflow: auto;
  background: #fff; border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink);
}
.hit { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 10px 12px; text-decoration: none; border-bottom: 3px solid #E5E9F2; }
.hit:hover, .hit:focus-visible { background: var(--kl); outline: none; }
.hit-no { font-family: var(--px); font-size: 10px; padding: 6px; background: var(--k); color: var(--kt); border: 2px solid var(--ink); align-self: start; }
.hit strong { display: block; }
.hit small { display: block; font-size: 15px; line-height: 1.3; color: #333; }
.nohit { margin: 0; padding: 14px; }
.menu-btn { display: none; }

/* ---------- layout + nav ---------- */
.layout { display: grid; grid-template-columns: var(--nav) minmax(0, 1fr); }
.nav {
  position: sticky; top: var(--top);
  height: calc(100vh - var(--top)); overflow: auto;
  background: #fff; border-right: 4px solid var(--ink);
  padding: 16px 14px 56px;
}
.main { min-width: 0; padding: 34px clamp(16px, 4vw, 56px) 96px; outline: none; }
.main > * { max-width: 980px; margin-inline: auto; }

.nav-home { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; padding: 6px 10px; font: 10px var(--px); text-decoration: none; border: 3px solid transparent; }
.nav-home:hover, .nav-home[aria-current] { border-color: var(--ink); background: #F1F4FB; }
.nav-world { margin-bottom: 18px; }
.nav-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; text-decoration: none;
  background: var(--k); color: var(--kt);
  border: 3px solid var(--ink);
  box-shadow: var(--raise), 4px 4px 0 var(--ink);
}
.nav-head small { display: block; font-family: var(--px); font-size: 8px; margin-bottom: 5px; }
.nav-head > span:last-child { font-family: var(--px); font-size: 10px; line-height: 1.5; }
.nav-tile { width: 34px; height: 34px; display: grid; place-items: center; flex: none; background: #fff; color: var(--kd); border: 2px solid var(--ink); }
.nav ol { list-style: none; margin: 10px 0 0; padding: 0 0 0 4px; }
.nav li a { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 6px; padding: 5px 8px 5px 20px; text-decoration: none; font-size: 16px; line-height: 1.3; }
.nav li a .lvl { font-family: var(--px); font-size: 9px; padding-top: 4px; color: var(--kd); }
.nav li a:hover { background: var(--kl); }
.nav li a[aria-current="page"] { background: var(--kl); box-shadow: inset 0 0 0 2px var(--ink); font-weight: 600; }
.nav li a[aria-current="page"]::before {
  content: ''; position: absolute; left: 6px; top: 50%; margin-top: -6px;
  border-left: 8px solid var(--ink); border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}

/* ---------- stage card (page header) ---------- */
.stage { background: #fff; border: 4px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); margin-bottom: 36px; }
.stage-band {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 10px 14px;
  background: var(--k); color: var(--kt);
  border-bottom: 4px solid var(--ink);
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, .35), inset 0 -5px 0 rgba(0, 0, 0, .2);
}
.stage-tile { width: 42px; height: 42px; display: grid; place-items: center; background: #fff; color: var(--kd); border: 3px solid var(--ink); }
.stage-no { font: 12px var(--px); }
.stage-world { font-size: 19px; font-weight: 600; }
.stage-band .status { margin-left: auto; }
.stage h1 { margin: 24px 24px 10px; font: 400 clamp(18px, 2.4vw, 28px)/1.45 var(--px); }
.stage-sum { margin: 0 24px 24px; font-size: 21px; line-height: 1.4; max-width: 62ch; }

/* ---------- status badges ---------- */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 8px;
  font: 9px/1 var(--px); white-space: nowrap;
  background: #000; color: #fff; border: 3px solid #000;
}
.status-building { background: #fff; color: #000; background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0, 0, 0, .14) 6px 12px); }
.status-planned { background: #fff; color: #000; border-style: dashed; }

/* ---------- prose ---------- */
.prose > :first-child { margin-top: 0; }
.prose h2 { display: flex; align-items: center; gap: 12px; margin: 44px 0 14px; font: 400 16px/1.5 var(--px); }
.prose h2::before { content: ''; flex: none; width: 14px; height: 14px; background: var(--k); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.prose h3 { margin: 30px 0 10px; font: 400 12px/1.6 var(--px); }
.prose p, .prose li { max-width: 68ch; }
.prose strong { font-weight: 700; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 26px; margin: 7px 0; }
.prose ul > li::before { content: ''; position: absolute; left: 4px; top: .55em; width: 9px; height: 9px; background: var(--k); box-shadow: 0 0 0 2px var(--ink); }
.prose ol { padding-left: 1.5em; }
.prose ol > li { margin: 6px 0; padding-left: 4px; }
.prose code { font-family: var(--mono); font-size: .8em; padding: 1px 6px; background: #fff; border: 2px solid var(--ink); white-space: nowrap; }
.prose pre {
  margin: 22px 0; padding: 16px 18px; overflow-x: auto;
  background: #000; color: #fff;
  border: 4px solid var(--ink);
  box-shadow: inset 0 0 0 3px #fff, 6px 6px 0 var(--k);
  font-size: 15px; line-height: 1.55;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; white-space: pre; }
.table-wrap { overflow-x: auto; margin: 24px 0; padding: 0 10px 10px 0; }
.prose table { border-collapse: collapse; min-width: 100%; background: #fff; border: 4px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); font-size: 16px; line-height: 1.4; }
.prose th { text-align: left; font: 400 10px/1.5 var(--px); background: var(--kl); padding: 10px 12px; border-bottom: 3px solid var(--ink); }
.prose td { padding: 9px 12px; border-top: 2px solid #E1E6F0; vertical-align: top; }
.prose hr { border: 0; height: 4px; background: repeating-linear-gradient(90deg, var(--ink) 0 12px, transparent 12px 20px); margin: 36px 0; }

/* ---------- figures ---------- */
.fig { margin: 30px 0 42px; background: #fff; border: 4px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); }
.fig-body { overflow-x: auto; }
.fig-scene .fig-body svg { display: block; width: 100%; height: auto; min-width: var(--minw, 640px); }
.fig-steps .fig-body, .fig-timeline .fig-body, .fig-matrix .fig-body { padding: 22px 22px 14px; }
.legend {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  padding: 12px 16px;
  background: #F6F8FD; border-top: 3px solid var(--ink);
  font-size: 15px; line-height: 1.3;
}
.chip { display: inline-flex; align-items: center; gap: 8px; }
.chip > i { width: 18px; height: 18px; flex: none; background: var(--k); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); font-style: normal; }
.chip b { font-weight: 700; }
.chip-ghost > i { background: #fff; border-style: dashed; box-shadow: none; }
.chip-step > i { display: grid; place-items: center; background: #000; color: #fff; font: 8px/1 var(--px); box-shadow: none; }
figcaption { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 3px solid var(--ink); font-size: 16px; line-height: 1.35; }
.fig-no { font: 9px/1 var(--px); background: #000; color: #fff; padding: 6px 7px; white-space: nowrap; }
.fig-cap { flex: 1; }
.enlarge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 9px; cursor: pointer;
  font: 9px/1 var(--px); color: #000;
  background: #fff; border: 3px solid #000; box-shadow: 3px 3px 0 #000;
}
.enlarge:hover { background: #F1F4FB; }
.enlarge:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }

/* scene interactions */
.scene .node .ring { opacity: 0; }
.scene .node:focus { outline: none; }
.scene .node:focus-visible .ring { opacity: 1; }
.scene .node.is-link { cursor: pointer; }
.scene .node .lift { transition: transform 90ms steps(2); }
.scene .node.is-link:hover .lift, .scene .node.is-link:focus-visible .lift { transform: translate(-3px, -3px); }
.scene .node[data-tip] { cursor: help; }
.scene .node.is-link[data-tip] { cursor: pointer; }

/* ---------- steps storyboard ---------- */
.steps { list-style: none; margin: 0; padding: 0 8px 10px 0; display: flex; align-items: stretch; }
.step { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; background: var(--kl); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.step-top {
  display: flex; align-items: center; gap: 8px; padding: 8px;
  background: var(--k); color: var(--kt);
  border-bottom: 3px solid var(--ink);
  box-shadow: inset 3px 3px 0 rgba(255, 255, 255, .4), inset -3px -3px 0 rgba(0, 0, 0, .18);
}
.coin { width: 28px; height: 28px; flex: none; display: grid; place-items: center; background: #000; color: #fff; font: 10px/1 var(--px); border: 2px solid #fff; outline: 2px solid #000; }
.step-tile { width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: #fff; color: var(--kd); border: 2px solid var(--ink); }
.step-who { margin-left: auto; font: 8px/1.5 var(--px); text-align: right; }
.step h4 { margin: 12px 12px 6px; font: 400 11px/1.55 var(--px); }
.step p { margin: 0 12px 14px; font-size: 16px; line-height: 1.35; }
.step-arrow { flex: 0 0 24px; align-self: center; height: 22px; margin: 0 6px 0 12px; background: var(--ink); clip-path: polygon(0 30%, 50% 30%, 50% 0, 100% 50%, 50% 100%, 50% 70%, 0 70%); }
.step.is-ghost { background: #fff; border-style: dashed; box-shadow: none; }
.step.is-ghost .step-top { background: var(--kl); color: #000; box-shadow: none; border-bottom-style: dashed; }

/* ---------- crew profile card ---------- */
.agent-card { margin: 30px 0 42px; background: #fff; border: 4px solid var(--ink); box-shadow: 12px 12px 0 var(--ink); }
.agent-head {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 20px; align-items: center;
  padding: 18px;
  background: var(--k); color: var(--kt);
  border-bottom: 4px solid var(--ink);
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, .35), inset 0 -6px 0 rgba(0, 0, 0, .2);
}
.agent-head .status { align-self: start; }
.portrait {
  width: 120px; height: 120px; display: grid; place-items: center;
  background: #fff; color: var(--kd);
  border: 4px solid var(--ink);
  box-shadow: inset 0 0 0 6px var(--kl), 5px 5px 0 var(--ink);
}
.portrait svg { width: 72px; height: 72px; }
.agent-name { font: 400 clamp(20px, 3vw, 30px)/1.3 var(--px); text-shadow: 3px 3px 0 rgba(0, 0, 0, .3); }
.agent-role { margin-top: 6px; font-size: 21px; font-weight: 600; }
.agent-tag { margin: 6px 0 0; font-size: 18px; line-height: 1.35; }
.agent-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); border-bottom: 4px solid var(--ink); background: var(--kl); }
.stat { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-right: 3px solid rgba(0, 0, 0, .12); }
.stat-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; background: #fff; color: var(--kd); border: 2px solid var(--ink); }
.stat-label { display: block; font: 8px/1.6 var(--px); }
.stat-value { display: block; font-size: 17px; line-height: 1.3; font-weight: 600; }
.agent-can { display: grid; grid-template-columns: 1fr 1fr; }
.can { padding: 14px 18px 8px; }
.can + .can { border-left: 4px solid var(--ink); }
.can h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font: 400 11px/1 var(--px); }
.can-mark { width: 26px; height: 26px; display: grid; place-items: center; border: 2px solid #000; }
.can-yes .can-mark { background: #000; color: #fff; }
.can-no .can-mark { background: #fff; color: #000; }
.can ul { list-style: none; margin: 0; padding: 0; }
.can li { position: relative; padding: 5px 0 5px 22px; font-size: 17px; line-height: 1.35; border-top: 2px dashed #E1E6F0; }
.can li:first-child { border-top: 0; }
.can li::before { content: ''; position: absolute; left: 2px; top: .75em; width: 10px; height: 10px; }
.can-yes li::before { background: #000; }
.can-no li::before { border: 2px solid #000; background: repeating-linear-gradient(45deg, #fff 0 2px, #000 2px 3px); }
.agent-card.is-ghost .portrait { border-style: dashed; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl { display: grid; grid-template-columns: 116px 36px minmax(0, 1fr); gap: 0 14px; }
.tl-date { padding-top: 13px; text-align: right; font: 9px/1.6 var(--px); }
.tl-rail { position: relative; display: flex; justify-content: center; }
.tl-rail::before { content: ''; position: absolute; top: 0; bottom: 0; width: 10px; background: var(--k); border-inline: 2px solid #000; }
.tl:first-child .tl-rail::before { top: 14px; }
.tl:last-child .tl-rail::before { bottom: auto; height: 22px; }
.tl-rail i { position: relative; margin-top: 4px; width: 36px; height: 36px; display: grid; place-items: center; background: #fff; color: var(--kd); border: 3px solid #000; box-shadow: 3px 3px 0 #000; }
.tl-body { padding: 6px 0 22px; }
.tl-body h4 { margin: 6px 0 2px; font-size: 19px; line-height: 1.3; font-weight: 700; }
.tl-body p { margin: 0; font-size: 16px; line-height: 1.4; }
.tl-src { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 15px; }
.tl.is-ghost .tl-rail i { border-style: dashed; box-shadow: none; }
.tl.is-ghost .tl-rail::before { background: repeating-linear-gradient(180deg, var(--k) 0 8px, #fff 8px 14px); }

/* ---------- matrix ---------- */
.matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 17px; }
.matrix thead th { padding: 0 6px 12px; vertical-align: bottom; }
.mx-head { display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; background: var(--k); color: var(--kt); border: 3px solid #000; box-shadow: var(--raise), 3px 3px 0 #000; font: 9px/1.3 var(--px); white-space: nowrap; }
.matrix tbody th { text-align: left; font-weight: 600; padding: 9px 12px 9px 0; border-top: 2px solid #E1E6F0; }
.mx-row { display: flex; align-items: center; gap: 10px; }
.matrix td { text-align: center; padding: 8px 6px; border-top: 2px solid #E1E6F0; }
.mx { display: inline-grid; place-items: center; width: 38px; height: 32px; border: 3px solid #000; }
.mx-sm { width: 24px; height: 22px; border-width: 2px; }
.mx-yes { background: #000; color: #fff; box-shadow: 3px 3px 0 #9CA5B8; }
.mx-no { background: #fff; color: #8E959C; border-color: #B5BBC2; }
.mx-read { background: #fff; color: #000; }
.mx-ask { background: #FFDFB8; color: #A34700; border-color: #A34700; }
.mx-planned { background: #fff; color: #50565D; border-style: dashed; }

/* ---------- color key ---------- */
.keys { list-style: none; margin: 26px 0 40px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.keys .key { display: grid; grid-template-columns: 60px 1fr; gap: 14px; align-items: center; margin: 0; padding: 12px; background: #fff; border: 3px solid #000; box-shadow: 5px 5px 0 #000; }
.keys .key::before { display: none; }
.key-block { width: 60px; height: 54px; display: grid; place-items: center; background: var(--k); color: var(--kt); border: 3px solid #000; box-shadow: var(--raise), 4px 4px 0 var(--kd); }
.key strong { display: block; font: 400 11px/1.6 var(--px); }
.key span:not(.key-block) { display: block; font-size: 17px; line-height: 1.3; }
.key small { display: block; margin-top: 2px; font-size: 15px; line-height: 1.3; color: #3B4250; }

/* ---------- callouts ---------- */
.callout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; margin: 28px 0; padding: 14px 16px; background: var(--kl); border: 4px solid #000; box-shadow: 6px 6px 0 #000; }
.callout p { margin: 0 0 6px; }
.callout p:last-child { margin-bottom: 0; }
.callout-icon { width: 42px; height: 42px; display: grid; place-items: center; background: var(--k); color: var(--kt); border: 3px solid #000; }
.callout-title { display: block; margin-bottom: 6px; font: 9px/1.6 var(--px); }
.callout-plan { background: #fff; border-style: dashed; box-shadow: none; }
.callout-say { background: #000; color: #fff; padding: 20px 22px; box-shadow: inset 0 0 0 4px #000, inset 0 0 0 7px #fff, 8px 8px 0 var(--k); }
.say-badge { width: 58px; height: 58px; display: grid; place-items: center; background: var(--k); color: var(--kt); border: 3px solid #fff; }
.say-name { display: block; margin-bottom: 8px; font: 11px/1.4 var(--px); color: var(--k); }
.callout-say .say-body { font-size: 19px; }
.callout-say code { background: #000; color: #fff; border-color: #fff; }

/* ---------- home ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 50px clamp(20px, 5vw, 60px) 88px;
  background: var(--sky); color: #fff;
  border: 4px solid var(--ink); box-shadow: 12px 12px 0 var(--ink);
  margin-bottom: 46px;
}
.logo { position: relative; margin: 0; font: 400 clamp(32px, 6.4vw, 72px)/1.2 var(--px); text-shadow: 4px 4px 0 var(--sky-deep), 8px 8px 0 var(--ink); animation: drop 520ms steps(6) both; }
.hero-sub { position: relative; max-width: 34ch; margin: 22px 0 0; font-size: clamp(20px, 2.2vw, 26px); line-height: 1.35; font-weight: 600; text-shadow: 2px 2px 0 var(--sky-deep); }
.cloud { position: absolute; opacity: .95; }
.cloud-a { top: 26px; right: 26%; }
.cloud-b { top: 118px; right: 5%; transform: scale(1.5); transform-origin: top right; }
.hero-plane { position: absolute; right: 14%; bottom: 58px; color: #fff; filter: drop-shadow(4px 4px 0 #000); animation: takeoff 1600ms steps(16) 250ms both; }
.runway { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: #3B4048; border-top: 4px solid var(--ink); }
.runway::after { content: ''; position: absolute; left: 0; right: 0; top: 15px; height: 6px; background: repeating-linear-gradient(90deg, #fff 0 30px, transparent 30px 56px); }
@keyframes drop { from { transform: translateY(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes takeoff { from { transform: translate(-70vw, 30px); } to { transform: none; } }

.section-title { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; font: 400 16px/1.5 var(--px); }
.section-title::before { content: ''; width: 14px; height: 14px; background: #000; box-shadow: 3px 3px 0 var(--sky); }
.crew { margin-bottom: 48px; }
.crew-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 24px; }
.crew-card {
  position: relative; display: grid; justify-items: start; align-content: start; gap: 8px;
  padding: 18px; text-decoration: none;
  background: var(--k); color: var(--kt);
  border: 4px solid var(--ink);
  box-shadow: inset 5px 5px 0 rgba(255, 255, 255, .4), inset -5px -5px 0 rgba(0, 0, 0, .2), 8px 8px 0 var(--ink);
  transition: transform 90ms steps(2), box-shadow 90ms steps(2);
}
.crew-card:hover, .crew-card:focus-visible { transform: translate(-3px, -3px); box-shadow: inset 5px 5px 0 rgba(255, 255, 255, .4), inset -5px -5px 0 rgba(0, 0, 0, .2), 11px 11px 0 var(--ink); }
.crew-portrait { width: 92px; height: 92px; display: grid; place-items: center; background: #fff; color: var(--kd); border: 4px solid var(--ink); box-shadow: inset 0 0 0 5px var(--kl); }
.crew-name { margin-top: 8px; font: 400 18px/1.3 var(--px); }
.crew-role { font-size: 19px; line-height: 1.3; font-weight: 600; }
.crew-card .status { position: absolute; top: 14px; right: 14px; }
.home-prose { margin-bottom: 48px; }
.world-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.world-tile { display: grid; gap: 8px; align-content: start; padding: 14px; text-decoration: none; background: #fff; border: 4px solid var(--ink); box-shadow: 6px 6px 0 var(--k); }
.world-tile:hover, .world-tile:focus-visible { box-shadow: 9px 9px 0 var(--k); transform: translate(-2px, -2px); }
.world-top { display: flex; align-items: center; gap: 10px; }
.world-icon { width: 46px; height: 46px; display: grid; place-items: center; background: var(--k); color: var(--kt); border: 3px solid var(--ink); box-shadow: var(--raise); }
.world-no { font: 9px var(--px); }
.world-title { font: 400 12px/1.6 var(--px); }
.world-blurb { font-size: 17px; line-height: 1.35; }

/* ---------- pager ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 60px; }
.pager-btn {
  display: grid; gap: 6px; padding: 14px 16px; text-decoration: none;
  background: var(--k); color: var(--kt);
  border: 4px solid var(--ink);
  box-shadow: var(--raise), 6px 6px 0 var(--ink);
}
.pager-next { text-align: right; }
.pager-btn small { font: 9px/1.5 var(--px); }
.pager-btn strong { font-size: 20px; line-height: 1.25; }
.pager-btn:hover, .pager-btn:focus-visible { transform: translate(-2px, -2px); box-shadow: var(--raise), 8px 8px 0 var(--ink); }

/* ---------- overlays ---------- */
.zoom { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, .8); }
.zoom-body { width: min(1560px, 96vw); max-height: 88vh; overflow: auto; background: #fff; border: 4px solid #000; box-shadow: 10px 10px 0 var(--sky); }
.zoom-body > svg { display: block; width: 100%; height: auto; }
.zoom-body > ol, .zoom-body > table { margin: 24px; }
.zoom-close { position: fixed; top: 16px; right: 16px; padding: 10px 12px; font: 10px var(--px); background: #fff; border: 3px solid #000; box-shadow: 4px 4px 0 #000; cursor: pointer; }
.tip { position: fixed; z-index: 70; max-width: 320px; padding: 10px 12px; background: #000; color: #fff; font-size: 16px; line-height: 1.35; border: 3px solid #fff; box-shadow: 0 0 0 3px #000, 6px 6px 0 rgba(0, 0, 0, .35); pointer-events: none; }
.render-error { margin: 22px 0; padding: 14px; background: #fff; border: 4px dashed #E2401F; }
.render-error code { display: block; margin-top: 6px; font-family: var(--mono); font-size: 14px; white-space: pre-wrap; }
#selftest { white-space: pre-wrap; font: 14px/1.5 var(--mono); background: #fff; border: 4px solid #000; padding: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .nav {
    position: fixed; top: var(--top); left: 0; bottom: 0; z-index: 25;
    width: min(340px, 88vw); height: auto;
    transform: translateX(-110%); transition: transform 120ms steps(3);
    box-shadow: 8px 0 0 rgba(0, 0, 0, .25);
  }
  body.nav-open .nav { transform: none; }
  .menu-btn { display: inline-flex; align-items: center; padding: 9px 10px; font: 10px var(--px); background: #fff; border: 3px solid #000; box-shadow: 3px 3px 0 #000; cursor: pointer; }
}
@media (max-width: 760px) {
  .steps { flex-direction: column; padding-right: 8px; }
  .step-arrow { flex: 0 0 22px; width: 22px; margin: 10px auto; transform: rotate(90deg); }
  .agent-head { grid-template-columns: 76px minmax(0, 1fr); }
  .agent-head .status { grid-column: 1 / -1; justify-self: start; }
  .portrait { width: 76px; height: 76px; }
  .portrait svg { width: 46px; height: 46px; }
  .agent-can { grid-template-columns: 1fr; }
  .can + .can { border-left: 0; border-top: 4px solid var(--ink); }
  .pager { grid-template-columns: 1fr; }
  .tl { grid-template-columns: 78px 32px minmax(0, 1fr); gap: 0 10px; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .topbar { gap: 10px; padding: 0 12px; }
  .brand-text { display: none; }
  .search { width: auto; flex: 1; }
  .stage h1 { margin: 18px 16px 8px; }
  .stage-sum { margin: 0 16px 18px; font-size: 19px; }
  .cloud-b { display: none; }
}
/* ---------- refinements ---------- */
figcaption { flex-wrap: wrap; }
.fig-cap { flex: 1 1 220px; }
.crew-card { grid-template-rows: auto auto 1fr auto; }
.crew-card .status { position: static; justify-self: start; margin-top: 6px; }
.step-top { flex-wrap: wrap; }
.step h4, .step p, .can li, .stat-value, .tl-body p { overflow-wrap: anywhere; }
@media (max-width: 560px) { .cloud { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
