/* Escape Bincov official site: rainy night, tide and lamplight. The pixel font only uses multiples of 16px. */
@font-face {
  font-family: "Bincov Site";
  src: url("../assets/fonts/bincov-site.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ink: #0a1113;
  --bg: #0d1719;
  --bg-2: #101d1f;
  --panel: rgba(16, 30, 32, .82);
  --panel-solid: #122123;
  --line: rgba(201, 213, 140, .16);
  --line-2: rgba(201, 213, 140, .32);
  --text: #dcd8c6;
  --text-2: #a9b0a3;
  --muted: #758079;
  --amber: #e8b850;
  --amber-2: #ffd27a;
  --amber-ink: #2a1d05;
  --salt: #c9d58c;
  --sea: #2f6e7c;
  --sea-2: #1a4450;
  --red: #c8473a;
  --px: "Bincov Site", "Microsoft YaHei", "PingFang SC", sans-serif;
  --sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --hud-h: 56px;
  --gutter: clamp(16px, 4vw, 64px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 16px/1.75 var(--sans);
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
kbd {
  font: 16px/1 var(--px);
  display: inline-block;
  min-width: 1.6em;
  padding: 3px 6px 2px;
  border: 1px solid var(--line-2);
  border-bottom-width: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  text-align: center;
  vertical-align: 1px;
}
.px { font-family: var(--px); font-weight: 400; letter-spacing: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 999; background: var(--amber); color: var(--amber-ink); padding: 8px 12px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
  --h: 48px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 22px;
  font-size: 16px; line-height: 1; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; border-radius: 2px;
  cursor: pointer; user-select: none;
  transition: transform .15s var(--ease), background-color .2s, border-color .2s, box-shadow .2s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { --h: 36px; padding: 0 14px; }
.btn-amber {
  background: var(--amber); color: var(--amber-ink);
  box-shadow: 0 0 0 1px rgba(255, 210, 122, .4) inset, 0 8px 30px -8px rgba(232, 184, 80, .55);
}
.btn-amber:hover { background: var(--amber-2); box-shadow: 0 0 0 1px #fff3 inset, 0 10px 40px -6px rgba(255, 210, 122, .75); }
.btn-ghost { background: rgba(10, 17, 19, .45); color: var(--text); border-color: var(--line-2); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber-2); }

/* ---------- Fixed canvas and grain ---------- */
#stage {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; display: block;
  background: #06090b;
  opacity: 0;
  transition: opacity .8s linear;
}
#stage.ready { opacity: 1; }
#stage.gone { opacity: 0; visibility: hidden; }
.grain {
  position: fixed; inset: -50%; z-index: 60; pointer-events: none;
  opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
main { position: relative; z-index: 1; }

/* ---------- HUD ---------- */
.hud {
  position: fixed; inset: 0 0 auto; z-index: 100;
  height: var(--hud-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  background: linear-gradient(to bottom, rgba(6, 10, 12, .85), rgba(6, 10, 12, .35));
  border-bottom: 1px solid rgba(201, 213, 140, .08);
  backdrop-filter: blur(8px) saturate(1.2);
}
.hud-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 16px; justify-self: start; }
.hud-brand img { width: 48px; height: 24px; image-rendering: pixelated; }
.hud-clock { display: grid; grid-template-columns: auto auto; grid-template-rows: auto 3px; column-gap: 10px; align-items: center; justify-items: center; }
.hud-clock-label { font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.hud-clock-time {
  font-size: 32px; line-height: 1; min-width: 4ch; text-align: center;
  color: var(--text); font-variant-numeric: tabular-nums;
  padding: 4px 10px 2px; border: 1px solid var(--line); background: rgba(0, 0, 0, .35);
}
.hud-clock-time.warn { color: var(--amber-2); border-color: rgba(232, 184, 80, .6); animation: blink 1s steps(2) 3; }
.hud-clock-bar { grid-column: 1 / -1; width: 100%; height: 3px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.hud-clock-bar i { display: block; height: 100%; width: 100%; background: var(--salt); transform-origin: left; transform: scaleX(1); }
@keyframes blink { 50% { opacity: .35; } }
.hud > :last-child { justify-self: end; }
.hud { grid-template-columns: 1fr auto auto auto auto; }
.hud-tasks { position: relative; justify-self: end; }
.hud-tasks-toggle {
  height: 36px; padding: 0 12px; font-size: 16px; color: var(--text-2);
  background: rgba(0, 0, 0, .35); border: 1px solid var(--line); cursor: pointer;
}
.hud-tasks-toggle:hover, .hud-tasks-toggle[aria-expanded="true"] { color: var(--text); border-color: var(--line-2); }
.hud-task-list {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 260px; margin: 0; padding: 8px; list-style: none;
  background: var(--panel-solid); border: 1px solid var(--line-2);
  box-shadow: 0 20px 50px -10px #000c;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s, transform .18s var(--ease), visibility 0s .18s;
}
.hud-tasks.open .hud-task-list { opacity: 1; visibility: visible; transform: none; transition: opacity .18s, transform .18s var(--ease); }
.hud-task-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-decoration: none; font-size: 15px; color: var(--text-2); }
.hud-task-list a:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.hud-task-list i { width: 14px; height: 14px; flex: none; border: 1px solid var(--line-2); position: relative; }
.hud-task-list a.done { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(201, 213, 140, .4); }
.hud-task-list a.done i { background: var(--salt); border-color: var(--salt); }
.hud-task-list a.done i::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.hud-sound {
  height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px;
  font-size: 16px; color: var(--text-2); background: rgba(0, 0, 0, .35); border: 1px solid var(--line); cursor: pointer;
}
.hud-sound[aria-pressed="true"] { color: var(--amber-2); border-color: rgba(232, 184, 80, .5); }
.hud-sound-icon { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.hud-sound-icon::before, .hud-sound-icon::after { content: ""; width: 3px; background: currentColor; height: 6px; }
.hud-sound-icon::after { height: 12px; }
.hud-sound[aria-pressed="true"] .hud-sound-icon::before { animation: eq .5s steps(3) infinite alternate; }
.hud-sound[aria-pressed="true"] .hud-sound-icon::after { animation: eq .4s steps(3) infinite alternate-reverse; }
@keyframes eq { from { height: 4px; } to { height: 14px; } }

.toast {
  position: fixed; left: 50%; top: calc(var(--hud-h) + 14px); z-index: 99;
  transform: translate(-50%, -10px); opacity: 0;
  padding: 10px 18px; font-size: 16px;
  background: rgba(8, 14, 16, .9); border: 1px solid rgba(232, 184, 80, .55); color: var(--amber-2);
  box-shadow: 0 10px 40px -8px #000;
  transition: opacity .25s, transform .25s var(--ease);
  pointer-events: none; white-space: nowrap;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Prologue ---------- */
.prologue { position: relative; height: 560vh; }
.prologue-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.hero {
  position: absolute; left: var(--gutter); top: 50%;
  transform: translateY(-46%);
  max-width: 560px;
  will-change: opacity, transform;
}
.hero::before {
  content: ""; position: absolute; z-index: -1; inset: -30% -40% -30% -60%;
  background: radial-gradient(closest-side, rgba(4, 7, 9, .72), rgba(4, 7, 9, 0));
  pointer-events: none;
}
.hero-title { margin: 0; }
.hero-wordmark {
  width: 432px; height: auto; image-rendering: pixelated;
  filter: drop-shadow(0 0 18px rgba(255, 210, 122, .14)) drop-shadow(0 4px 0 rgba(0, 0, 0, .6));
}
.hero-latin {
  display: block; margin-top: 14px;
  font: 600 13px/1 var(--sans); letter-spacing: .32em; color: var(--salt); opacity: .85;
}
.hero-tagline { margin: 22px 0 0; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.8; color: var(--text); text-shadow: 0 2px 12px #000; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 22px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--text-2); }
.hero-facts li::before { content: "■"; color: var(--amber); font-size: 8px; vertical-align: 2px; margin-right: 8px; }

.radio {
  position: absolute; right: var(--gutter); bottom: 28px;
  width: min(380px, calc(100vw - 2 * var(--gutter)));
  padding: 12px 16px 14px;
  background: rgba(6, 10, 12, .72); border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  will-change: opacity;
}
.radio-head { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--salt); }
.radio-led { width: 8px; height: 8px; background: #6fe08a; box-shadow: 0 0 8px #6fe08a; animation: led 1.6s steps(2) infinite; }
@keyframes led { 50% { background: #1d4a28; box-shadow: none; } }
.radio-text { margin: 8px 0 0; min-height: 5.25em; font-size: 14px; line-height: 1.75; color: var(--text-2); }
.radio-text::after { content: "▌"; color: var(--salt); animation: blink 1s steps(2) infinite; margin-left: 2px; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 10px; font-size: 16px; color: var(--text-2);
  text-shadow: 0 2px 8px #000;
}
.scroll-cue i { width: 2px; height: 40px; background: linear-gradient(var(--amber), transparent); animation: cue 1.8s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 70% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

.story { position: absolute; inset: 0; pointer-events: none; }
.story::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .8s;
  background: radial-gradient(46% 26% at 50% 50%, rgba(3, 7, 9, .62), rgba(3, 7, 9, 0) 100%);
}
.story.on::before { opacity: 1; }
.story-day {
  position: absolute; left: 50%; top: calc(var(--hud-h) + 6vh); transform: translateX(-50%);
  margin: 0; font-size: 16px; color: var(--salt); letter-spacing: .2em;
  opacity: 0; transition: opacity .6s;
}
.story-day.on { opacity: .9; }
.story-line {
  position: absolute; left: 50%; top: 50%;
  width: min(880px, calc(100vw - 2 * var(--gutter)));
  margin: 0; text-align: center;
  font-size: clamp(20px, 2.4vw, 32px); line-height: 1.75; color: #f1ecd9;
  text-shadow: 0 2px 2px #000, 0 0 30px rgba(0, 0, 0, .9);
  opacity: 0; filter: blur(10px);
  transform: translate(-50%, calc(-50% + 24px));
  transition: opacity .7s var(--ease), filter .7s var(--ease), transform .9s var(--ease);
}
.story-line.on { opacity: 1; filter: none; transform: translate(-50%, -50%); }
.story-line.past { opacity: 0; filter: blur(6px); transform: translate(-50%, calc(-50% - 30px)); }
.story-big { font-family: var(--px); font-size: clamp(32px, 3vw, 48px); line-height: 1.5; }
.story-line.story-big.solo { font-size: clamp(32px, 4vw, 64px); }
.story-line em { font-style: normal; color: var(--amber-2); }
.stencil {
  display: block; width: max-content; margin: 18px auto 0;
  font-family: var(--px); font-size: clamp(48px, 7vw, 96px); line-height: 1;
  color: var(--red); letter-spacing: .12em;
  text-shadow: 0 0 2px rgba(200, 71, 58, .9), 0 0 14px rgba(200, 71, 58, .45), 0 3px 0 rgba(0, 0, 0, .6);
  opacity: .94;
  transform: rotate(-1.5deg);
}
.tideline {
  position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%);
  display: grid; justify-items: end; gap: 4px; font-size: 16px; color: var(--text-2);
  opacity: 0; transition: opacity .5s;
}
.tideline.on { opacity: 1; }
.tideline b { font-weight: 400; font-size: 32px; color: #9fd3d9; font-variant-numeric: tabular-nums; }

/* ---------- Section headings ---------- */
.sec-head { max-width: 760px; }
.sec-kicker { margin: 0; font-size: 16px; color: var(--amber); letter-spacing: .08em; }
.sec-title { margin: 10px 0 0; font-size: clamp(32px, 4.2vw, 64px); line-height: 1.25; color: #f1ecd9; }
.sec-lede { margin: 16px 0 0; font-size: 17px; color: var(--text-2); max-width: 640px; }

/* ---------- Raid loop ---------- */
.loop {
  position: relative; height: 520vh;
  background:
    radial-gradient(1200px 600px at 80% 10%, rgba(47, 110, 124, .16), transparent 60%),
    linear-gradient(var(--bg), var(--bg));
  border-top: 1px solid var(--line);
}
.loop::before {
  /* Waterline left by the tide */
  content: ""; position: absolute; inset: -80px 0 auto; height: 80px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.loop-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: grid; grid-template-rows: auto 1fr auto; gap: 24px;
  padding: calc(var(--hud-h) + 4vh) 0 4vh;
  overflow: hidden;
}
.loop .sec-head { padding: 0 var(--gutter); }
.loop-rail { position: relative; min-height: 0; }
.loop-steps {
  --step-w: min(74vw, 1240px);
  position: absolute; inset: 0 auto 0 0;
  display: flex; gap: 4vw; margin: 0; padding: 0 var(--gutter); list-style: none;
  will-change: transform;
}
.loop-step {
  flex: none; width: var(--step-w); height: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: center;
  opacity: .38; transition: opacity .5s var(--ease);
}
.loop-step.on { opacity: 1; }
.loop-step .monitor { justify-self: end; width: 100%; max-width: calc((100svh - 330px) * 16 / 9); }
.monitor {
  position: relative; margin: 0; min-width: 0;
  aspect-ratio: 16 / 9; max-height: 100%;
  border: 1px solid var(--line-2);
  background: #000;
  box-shadow: 0 40px 80px -30px #000, 0 0 0 6px rgba(0, 0, 0, .35);
}
.monitor img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(.45) contrast(1.1); transition: filter .8s var(--ease); }
.loop-step.on .monitor img { filter: none; }
.monitor > .scan {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(to bottom, transparent 0 46%, rgba(232, 184, 80, .22) 49.5%, rgba(255, 240, 200, .5) 50%, transparent 50.5%);
  background-size: 100% 220%; background-position: 0 100%; background-repeat: no-repeat; opacity: 0;
}
.loop-step.on .monitor > .scan { animation: sweep 1.1s var(--ease); }
@keyframes sweep { 0% { opacity: 1; background-position: 0 100%; } 90% { opacity: 1; } 100% { opacity: 0; background-position: 0 0; } }
.monitor::before, .monitor::after {
  content: ""; position: absolute; width: 22px; height: 22px; z-index: 2;
  border: 2px solid var(--amber);
}
.monitor::before { left: -8px; top: -8px; border-width: 2px 0 0 2px; }
.monitor::after { right: -8px; bottom: -8px; border-width: 0 2px 2px 0; }
.monitor { --scan: 0; }
.loop-step.on .monitor { animation: scanin 1s var(--ease); }
@keyframes scanin { from { box-shadow: 0 40px 80px -30px #000, 0 0 0 6px rgba(0, 0, 0, .35), 0 0 0 1px var(--amber); } }
.loop-copy h3 { margin: 4px 0 0; font-size: 32px; line-height: 1.3; color: #f1ecd9; }
.loop-copy p { margin: 12px 0 0; color: var(--text-2); }
.loop-no { font-size: 64px; line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--amber); }
.keys { font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.loop-progress { margin: 0 var(--gutter); height: 2px; background: rgba(255, 255, 255, .06); }
.loop-progress i { display: block; height: 100%; background: var(--amber); transform-origin: left; transform: scaleX(0); }

/* ---------- County map ---------- */
.county {
  position: relative; padding: 14vh var(--gutter) 12vh;
  background: linear-gradient(var(--bg), var(--bg-2));
}
.county-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; margin-top: 40px; align-items: start; }
.county-map {
  position: relative; aspect-ratio: 3 / 2; overflow: hidden;
  border: 1px solid var(--line-2); background: #0a2533;
  box-shadow: 0 50px 100px -40px #000;
  touch-action: pan-y;
}
.county-map canvas, .county-fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
.county-fallback { object-fit: cover; }
.county-map.gl .county-fallback { visibility: hidden; }
.county-route { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.county-route path {
  fill: none; stroke: var(--amber); stroke-width: .45; stroke-linecap: round;
  stroke-dasharray: 1.4 1.1; vector-effect: none;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, .9));
  animation: march 1.2s linear infinite;
}
@keyframes march { to { stroke-dashoffset: -2.5; } }
.county-pins { position: absolute; inset: 0; }
.pin {
  position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%);
  transform: translate(-7px, -7px);
  display: flex; align-items: center; gap: 8px;
  padding: 0; border: 0; background: none; color: var(--text); cursor: pointer;
  font: 16px/1.1 var(--px);
}
.pin[data-side="l"] { flex-direction: row-reverse; transform: translate(calc(-100% + 7px), -7px); }
.pin-mark {
  width: 14px; height: 14px; flex: none; position: relative;
  border: 2px solid #e6e2cf; background: rgba(10, 16, 18, .8); transform: rotate(45deg);
  transition: background-color .2s, border-color .2s, transform .2s var(--ease);
}
.pin.open .pin-mark { border-color: var(--amber); background: var(--amber); }
.pin-label {
  display: grid; padding: 4px 8px 3px; text-align: left;
  background: rgba(8, 14, 16, .82); border: 1px solid rgba(255, 255, 255, .12);
  white-space: nowrap; transition: border-color .2s, background-color .2s;
}
.pin-label small { font: 12px/1.3 var(--sans); color: var(--muted); }
.pin.open .pin-label small { color: var(--amber); }
.pin.flood .pin-label small { color: #8fd0dc; }
.pin:hover .pin-label, .pin.on .pin-label { border-color: var(--amber); }
.pin.on .pin-mark { transform: rotate(45deg) scale(1.25); background: var(--amber-2); border-color: #fff; }
.pin.on .pin-mark::after {
  content: ""; position: absolute; inset: -9px; border: 2px solid var(--amber);
  animation: ping 1.6s var(--ease) infinite;
}
@keyframes ping { from { opacity: .9; transform: scale(.6); } to { opacity: 0; transform: scale(1.7); } }
.pin-base .pin-mark { border-color: #7fd18f; background: #3d8c4d; transform: none; }
.pin-base .pin-label small { color: #7fd18f; }
.pin-base { cursor: default; }
.county-badge {
  position: absolute; right: 2.2%; top: 3%;
  display: grid; justify-items: center; padding: 10px 16px 8px;
  background: rgba(8, 14, 16, .78); border: 1px solid var(--line-2);
  pointer-events: none;
}
.county-badge b { font-weight: 400; font-size: 32px; line-height: 1.2; color: #f1ecd9; }
.county-badge small { font: 11px/1.4 var(--sans); letter-spacing: .3em; color: var(--muted); }
.brief {
  height: 100%; min-height: 560px;
  display: grid; grid-template-rows: auto 1fr;
  background: var(--panel-solid); border: 1px solid var(--line-2);
}
.brief-art { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: #000; }
.brief-art img { width: 100%; height: 100%; object-fit: cover; }
.brief-art img.swap { animation: swap .6s var(--ease); }
@keyframes swap { from { clip-path: inset(0 0 100% 0); filter: brightness(2) saturate(0); } to { clip-path: inset(0 0 0 0); filter: none; } }
.brief-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px), linear-gradient(to top, var(--panel-solid), transparent 40%);
}
.brief-tag { position: absolute; right: 10px; top: 10px; z-index: 1; font-size: 16px; padding: 3px 8px 2px; background: rgba(0, 0, 0, .55); color: var(--text-2); }
.brief-body { padding: 4px 20px 20px; display: grid; align-content: start; }
.brief-area { margin: 0; font-size: 16px; color: var(--muted); }
.brief-name { margin: 4px 0 0; font-size: 32px; line-height: 1.3; color: #f1ecd9; }
.brief-desc { margin: 10px 0 0; font-size: 15px; color: var(--text-2); min-height: 5.25em; }
.brief-feat { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; min-height: 30px; }
.brief-feat li { font-size: 12px; padding: 3px 8px; border: 1px solid var(--line-2); color: var(--salt); }
.brief-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 16px; background: var(--line); border: 1px solid var(--line); }
.brief-meta div { background: var(--panel-solid); padding: 8px 12px; display: grid; }
.brief-meta small { font-size: 12px; color: var(--muted); }
.brief-meta b { font-weight: 400; font-size: 16px; color: var(--text); }
.brief-meta b.open { color: var(--amber); }
.brief-meta b.wet { color: #8fd0dc; }
.tide-ctl {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "l r b" ". d ." ". h h";
  align-items: center; gap: 6px 16px; margin-top: 18px; max-width: calc(100% - 400px);
}
.tide-ctl label { grid-area: l; font-size: 16px; color: #8fd0dc; }
.tide-ctl input { grid-area: r; }
.tide-ctl button { grid-area: b; }
.tide-days { grid-area: d; display: flex; justify-content: space-between; margin: 0; padding: 0; list-style: none; font-size: 16px; color: var(--muted); }
.tide-hint { grid-area: h; margin: 0; font-size: 13px; color: var(--muted); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(to right, #2f6e7c, #8fd0dc); border: 1px solid var(--line-2); }
input[type="range"]::-moz-range-track { height: 6px; background: linear-gradient(to right, #2f6e7c, #8fd0dc); border: 1px solid var(--line-2); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 24px; margin-top: -10px; background: #e6e2cf; border: 2px solid #0a1113; box-shadow: 0 0 0 1px #8fd0dc; }
input[type="range"]::-moz-range-thumb { width: 14px; height: 22px; background: #e6e2cf; border: 2px solid #0a1113; border-radius: 0; }

/* ---------- Enemies ---------- */
.threats {
  position: relative; padding: 14vh var(--gutter);
  background:
    radial-gradient(900px 500px at 15% 70%, rgba(200, 71, 58, .08), transparent 60%),
    var(--bg-2);
  border-top: 1px solid var(--line);
}
.threat-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 40px; max-width: 1100px; }
.threat-tab {
  height: 56px; display: grid; align-content: center; justify-items: start; padding: 0 14px;
  font: 16px/1.2 var(--px); color: var(--text-2); text-align: left;
  background: rgba(255, 255, 255, .02); border: 1px solid var(--line); cursor: pointer;
  transition: border-color .2s, color .2s, background-color .2s;
}
.threat-tab small { font: 12px/1.3 var(--sans); color: var(--muted); }
.threat-tab:hover { border-color: var(--line-2); color: var(--text); }
.threat-tab[aria-selected="true"] { border-color: var(--amber); color: #f1ecd9; background: rgba(232, 184, 80, .07); }
.threat-card {
  display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 32px;
  margin-top: 16px; max-width: 1100px; min-height: 420px;
  border: 1px solid var(--line-2); background: var(--panel-solid);
}
.threat-stage {
  position: relative; overflow: hidden; min-height: 420px;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 36px;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .14) 0 2px, transparent 2px 4px),
    radial-gradient(55% 60% at 42% 30%, rgba(232, 184, 80, .14), transparent 70%),
    linear-gradient(#152022, #0b1214);
  border-right: 1px solid var(--line);
}
.threat-stage::before {
  /* Ground */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 36px;
  background: repeating-linear-gradient(90deg, #1b2628 0 32px, #172123 32px 64px);
  border-top: 2px solid #26363a;
}
.threat-stage::after {
  /* Slanted rain */
  content: ""; position: absolute; inset: -40px; pointer-events: none;
  background-image: linear-gradient(105deg, transparent 49.5%, rgba(170, 200, 210, .22) 50%, transparent 50.5%);
  background-size: 22px 46px;
  animation: rain .5s linear infinite;
}
@keyframes rain { to { background-position: -8px 46px; } }
.sprite {
  --s: 6; position: relative; z-index: 1;
  width: calc(32px * var(--s)); height: calc(48px * var(--s));
  background-repeat: no-repeat; background-size: calc(160px * var(--s)) calc(48px * var(--s));
  image-rendering: pixelated;
  animation: walk .7s steps(5) infinite;
  filter: drop-shadow(0 10px 0 rgba(0, 0, 0, .35));
  transform-origin: bottom center;
}
.sprite::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: -6px; height: 10px; background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent); }
.sprite.in { animation: walk .7s steps(5) infinite, rise .6s var(--ease) both; }
@keyframes walk { to { background-position-x: calc(-160px * var(--s)); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); filter: brightness(3) drop-shadow(0 10px 0 rgba(0, 0, 0, .35)); } }
.dossier { --s: 3; position: relative; z-index: 1; margin: 0 110px -2px 0; }
.dossier img { width: calc(96px * var(--s)); height: calc(128px * var(--s)); image-rendering: pixelated; filter: drop-shadow(0 10px 0 rgba(0, 0, 0, .35)); }
.dossier.wide img { width: calc(128px * var(--s)); height: calc(96px * var(--s)); }
.dossier figcaption {
  position: absolute; left: 0; top: 14px; padding: 3px 8px 2px; font-size: 16px; color: #f1ecd9;
  background: rgba(8, 14, 16, .78); border: 1px solid rgba(200, 71, 58, .6);
}
.dossier.in { animation: rise .6s var(--ease) both; }
.ingame {
  position: absolute; right: 14px; bottom: 44px; z-index: 2;
  display: flex; align-items: flex-end; gap: 2px; padding: 22px 6px 4px;
  background: rgba(8, 14, 16, .6); border: 1px solid var(--line-2);
}
.ingame small { position: absolute; left: 6px; top: 2px; font-size: 16px; line-height: 1.1; color: var(--muted); }
.ingame .sprite { --s: 2; filter: none; }
.ingame .sprite::after { display: none; }
.threat-info { padding: 32px 32px 32px 0; }
.threat-kicker { margin: 0; font-size: 16px; color: var(--amber); }
.threat-name { margin: 6px 0 0; font-size: 48px; line-height: 1.2; color: #f1ecd9; }
.threat-desc { margin: 14px 0 0; color: var(--text-2); min-height: 5.25em; }
.threat-roster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.threat-roster li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); font-size: 15px; }
.threat-roster li::before { content: ""; width: 6px; height: 6px; background: var(--red); flex: none; }

/* ---------- Station people ---------- */
.people { position: relative; padding: 14vh var(--gutter); background: linear-gradient(var(--bg-2), var(--bg-2)); border-top: 1px solid var(--line); }
.people-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 40px 0 0; padding: 0; list-style: none; max-width: 1240px; }
.person { display: grid; grid-template-rows: 384px auto; background: var(--panel-solid); border: 1px solid var(--line-2); outline-offset: 4px; transition: border-color .25s; }
.person:hover, .person:focus-visible { border-color: var(--amber); }
.person-stage {
  position: relative; overflow: hidden; display: grid; place-items: end center;
  background:
    radial-gradient(48% 62% at 34% 18%, rgba(255, 210, 122, .2), transparent 70%),
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .12) 0 2px, transparent 2px 4px),
    linear-gradient(#1a2426, #0e1618);
  border-bottom: 1px solid var(--line);
}
.portrait {
  --s: 3; position: relative; z-index: 1; display: block;
  width: calc(96px * var(--s)); height: calc(128px * var(--s));
  background-repeat: no-repeat; background-size: calc(192px * var(--s)) calc(128px * var(--s)); background-position: 0 0;
  image-rendering: pixelated;
}
/* Frame 2 only moves the mouth (Sol's verification.json), so flipping frames reads as talking. */
.person:hover .portrait, .person:focus-visible .portrait { animation: talk .36s steps(1) infinite; }
@keyframes talk { 0% { background-position: 0 0; } 50% { background-position: calc(-96px * var(--s)) 0; } }
.person-body { padding: 18px 22px 22px; }
.person-body h3 { margin: 0; font-size: 32px; line-height: 1.3; color: #f1ecd9; }
.person-role { margin: 2px 0 0; font-size: 13px; color: var(--amber); }
.person-say {
  position: relative; margin: 14px 0 0; padding: 12px 14px; min-height: 4.6em;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line-2);
  font-size: 16px; line-height: 1.7; color: #f1ecd9;
}
.person-say::before { content: ""; position: absolute; left: 24px; top: -7px; width: 12px; height: 12px; background: var(--panel-solid); border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2); transform: rotate(45deg); }
.person-note { margin: 12px 0 0; font-size: 14px; color: var(--text-2); }

/* ---------- Gunsmith ---------- */
.bench { position: relative; height: 320vh; background: linear-gradient(var(--bg-2), #0c1517); border-top: 1px solid var(--line); }
.bench-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto; gap: 16px;
  padding: calc(var(--hud-h) + 4vh) var(--gutter) 5vh;
}
.bench-sticky::before {
  /* Workbench grid */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(201, 213, 140, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(201, 213, 140, .05) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask: radial-gradient(70% 60% at 50% 55%, #000, transparent);
  mask: radial-gradient(70% 60% at 50% 55%, #000, transparent);
}
.bench-sticky > * { position: relative; z-index: 1; }
.bench-board { position: relative; display: grid; place-items: center; min-height: 0; }
.bench-gun { --s: 4; position: relative; width: calc(194px * var(--s)); height: calc(50px * var(--s)); }
.bench-part {
  position: absolute; image-rendering: pixelated;
  width: calc(var(--w) * 1px * var(--s)); height: calc(var(--h) * 1px * var(--s));
  left: calc(var(--x) * 1px * var(--s)); top: calc(var(--y) * 1px * var(--s));
  will-change: transform;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .4));
}
.bench-leaders { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.bench-leaders line { stroke: rgba(232, 184, 80, .55); stroke-width: 1; stroke-dasharray: 3 3; }
.bench-leaders circle { fill: var(--amber); }
.bench-labels { position: absolute; inset: 0; pointer-events: none; }
.bench-label {
  position: absolute; left: 0; top: 0; display: grid; padding: 4px 8px 3px;
  background: rgba(8, 14, 16, .86); border: 1px solid rgba(232, 184, 80, .45);
  font: 16px/1.2 var(--px); color: #f1ecd9; white-space: nowrap;
  transform: translate(-50%, -50%);
}
.bench-label small { font: 12px/1.3 var(--sans); color: var(--amber); }
.bench-gun.done .bench-part { filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .4)) drop-shadow(0 0 10px rgba(232, 184, 80, .25)); }
.bench-stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; align-content: start;
  max-width: 980px; justify-self: center; width: 100%; min-height: 104px; opacity: 0;
}
.bench-chip { display: grid; padding: 8px 14px 7px; border: 1px solid var(--line-2); background: rgba(8, 14, 16, .75); min-width: 150px; }
.bench-chip b { font-weight: 400; font-size: 16px; }
.bench-chip small { font-size: 12px; color: var(--muted); }
.bench-chip.up b { color: #9fdc8f; }
.bench-chip.down b { color: #e09a7c; }
.bench-note { flex-basis: 100%; margin: 4px 0 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- Features ---------- */
.features { padding: 16vh var(--gutter); background: #0c1517; border-top: 1px solid var(--line); }
.feat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 48px 0 0; padding: 0; list-style: none; background: var(--line); border: 1px solid var(--line); }
.feat { position: relative; padding: 28px 28px 32px; background: #0c1517; overflow: hidden; transition: background-color .3s; }
.feat:hover { background: #102023; }
.feat::before {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--amber), transparent);
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease);
}
.feat.seen::before { transform: scaleX(1); }
.feat-num { display: block; font-size: 64px; line-height: 1; color: var(--amber); font-variant-numeric: tabular-nums; }
.feat h3 { margin: 10px 0 0; font-size: 16px; color: #f1ecd9; }
.feat p { margin: 10px 0 0; color: var(--text-2); font-size: 15px; }

/* ---------- Extraction ---------- */
.extract {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; align-content: center; justify-items: center; gap: 36px;
  padding: 14vh var(--gutter) 10vh; text-align: center;
  background: #070c0e; overflow: hidden;
  border-top: 1px solid var(--line);
}
.extract > :not(.extract-scene) { position: relative; z-index: 1; }
.extract-scene { position: absolute; inset: 0; container-type: size; overflow: hidden; pointer-events: none; }
.extract-frame {
  /* One 640x360 art frame scaled to cover the section; every layer shares its scale. */
  position: absolute; left: 50%; top: 50%; width: max(100cqw, 100cqh * 16 / 9); aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
}
.extract-frame .layer { position: absolute; top: 0; height: 100%; }
.extract-frame img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.extract-frame .far { left: 0; width: 100%; }
/* Mid and near are Sol's 680-wide overscan versions: x = -20 art px, then +-10 / +-20 of parallax. */
.extract-frame .mid, .extract-frame .near { left: -3.125%; width: 106.25%; }
.extract-frame .mid { transform: translate(calc(var(--ex, 0) * -1.47%), calc(var(--ey, 0) * 3%)); }
.extract-frame .near { transform: translate(calc(var(--ex, 0) * -2.94%), calc(var(--ey, 0) * 7%)); }
.flare {
  position: absolute; left: 23.97%; top: 75.6%; width: 7%; aspect-ratio: 1; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 150, 90, .6), rgba(220, 70, 40, .22) 50%, transparent);
  mix-blend-mode: screen; animation: flare 1.3s steps(4) infinite;
}
@keyframes flare { 0% { opacity: .75; } 25% { opacity: 1; } 50% { opacity: .6; } 75% { opacity: .9; } }
.extract-rain {
  position: absolute; inset: -40px;
  background-image: linear-gradient(105deg, transparent 49.6%, rgba(170, 200, 210, .18) 50%, transparent 50.4%);
  background-size: 26px 58px; animation: rain .45s linear infinite;
}
.extract-scene::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(34% 40% at 50% 50%, rgba(5, 9, 11, .62), transparent 100%),
    linear-gradient(to bottom, #070c0e 0, rgba(7, 12, 14, 0) 18%, rgba(7, 12, 14, 0) 70%, rgba(7, 12, 14, .85) 100%);
}
.extract-zone { position: relative; width: min(560px, 90vw); aspect-ratio: 1; display: grid; place-items: center; }
.extract-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: rgba(5, 9, 11, .35); stroke: rgba(232, 184, 80, .25); stroke-width: 1.5; stroke-dasharray: 4 5; animation: spin 30s linear infinite; transform-origin: center; }
.ring-fg { fill: none; stroke: var(--amber); stroke-width: 4; stroke-linecap: butt; stroke-dasharray: 553; stroke-dashoffset: 553; filter: drop-shadow(0 0 6px rgba(232, 184, 80, .8)); }
@keyframes spin { to { transform: rotate(360deg); } }
.extract-core { position: relative; display: grid; justify-items: center; gap: 12px; max-width: 360px; }
.extract-title { margin: 0; font-size: clamp(32px, 4vw, 48px); line-height: 1.2; color: #f1ecd9; }
.extract-sub { margin: 0; color: var(--text-2); font-size: 15px; min-height: 3.5em; }
.btn-hold { --h: 56px; overflow: hidden; min-width: 220px; touch-action: none; -webkit-touch-callout: none; }
.btn-hold span { position: relative; z-index: 1; }
.btn-hold i { position: absolute; inset: 0; background: #fff6; transform-origin: left; transform: scaleX(0); }
.extract.done .extract-title { color: var(--amber-2); }
.extract-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.extract-note { margin: 0; max-width: 560px; font-size: 13px; color: var(--muted); }
.extract-flash { position: fixed; inset: 0; z-index: 200; background: #fff; pointer-events: none; animation: flash .9s ease-out forwards; }
@keyframes flash { from { opacity: .9; } to { opacity: 0; } }

.foot { position: relative; z-index: 1; padding: 40px var(--gutter) 56px; background: #070c0d; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
.foot .px { font-size: 16px; color: var(--text-2); margin-bottom: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .county-grid { grid-template-columns: 1fr; }
  .brief { min-height: 0; grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .tide-ctl { max-width: none; }
  .loop-step { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: center; gap: 16px; }
  .loop-steps { --step-w: min(78vw, 820px); }
  .loop-copy p:not(.keys) { max-width: 560px; }
  .bench-gun { --s: 3; }
}
@media (max-width: 820px) {
  :root { --hud-h: 52px; }
  .hud { grid-template-columns: 1fr auto auto auto; gap: 8px; }
  .hud-tasks, .hud-brand span { display: none; }
  .hud-clock-label { display: none; }
  .hud-clock { grid-template-columns: auto; }
  .hud-clock-time { font-size: 16px; padding: 4px 8px 3px; }
  .hud-sound { padding: 0 10px; }
  .hud-sound { font-size: 0; gap: 0; }
  .hero { top: auto; bottom: 150px; transform: none; right: var(--gutter); }
  .hero::before { inset: -20% -20% -10% -20%; }
  .hero-wordmark { width: 288px; }
  .hero-tagline { font-size: 16px; }
  .hero-facts { display: none; }
  .radio { display: none; }
  .scroll-cue { bottom: 18px; }
  .tideline { top: auto; bottom: 18vh; }
  .loop { height: auto; }
  .loop-sticky { position: relative; height: auto; display: block; padding: 12vh 0 8vh; }
  .loop-rail { margin-top: 32px; }
  .loop-steps { position: static; flex-direction: column; gap: 56px; transform: none !important; }
  .loop-step { width: auto; height: auto; opacity: 1; }
  .loop-progress { display: none; }
  .brief { grid-template-columns: 1fr; }
  .pin-label small { display: none; }
  .pin { font-size: 0; }
  .pin.on, .pin.open, .pin-base { font-size: 16px; }
  .pin-label { padding: 2px 6px; }
  .pin:not(.on):not(.open):not(.pin-base) .pin-label { display: none; }
  .county-badge { display: none; }
  .tide-ctl { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "l r" ". d" "b b" "h h"; }
  .tide-ctl button { justify-self: start; }
  .threat-tabs { grid-template-columns: repeat(5, minmax(120px, 1fr)); overflow-x: auto; scrollbar-width: none; }
  .threat-card { grid-template-columns: 1fr; }
  .threat-stage { border-right: 0; border-bottom: 1px solid var(--line); }
  .sprite { --s: 4; }
  .dossier { --s: 2; margin-right: 96px; }
  .threat-stage { min-height: 340px; }
  .dossier.wide { margin-right: 0; }
  .threat-stage:has(.wide) .ingame { top: 12px; bottom: auto; }
  .ingame .sprite { --s: 1.5; }
  .threat-info { padding: 0 20px 24px; }
  .threat-name { font-size: 32px; }
  .threat-roster { grid-template-columns: 1fr; }
  .bench-gun { --s: 2; }
  .bench-stats { grid-template-columns: 1fr 1fr; }
  .feat-grid { grid-template-columns: 1fr; }
  .stencil { letter-spacing: .04em; }
}
@media (max-width: 520px) {
  .bench-gun { --s: 1.5; }
  .bench-label { font-size: 12px; font-family: var(--sans); }
  .bench-label small { display: none; }
  .hero-actions .btn { flex: 1 1 auto; }
}
@media (min-width: 1800px) {
  .hero-wordmark { width: 576px; }
  .hero { max-width: 680px; }
  .bench-gun { --s: 5; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .threat-stage::after, .county-route path, .ring-bg, .scroll-cue i, .extract-rain, .flare { animation: none; }
  .sprite { animation-duration: 1.4s; }
  .story-line { transition-duration: .01s; filter: none; }
}
@media (max-width: 960px) {
  .people-grid { grid-template-columns: 1fr; max-width: 560px; }
  .person { grid-template-rows: 256px auto; }
  .portrait { --s: 2; }
}
