/* Colours and type stacks come from the game (src/tokens.css), so the page looks like the menus. No web fonts: nothing loads from a third party. */
:root {
  --bg: #080d12; --panel: #10191c; --line: #c0c5b429; --line-strong: #58615a;
  --ink: #e6e1cf; --ink-2: #b9c0b0; --ink-3: #8f9a94;
  --amber: #c6a663; --amber-hi: #e5d5a2; --amber-btn: #be9c55;
  --impulse: #e9ce79; --heat: #dc8a59; --cryo: #79c8e7; --gravity: #af91dc;
  --font-display: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  --font-ui: "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1.0625rem/1.65 var(--font-ui); -webkit-text-size-adjust: 100%; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--amber-hi); text-underline-offset: .2em; }
a:hover { color: #fff3cc; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
h1, h2 { margin: 0; font-family: var(--font-display); font-weight: 400; line-height: 1.05; letter-spacing: .01em; }
h2 { font-size: clamp(2rem, 4.5vw, 3rem); color: var(--amber-hi); }
p { margin: 0 0 1em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Hero: the Steam library hero has dark sky on top and the crew right of centre, so the copy sits top left. */
/* Inline padding lines the copy up with the 1200px content column below. The height also follows the width (52vw), so the
   3:1 image keeps the whole crew in frame on mid-size screens and the trailer starts right after it. */
.hero { position: relative; isolation: isolate; min-height: clamp(520px, min(80svh, 52vw), 900px); padding: clamp(32px, 9vh, 112px) max(var(--gutter), calc((100% - 1200px) / 2 + var(--gutter))) 48px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 70% 100%; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #080d12e0 0, #080d1280 38%, #080d1200 62%), linear-gradient(0deg, var(--bg) 0, #080d1200 22%); }
.hero-copy { max-width: 36rem; }
.hero h1 img { width: min(560px, 100%); }
.tagline { margin: 1.5rem 0 2rem; font-size: clamp(1.125rem, 2vw, 1.3rem); line-height: 1.5; text-shadow: 0 1px 3px #000; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.btn { display: inline-block; padding: .8rem 1.4rem; border: 1px solid #c8ac75; border-bottom: 3px solid #78613b; background: var(--amber-btn); color: #141c1b; font-weight: 700; text-decoration: none;
  transition: translate .25s var(--ease), background-color .25s, box-shadow .25s; }
.btn:hover { background: #d1af67; color: #141c1b; translate: 0 -2px; box-shadow: 0 6px 24px #c6a66355; }
.btn:active { translate: 0 1px; box-shadow: none; }
.link-quiet { color: var(--ink); font-weight: 600; text-shadow: 0 1px 3px #000; }
/* Phones, tablets and narrow windows: below 1024px the text column would cover the crew, so the copy sits on the dark
   page and the image follows it: media/hero-crew.webp, the crew without the sky, with faded edges. */
@media (max-width: 1023px) {
  .hero { display: flex; flex-direction: column; min-height: 0; padding-bottom: 0; }
  .hero::after { content: none; }
  .hero picture { display: contents; }
  .hero-bg { position: static; order: 1; width: calc(100% + 2 * var(--gutter)); height: auto; margin: 8px calc(-1 * var(--gutter)) 0;
    mask-image: linear-gradient(#0000, #000 15%, #000 75%, #0000); }
  .tagline { margin: 1.25rem 0 1.5rem; }
}

/* clip: screenshots slide in from the right and must not widen the page while they wait. */
main { overflow-x: clip; }
main > section { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.trailer { position: relative; margin-top: clamp(-96px, -5vw, -32px); }
.trailer video { width: 100%; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line-strong); }

/* Each feature: copy on the left, a real screenshot on the right; stacked on narrow screens. */
.feature { display: grid; gap: 24px 48px; margin-top: clamp(64px, 10vw, 128px); }
.feature h2 { margin-bottom: .6em; }
.feature p { color: var(--ink-2); max-width: 38rem; }
/* Screenshots open in the preview dialog (site.js); without script the link just shows the image. */
.shot { display: block; overflow: hidden; border: 1px solid var(--line-strong); cursor: zoom-in; transition: border-color .25s, box-shadow .3s; }
.shot img { width: 100%; transition: scale .5s var(--ease); }
.shot:hover { border-color: var(--amber); box-shadow: 0 10px 30px #0008; }
.shot:hover img { scale: 1.02; }
@media (min-width: 900px) {
  .feature { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; }
}
.cartridges { margin: 0 0 1em; padding: 0; list-style: none; color: var(--ink-2); }
.cartridges li { position: relative; padding: .35rem 0 .35rem 1.1rem; }
.cartridges li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); box-shadow: 0 0 10px var(--c); transform-origin: 50% 100%; }
.cartridges b { color: var(--c); font-weight: 600; }

footer { width: min(100% - 2 * var(--gutter), 1200px - 2 * var(--gutter)); margin: clamp(80px, 12vw, 160px) auto 0; padding: 32px 0 48px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .9375rem; }
footer p { margin: 0 0 .5em; }
footer .contact { color: var(--ink); font-size: 1.0625rem; }

/* Legal page */
.legal { max-width: 46rem; margin: 0 auto; padding: 48px var(--gutter) 0; }
.legal h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); color: var(--amber-hi); margin: 1.5rem 0 1rem; }
.legal h2 { font-size: 1.75rem; margin: 2.5rem 0 .75rem; }
.legal h3 { margin: 1.75rem 0 .5rem; font-size: 1.0625rem; }
.legal p, .legal li { color: var(--ink-2); }

/* Press kit */
.press { max-width: 1200px; margin: 0 auto; padding: 48px var(--gutter) 0; }
.press > section { margin-top: clamp(56px, 8vw, 96px); padding: 0; }
.press .back img, .legal .back img { width: 220px; }
.press h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); color: var(--amber-hi); margin: 1.5rem 0 .75rem; }
.press h2 { margin-bottom: .5em; }
.press h3 { margin: 1.75rem 0 .5rem; font-size: 1.0625rem; }
.press .lead { max-width: 40rem; font-size: 1.2rem; color: var(--ink); }
.press p, .press li { color: var(--ink-2); max-width: 44rem; }
.press video { width: 100%; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line-strong); }
.press-intro { display: grid; gap: 32px 64px; }
@media (min-width: 900px) { .press-intro { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: start; } }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .6rem 1.5rem; margin: 0; padding: 1.5rem; border: 1px solid var(--line-strong); background: var(--panel); }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.file-note { color: var(--ink-3); font-size: .9375rem; margin-top: .75rem; }
.downloads { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 20px; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.downloads a { display: flex; flex-direction: column; gap: .6rem; height: 100%; padding: 10px 10px 14px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); text-decoration: none; font-size: .9375rem;
  transition: border-color .25s, translate .3s var(--ease), box-shadow .3s; }
.downloads img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #0c1418; transition: scale .5s var(--ease); }
.downloads img.icon { padding: 24px; }
.downloads small { display: block; color: var(--ink-3); }
.downloads a:hover { border-color: var(--amber); translate: 0 -3px; box-shadow: 0 10px 30px #0008; color: var(--amber-hi); }
.downloads a:hover img { scale: 1.03; }
.downloads a.zoom { cursor: zoom-in; }

/* Trailer play button (site.js): the whole poster is the button; the octagon echoes the optics in the logo. */
.player { position: relative; }
.player::before { content: ""; position: absolute; inset: 1px; z-index: 1; pointer-events: none; background: radial-gradient(circle, #080d1299 0, #080d1200 45%); transition: opacity .3s; }
.play { position: absolute; inset: 0; z-index: 2; width: 100%; border: 0; padding: 0; background: none; cursor: pointer; --s: clamp(64px, 9vw, 104px); transition: opacity .3s, visibility .3s; }
.play::before, .play::after { content: ""; position: absolute; inset: 0; margin: auto; transition: scale .3s var(--ease), background-color .3s; }
.play::before { width: var(--s); height: var(--s); background: var(--amber-btn); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.play::after { width: calc(var(--s) * .32); height: calc(var(--s) * .38); translate: 12% 0; background: #141c1b; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.play:hover::before { background: #d1af67; scale: 1.08; }
.play:hover::after { scale: 1.08; }
.play:focus-visible { outline-offset: -6px; }
.player.playing::before { opacity: 0; }
.player.playing .play { opacity: 0; visibility: hidden; }

/* Image preview: a native modal dialog, closed by Escape, a click anywhere or the close button. */
html:has(.lightbox[open]) { overflow: hidden; }
.lightbox { max-width: 96vw; max-height: 96vh; padding: 0; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); overflow: hidden; }
.lightbox::backdrop { background: #04070ad9; backdrop-filter: blur(6px); }
.lightbox img { max-width: min(96vw, 1920px); max-height: calc(96vh - 3.5rem); margin: 0 auto; cursor: zoom-out; }
.lightbox p { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; margin: 0; padding: .7rem 1rem; font-size: .9375rem; }
.lightbox span { flex: 1; color: var(--ink-2); }
.lightbox button { padding: .35rem .9rem; border: 1px solid var(--line-strong); background: var(--panel-raised, #172321); color: var(--ink); font: inherit; cursor: pointer; }
.lightbox button:hover { border-color: var(--amber); }

/* Motion. Everything here only moves transform/opacity, and nothing moves for people who ask for reduced motion.
   Scroll reveals need the "motion" class, which a head script sets only when IntersectionObserver exists. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .hero-bg { animation: hero-in 1.8s var(--ease) both; }
  /* The logo lands like a robot dropping onto the pad, then hovers like the crew does in the game. */
  .hero h1 { animation: land 1s .15s cubic-bezier(.3, 1.35, .5, 1) both, hover 5s 1.4s ease-in-out infinite; }
  .tagline { animation: rise .8s .55s var(--ease) both; }
  .actions { animation: rise .8s .7s var(--ease) both; }

  .motion .reveal > * { opacity: 0; translate: 0 40px; transition: opacity .9s var(--ease), translate .9s var(--ease); }
  .motion .feature.reveal > .shot { translate: 64px 0; scale: .97; transition: opacity .9s .12s var(--ease), translate .9s .12s var(--ease), scale .9s .12s var(--ease); }
  .motion .reveal.in > *, .motion .feature.reveal.in > .shot { opacity: 1; translate: 0 0; scale: 1; }
  /* Cartridge bars charge up one after another once their section is in view. */
  .motion .cartridges li::before { scale: 1 0; transition: scale .6s var(--ease); }
  .motion .reveal.in .cartridges li::before { scale: 1 1; }
  .motion .reveal.in .cartridges li:nth-child(1)::before { transition-delay: .5s; }
  .motion .reveal.in .cartridges li:nth-child(2)::before { transition-delay: .62s; }
  .motion .reveal.in .cartridges li:nth-child(3)::before { transition-delay: .74s; }
  .motion .reveal.in .cartridges li:nth-child(4)::before { transition-delay: .86s; }

  /* Parallax where the browser can tie an animation to scrolling (no script, no scroll handler); not on the stacked phone layout. */
  @media (min-width: 1024px) {
    @supports (animation-timeline: scroll()) {
      .hero-bg { animation: hero-in 1.8s var(--ease) both, drift linear both; animation-timeline: auto, scroll(root); animation-range: normal, 0 100vh; }
    }
  }

  .play::before { animation: beckon 2.4s ease-in-out infinite; }
  .play:hover::before { animation: none; }
  .lightbox, .lightbox::backdrop { opacity: 0; transition: opacity .3s var(--ease), scale .3s var(--ease), overlay .3s allow-discrete, display .3s allow-discrete; }
  .lightbox { scale: .96; }
  .lightbox[open], .lightbox[open]::backdrop { opacity: 1; scale: 1; }
  @starting-style { .lightbox[open], .lightbox[open]::backdrop { opacity: 0; scale: .96; } }
}
@keyframes hero-in { from { opacity: 0; scale: 1.08; } }
@keyframes drift { to { translate: 0 18%; } }
@keyframes land { 0% { opacity: 0; translate: 0 -70px; } 45% { opacity: 1; } 100% { translate: 0 0; } }
@keyframes hover { 50% { translate: 0 -5px; } }
@keyframes beckon { 50% { scale: 1.06; background-color: #d1af67; } }
@keyframes rise { from { opacity: 0; translate: 0 16px; } }
