/* Canyon Command website. Visual language: the game's own HUD (amber corner ticks, angled
   buttons, telemetry read-outs, Rajdhani lettering) over the game's painted art. Map chapters use full-bleed
   paintings; the guide uses blueprint plates and spec tables. One colour per build category, everywhere. */
:root {
  color-scheme: dark;
  --bg: #07080a;
  --steel: #0e0f12;
  --panel: #14151a;
  --panel-hi: #1b1c22;
  --line: #2e3036;
  --line-soft: #ffffff12;
  --ink: #ece8e0;
  --text: #c9c3b8;
  --muted: #8f8a80;
  --amber: #f5a524;
  --amber-hi: #ffc24d;
  --amber-ink: #1a1206;
  --ground: #f5a524;
  --air: #6cb8ff;
  --control: #b28cff;
  --support: #7bd651;
  --danger: #e2574c;
  --bp: #0f3a7a;
  --bp-deep: #0a2a5c;
  --bp-line: #ffffffcc;
  --hud: Rajdhani, 'Arial Narrow', 'Segoe UI', sans-serif;
  --sans: Inter, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', Consolas, monospace;
  --content: 1200px;
  --topbar-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --cut: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15.5px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-hi); }
img { max-width: 100%; }
button { font: inherit; cursor: pointer; }
code, kbd, pre { font-family: var(--mono); }
kbd { display: inline-block; min-width: 26px; text-align: center; padding: 1px 8px; font: 600 12px/20px var(--mono); color: var(--ink); background: linear-gradient(180deg, #24262c, #17181c); border: 1px solid #50535a; border-bottom-width: 3px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
[hidden] { display: none !important; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
.visually-hidden, .sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--amber); color: var(--amber-ink); padding: 8px 12px; font-weight: 600; }
.skip-link:focus { top: 8px; }
.fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.fx-vignette { display: none; }
#site { position: relative; z-index: 1; min-height: 100svh; display: flex; flex-direction: column; overflow-x: clip; }
main { flex: 1; width: 100%; }
.wrap { max-width: var(--content); margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-left, 0px)) 0 max(20px, env(safe-area-inset-right, 0px)); }

