/* Dusk Station — site styles */
:root {
  --ink: #07060b;
  --night: #0c0914;
  --panel: #141020;
  --panel-2: #1b1529;
  --line: #2d2342;
  --line-2: #3d3058;
  --text: #efe6d4;
  --muted: #b1a3c2;
  --dim: #7c6f8f;
  --amber: #f6c070;
  --amber-hi: #ffd890;
  --orange: #e07c3f;
  --rust: #8c3a1c;
  --rose: #cf5f45;
  --teal: #5fe8cf;
  --teal-deep: #1f8a7a;
  --magenta: #ff5fa8;
  --display: 'Silkscreen', ui-monospace, monospace;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --px: 4px;
  --wrap: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--amber-hi); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- pixel primitives ---------- */
.notch {
  /* stepped-corner border without clip-path, NES style */
  box-shadow:
    0 calc(-1 * var(--b, 3px)) 0 0 var(--bc, var(--line)),
    0 var(--b, 3px) 0 0 var(--bc, var(--line)),
    calc(-1 * var(--b, 3px)) 0 0 0 var(--bc, var(--line)),
    var(--b, 3px) 0 0 0 var(--bc, var(--line));
}
.btn {
  --bg: var(--amber); --fg: #1e100b; --edge: var(--rust); --bc: var(--ink);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .65em;
  margin: 4px; padding: 15px 22px 17px;
  font: 400 15px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  color: var(--fg); background: var(--bg); border: 0; cursor: pointer;
  box-shadow:
    inset 0 -4px 0 0 var(--edge),
    inset 0 3px 0 0 rgba(255, 255, 255, .28),
    0 -4px 0 0 var(--bc), 0 4px 0 0 var(--bc), -4px 0 0 0 var(--bc), 4px 0 0 0 var(--bc);
  transition: transform .08s steps(2), background-color .12s;
}
.btn:hover { --bg: var(--amber-hi); color: var(--fg); transform: translateY(-2px); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 0 var(--edge), 0 -4px 0 0 var(--bc), 0 4px 0 0 var(--bc), -4px 0 0 0 var(--bc), 4px 0 0 0 var(--bc); }
.btn--ghost { --bg: var(--panel-2); --fg: var(--text); --edge: #0f0b18; --bc: var(--line-2); }
.btn--ghost:hover { --bg: #251d38; color: var(--amber-hi); }
.btn--teal { --bg: var(--teal); --fg: #06211d; --edge: var(--teal-deep); }
.btn--teal:hover { --bg: #9ff8ea; }
.btn--small { padding: 11px 15px 13px; font-size: 12px; }
.btn--big { padding: 20px 30px 23px; font-size: 20px; }
.btn svg { width: 1.05em; height: 1.05em; flex: none; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 12.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--teal);
}
.eyebrow::before { content: ''; width: 8px; height: 8px; background: currentColor; box-shadow: 4px 4px 0 var(--teal-deep); }
.kicker { font: 600 12px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }

h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .02em; line-height: 1.12; margin: 0; }
h2 { font-size: clamp(28px, 4.2vw, 46px); color: var(--amber); text-shadow: 0 3px 0 var(--rust); }
h3 { font-size: 21px; color: var(--text); }
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--text); max-width: 58ch; }
.muted { color: var(--muted); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 18px; padding: 12px clamp(14px, 3vw, 32px);
  transition: background-color .25s, box-shadow .25s;
}
.nav.is-solid { background: rgba(10, 8, 17, .92); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 400 17px/1 var(--display); letter-spacing: .04em; }
.brand img { width: 30px; height: 30px; }
.brand:hover { color: var(--amber-hi); }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a:not(.btn) { color: var(--muted); text-decoration: none; font: 500 14px/1 var(--mono); padding: 10px 12px; letter-spacing: .04em; }
.nav-links a:not(.btn):hover { color: var(--amber-hi); }
.gh-link { display: inline-flex; padding: 8px; color: var(--muted); }
.gh-link svg { width: 22px; height: 22px; }
@media (max-width: 860px) { .nav-links a.nav-text { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: 128px 0 72px; min-height: 100svh; display: flex; align-items: center; }
.hero-bg { position: absolute; inset: 0; z-index: -2; background: #140b27 url(keyart.png) center 78% / cover no-repeat; image-rendering: pixelated; image-rendering: crisp-edges; }
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(7, 6, 11, .55) 0%, rgba(7, 6, 11, .2) 22%, rgba(7, 6, 11, .15) 45%, rgba(7, 6, 11, .78) 74%, var(--ink) 100%);
}
.hero-inner { display: grid; justify-items: center; text-align: center; gap: 26px; }
.title {
  font-size: clamp(48px, 10.5vw, 132px); color: var(--amber); letter-spacing: .01em;
  text-shadow: 0 5px 0 var(--rust), 0 10px 0 rgba(7, 6, 11, .55);
}
.tagline { font-size: clamp(18px, 2.2vw, 23px); max-width: 44ch; margin: 0; color: #f6ead8; text-shadow: 0 2px 0 rgba(7, 6, 11, .8); }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; font: 500 13px/1.3 var(--mono); color: var(--muted); letter-spacing: .03em; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta span::before { content: ''; width: 6px; height: 6px; background: var(--amber); }

/* ---------- game screen ---------- */
.screen-wrap { width: min(1040px, 100%); margin-top: 6px; }
.screen {
  position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden;
  box-shadow: 0 0 0 4px #000, 0 0 0 8px var(--line-2), 0 0 0 12px #000, 0 40px 90px rgba(0, 0, 0, .65);
}
.screen:fullscreen { box-shadow: none; aspect-ratio: auto; width: 100vw; height: 100vh; }
.screen > video, .screen > iframe, .screen > img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.screen > video { object-fit: cover; image-rendering: pixelated; }
.screen-overlay {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 18px; justify-items: center;
  background: radial-gradient(ellipse at center, rgba(7, 6, 11, .25), rgba(7, 6, 11, .62) 75%); border: 0; cursor: pointer; color: var(--text);
}
.screen-overlay:hover .btn { --bg: var(--amber-hi); transform: translateY(-2px); }
.screen-overlay small { font: 500 13px/1.2 var(--mono); color: #e7dccb; letter-spacing: .05em; text-shadow: 0 2px 0 #000; }
.screen-tag {
  position: absolute; right: 14px; top: 14px; z-index: 2; pointer-events: none;
  font: 600 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink); background: var(--teal); padding: 6px 8px 5px;
}
.screen-tag.is-live { background: var(--magenta); color: #2a0614; }
.screen-bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; margin-top: 22px; }
.screen-help { margin: 14px 0 0; font: 500 13px/1.5 var(--mono); color: var(--muted); }
.screen-help kbd { color: var(--text); }

kbd {
  display: inline-block; min-width: 1.9em; padding: 3px 7px 4px; text-align: center;
  font: 600 12.5px/1.2 var(--mono); color: var(--text); background: var(--panel-2);
  box-shadow: inset 0 -3px 0 #0b0812, 0 -2px 0 var(--line-2), 0 2px 0 var(--line-2), -2px 0 0 var(--line-2), 2px 0 0 var(--line-2);
  margin: 2px 3px;
}

/* ---------- sections ---------- */
section { position: relative; }
.band { padding: clamp(72px, 10vw, 128px) 0; }
.band--night { background: var(--night); }
.band--deep { background: #0a0711; }
.sec-head { display: grid; gap: 16px; margin-bottom: clamp(36px, 5vw, 56px); max-width: 760px; }
.sec-head.center { margin-inline: auto; text-align: center; justify-items: center; }

/* stepped divider between bands */
.steps { height: 24px; background:
  linear-gradient(90deg, var(--from) 0 100%) top / 100% 8px no-repeat,
  repeating-linear-gradient(90deg, var(--from) 0 48px, transparent 48px 96px) 0 8px / 100% 8px no-repeat,
  repeating-linear-gradient(90deg, var(--from) 0 16px, transparent 16px 96px) 24px 16px / 100% 8px no-repeat;
  background-color: var(--to);
}

/* story */
.story { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.story p { margin: 0 0 18px; color: var(--muted); }
.story p.lead { color: var(--text); }
@media (max-width: 880px) { .story { grid-template-columns: 1fr; } }

.frame {
  --b: 4px; --bc: var(--line-2);
  position: relative; background: #000; margin: 4px;
}
.frame img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.frame figcaption, .caption {
  display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--panel);
  font: 500 12.5px/1.35 var(--mono); color: var(--muted); letter-spacing: .03em;
}
.frame figcaption b, .caption b { color: var(--text); font-weight: 600; }
figure { margin: 0; }

/* regions */
.regions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.region { --b: 3px; --bc: var(--line); background: var(--panel); margin: 3px; display: grid; grid-template-rows: auto 1fr; }
.region img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.region-body { padding: 20px 22px 24px; display: grid; gap: 12px; align-content: start; }
.region-body p { margin: 0; color: var(--muted); font-size: 15.5px; }
.swatches { display: flex; gap: 0; margin-top: 4px; }
.swatches i { width: 22px; height: 12px; display: block; }
.region h3 { color: var(--accent); }
@media (max-width: 960px) { .regions { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; } }

/* features */
.features { display: grid; gap: clamp(56px, 8vw, 104px); }
.feature { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.feature:nth-child(even) .feature-media { order: 2; }
.feature-text { display: grid; gap: 14px; }
.feature-text h3 { font-size: clamp(22px, 2.6vw, 30px); color: var(--amber); }
.feature-text p { margin: 0; color: var(--muted); }
.feature-text ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.feature-text li { position: relative; padding-left: 24px; font-size: 15.5px; }
.feature-text li::before { content: ''; position: absolute; left: 2px; top: .58em; width: 8px; height: 8px; background: var(--teal); box-shadow: 3px 3px 0 var(--teal-deep); }
@media (max-width: 880px) { .feature { grid-template-columns: 1fr; } .feature:nth-child(even) .feature-media { order: 0; } }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.shot { all: unset; cursor: zoom-in; display: block; position: relative; background: #000; box-shadow: 0 0 0 3px var(--line); }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .25s steps(4); }
.shot span { position: absolute; left: 10px; bottom: 10px; font: 600 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text); background: rgba(7, 6, 11, .82); padding: 6px 8px; }
.shot:hover img, .shot:focus-visible img { transform: scale(1.04); }
.shot:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
dialog.lightbox { padding: 0; border: 0; background: transparent; max-width: min(1280px, 94vw); width: 100%; color: var(--text); }
dialog.lightbox::backdrop { background: rgba(5, 4, 8, .9); }
dialog.lightbox img { width: 100%; box-shadow: 0 0 0 4px var(--line-2); background: #000; }
dialog.lightbox p { margin: 12px 0 0; text-align: center; font: 500 14px/1.4 var(--mono); color: var(--muted); }
dialog.lightbox button { position: absolute; top: -48px; right: 0; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; margin-bottom: clamp(48px, 7vw, 80px); background: var(--panel); --b: 3px; --bc: var(--line); margin-inline: 3px; }
.stat { padding: 22px 16px 20px; text-align: center; border-right: 2px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font: 400 clamp(22px, 2.6vw, 30px)/1.1 var(--display); color: var(--amber); }
.stat span { display: block; margin-top: 8px; font: 500 12px/1.35 var(--mono); color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(3, 1fr); } .stat:nth-child(3) { border-right: 0; } .stat:nth-child(-n+3) { border-bottom: 2px solid var(--line); } }
@media (max-width: 520px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat { border-right: 0; border-bottom: 2px solid var(--line); } .stat:nth-child(odd) { border-right: 2px solid var(--line); } }

/* exploded render layers */
.anatomy { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: center; margin-bottom: clamp(56px, 8vw, 96px); }
.stack { display: grid; place-items: center; min-height: 520px; perspective: 1600px; position: relative; }
.stack-scene { position: relative; width: min(560px, 82vw); aspect-ratio: 16 / 9; transform-style: preserve-3d; transform: rotateX(57deg) rotateZ(-36deg) translateZ(-60px); transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; transform: translateZ(calc(var(--i) * 44px)); transition: transform .9s cubic-bezier(.2, .7, .2, 1), outline-color .3s; outline: 2px solid rgba(239, 230, 212, .22); }
.layer.is-hot { outline-color: var(--teal); }
.stack.is-assembled .stack-scene { transform: none; }
.stack.is-assembled .layer { transform: none; outline-color: transparent; }
.layer-list { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 2px; counter-reset: layer 8; }
.layer-list li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: baseline; padding: 10px 12px; background: var(--panel); cursor: default; transition: background-color .15s; }
.layer-list li:hover, .layer-list li.is-hot { background: var(--panel-2); }
.layer-list li::before { counter-increment: layer -1; content: counter(layer, decimal-leading-zero); font: 600 12px/1 var(--mono); color: var(--teal); }
.layer-list b { font: 600 14.5px/1.3 var(--sans); color: var(--text); }
.layer-list span { display: block; font: 400 13.5px/1.45 var(--sans); color: var(--muted); }
@media (max-width: 960px) { .anatomy { grid-template-columns: 1fr; } .stack { min-height: 420px; } }
@media (max-width: 520px) { .stack { min-height: 300px; } .layer { transform: translateZ(calc(var(--i) * 26px)); } }

.tech { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.tech article { --b: 3px; --bc: var(--line); background: var(--panel); margin: 3px; padding: 24px 24px 26px; display: grid; gap: 10px; align-content: start; }
.tech h3 { font-size: 17px; color: var(--amber); display: flex; gap: 10px; align-items: center; }
.tech h3 i { width: 10px; height: 10px; background: var(--teal); flex: none; box-shadow: 3px 3px 0 var(--teal-deep); }
.tech p { margin: 0; color: var(--muted); font-size: 15.5px; }
.tech code { font: 500 .92em var(--mono); color: var(--text); background: #0d0a15; padding: 1px 5px; }
@media (max-width: 960px) { .tech { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .tech { grid-template-columns: 1fr; } }

/* controls */
.controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
.controls .card { --b: 3px; --bc: var(--line); background: var(--panel); margin: 3px; padding: 24px clamp(18px, 3vw, 30px) 26px; }
.controls h3 { font-size: 16px; color: var(--teal); margin-bottom: 14px; letter-spacing: .08em; }
.ctable { width: 100%; border-collapse: collapse; }
.ctable th { text-align: left; font: 600 14.5px/1.3 var(--sans); color: var(--text); padding: 10px 12px 10px 0; width: 42%; vertical-align: middle; }
.ctable td { padding: 7px 0; color: var(--muted); font: 500 13.5px/1.6 var(--mono); }
.ctable tr + tr { border-top: 2px solid #1d1629; }
.options { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.chip { font: 600 12.5px/1 var(--mono); letter-spacing: .05em; color: var(--text); background: var(--panel-2); padding: 10px 12px; box-shadow: inset 3px 0 0 var(--teal); }
@media (max-width: 1100px) { .controls { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .controls { grid-template-columns: 1fr; } }
.ctable .alt { color: var(--dim); font-size: 12px; }
.pad-note { color: var(--dim); }
@media (pointer: coarse) { .pad-note { display: none; } }

/* testing callout */
.callout { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; --b: 3px; --bc: var(--line); background: linear-gradient(90deg, #17112a, var(--panel)); margin: 56px 3px 0; padding: 28px clamp(20px, 4vw, 40px); }
.callout .bot { width: 92px; height: 92px; image-rendering: pixelated; }
.callout h3 { font-size: 20px; color: var(--teal); margin-bottom: 8px; }
.callout p { margin: 0; color: var(--muted); }
@media (max-width: 640px) { .callout { grid-template-columns: 1fr; } }

/* final CTA */
.finale { position: relative; isolation: isolate; overflow: hidden; padding: clamp(96px, 14vw, 170px) 0; text-align: center; }
.finale-bg { position: absolute; inset: 0; z-index: -2; background: #140b27 url(screens/ridge.png) center 60% / cover no-repeat; image-rendering: pixelated; image-rendering: crisp-edges; }
.finale::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--ink) 0%, rgba(7, 6, 11, .35) 30%, rgba(7, 6, 11, .45) 70%, var(--ink) 100%); }
.finale h2 { font-size: clamp(32px, 6vw, 68px); }
.finale p { margin: 18px auto 30px; max-width: 46ch; color: #f2e6d4; font-size: 19px; text-shadow: 0 2px 0 rgba(0, 0, 0, .7); }

footer { padding: 40px 0 56px; border-top: 2px solid var(--line); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 32px; align-items: center; font: 500 13.5px/1.6 var(--mono); color: var(--dim); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--amber-hi); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .stack-scene, .layer { transition: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* enemy roster */
.roster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: clamp(56px, 8vw, 96px); }
.foe { --b: 3px; --bc: var(--line); background: var(--panel); margin: 3px; display: grid; grid-template-rows: auto 1fr; }
.foe-sprites { display: flex; align-items: flex-end; justify-content: center; gap: 22px; height: 128px; padding: 18px 16px 20px; background: #0d0a15; box-shadow: inset 0 -3px 0 var(--line); }
.foe-sprites img { image-rendering: pixelated; image-rendering: crisp-edges; }
.foe-sprites figure { display: grid; justify-items: center; gap: 8px; }
.foe-sprites figcaption { font: 600 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.foe-body { padding: 18px 20px 22px; display: grid; gap: 8px; align-content: start; }
.foe h3 { font-size: 16px; }
.foe p { margin: 0; font-size: 14.5px; color: var(--muted); }
.foe .tell { font: 600 11.5px/1.35 var(--mono); color: var(--magenta); letter-spacing: .06em; text-transform: uppercase; }
@media (max-width: 1000px) { .roster { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .roster { grid-template-columns: 1fr; } }

/* small screens and touch devices */
.touch-only { display: none; }
@media (pointer: coarse) { .key-only { display: none; } .touch-only { display: inline; } }
@media (max-width: 640px) {
  .btn--big { padding: 15px 20px 17px; font-size: 16px; }
  .screen-overlay small { display: none; }
  .screen-tag { right: 10px; top: 10px; font-size: 10px; }
  .hero { padding-top: 104px; }
}