/* ---------- HUD primitives ---------- */
.eyebrow { margin: 0; font: 600 12px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--amber); }
.hud-title { margin: 0; font: 700 clamp(30px, 4.4vw, 52px)/1 var(--hud); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); text-wrap: balance; }
.h2 { margin: 0; font: 700 clamp(28px, 3.6vw, 44px)/1.05 var(--hud); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); text-wrap: balance; }
.lede { margin: 0; color: var(--text); font-size: 16.5px; line-height: 1.6; text-wrap: pretty; max-width: 62ch; }
.ticks { position: relative; }
.ticks::before, .ticks::after { content: ''; position: absolute; width: 18px; height: 18px; border: 2px solid var(--amber); pointer-events: none; }
.ticks::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.ticks::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
.panel { background: linear-gradient(180deg, var(--panel), var(--steel)); border: 1px solid var(--line); }
.cut { clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); }
.sect-head { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.sect-head .no { flex: none; font: 600 13px var(--mono); color: var(--amber); border: 1px solid #f5a52480; padding: 4px 9px; letter-spacing: .1em; }
.sect-head .h2 { flex: none; }
.sect-head::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, #f5a52480, transparent); }
.section { position: relative; padding: clamp(72px, 10vw, 128px) 0 0; }
.reveal { opacity: 1; transform: none; transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal:not(.in) { opacity: .001; transform: translateY(26px); }
.cat-boss { --c: var(--danger); } .cat-ground { --c: var(--ground); } .cat-air { --c: var(--air); } .cat-control { --c: var(--control); } .cat-support { --c: var(--support); }

/* Buttons */
.cta { display: inline-flex; align-items: center; gap: 12px; padding: 15px 44px 13px 40px; font: 700 22px/1 var(--hud); letter-spacing: .28em; text-transform: uppercase; color: var(--amber-ink); background: linear-gradient(180deg, var(--amber-hi), var(--amber) 55%, #e08d14); clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%); box-shadow: 0 0 40px #f5a52455; transition: filter .2s, transform .2s var(--ease); }
.cta:hover { color: var(--amber-ink); filter: brightness(1.08); transform: translateY(-1px); }
.cta svg { flex: none; }
.cta small { display: block; font: 500 11px var(--mono); letter-spacing: .06em; text-transform: none; opacity: .75; margin-top: 5px; }
.cta-text { display: flex; flex-direction: column; align-items: flex-start; }
.ghost { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; font: 600 15px var(--hud); letter-spacing: .16em; text-transform: uppercase; color: var(--ink); border: 1px solid #ffffff2a; background: #ffffff06; }
.ghost:hover { color: var(--ink); border-color: var(--amber); background: #f5a5240f; }

/* ---------- Top bar (direction A) ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: #07080ad9; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid #f5a52426; }
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, #f5a52499 20%, #f5a52499 80%, transparent); opacity: .35; }
.topbar-inner { max-width: var(--content); margin: 0 auto; height: var(--topbar-h); padding: 0 20px; display: flex; align-items: center; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--ink); font: 700 18px var(--hud); letter-spacing: .14em; text-transform: uppercase; }
.brand:hover { color: var(--ink); }
.brand img { width: 30px; height: 30px; }
.mark { display: inline-flex; gap: 3px; height: 17px; align-items: flex-end; }
.mark i { display: block; width: 3px; height: 100%; background: var(--amber); }
.mark i:nth-child(2) { width: 6px; height: 45%; opacity: .55; }
.mark i:nth-child(3) { height: 80%; }
.nav { display: flex; gap: 2px; flex: 1; justify-content: center; min-width: 0; }
.nav a { position: relative; padding: 8px 14px; font: 600 14px var(--hud); letter-spacing: .18em; text-transform: uppercase; color: var(--text); white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--amber); }
.nav a[aria-current="page"]::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.version-pill { flex: none; font: 600 12px var(--mono); letter-spacing: .06em; color: var(--amber); border: 1px solid #f5a52480; padding: 5px 10px; }
.version-pill::before { content: '● '; color: var(--support); }
.version-pill:hover { background: #f5a52414; }
.top-play { flex: none; padding: 8px 18px 7px; font: 700 15px var(--hud); letter-spacing: .2em; color: var(--amber-ink); background: var(--amber); clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.top-play:hover { color: var(--amber-ink); background: var(--amber-hi); }

/* ---------- Footer ---------- */
.site-footer { position: relative; margin-top: clamp(90px, 12vw, 150px); border-top: 1px solid #f5a52433; background: linear-gradient(180deg, #0b0c0f, #050607); }
.footer-inner { max-width: var(--content); margin: 0 auto; padding: 40px 20px 46px; display: grid; grid-template-columns: 1fr auto; gap: 18px 32px; align-items: center; }
.footer-brand { margin: 0; display: flex; align-items: center; gap: 10px; font: 600 15px var(--hud); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; font: 600 14px var(--hud); letter-spacing: .14em; text-transform: uppercase; }
.footer-nav a { color: var(--text); }
.footer-nav a:hover { color: var(--amber); }
.footer-legal { grid-column: 1 / -1; margin: 0; font: 12px var(--mono); color: var(--muted); }

/* ---------- Homepage: hero (A) ---------- */
body[data-page="home"] .topbar { position: fixed; left: 0; right: 0; background: linear-gradient(180deg, #07080ae6, #07080a00); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom-color: transparent; transition: background .3s; }
body[data-page="home"].scrolled .topbar { background: #07080ae0; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom-color: #f5a52426; }
.hero { position: relative; height: max(640px, min(100svh, 980px)); overflow: hidden; isolation: isolate; }
.para { position: absolute; inset: 0; z-index: -2; }
.para > div { position: absolute; inset: -6% -5%; background: center 45% / cover no-repeat; will-change: transform; }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #07080a66 0, #07080a00 22%, #07080a00 55%, #07080acc 84%, var(--bg) 100%); }
.scan { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: repeating-linear-gradient(0deg, #ffffff07 0 1px, transparent 1px 3px); mix-blend-mode: overlay; }
.hud-frame { position: absolute; inset: calc(var(--topbar-h) + 20px) max(20px, 3vw) 28px; border: 1px solid #f5a5242a; pointer-events: none; }
.hud-frame::before, .hud-frame::after { content: ''; position: absolute; width: 30px; height: 30px; border: 2px solid var(--amber); }
.hud-frame::before { left: -2px; top: -2px; border-right: 0; border-bottom: 0; }
.hud-frame::after { right: -2px; bottom: -2px; border-left: 0; border-top: 0; }
.readout { position: absolute; font: 500 12px/1.6 var(--mono); letter-spacing: .1em; color: #f5a524d9; text-transform: uppercase; text-shadow: 0 1px 6px #000; }
.readout.tl { left: 16px; top: 14px; } .readout.tr { right: 16px; top: 14px; text-align: right; } .readout.bl { left: 16px; bottom: 12px; } .readout.br { right: 16px; bottom: 12px; text-align: right; }
.blink { animation: blink 1.4s steps(1) infinite; }
.hero-center { position: absolute; left: 0; right: 0; top: calc(var(--topbar-h) + 7vh); display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 0 20px; text-align: center; }
.hero-logo { width: min(640px, 86vw); height: auto; filter: drop-shadow(0 12px 32px #000c); animation: arrive 1.1s var(--ease) both; }
.hero-tag { margin: 0; font: 600 clamp(18px, 2vw, 23px)/1.35 var(--hud); letter-spacing: .1em; color: #efe4d2; text-shadow: 0 2px 14px #000; animation: arrive 1.1s .15s var(--ease) both; }
.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 12px; animation: arrive 1.1s .3s var(--ease) both; }
.hero-meta { font: 500 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text); text-shadow: 0 1px 8px #000; }
.hero-meta a { color: var(--amber); }
.scroll-cue { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); font: 600 11px var(--mono); letter-spacing: .3em; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.scroll-cue i { width: 1px; height: 34px; background: linear-gradient(var(--amber), transparent); animation: cue 2s ease-in-out infinite; }

/* Stats strip */
.stats { position: relative; z-index: 2; margin-top: -40px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); background: #0c0d10e6; backdrop-filter: blur(8px); }
.stats > div { padding: 18px 20px; border-left: 1px solid var(--line); }
.stats > div:first-child { border-left: 0; }
.stats b { display: block; font: 700 40px/1 var(--hud); color: var(--amber); letter-spacing: .02em; }
.stats span { font: 600 13px var(--hud); letter-spacing: .18em; text-transform: uppercase; color: var(--ink); }

/* ---------- Map chapters (B): each sector is a tall, pinned scene that builds up while you scroll ---------- */
/* --p (0 to 1) is the scroll progress through a chapter, set by home.js. Classes s1 to s5 switch on as it builds. */
.chapters { display: flex; flex-direction: column; margin-top: 8px; }
.chapter { position: relative; height: 200vh; --p: 0; }
.ch-stage { position: sticky; top: 0; height: 100vh; min-height: 620px; overflow: hidden; isolation: isolate; background: var(--tint); }
.ch-bg { position: absolute; inset: -6%; z-index: -3; }
.ch-paint { width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.22) translateY(calc(var(--p) * -4%)); filter: saturate(.85) brightness(.75); transition: opacity 1.2s var(--ease), transform 2.4s var(--ease), filter 1.6s; }
.chapter.s1 .ch-paint { opacity: 1; transform: scale(calc(1.08 - var(--p) * .06)) translateY(calc(var(--p) * -4%)); filter: saturate(1) brightness(.9); }
.ch-grade { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.ch-fx { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.ch-copy { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 16px; max-width: 520px; }
.ch-title { margin: 0; font: 700 clamp(56px, 8vw, 128px)/.86 'Saira Extra Condensed', var(--hud); text-transform: uppercase; color: var(--acc2); text-shadow: 0 6px 40px #000c; letter-spacing: .005em; }
.ch-title .ln { display: block; overflow: hidden; padding-bottom: .04em; }
.ch-title .ln > span { display: inline-block; transform: translateY(105%); transition: transform .9s var(--ease); }
.chapter.s2 .ch-title .ln > span { transform: none; }
.chapter.s2 .ch-title .ln:nth-child(2) > span { transition-delay: .12s; }
.ch-copy p { margin: 0; color: #f2e8da; font-size: 17px; line-height: 1.6; max-width: 46ch; text-shadow: 0 2px 14px #000; opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.chapter.s3 .ch-copy p { opacity: 1; transform: none; }
.ch-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-facts span { font: 600 12px var(--mono); letter-spacing: .06em; padding: 5px 10px; color: var(--acc2); background: #0009; border: 1px solid color-mix(in srgb, var(--acc) 55%, transparent); opacity: 0; transform: translateY(10px); transition: opacity .5s, transform .5s var(--ease); }
.ch-facts .main { color: #111; background: var(--acc); border-color: var(--acc); }
.chapter.s3 .ch-facts span { opacity: 1; transform: none; }
.chapter.s3 .ch-facts span:nth-child(2) { transition-delay: .08s; } .chapter.s3 .ch-facts span:nth-child(3) { transition-delay: .16s; } .chapter.s3 .ch-facts span:nth-child(4) { transition-delay: .24s; }
.ch-map { position: absolute; z-index: 1; margin: 0; opacity: 0; transition: opacity .9s var(--ease), transform 1.1s var(--ease); }
.chapter.s4 .ch-map { opacity: 1; }
.ch-map-frame { position: relative; border: 2px solid color-mix(in srgb, var(--acc) 70%, #000); box-shadow: 0 40px 90px #000d, 0 0 0 6px #0008, 0 0 60px color-mix(in srgb, var(--acc) 30%, transparent); background: #000; }
.ch-map-frame img { display: block; width: 100%; height: auto; }
.ch-map-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ch-map figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--acc2); text-shadow: 0 1px 6px #000; }
.ch-emblem { position: absolute; z-index: 2; width: 96px; height: 96px; filter: drop-shadow(0 10px 22px #000); opacity: 0; transform: translateY(-30px) rotate(-12deg); transition: opacity .7s, transform .9s cubic-bezier(.3, 1.6, .5, 1); }
.chapter.s2 .ch-emblem { opacity: 1; transform: none; }

/* Layouts, one per theme */
.lay-left .ch-copy { left: max(5vw, 24px); bottom: 12vh; }
.lay-left .ch-map { right: max(5vw, 24px); top: calc(var(--topbar-h) + 6vh); width: min(46vw, 720px, calc((100vh - var(--topbar-h) - 16vh) * var(--ar, 1.4))); transform: perspective(1400px) rotateY(-14deg) rotateX(6deg) translateX(12%); }
.lay-left.s4 .ch-map { transform: perspective(1400px) rotateY(-8deg) rotateX(4deg) translateY(calc(var(--p) * -3vh)); }
.lay-left .ch-emblem { left: max(5vw, 24px); top: 12vh; }
.lay-center .ch-copy { left: 50%; top: calc(var(--topbar-h) + 3vh); gap: 10px; transform: translateX(-50%); max-width: 900px; align-items: center; text-align: center; }
.lay-center .ch-copy p { max-width: 62ch; }
.lay-center .ch-title { font-size: clamp(48px, 5.6vw, 92px); }
.lay-center .ch-title .ln { display: inline-block; margin: 0 .12em; }
.lay-center .ch-map { left: 50%; bottom: 4vh; width: min(52vw, 760px, calc((100vh - var(--topbar-h) - 330px) * var(--ar, 1.4))); transform: translateX(-50%) translateY(18%) scale(.92); }
.lay-center.s4 .ch-map { transform: translateX(-50%) translateY(calc(var(--p) * -4vh)) scale(1); }
.lay-center .ch-emblem { right: max(5vw, 24px); top: 12vh; }
.lay-right .ch-copy { right: max(5vw, 24px); top: calc(var(--topbar-h) + 10vh); align-items: flex-end; text-align: right; }
.lay-right .ch-map { left: max(5vw, 24px); bottom: 8vh; width: min(44vw, 680px, calc((100vh - var(--topbar-h) - 20vh) * var(--ar, 1.4))); transform: translateX(-14%) rotate(-3deg); }
.lay-right.s4 .ch-map { transform: rotate(-2deg) translateY(calc(var(--p) * -3vh)); }
.lay-right .ch-map-frame { border: 0; padding: 8px; background: repeating-linear-gradient(135deg, var(--acc) 0 14px, #1a1206 14px 28px); }
.lay-right .ch-emblem { right: max(5vw, 24px); bottom: 10vh; }
.lay-frost .ch-copy { right: max(6vw, 24px); bottom: 14vh; }
.lay-frost .ch-map { left: max(6vw, 24px); top: calc(var(--topbar-h) + 5vh); width: min(42vw, 640px, calc((100vh - var(--topbar-h) - 16vh) * var(--ar, 1.4))); transform: translateY(10%); }
.lay-frost.s4 .ch-map { transform: translateY(calc(var(--p) * -3vh)); }
.lay-frost .ch-map-frame { border: 1px solid #cdefff; border-radius: 4px; box-shadow: 0 0 0 10px #cdefff1a, 0 30px 80px #000c, inset 0 0 30px #7fd8ff55; }
.lay-frost .ch-emblem { right: max(6vw, 24px); top: 14vh; }
.lay-wide .ch-map { right: max(4vw, 24px); top: calc(var(--topbar-h) + 4vh); width: min(64vw, calc((100vh - var(--topbar-h) - 12vh) * var(--ar, 1.4))); transform: translateX(6%) scale(1.04); }
.lay-wide.s4 .ch-map { transform: translateY(calc(var(--p) * -2vh)); }
.lay-wide .ch-map-frame { border-color: #9be85a88; }
.lay-wide .ch-copy { left: max(5vw, 24px); bottom: 7vh; padding: 22px 26px; background: #050a06d9; border: 1px solid #9be85a55; backdrop-filter: blur(6px); }
.lay-wide .ch-title { font-size: clamp(48px, 6vw, 96px); }
.lay-wide .ch-emblem { left: max(5vw, 24px); top: calc(var(--topbar-h) + 4vh); }
.lay-wide .ch-bg { filter: blur(2px); }

/* Themes: colour grading over the painting */
.th-obsidian .ch-grade { background: radial-gradient(ellipse at 75% 100%, #ff5a1a3a, transparent 60%), linear-gradient(90deg, #0b0503ee 0%, #0b050377 38%, transparent 62%), linear-gradient(180deg, #0b050399, transparent 25%, transparent 70%, #0b0503); }
.th-rim .ch-grade { background: radial-gradient(ellipse at 50% 0%, #0b0604ee 0%, #0b060488 40%, transparent 70%), linear-gradient(180deg, transparent 50%, #1a0805e6 100%), radial-gradient(circle at 18% 12%, #ffb27a33, transparent 30%); }
.th-foundry .ch-grade { background: linear-gradient(270deg, #0d0903f0 0%, #0d090388 40%, transparent 65%), linear-gradient(0deg, #ffb00a22, transparent 40%), linear-gradient(180deg, #0d0903aa, transparent 30%); }
.th-cold .ch-grade { background: linear-gradient(270deg, #040b12f0 0%, #040b1288 40%, transparent 70%), linear-gradient(180deg, #a8e4ff22, transparent 40%, #040b12cc 100%); }
.th-cold.s1 .ch-paint { filter: saturate(.7) brightness(.85); }
.th-titan .ch-grade { background: radial-gradient(ellipse at 50% 50%, transparent 30%, #030803ee 85%), linear-gradient(180deg, #030803cc, transparent 20%, transparent 80%, #030803); }
.th-titan .ch-stage::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; top: 0; z-index: 3; background: linear-gradient(90deg, transparent, #9be85a, transparent); box-shadow: 0 0 18px #9be85a; animation: scanline 6s linear infinite; pointer-events: none; }
@keyframes scanline { from { transform: translateY(0); } to { transform: translateY(100vh); } }

/* Phones: copy on top, the map below it */
@media (max-width: 760px) {
  .chapter { height: 170vh; }
  .ch-copy, .lay-center .ch-copy, .lay-right .ch-copy, .lay-frost .ch-copy, .lay-wide .ch-copy { left: 20px; right: 20px; top: 9vh; bottom: auto; transform: none; max-width: none; align-items: flex-start; text-align: left; padding: 0; background: none; border: 0; backdrop-filter: none; }
  .ch-title, .lay-center .ch-title, .lay-wide .ch-title { font-size: clamp(46px, 14vw, 72px); }
  .ch-copy p { font-size: 15px; }
  .ch-map, .lay-left .ch-map, .lay-center .ch-map, .lay-right .ch-map, .lay-frost .ch-map, .lay-wide .ch-map { left: 20px; right: 20px; top: auto; bottom: 6vh; width: auto; transform: translateY(12%); }
  .chapter.s4 .ch-map { transform: none; }
  .ch-emblem { width: 64px; height: 64px; right: 20px !important; left: auto !important; top: 9vh !important; bottom: auto !important; }
}
/* No pinning when the reader wants less motion, or on short screens */
@media (prefers-reduced-motion: reduce), (max-height: 560px) {
  .chapter { height: auto; }
  .ch-stage { position: relative; height: auto; min-height: 0; padding: 60px 24px; display: grid; gap: 24px; }
  .ch-copy, .ch-map, .ch-emblem { position: relative; inset: auto !important; left: auto !important; right: auto !important; top: auto !important; bottom: auto !important; transform: none !important; width: auto !important; max-width: 100%; opacity: 1; }
  .ch-paint, .ch-copy p, .ch-facts span, .ch-title .ln > span { opacity: 1; transform: none; }
}

/* ---------- Blueprint (white lines on blue) ---------- */
.blueprint { position: relative; margin-top: clamp(72px, 10vw, 128px); padding: clamp(56px, 8vw, 96px) 0; color: #eaf2ff; background-color: var(--bp); background-image: linear-gradient(#ffffff1f 1px, transparent 1px), linear-gradient(90deg, #ffffff1f 1px, transparent 1px), linear-gradient(#ffffff0c 1px, transparent 1px), linear-gradient(90deg, #ffffff0c 1px, transparent 1px), radial-gradient(ellipse at 50% 40%, #1a4f9c, var(--bp-deep) 80%); background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px, 100% 100%; overflow: hidden; }
.blueprint::before { content: ''; position: absolute; inset: 16px; border: 1px solid #ffffff55; pointer-events: none; }
.blueprint .eyebrow { color: #ffffff; opacity: .8; }
.blueprint .h2 { color: #fff; }
.bp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.bp-copy { display: flex; flex-direction: column; gap: 16px; }
.bp-copy p { margin: 0; color: #d6e4fb; }
.bp-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font: 12px var(--mono); letter-spacing: .06em; }
.bp-legend li { display: flex; align-items: center; gap: 10px; }
.bp-legend i { width: 26px; height: 12px; flex: none; }
.bp-stamp { align-self: flex-start; font: 600 12px var(--mono); letter-spacing: .2em; padding: 4px 10px; border: 2px solid #fff; transform: rotate(-3deg); }
.bp-board { position: relative; border: 1px solid #ffffffaa; background: #0c3266aa; }
.bp-board canvas { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: manipulation; }
.bp-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 10px 14px; border-top: 1px solid #ffffff66; font: 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.bp-bar button { font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #fff; background: transparent; border: 1px solid #fff; padding: 4px 10px; }
.bp-bar button:hover { background: #ffffff22; }
.bp-tag { position: absolute; font: 600 11px var(--mono); letter-spacing: .12em; padding: 2px 7px; background: var(--bp); border: 1px solid #fff; color: #fff; pointer-events: none; }

/* ---------- Arsenal (A cards) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tabs button { padding: 8px 16px 7px; font: 700 14px var(--hud); letter-spacing: .16em; text-transform: uppercase; color: var(--c, var(--text)); background: #ffffff05; border: 1px solid #ffffff1f; }
.tabs button[aria-selected="true"] { background: var(--c, var(--amber)); color: var(--amber-ink); border-color: var(--c, var(--amber)); }
.tabs button span { opacity: .7; font-family: var(--mono); font-size: 12px; margin-left: 6px; }
.arsenal { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.unit { position: relative; padding: 14px 14px 16px; background: linear-gradient(180deg, var(--panel), var(--steel)); border: 1px solid var(--line); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); transition: border-color .25s, transform .25s var(--ease); animation: arrive .5s var(--ease) both; }
.unit::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); box-shadow: 0 0 12px var(--c); }
.unit:hover { border-color: var(--c); transform: translateY(-3px); }
.unit .art { height: 104px; display: grid; place-items: center; }
.unit .art img { max-height: 100px; max-width: 100%; filter: drop-shadow(0 10px 10px #000a); animation: bob 3.2s ease-in-out infinite alternate; }
.unit:hover .art img { animation-duration: .9s; }
.unit h3 { margin: 6px 0 0; font: 700 18px var(--hud); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.unit .meta { font: 11px var(--mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.unit .meta b { color: var(--c); font-weight: 600; }
.unit p { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--text); }
.bars { display: grid; gap: 4px; margin-top: 10px; }
.bar { display: grid; grid-template-columns: 50px 1fr 38px; align-items: center; gap: 8px; font: 10.5px var(--mono); color: var(--muted); letter-spacing: .06em; }
.bar i { display: block; height: 4px; background: #ffffff12; position: relative; overflow: hidden; }
.bar i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--v); background: var(--c); transform-origin: left; animation: grow .9s var(--ease) both; }
.bar em { font-style: normal; color: var(--ink); text-align: right; }

/* ---------- Hostiles ---------- */
.hostiles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 28px; align-items: start; }
.enemy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 10px; }
.enemy { padding: 10px 12px; background: var(--steel); border: 1px solid var(--line); }
.enemy .art { height: 64px; display: grid; place-items: center; }
.enemy .art img { max-height: 58px; filter: drop-shadow(0 6px 6px #000); }
.enemy.air .art img { animation: hover-air 2.4s ease-in-out infinite alternate; }
.enemy b { display: block; font: 700 15px var(--hud); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.enemy small { font: 10.5px var(--mono); color: var(--muted); }
.enemy small i { font-style: normal; color: var(--danger); }
.enemy.air small i { color: var(--air); }
.boss-track { position: relative; display: flex; flex-direction: column; gap: 12px; }
.boss { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr) 200px; align-items: center; gap: 16px; padding: 10px 16px 10px 12px; border: 1px solid #e2574c40; background: linear-gradient(90deg, #2a0f0d, #120809 70%); overflow: hidden; }
.boss .wave { font: 700 34px/1 var(--hud); color: var(--danger); text-align: center; }
.boss .wave small { display: block; font: 600 10px var(--mono); letter-spacing: .16em; color: #e2574caa; }
.boss h3 { margin: 0; font: 700 22px var(--hud); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.boss p { margin: 2px 0 0; font-size: 13px; color: var(--text); }
.boss img { width: 200px; height: 96px; object-fit: contain; object-position: right center; filter: drop-shadow(0 8px 10px #000); transition: transform .6s var(--ease); }
.boss:hover img { transform: translateX(-8px) scale(1.06); }

/* ---------- Battle anatomy ---------- */
.anatomy { position: relative; border: 1px solid var(--line); background: #000; }
.anatomy > img { display: block; width: 100%; height: auto; }
.pin { position: absolute; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 14px var(--hud); color: var(--amber-ink); background: var(--amber); box-shadow: 0 0 0 4px #f5a52440, 0 0 22px var(--amber); animation: ping 2.4s ease-out infinite; border: 0; padding: 0; }
.pin[aria-pressed="true"] { background: #fff; }
.ring-overlay { position: absolute; pointer-events: none; overflow: visible; }
.legend { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 8px 22px; counter-reset: pin; }
.legend li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 14px; counter-increment: pin; }
.legend li::before { content: counter(pin); flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--hud); color: var(--amber-ink); background: var(--amber); }
.legend li.on { color: var(--ink); }
.legend b { color: var(--ink); font-weight: 600; }

/* ---------- Abilities ---------- */
.abilities { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ability { position: relative; padding: 18px; background: radial-gradient(ellipse at 50% 0%, #2a1c0c, var(--steel) 70%); border: 1px solid var(--line); overflow: hidden; }
.ability .fx-box { height: 150px; display: grid; place-items: center; position: relative; }
.ability .sheet { width: 150px; height: 150px; background-repeat: no-repeat; background-size: auto 100%; image-rendering: auto; }
.ability .icon { position: absolute; left: 0; top: 0; width: 44px; height: 44px; }
.ability h3 { margin: 8px 0 2px; font: 700 22px var(--hud); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.ability p { margin: 0; font-size: 14px; }
.ability .key { position: absolute; right: 16px; top: 16px; }

/* ---------- Difficulty ladder + record ---------- */
.ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; align-items: end; }
.rung { position: relative; padding: 14px; border: 1px solid var(--line); background: var(--steel); display: flex; flex-direction: column; gap: 4px; min-height: calc(96px + var(--h) * 1px); justify-content: flex-start; overflow: hidden; }
.rung::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--h) * 1px); background: linear-gradient(180deg, #f5a52422, #f5a52408); border-top: 2px solid var(--amber); }
.rung > * { position: relative; }
.rung b { font: 700 24px var(--hud); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.rung span { font: 12px var(--mono); color: var(--muted); }
.pace { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; margin-top: 14px; }
.pace > div { padding: 16px 18px; border: 1px solid var(--line); border-left: 3px solid var(--c, var(--amber)); background: var(--steel); }
.pace b { display: block; font: 700 18px var(--hud); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.pace p { margin: 4px 0 0; font-size: 14px; }
.record { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px 26px; align-items: center; padding: 22px 24px; }
.record .rank { font: 700 30px/1 var(--hud); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.record .xpbar { height: 6px; background: #ffffff10; margin-top: 10px; }
.record .xpbar i { display: block; height: 100%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.record dl { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.record dt { font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.record dd { margin: 0; font: 700 26px var(--hud); color: var(--amber); }

/* ---------- Releases + FAQ ---------- */
.rel-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rel { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.rel .v { font: 700 24px var(--hud); letter-spacing: .08em; color: var(--ink); }
.rel .v time { font: 12px var(--mono); color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.rel h3 { margin: 0; font: 600 15px var(--sans); color: var(--amber); }
.rel p { margin: 0; font-size: 14px; }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; gap: 14px; padding: 16px 4px; font: 600 19px var(--hud); letter-spacing: .06em; color: var(--ink); }
.faq summary::before { content: '›'; color: var(--amber); font-size: 22px; transition: transform .2s; }
.faq details[open] summary::before { transform: rotate(90deg); }
.faq details p { margin: 0; padding: 0 4px 18px 30px; color: var(--text); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 40px; align-items: start; }

/* ---------- Page heads (changelog, guide, docs, 404) ---------- */
.page-head { position: relative; padding: clamp(46px, 7vw, 86px) 0 clamp(24px, 3vw, 36px); display: flex; flex-direction: column; gap: 14px; }
.page-head h1 { margin: 0; font: 700 clamp(40px, 6vw, 72px)/.95 var(--hud); letter-spacing: .05em; text-transform: uppercase; color: var(--ink); }
.page-head .lede { font-size: 17px; }
.page-banner { position: relative; overflow: hidden; border-bottom: 1px solid #f5a52433; }
.page-banner::before { content: ''; position: absolute; inset: 0; background: var(--banner) center 40% / cover no-repeat; opacity: .32; filter: saturate(.8); }
.page-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #07080a55, var(--bg)), repeating-linear-gradient(0deg, #ffffff06 0 1px, transparent 1px 3px); }
.page-banner .wrap { position: relative; z-index: 1; }

/* ---------- Changelog timeline ---------- */
.version-index { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.version-index a { font: 600 12px var(--mono); padding: 5px 10px; border: 1px solid #ffffff1f; color: var(--text); }
.version-index a:first-child { border-color: var(--amber); color: var(--amber); }
.version-index a:hover { border-color: var(--amber); color: var(--amber); }
.releases { position: relative; display: flex; flex-direction: column; gap: 20px; padding: 18px 0 0 34px; }
.releases::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--amber), #f5a52422 60%, transparent); }
.release-card { position: relative; padding: 22px 24px 20px; background: linear-gradient(180deg, var(--panel), var(--steel)); border: 1px solid var(--line); clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%); }
.release-card .node { position: absolute; left: -31px; top: 28px; width: 14px; height: 14px; transform: rotate(45deg); background: var(--bg); border: 2px solid var(--amber); }
.releases > .release-card:first-child .node, .release-card.is-latest .node { background: var(--amber); box-shadow: 0 0 14px var(--amber); }
.release-card > .node { left: -31px; }
.release-card { overflow: visible; }
.release-card header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.release-card h2 { margin: 0; font: 700 32px var(--hud); letter-spacing: .06em; }
.release-card h2 a { color: var(--ink); }
.rdate { font: 12px var(--mono); color: var(--muted); }
.badge { font: 700 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--amber-ink); background: var(--amber); padding: 3px 8px; }
.rtitle { margin: 8px 0 2px; font: 700 20px var(--hud); letter-spacing: .1em; text-transform: uppercase; color: var(--amber); }
.rsummary { margin: 0 0 14px; max-width: 75ch; color: var(--text); }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 14px 28px; }
.group { --c: var(--muted); }
.group.Added { --c: var(--support); } .group.Changed { --c: var(--air); } .group.Fixed { --c: var(--amber); } .group.Security { --c: var(--danger); }
.group h3 { margin: 0 0 6px; display: inline-flex; align-items: center; gap: 8px; font: 700 13px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--c); }
.group h3::before { content: ''; width: 8px; height: 8px; background: var(--c); box-shadow: 0 0 10px var(--c); }
.group ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14.5px; }
.group li::marker { color: var(--c); }
.technical { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; font-size: 13.5px; }
.technical summary { font: 600 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.technical summary::before { content: '+ '; color: var(--amber); }
.technical[open] summary::before { content: '− '; }
.technical ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 5px; color: var(--muted); }
.release-downloads { display: flex; gap: 8px; margin-top: 16px; }
.release-downloads a { font: 700 14px var(--hud); letter-spacing: .18em; text-transform: uppercase; padding: 7px 16px; color: var(--amber-ink); background: var(--amber); }
.release-downloads small { display: none; }

/* ---------- Guide and docs (C: plates, route lines, spec tables) ---------- */
.doc { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; padding: 8px 0 40px; }
.toc { position: sticky; top: calc(var(--topbar-h) + 18px); align-self: start; max-height: calc(100svh - var(--topbar-h) - 36px); overflow: auto; scrollbar-width: thin; padding-right: 6px; }
.toc p { margin: 0 0 10px; font: 600 11px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.toc-search { width: 100%; margin: 0 0 14px; padding: 9px 12px; font: 14px var(--sans); color: var(--ink); background: #0e0f12; border: 1px solid var(--line); }
.toc-search:focus { border-color: var(--amber); outline: none; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 10px; align-items: baseline; padding: 7px 10px; border-left: 2px solid var(--line); color: var(--text); font: 600 15px var(--hud); letter-spacing: .1em; text-transform: uppercase; }
.toc a::before { content: counter(toc, decimal-leading-zero); font: 11px var(--mono); color: var(--muted); }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--amber); background: linear-gradient(90deg, #f5a5241c, transparent); }
.toc a[aria-current="true"]::before { color: var(--amber); }
.toc-select { display: none; }
.prose { min-width: 0; max-width: 80ch; color: var(--text); font-size: 15.5px; line-height: 1.7; }
.prose > section { padding: 4px 0 40px; margin-bottom: 40px; border-bottom: 1px solid var(--line-soft); }
.prose > section:last-child { border-bottom: 0; }
.prose h2 { margin: 0 0 16px; display: flex; align-items: center; gap: 14px; font: 700 clamp(26px, 3vw, 34px)/1.1 var(--hud); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.prose h2 .num { flex: none; font: 600 12px var(--mono); color: var(--amber); border: 1px solid #f5a52480; padding: 3px 8px; letter-spacing: .1em; }
.prose h3 { margin: 28px 0 10px; font: 700 20px var(--hud); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin: 5px 0; }
.prose li::marker { color: var(--amber); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose code { color: var(--ink); background: #ffffff0d; padding: 1px 6px; font-size: .9em; }
.prose :is(p, li, td) a { text-decoration: underline; text-decoration-color: #f5a52466; text-underline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.prose th { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--line); }
.prose pre { margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--amber); background: #0b0c0f; overflow-x: auto; font-size: 13px; line-height: 1.6; color: var(--text); }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin: 0 0 14px; padding: 10px 16px; border-left: 3px solid var(--air); background: #6cb8ff0d; }
.prose img { max-width: 100%; height: auto; border: 1px solid var(--line); }
.docs-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.docs-nav a { font: 600 13px var(--hud); letter-spacing: .14em; text-transform: uppercase; padding: 6px 12px; border: 1px solid #ffffff1f; color: var(--text); }
.docs-nav a[aria-current="page"] { color: var(--amber-ink); background: var(--amber); border-color: var(--amber); }
.callout { position: relative; margin: 0 0 16px; padding: 12px 16px 12px 18px; border: 1px solid var(--line); border-left: 3px solid var(--c, var(--air)); background: color-mix(in srgb, var(--c, var(--air)) 6%, var(--steel)); font-size: 14.5px; }
.callout > b:first-child { display: block; margin-bottom: 2px; font: 700 12px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--c, var(--air)); }
.callout.tip { --c: var(--support); } .callout.warn { --c: var(--amber); } .callout.boss { --c: var(--danger); }
.steps { list-style: none; padding: 0 !important; display: grid; gap: 10px; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; margin: 0 !important; padding: 14px 16px 14px 62px; border: 1px solid var(--line); background: var(--steel); }
.steps > li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 14px; top: 13px; font: 700 22px var(--hud); color: var(--amber); }
.steps > li > strong:first-child { display: block; font: 700 17px var(--hud); letter-spacing: .1em; text-transform: uppercase; }
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 6px 18px; margin: 0 0 16px; }
.keys div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
/* Spec tables (C) */
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; margin: 0 0 18px; }
.spec { position: relative; padding: 12px 14px; border: 1px solid #ffffff1f; background: linear-gradient(180deg, #101318, #0b0d11); background-image: linear-gradient(#ffffff06 1px, transparent 1px), linear-gradient(90deg, #ffffff06 1px, transparent 1px); background-size: 14px 14px; }
.spec .tag { position: absolute; right: 10px; top: 10px; font: 700 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; padding: 2px 6px; color: #0b0d11; background: var(--c); }
.spec .art { height: 86px; display: grid; place-items: center; }
.spec .art img { max-height: 80px; filter: drop-shadow(0 0 1px #9cc2ff88) drop-shadow(0 8px 8px #000); }
.spec h4 { margin: 4px 0 2px; font: 700 18px var(--hud); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.spec p { margin: 0 0 6px; font-size: 13px; line-height: 1.45; }
.spec table { display: table; width: 100%; margin: 0; font: 11.5px var(--mono); }
.spec td { padding: 4px 0; border-bottom: 1px dashed #ffffff1c; }
.spec td:last-child { text-align: right; color: var(--c); }
.spec[hidden] { display: none; }
/* Plates (C) */
.plate { position: relative; margin: 0 0 20px; border: 1px solid #ffffff2a; background: var(--bp-deep); }
.plate-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 9px 14px; border-bottom: 1px solid #ffffff2a; font: 600 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #eaf2ff; }
.plate-head b { color: #ffcc66; font-weight: 600; }
.plate-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.plate-body canvas { display: block; width: 100%; height: auto; border-right: 1px solid #ffffff2a; background: var(--bp); }
.plate-body img { display: block; width: 100%; height: 100%; object-fit: cover; }
.plate-cap { padding: 10px 14px; border-top: 1px solid #ffffff2a; font-size: 13.5px; color: #d6e4fb; }
.prev-next { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; }
.prev-next a { flex: 1; padding: 14px 16px; border: 1px solid var(--line); background: var(--steel); font: 700 16px var(--hud); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.prev-next a small { display: block; font: 11px var(--mono); color: var(--muted); letter-spacing: .14em; }
.prev-next a:last-child { text-align: right; }
.prev-next a:hover { border-color: var(--amber); }
mark { background: #f5a52455; color: var(--ink); }

/* ---------- 404 ---------- */
.notfound { min-height: 62svh; display: grid; place-items: center; padding: 60px 20px; }
.nf { max-width: 620px; width: 100%; display: flex; flex-direction: column; gap: 16px; }
.nf h1 { margin: 0; font: 700 clamp(48px, 8vw, 84px)/.9 var(--hud); text-transform: uppercase; letter-spacing: .04em; color: var(--ink); }
.nf p { margin: 0; }
.nf-disk { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); background: var(--steel); }
.nf-disk-head { display: flex; justify-content: space-between; font: 12px var(--mono); color: var(--muted); }
.nf-disk-head b { color: var(--ink); }
.nf-bar { display: flex; gap: 3px; height: 30px; }
.nf-bar i { background: #ffffff1f; } .nf-bar i:nth-child(1) { flex: 1; } .nf-bar i:nth-child(2) { flex: 5; background: #ffffff2e; } .nf-bar i:nth-child(3) { flex: 2; }
.nf-bar .gap { flex: 3; border: 1px dashed var(--amber); background: repeating-linear-gradient(135deg, #f5a52418 0 6px, transparent 6px 12px); display: grid; place-items: center; font: 11px var(--mono); color: var(--amber); }
.nf-log { margin: 0; padding: 14px 18px; border: 1px solid var(--line); background: #08090b; font: 13px/1.8 var(--mono); white-space: pre-wrap; }
.nf-log .p { color: var(--muted); } .nf-log .e { color: var(--danger); }
.nf-log .caret { display: inline-block; width: 8px; height: 15px; background: var(--amber); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
.nf .cta { font-size: 17px; padding: 12px 30px 11px 28px; }

/* ---------- Motion ---------- */
@keyframes arrive { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-6px); } }
@keyframes hover-air { from { transform: translate(-3px, 0) rotate(-2deg); } to { transform: translate(3px, -6px) rotate(2deg); } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 #f5a524aa, 0 0 22px var(--amber); } 70% { box-shadow: 0 0 0 16px #f5a52400, 0 0 22px var(--amber); } 100% { box-shadow: 0 0 0 0 #f5a52400, 0 0 22px var(--amber); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js .reveal:not(.in) { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .nav a { padding: 8px 9px; letter-spacing: .12em; }
  .version-pill { display: none; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats > div:nth-child(4) { border-left: 0; }
  .stats > div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .bp-grid, .hostiles, .two { grid-template-columns: minmax(0, 1fr); }
  .abilities, .rel-list { grid-template-columns: minmax(0, 1fr); }
  .ladder { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .doc { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .toc { display: none; }
  .toc-select { display: block; position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 5; width: 100%; margin: 0 0 18px; padding: 10px 12px; font: 600 15px var(--hud); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); background: #0e0f12; border: 1px solid var(--line); }
  .plate-body { grid-template-columns: minmax(0, 1fr); }
  .plate-body canvas { border-right: 0; border-bottom: 1px solid #ffffff2a; }
  .record dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  :root { --topbar-h: 56px; }
  .topbar-inner { gap: 10px; padding: 0 12px; }
  .brand span { display: none; }
  .nav { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .nav a { padding: 8px 7px; font-size: 13px; }
  .top-play { padding: 7px 12px 6px; font-size: 13px; }
  .readout.tr, .readout.br { display: none; }
  .hero-center { top: calc(var(--topbar-h) + 4vh); }
  .cta { font-size: 19px; padding: 14px 32px 12px 30px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: -24px; }
  .stats > div { border-left: 0 !important; border-top: 1px solid var(--line); }
  .stats > div:nth-child(-n+2) { border-top: 0; }
  .stats > div:nth-child(5) { grid-column: 1 / -1; }
  .stats b { font-size: 32px; }
  .boss { grid-template-columns: 64px minmax(0, 1fr); }
  .boss img { grid-column: 1 / -1; width: 100%; height: 90px; }
  .ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .releases { padding-left: 24px; }
  .releases::before { left: 4px; }
  .release-card .node, .release-card > .node { left: -26px; }
  .sect-head { flex-wrap: wrap; }
}
.spec .art img, .enemy .art img, .unit .art img { border: 0; }
.spec .art img { max-width: 78%; }
.spec td:first-child { white-space: nowrap; padding-right: 10px; color: var(--muted); }
.plate-body img { border: 0; }
@media (max-width: 640px) {
  .readout.tl { display: none; }
  .nav a[data-nav="docs"] { display: none; }
  .pin { width: 20px; height: 20px; font-size: 11px; box-shadow: 0 0 0 2px #f5a52440, 0 0 12px var(--amber); }
  .hero-logo { margin-top: 10px; }
}

/* ---------- Black-and-white blueprint sections (Arsenal, Hostiles) ---------- */
.section.bw { margin-top: clamp(72px, 10vw, 128px); padding: clamp(56px, 7vw, 90px) 0; background-color: #0a0a0a; background-image: linear-gradient(#ffffff17 1px, transparent 1px), linear-gradient(90deg, #ffffff17 1px, transparent 1px), linear-gradient(#ffffff08 1px, transparent 1px), linear-gradient(90deg, #ffffff08 1px, transparent 1px); background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px; position: relative; }
.section.bw::before { content: ""; position: absolute; inset: 16px; border: 1px solid #ffffff40; pointer-events: none; }
.section.bw::after { content: "DWG · " attr(id); position: absolute; right: 28px; bottom: 24px; font: 600 11px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: #ffffff60; }
.section.bw + .section.bw { margin-top: 0; border-top: 1px solid #ffffff20; }
.section.bw .unit, .section.bw .enemy, .section.bw .mod { background: #0d0d0dee; }

/* ---------- Hostile rows: one wide row of cards, scrolled sideways ---------- */
.row-scroll { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px max(20px, calc((100vw - var(--content)) / 2 + 20px)) 18px; scrollbar-width: thin; scrollbar-color: #ffffff40 transparent; }
.row-scroll > * { flex: 0 0 auto; scroll-snap-align: start; }
.row-title { margin: 30px 0 12px; font: 700 22px var(--hud); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.row-title span { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: none; color: var(--muted); }
.enemy { width: 210px; padding: 14px 16px; border: 1px solid #ffffff2a; position: relative; }
.enemy .art { height: 110px; }
.enemy .art img { max-height: 96px; }
.enemy b { font-size: 19px; }
.enemy dl { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font: 11px var(--mono); }
.enemy dt { color: var(--muted); }
.enemy dd { margin: 0; text-align: right; color: var(--ink); }
.enemy .type { position: absolute; right: 10px; top: 10px; font: 700 10px var(--mono); letter-spacing: .14em; padding: 2px 6px; color: #0b0d11; background: var(--danger); }
.enemy.air .type { background: var(--air); }
.boss-track { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 12px; }

/* Modifier cards: each shows its effect on a real enemy sprite */
.mod { width: 240px; padding: 14px 16px 16px; border: 1px solid #ffffff2a; display: flex; flex-direction: column; gap: 6px; }
.mod h4 { margin: 4px 0 0; display: flex; align-items: center; gap: 8px; font: 700 19px var(--hud); letter-spacing: .1em; text-transform: uppercase; color: var(--mc); }
.mod h4 img { width: 18px; height: 18px; }
.mod p { margin: 0; font-size: 13.5px; line-height: 1.45; }
.mod small { font: 11px var(--mono); color: var(--muted); }
.mod small b { color: var(--ink); font-weight: 600; }
.mod-stage { position: relative; height: 120px; display: grid; place-items: center; overflow: hidden; background: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, var(--mc) 16%, transparent), transparent 70%); border-bottom: 1px dashed #ffffff22; }
.mod-stage img { grid-area: 1 / 1; position: relative; max-height: 74px; filter: drop-shadow(0 8px 8px #000); }
.mod-stage i { position: absolute; inset: 0; pointer-events: none; }
.mod-F { --mc: #ffb347; } .mod-R { --mc: #7bd651; } .mod-S { --mc: #6cb8ff; } .mod-A { --mc: #c9c3b8; } .mod-P { --mc: #ff8a6a; } .mod-C { --mc: #b28cff; } .mod-E { --mc: #7fe8ff; }
.mod-F img { animation: mod-dash 1.4s ease-in-out infinite; }
.mod-F i { background: repeating-linear-gradient(180deg, transparent 0 14px, #ffb34766 14px 16px, transparent 16px 30px); -webkit-mask: linear-gradient(90deg, transparent, #000 30%, #000 55%, transparent 70%); mask: linear-gradient(90deg, transparent, #000 30%, #000 55%, transparent 70%); animation: mod-streak .5s linear infinite; }
@keyframes mod-dash { 0%, 100% { transform: translateX(-14px); } 50% { transform: translateX(14px); } }
@keyframes mod-streak { from { transform: translateX(10%); } to { transform: translateX(-10%); } }
.mod-R img { animation: mod-heal 1.8s ease-in-out infinite; }
.mod-R i::before, .mod-R i::after { content: "+"; position: absolute; left: 44%; bottom: 20%; font: 700 22px var(--hud); color: #7bd651; text-shadow: 0 0 10px #7bd651; animation: mod-rise 1.8s ease-out infinite; }
.mod-R i::after { left: 58%; animation-delay: .9s; }
@keyframes mod-rise { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-60px); opacity: 0; } }
@keyframes mod-heal { 50% { filter: drop-shadow(0 0 10px #7bd651) drop-shadow(0 8px 8px #000); } }
.mod-S i { inset: 18px 54px; border-radius: 50%; border: 2px solid #6cb8ffcc; background: radial-gradient(circle, transparent 50%, #6cb8ff44); box-shadow: 0 0 20px #6cb8ff88, inset 0 0 20px #6cb8ff66; animation: mod-shield 2.2s ease-in-out infinite; }
@keyframes mod-shield { 50% { transform: scale(1.06); opacity: .7; } }
.mod-A img { filter: grayscale(.3) contrast(1.2) drop-shadow(0 8px 8px #000); }
.mod-A i { background: linear-gradient(110deg, transparent 35%, #ffffff55 48%, transparent 60%); background-size: 250% 100%; animation: mod-sheen 2.4s linear infinite; }
.mod-A i::after { content: "−2"; position: absolute; right: 26%; top: 18%; font: 700 15px var(--hud); color: #c9c3b8; animation: mod-rise 1.2s ease-out infinite; }
@keyframes mod-sheen { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.mod-P .twin { max-height: 52px; animation: mod-split 2.4s ease-in-out infinite; }
.mod-P .twin.b { animation-name: mod-split-b; }
.mod-P .whole { animation: mod-gone 2.4s ease-in-out infinite; }
@keyframes mod-split { 0%, 40% { transform: translate(0, 0) scale(.7); opacity: 0; } 55% { opacity: 1; } 100% { transform: translate(-44px, 12px) scale(1); opacity: 1; } }
@keyframes mod-split-b { 0%, 40% { transform: translate(0, 0) scale(.7); opacity: 0; } 55% { opacity: 1; } 100% { transform: translate(44px, -8px) scale(1); opacity: 1; } }
@keyframes mod-gone { 0%, 38% { opacity: 1; transform: scale(1); } 50%, 100% { opacity: 0; transform: scale(1.3); } }
.mod-C img { animation: mod-cloak 2.6s ease-in-out infinite; }
.mod-C i { inset: 22px 60px; border: 1.5px dashed #b28cffaa; border-radius: 8px; animation: mod-cloak 2.6s ease-in-out infinite reverse; }
@keyframes mod-cloak { 0%, 100% { opacity: 1; } 45%, 60% { opacity: .08; } }
.mod-E i::before, .mod-E i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 2px solid #7fe8ff; box-shadow: 0 0 16px #7fe8ff; animation: mod-emp 1.8s ease-out infinite; }
.mod-E i::after { animation-delay: .9s; }
@keyframes mod-emp { from { transform: scale(.4); opacity: 1; } to { transform: scale(5); opacity: 0; } }

/* ---------- Difficulty counters, colour-graded from easy to endless ---------- */
.rung { --dc: var(--amber); }
.rung::before { background: linear-gradient(180deg, color-mix(in srgb, var(--dc) 22%, transparent), color-mix(in srgb, var(--dc) 4%, transparent)); border-top-color: var(--dc); }
.rung .count { font: 700 clamp(34px, 3.6vw, 48px)/1 var(--hud); color: var(--dc); text-shadow: 0 0 22px color-mix(in srgb, var(--dc) 45%, transparent); font-variant-numeric: tabular-nums; }
.rung .count small { font: 600 11px var(--mono); letter-spacing: .14em; color: var(--muted); margin-left: 6px; text-shadow: none; }
.pips { display: flex; gap: 3px; margin: 2px 0 4px; }
.pips i { width: 14px; height: 4px; background: #ffffff18; }
.pips i.on { background: var(--dc); box-shadow: 0 0 8px var(--dc); }

.rung .count > span { font: inherit; color: inherit; }
.rung { min-height: calc(150px + var(--h) * .5px); }
.rung::before { height: calc(var(--h) * .5px + 4px); }
.mod-A i { inset: 34px 58px; border-radius: 10px; mix-blend-mode: overlay; }
