/* Stackyard — landing page.
   Everything is drawn on a pixel grid: every sprite is nearest-neighbour art
   sized as native x one of the integer scales declared in :root, never a
   fractional one. Colours are the game's own palette, straight from
   tools/sprites/palette.py. */

/* Three subsets per family. A Portuguese reader downloads the Latin file and
   nothing else; the Cyrillic one only loads for a reader who needs it. */
@font-face {
  font-family: "HC Display";
  src: url("/media/press-start-2p-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "HC Display";
  src: url("/media/press-start-2p-latin-ext.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: "HC Display";
  src: url("/media/press-start-2p-cyrillic.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "HC Body";
  src: url("/media/pixelify-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "HC Body";
  src: url("/media/pixelify-sans-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: "HC Body";
  src: url("/media/pixelify-sans-cyrillic.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  /* palette */
  --ink: #3a2a34;
  --void: #060f1a;
  --night: #0a1b2c;
  --steel-d: #5e5a68;
  --steel: #827e8a;
  --steel-l: #aaa6b0;
  --amber-d: #c68628;
  --amber: #eeb03e;
  --amber-l: #fcd474;
  --cream: #e8e2d0;
  --paper-ink: #3a3028;
  --leaf: #5c9458;

  /* Integer scales. Every sprite is drawn at native size times one of these,
     so a source pixel is always a whole number of screen pixels.
     --s art · --k chrome · --ls wordmark · --ai card art · --ds small props
     --ws water and road · --bs the ship · --sk the skyline · --m marks */
  --s: 3;
  --k: 3;
  --ls: 1;
  --ai: 1;
  --ds: 2;
  --ws: 3;
  --bs: 1;
  --sk: 1;
  --m: 2;

  /* Room the hero must leave under its content: the water band, the ship that
     rides it and the skyline behind both, so none of the three ever share
     space with the copy. */
  --sea-h: calc(var(--ws) * 32px);
  --sea-room: calc(var(--sea-h) + var(--bs) * 70px);
  --gutter: 20px;
  --wide: 1120px;

  /* How far each parallax layer is pushed, written by script.js. */
  --sky-y: 0px;
  --skyline-y: 0px;
  --sway: 0px;

  /* The crane lockup, in source pixels, as printed by `gen_lockup()` in
     tools/sprites/gen_landing.py. --lk-rope is where the falls leave the
     trolley and --lk-drop how far the word is lowered before the lift. */
  --lk-w: 339;
  --lk-h: 186;
  --lk-rope: 39;
  --lk-drop: 10;
  --u: calc(var(--ls) * 1px);
}

@media (min-width: 700px) {
  :root { --s: 4; --k: 3; --ls: 2; --ds: 3; --bs: 2; --sk: 2; --gutter: 32px; }
}

@media (min-width: 1080px) {
  :root {
    --s: 5; --k: 4; --ai: 2; --ws: 4; --gutter: 40px;
    /* The ship may sail behind the last line of copy here: the crane took the
       height its funnel used to have to itself. */
    --sea-room: calc(var(--sea-h) + var(--bs) * 38px);
  }
}

@media (min-width: 1400px) {
  :root { --wide: 1240px; }
}

/* The lockup is mostly title, so its scale answers to the height of the
   window as well: one step too many and the call to action leaves the first
   screen. */
@media (min-width: 1500px) and (min-height: 1120px) {
  :root { --ls: 3; }
}

* { box-sizing: border-box; }

html {
  background: var(--void);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 300px;
  overflow-x: hidden;
  color: var(--cream);
  background: var(--night);
  font-family: "HC Body", ui-monospace, "Courier New", monospace;
  font-size: clamp(16px, 1.1rem + 0.2vw, 21px);
  line-height: 1.55;
  -webkit-font-smoothing: none;
  text-rendering: geometricPrecision;
}

img {
  display: block;
  image-rendering: pixelated;
}

a { color: inherit; }

a,
button { -webkit-tap-highlight-color: transparent; }

::selection {
  color: var(--void);
  background: var(--amber-l);
}

:focus-visible {
  outline: 3px solid var(--amber-l);
  outline-offset: 3px;
}

h1, h2, h3 {
  margin: 0;
  font-family: "HC Display", "HC Body", monospace;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.skip {
  position: fixed;
  z-index: 90;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: var(--void);
  background: var(--amber-l);
  border: 3px solid var(--ink);
  font-family: "HC Display", monospace;
  font-size: 11px;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:focus { transform: translateY(0); }

/* ----------------------------------------------------------------- marks */
/* Play, chevron, diamond, arrow, tick and cross, drawn as pixels and worn as a
   mask so each one picks up the colour of the text it sits in. */
.mark {
  display: inline-block;
  flex: none;
  width: calc(var(--m) * 8px);
  height: calc(var(--m) * 8px);
  vertical-align: middle;
  background-color: currentColor;
  -webkit-mask: url("/media/marks.png") no-repeat 0 0 / calc(var(--m) * 48px) calc(var(--m) * 8px);
  mask: url("/media/marks.png") no-repeat 0 0 / calc(var(--m) * 48px) calc(var(--m) * 8px);
}

.m-down { -webkit-mask-position: calc(var(--m) * -8px) 0; mask-position: calc(var(--m) * -8px) 0; }
.m-dia { -webkit-mask-position: calc(var(--m) * -16px) 0; mask-position: calc(var(--m) * -16px) 0; }
.m-out { -webkit-mask-position: calc(var(--m) * -24px) 0; mask-position: calc(var(--m) * -24px) 0; }
.m-check { -webkit-mask-position: calc(var(--m) * -32px) 0; mask-position: calc(var(--m) * -32px) 0; }
.m-cross { -webkit-mask-position: calc(var(--m) * -40px) 0; mask-position: calc(var(--m) * -40px) 0; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  border: solid transparent;
  border-width: calc(var(--k) * 5px);
  border-image: url("/media/btn.png") 5 fill / calc(var(--k) * 5px) repeat;
  color: #2a1d10;
  font-family: "HC Display", monospace;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.45);
  transition: transform 90ms steps(2), filter 120ms linear;
}

.btn .mark { color: #7a4a14; }

.btn:hover { filter: brightness(1.12); }

.btn:active { transform: translateY(calc(var(--k) * 1px)); }

.btn-sm {
  border-width: calc(var(--k) * 4px);
  border-image-width: calc(var(--k) * 4px);
  padding: 0 2px;
  font-size: 11px;
}

.btn-lg {
  position: relative;
  padding: 0 6px;
  font-size: clamp(13px, 3.1vw, 18px);
  box-shadow: 0 calc(var(--k) * 2px) 0 rgba(6, 15, 26, 0.55);
}

/* The lamp under the main call to action: it is the one thing on the page
   that should look plugged in. */
.btn-lg::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: calc(var(--k) * -5px);
  background: radial-gradient(closest-side, rgba(238, 176, 62, 0.5), transparent);
  animation: lamp 3.6s ease-in-out infinite;
}

/* ------------------------------------------------------------------- HUD */
.hud {
  position: fixed;
  z-index: 60;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 58px;
  padding-right: max(12px, env(safe-area-inset-right));
  padding-left: max(12px, env(safe-area-inset-left));
  background: linear-gradient(#0d2135, #081827);
  border-bottom: 3px solid var(--ink);
  box-shadow: 0 3px 0 rgba(238, 176, 62, 0.35), 0 8px 24px rgba(0, 0, 0, 0.5);
}

.hud-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: "HC Display", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--amber-l);
  text-decoration: none;
}

.hud-brand img { width: 28px; height: 30px; }

.hud-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-state {
  display: none;
  gap: 8px;
  align-items: center;
  margin: 0;
  font-family: "HC Display", monospace;
  font-size: 9px;
  color: var(--steel-l);
  letter-spacing: 0.08em;
}

.hud-state i {
  width: 8px;
  height: 8px;
  background: var(--leaf);
  box-shadow: 0 0 8px var(--leaf);
  animation: blink 2.4s steps(1) infinite;
}

@media (min-width: 700px) {
  .hud { height: 66px; }
  .hud-brand { font-size: 14px; }
  .hud-state { display: inline-flex; }
}

/* ------------------------------------------------------------ language */
.lang { position: relative; }

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 7px 8px;
  color: var(--amber-l);
  background: rgba(6, 15, 26, 0.72);
  border: 2px solid var(--steel-d);
  font-family: "HC Display", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 120ms linear, color 120ms linear;
}

.lang-btn:hover { border-color: var(--amber-d); }

.lang-btn .mark { --m: 1; }

.lang-btn[aria-expanded="true"] {
  color: var(--void);
  background: var(--amber);
  border-color: var(--amber-l);
}

.lang-list {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  min-width: 190px;
  max-height: min(62vh, 460px);
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #0d2135;
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 2px rgba(238, 176, 62, 0.4), 0 12px 28px rgba(0, 0, 0, 0.6);
}

.lang-list[hidden] { display: none; }

.lang-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 10px;
  color: #cbd6e2;
  cursor: pointer;
  font-size: 0.86em;
}

.lang-list b {
  min-width: 2.4em;
  color: var(--steel-l);
  font-family: "HC Display", monospace;
  font-size: 9px;
  font-weight: 400;
}

.lang-list li:hover,
.lang-list li:focus-visible {
  color: var(--void);
  background: var(--amber);
  outline: none;
}

.lang-list li:hover b,
.lang-list li:focus-visible b { color: #7a4a14; }

.lang-list li[aria-selected="true"] {
  color: var(--amber-l);
  box-shadow: inset 3px 0 0 var(--amber);
}

.lang-list li[aria-selected="true"]:hover { color: var(--void); }

/* ------------------------------------------------------------------ HERO */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: 80px var(--gutter) var(--sea-room);
  overflow: hidden;
  isolation: isolate;
}

.hero-sky {
  position: absolute;
  inset: -60px 0 0;
  z-index: -4;
  background-image: url("/media/port-strip.png");
  background-repeat: repeat;
  /* Exactly twice the 640x720 source, and drawn nearest-neighbour: the whole
     page is built on whole source pixels, and the backdrop was the one layer
     the browser was allowed to interpolate. */
  background-size: 1280px 1440px;
  image-rendering: pixelated;
  background-position: center 0;
  transform: translate3d(var(--sway), var(--sky-y), 0);
  animation: drift 120s linear infinite alternate;
}

/* Night grade, vignette and CRT lines, in that order. */
.hero-grade {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(4, 10, 18, 0.34) 0 2px, transparent 2px 4px),
    radial-gradient(78% 58% at 50% 40%, rgba(5, 13, 23, 0.68) 0%, rgba(5, 13, 23, 0.34) 46%, transparent 72%),
    radial-gradient(130% 84% at 50% 42%, transparent 16%, rgba(4, 12, 22, 0.8) 78%),
    linear-gradient(180deg, rgba(8, 20, 34, 0.86) 0%, rgba(8, 20, 34, 0.42) 34%, rgba(6, 15, 26, 0.9) 100%);
}

/* The middle distance: gantries, sheds and light masts, tiled and moved at
   their own rate so the mirrored backdrop behind them stops reading as one
   symmetrical wall on a wide screen. */
.hero-skyline {
  position: absolute;
  z-index: -3;
  inset: auto 0 calc(var(--sea-h) - var(--sk) * 6px);
  height: calc(var(--sk) * 120px);
  pointer-events: none;
  transform: translate3d(calc(var(--sway) * 2.4), var(--skyline-y), 0);
}

.hero-skyline i {
  display: block;
  height: 100%;
  background: url("/media/skyline.png") 0 100% / calc(var(--sk) * 320px) calc(var(--sk) * 120px) repeat-x;
  image-rendering: pixelated;
  opacity: 0.95;
  animation: creep 90s linear infinite;
}

.sky-traffic {
  position: absolute;
  inset: 58px 0 auto;
  z-index: -1;
  height: 46%;
  pointer-events: none;
}

.gull {
  position: absolute;
  display: block;
  width: calc(var(--s) * 16px);
  height: calc(var(--s) * 16px);
  background: url("/media/seagull.png") 0 0 / calc(var(--s) * 64px) calc(var(--s) * 16px);
  image-rendering: pixelated;
  animation: flap 0.5s steps(4) infinite, cross-r 26s linear infinite;
}

.gull-1 { top: 14%; animation-duration: 0.5s, 26s; animation-delay: 0s, -4s; }
.gull-2 { top: 32%; animation-duration: 0.42s, 34s; animation-delay: 0s, -17s; }
.gull-3 { top: 6%; animation-duration: 0.6s, 44s; animation-delay: 0s, -30s; }

.hero-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: var(--wide);
  text-align: center;
}

/* ---------------------------------------------------------------- LOCKUP */
/* A whole ship-to-shore crane with the title on its spreader. Everything is
   placed in source pixels times --u, and everything that moves moves by whole
   source pixels, in steps. */
.lockup {
  position: relative;
  flex: none;
  width: calc(var(--lk-w) * var(--u));
  height: calc(var(--lk-h) * var(--u));
  /* 339px at phone scale: on a 360px screen it borrows from the gutter rather
     than shrinking the one thing the page is here to say. */
  margin: 0 calc(var(--gutter) * -0.7);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* The crane stands to the left of what it lifts, so the box is shifted until
   the word, not the steel, is on the page's centre line — where there is room. */
@media (min-width: 700px) {
  .lockup { left: calc(-14 * var(--u)); }
}

.lockup i { image-rendering: pixelated; }

.lk-frame {
  position: absolute;
  inset: 0;
  background: url("/media/sts-frame.png") 0 0 / 100% 100% no-repeat;
  filter: drop-shadow(0 calc(var(--u) * 2) 0 rgba(6, 15, 26, 0.6));
}

/* The aircraft warning light on the boom tip. */
.lk-beacon {
  position: absolute;
  left: calc(333 * var(--u));
  top: calc(12 * var(--u));
  width: var(--u);
  height: var(--u);
  background: #ff5c4e;
  box-shadow: 0 0 calc(var(--u) * 3) calc(var(--u) * 1) rgba(255, 92, 78, 0.85);
  animation: blink 1.8s steps(1) infinite;
}

.lk-trolley {
  position: absolute;
  left: calc(170 * var(--u));
  top: calc(26 * var(--u));
  width: calc(27 * var(--u));
  height: calc(14 * var(--u));
  background: url("/media/sts-trolley.png") 0 0 / 100% 100% no-repeat;
}

/* The falls are far longer than they need to be and the shaft cuts them off at
   the trolley, so one transform on the load is the whole hoist: the ropes pay
   out and take up without being animated at all. */
.lk-shaft {
  position: absolute;
  inset: calc(var(--lk-rope) * var(--u)) 0 0;
  clip-path: inset(0 -60px -60px -60px);
}

.lk-load {
  position: absolute;
  inset: 0;
  animation:
    lift 1500ms steps(10) 350ms both,
    bob 8s steps(1) 4s infinite;
}

.lockup.is-working .lk-load { animation: relift 1700ms linear both; }

.lk-rope {
  position: absolute;
  top: calc(-70 * var(--u));
  width: calc(7 * var(--u));
  height: calc(78 * var(--u));
  background: repeating-linear-gradient(90deg,
    #1a121e 0 calc(1 * var(--u)), #bec6d4 0 calc(2 * var(--u)),
    #1a121e 0 calc(3 * var(--u)), transparent 0 calc(4 * var(--u)));
}

.lk-rope-l { left: calc(173 * var(--u)); }
.lk-rope-r { left: calc(187 * var(--u)); }

.lk-spreader {
  position: absolute;
  left: calc(60 * var(--u));
  top: calc(8 * var(--u));
  width: calc(247 * var(--u));
  height: calc(9 * var(--u));
  background: url("/media/sts-spreader.png") 0 0 / 100% 100% no-repeat;
}

.wordmark {
  position: absolute;
  left: calc(40 * var(--u));
  top: calc(14 * var(--u));
  line-height: 0;
}

/* The brand logo itself, the one illustrated image up here: sized in crane
   pixels so it sits in the twistlocks, and left to the browser to resample. */
.wordmark img {
  width: calc(287 * var(--u));
  height: auto;
  max-width: none;
  filter: drop-shadow(0 0 calc(var(--s) * 4px) rgba(238, 176, 62, 0.3));
}

/* What a click on the crane earns: the game's own verb, once, for free. */
.pop {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  color: var(--amber-l);
  font-family: "HC Display", monospace;
  font-size: clamp(10px, 2.6vw, 16px);
  white-space: nowrap;
  text-shadow: 2px 2px 0 #1a121e, -2px 0 0 #1a121e, 0 -2px 0 #1a121e;
  animation: pop 800ms steps(8) both;
}

/* The copy waits for the lift, then lands a line at a time. */
.hero-stage > .tagline,
.hero-stage > .pitch,
.hero-stage > .btn,
.hero-stage > .tags,
.hero-stage > .cue { animation: land 420ms steps(4) backwards; }

.hero-stage > .tagline { animation-delay: 1500ms; }
.hero-stage > .pitch { animation-delay: 1650ms; }
.hero-stage > .btn { animation-delay: 1800ms; }
.hero-stage > .tags { animation-delay: 1950ms; }
.hero-stage > .cue { animation-delay: 2100ms; }

/* A short window keeps the button, not the hint that there is more below. */
@media (max-height: 1000px) and (min-width: 700px) {
  .hero-stage > .cue,
  .hero-stage > .tags { display: none; }
}

.tagline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: "HC Display", monospace;
  font-size: clamp(9px, 2.4vw, 15px);
  letter-spacing: 0.12em;
  color: var(--amber-l);
}

.tagline i {
  width: clamp(24px, 8vw, 120px);
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--amber-d) 0 6px, transparent 6px 12px);
}

.pitch {
  max-width: 34ch;
  margin: 0;
  color: #dde5ee;
  text-shadow: 0 2px 0 rgba(6, 15, 26, 0.9);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 6px 10px;
  color: var(--steel-l);
  background: rgba(10, 24, 40, 0.8);
  border: 2px solid var(--steel-d);
  box-shadow: 3px 3px 0 rgba(6, 15, 26, 0.65);
  font-family: "HC Display", monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
}

@media (min-width: 1080px) {
  .hero-stage { gap: 24px; }
  .pitch { max-width: 44ch; font-size: 1.12em; }
  .tags li { font-size: 10px; padding: 8px 12px; }
}

/* the sea band and the ship that crosses it */
.sea {
  position: absolute;
  inset: auto 0 0;
  z-index: 0;
  height: var(--sea-h);
  pointer-events: none;
}

.sea-water {
  position: absolute;
  inset: 0;
  background: url("/media/water.png") 0 0 / calc(var(--ws) * 64px) calc(var(--ws) * 32px) repeat;
  image-rendering: pixelated;
  border-top: calc(var(--ws) * 1px) solid rgba(226, 240, 240, 0.55);
  box-shadow: inset 0 calc(var(--ws) * 3px) 0 rgba(226, 240, 240, 0.14);
  animation: swell 9s linear infinite;
}

/* the far side of the channel falls away into the dark */
.sea-water::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 15, 26, 0) 0%, rgba(6, 15, 26, 0.5) 100%);
}

/* A three-frame strip: bow wave, wash and funnel smoke are stepped, never
   cross-faded, because a pixel ship with soft edges is not a pixel ship. */
.boat {
  position: absolute;
  z-index: 1;
  bottom: calc(var(--ws) * 10px);
  left: 0;
  display: block;
  width: calc(var(--bs) * 228px);
  height: calc(var(--bs) * 104px);
  background: url("/media/ship-side.png") 0 0 / calc(var(--bs) * 684px) calc(var(--bs) * 104px);
  image-rendering: pixelated;
  filter: drop-shadow(0 calc(var(--bs) * 2px) 0 rgba(6, 15, 26, 0.55));
  animation: sail 62s linear infinite, chug 0.66s steps(3) infinite;
}

.cue {
  display: inline-flex;
  margin-top: 6px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--steel-l);
  background: rgba(6, 15, 26, 0.72);
  border: 2px solid var(--steel-d);
  font-family: "HC Display", monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: color 140ms linear, border-color 140ms linear;
}

.cue:hover { color: var(--amber-l); border-color: var(--amber-d); }

.cue .mark { --m: 1; animation: nudge 1.6s steps(2) infinite; }

/* ---------------------------------------------------------------- TICKER */
.wire {
  position: relative;
  overflow: hidden;
  background: var(--void);
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
}

.wire-tape {
  display: flex;
  width: max-content;
  padding: 9px 0;
  background: #07131f;
  border-bottom: 2px solid rgba(238, 176, 62, 0.35);
  animation: tape 42s linear infinite;
}

.wire-tape .mark { --m: 1; margin: 0 0.5em; color: var(--amber-d); }

.wire-tape p {
  display: flex;
  align-items: center;
  margin: 0;
  padding-right: 1em;
  white-space: nowrap;
  color: var(--amber);
  font-family: "HC Display", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.road {
  position: relative;
  height: calc(var(--ws) * 44px);
  background: url("/media/road.png") 0 0 / calc(var(--ws) * 64px) calc(var(--ws) * 44px) repeat-x;
  image-rendering: pixelated;
  overflow: hidden;
}

.rig {
  position: absolute;
  display: block;
  width: calc(var(--ws) * 65px);
  height: calc(var(--ws) * 18px);
  background-image: url("/media/truck.png");
  background-size: calc(var(--ws) * 195px) calc(var(--ws) * 18px);
  image-rendering: pixelated;
}

/* Two lanes, and every rig in a lane runs at the same speed with its delay
   spread evenly across the loop. They used to have a duration each, which
   meant the faster ones drove straight through the slower ones. */
.rig-1,
.rig-3,
.rig-5 {
  top: calc(var(--ws) * 4px);
  animation: haul-r 22s linear infinite;
}

.rig-2,
.rig-4 {
  top: calc(var(--ws) * 24px);
  animation: haul-l 27s linear infinite;
}

.rig-1 { background-position: 0 0; }
.rig-3 { background-position: calc(var(--ws) * -130px) 0; animation-delay: -7.33s; }
.rig-5 { background-position: calc(var(--ws) * -65px) 0; animation-delay: -14.66s; }
.rig-2 { background-position: calc(var(--ws) * -65px) 0; }
.rig-4 { background-position: 0 0; animation-delay: -13.5s; }

/* ------------------------------------------------------------- SECTIONS */
.bay,
.yard,
.manifest,
.berth {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(38px, 4vw, 60px) var(--gutter);
}


.bay h2,
.yard h2,
.manifest h2,
.berth h2 {
  font-size: clamp(14px, 3.6vw, 20px);
  line-height: 1.75;
  text-shadow: 0 2px 0 rgba(6, 15, 26, 0.8);
}


@media (min-width: 1080px) {
  .bay h2,
  .yard h2,
  .manifest h2,
  .berth h2 { font-size: clamp(17px, 1.7vw, 23px); }
}

.steps,
.cards {
  display: grid;
  gap: clamp(20px, 3vw, 30px);
  margin: clamp(24px, 3vw, 36px) 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 860px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

.panel {
  border: solid transparent;
  border-width: calc(var(--k) * 6px);
  border-image: url("/media/panel.png") 6 fill / calc(var(--k) * 6px) repeat;
  box-shadow: 0 calc(var(--k) * 2px) 0 rgba(6, 15, 26, 0.7);
}

.step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 160ms steps(3), box-shadow 160ms steps(3);
}

.step-num {
  position: absolute;
  top: calc(var(--k) * -4px);
  left: calc(var(--k) * -4px);
  padding: 5px 8px;
  color: var(--void);
  background: var(--amber);
  border: 2px solid var(--ink);
  font-family: "HC Display", monospace;
  font-size: 11px;
}

.step-art {
  position: relative;
  display: block;
  width: 100%;
  height: calc(var(--ai) * 104px);
  background-repeat: no-repeat;
  background-position: center bottom;
  image-rendering: pixelated;
  filter: drop-shadow(0 calc(var(--ai) * 3px) 0 rgba(6, 15, 26, 0.55));
}

/* The feeder: the hero ship's little sister, same drawing routine, three bays
   instead of six, so it fits a card without being scaled off the grid. The
   sprite lives on an inner element because a strip animated by
   `background-position` cannot also be centred by one. */
.art-ship i {
  display: block;
  width: calc(var(--ai) * 150px);
  height: calc(var(--ai) * 104px);
  max-width: 100%;
  margin: 0 auto;
  background: url("/media/ship-feeder.png") 0 0 / calc(var(--ai) * 450px) calc(var(--ai) * 104px);
  image-rendering: pixelated;
  animation: chug-card 0.66s steps(3) infinite;
}

.art-crane {
  background-image: url("/media/crane.png");
  background-size: calc(var(--ai) * 56px) calc(var(--ai) * 66px);
  background-position: center bottom;
}

/* The box on the hook, running the lift the card is describing. The sprite's
   boom reaches out to the left over the water, so the box hangs 22 source
   pixels left of the crane's centre rather than under its legs. */
.art-crane i {
  position: absolute;
  left: 50%;
  bottom: calc(var(--ai) * 2px);
  width: calc(var(--ai) * 24px);
  height: calc(var(--ai) * 13px);
  margin-left: calc(var(--ai) * -22px);
  background: url("/media/containers.png") calc(var(--ai) * -48px) 0 / calc(var(--ai) * 192px) calc(var(--ai) * 13px);
  image-rendering: pixelated;
  animation: hoist 4.2s steps(6) infinite;
}

.art-map {
  background-image: url("/media/world-map.png");
  /* The chart is authored at 288x144: 1:1 on desktop, an exact half on a phone. */
  background-size: calc(var(--ai) * 144px) calc(var(--ai) * 72px);
  background-position: center 40%;
  filter: saturate(0.82) brightness(0.94) drop-shadow(0 calc(var(--ai) * 3px) 0 rgba(6, 15, 26, 0.55));
}

.step h3 {
  margin: 18px 0 10px;
  color: var(--amber-l);
  font-size: clamp(12px, 3.1vw, 15px);
}

.step p,
.card p {
  margin: 0;
  color: #c3cedb;
  font-size: 0.94em;
}

/* --------------------------------------------------------------- SHOTS */
.shots {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(38px, 4vw, 60px);
}

.shots h2 {
  font-size: clamp(14px, 3.6vw, 20px);
  line-height: 1.75;
  text-shadow: 0 2px 0 rgba(6, 15, 26, 0.8);
}

@media (min-width: 1080px) {
  .shots h2 { font-size: clamp(17px, 1.7vw, 23px); }
}

/* A strip you drag on a phone and three monitors on a desk. The frames are the
   panel chrome, so a capture sits in the page the way a card does. */
.reel {
  display: flex;
  gap: clamp(16px, 2.4vw, 28px);
  margin: clamp(24px, 3vw, 36px) calc(var(--gutter) * -1) 0;
  padding: 6px var(--gutter) 18px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.reel::-webkit-scrollbar { display: none; }

.shot {
  position: relative;
  flex: none;
  width: min(74vw, 340px);
  scroll-snap-align: center;
  border: solid transparent;
  border-width: calc(var(--k) * 4px);
  border-image: url("/media/panel.png") 6 fill / calc(var(--k) * 4px) repeat;
  box-shadow: 0 calc(var(--k) * 2px) 0 rgba(6, 15, 26, 0.7);
}

.shot img {
  width: 100%;
  height: auto;
  image-rendering: auto;
}

/* Scanlines, so three photographs belong to a page drawn in pixels. */
.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(4, 10, 18, 0.16) 0 2px, transparent 2px 4px);
}

@media (min-width: 860px) {
  .reel {
    justify-content: center;
    margin-right: 0;
    margin-left: 0;
    padding-right: 0;
    padding-left: 0;
    overflow: visible;
  }

  .shot { flex: 1 1 0; width: auto; max-width: 380px; }
  .shot.seen:nth-child(1) { transform: rotate(-2deg) translateY(10px); }
  .shot.seen:nth-child(3) { transform: rotate(2deg) translateY(10px); }
  .shot.seen:nth-child(2) { z-index: 1; }
}

@media (hover: hover) and (pointer: fine) {
  .shot.seen { transition: transform 160ms steps(3), box-shadow 160ms steps(3); }

  .shot.seen:hover {
    z-index: 2;
    transform: translateY(calc(var(--k) * -3px)) scale(1.03);
    box-shadow: 0 calc(var(--k) * 5px) 0 rgba(6, 15, 26, 0.75);
  }
}

/* ---------------------------------------------------------------- YARD */
.yard { padding-top: 0; }

@media (min-width: 620px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1080px) {
  .cards { grid-template-columns: repeat(4, 1fr); gap: 22px; }
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 160ms steps(3), box-shadow 160ms steps(3);
}

.card h3 {
  margin: 0;
  color: var(--amber-l);
  font-size: clamp(11px, 2.6vw, 13px);
  line-height: 1.6;
}

.chip {
  display: block;
  width: calc(var(--ds) * 16px);
  height: calc(var(--ds) * 16px);
  background-image: url("/media/chips.png");
  background-size: calc(var(--ds) * 80px) calc(var(--ds) * 16px);
  image-rendering: pixelated;
}

.chip-globe { background-position: calc(var(--ds) * -16px) 0; }
.chip-coin { background-position: calc(var(--ds) * -32px) 0; }
.chip-box { background-position: calc(var(--ds) * -48px) 0; }
.chip-cat { background-position: calc(var(--ds) * -64px) 0; }

/* Lift on hover, on pointers that can hover. A card that jumps under a thumb
   is a card that looks broken. */
@media (hover: hover) and (pointer: fine) {
  .step:hover,
  .card:hover {
    transform: translateY(calc(var(--k) * -2px));
    box-shadow: 0 calc(var(--k) * 4px) 0 rgba(6, 15, 26, 0.75);
  }
}

/* -------------------------------------------------------------- MANIFEST */
.board {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  padding: 6px 4px 10px;
  color: var(--paper-ink);
  border: solid transparent;
  border-width: calc(var(--k) * 6px);
  border-image: url("/media/board.png") 6 fill / calc(var(--k) * 6px) repeat;
  box-shadow: 0 calc(var(--k) * 2px) 0 rgba(6, 15, 26, 0.7);
}

.board h2 {
  color: #2c2318;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.35);
}

.board-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 0;
}

.stamp {
  padding: 6px 8px;
  color: #b3392f;
  border: 3px solid #b3392f;
  font-family: "HC Display", monospace;
  font-size: 9px;
  opacity: 0.75;
  transform: rotate(-8deg);
}


.rules {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.rules li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px dashed rgba(90, 78, 60, 0.45);
  font-size: 0.98em;
}

.rules li:last-child { border-bottom: 0; }

.rules .mark {
  margin-top: 0.42em;
  color: #b3392f;
}

.rules li:nth-child(n+3) .mark { color: #3d7a42; }

.cat {
  display: block;
  flex: none;
  width: calc(var(--ds) * 14px);
  height: calc(var(--ds) * 12px);
  background: url("/media/cat.png") 0 0 / calc(var(--ds) * 28px) calc(var(--ds) * 12px);
  image-rendering: pixelated;
  animation: tail 2.2s steps(2) infinite;
}

/* ------------------------------------------------------------------- CTA */
.berth { padding-bottom: clamp(64px, 8vw, 104px); }

.cabinet {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) 12px clamp(24px, 4vw, 44px);
  text-align: center;
  overflow: hidden;
}

.coin {
  margin: 0;
  color: var(--amber-l);
  font-family: "HC Display", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  animation: blink 1.2s steps(1) infinite;
}

.cabinet p:not(.coin) {
  margin: 0;
  color: #c3cedb;
}

/* Six boxes, three to a row at every size: exactly three widths plus two gaps,
   so the stack never leaves one box stranded on a row of its own. */
.stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(var(--s) * 2px);
  align-items: flex-end;
  max-width: min(100%, calc(var(--s) * 76px));
  margin-top: 8px;
}

.stack i {
  display: block;
  width: calc(var(--s) * 24px);
  height: calc(var(--s) * 13px);
  background-image: url("/media/containers.png");
  background-size: calc(var(--s) * 192px) calc(var(--s) * 13px);
  image-rendering: pixelated;
  animation: settle 620ms steps(4) both;
}

.stack i:nth-child(odd) { margin-bottom: calc(var(--s) * 2px); }
.stack i:nth-child(1) { background-position: 0 0; animation-delay: 60ms; }
.stack i:nth-child(2) { background-position: calc(var(--s) * -24px) 0; animation-delay: 140ms; }
.stack i:nth-child(3) { background-position: calc(var(--s) * -48px) 0; animation-delay: 220ms; }
.stack i:nth-child(4) { background-position: calc(var(--s) * -96px) 0; animation-delay: 300ms; }
.stack i:nth-child(5) { background-position: calc(var(--s) * -144px) 0; animation-delay: 380ms; }
.stack i:nth-child(6) { background-position: calc(var(--s) * -168px) 0; animation-delay: 460ms; }

/* ---------------------------------------------------------------- FOOTER */
.dock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px var(--gutter) calc(22px + env(safe-area-inset-bottom));
  color: var(--steel);
  background: var(--void);
  border-top: 3px solid var(--ink);
  font-family: "HC Display", monospace;
  font-size: 8px;
  letter-spacing: 0.06em;
}

.dock a {
  color: var(--amber);
  text-decoration: none;
}

.dock .mark { --m: 1; }

.dock a:hover { color: var(--amber-l); }

/* -------------------------------------------------------------- MOVEMENT */
/* Scrolled past the hero, nothing in it needs to keep running. */
.hero.is-parked .hero-sky,
.hero.is-parked .hero-skyline i,
.hero.is-parked .gull,
.hero.is-parked .sea-water,
.hero.is-parked .boat {
  animation-play-state: paused;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 460ms steps(8) calc(var(--i, 0) * 90ms),
    transform 460ms steps(8) calc(var(--i, 0) * 90ms);
}

.reveal.seen {
  opacity: 1;
  transform: none;
}

@keyframes blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0.18; }
}

@keyframes lamp {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes drift {
  from { background-position: center 0; }
  to { background-position: center -520px; }
}

@keyframes creep {
  from { background-position-x: 0; }
  to { background-position-x: calc(var(--sk) * -320px); }
}

@keyframes flap {
  from { background-position-x: 0; }
  to { background-position-x: calc(var(--s) * -64px); }
}

@keyframes cross-r {
  from { transform: translateX(-14vw); }
  to { transform: translateX(112vw); }
}

@keyframes swell {
  from { background-position-x: 0; }
  to { background-position-x: calc(var(--ws) * -64px); }
}

@keyframes sail {
  from { transform: translateX(calc(var(--bs) * -240px)); }
  to { transform: translateX(102vw); }
}

@keyframes chug {
  from { background-position-x: 0; }
  to { background-position-x: calc(var(--bs) * -684px); }
}

@keyframes chug-card {
  from { background-position-x: 0; }
  to { background-position-x: calc(var(--ai) * -450px); }
}

@keyframes hoist {
  0% { transform: translateY(0); }
  30% { transform: translateY(calc(var(--ai) * -46px)); }
  70% { transform: translateY(calc(var(--ai) * -46px)); }
  100% { transform: translateY(0); }
}

@keyframes lift {
  from { transform: translateY(calc(var(--lk-drop) * var(--u))); }
  to { transform: none; }
}

/* Lowered to the quay and taken up again: paid out quickly, hoisted slowly. */
@keyframes relift {
  0% { transform: none; animation-timing-function: steps(6); }
  22% { transform: translateY(calc(var(--lk-drop) * var(--u))); animation-timing-function: steps(1); }
  36% { transform: translateY(calc(var(--lk-drop) * var(--u))); animation-timing-function: steps(10); }
  100% { transform: none; }
}

/* The operator easing the load: two pixels down and back, now and then. */
@keyframes bob {
  0%, 100% { transform: none; }
  3% { transform: translateY(calc(1 * var(--u))); }
  6% { transform: translateY(calc(2 * var(--u))); }
  12% { transform: translateY(calc(1 * var(--u))); }
  15% { transform: none; }
}

@keyframes pop {
  from { opacity: 1; transform: translate(-50%, -50%); }
  70% { opacity: 1; }
  to { opacity: 0; transform: translate(-50%, calc(-50% - 44px)); }
}

@keyframes land {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: none; }
}

@keyframes settle {
  from { opacity: 0; transform: translateY(-18px); }
  to { opacity: 1; transform: none; }
}

@keyframes nudge {
  0%, 60% { transform: translateY(0); }
  61%, 100% { transform: translateY(3px); }
}

@keyframes tail {
  from { background-position-x: 0; }
  to { background-position-x: calc(var(--ds) * -28px); }
}

@keyframes tape {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes haul-r {
  from { transform: translateX(calc(var(--ws) * -70px)); }
  to { transform: translateX(101vw); }
}

@keyframes haul-l {
  from { transform: translateX(101vw) scaleX(-1); }
  to { transform: translateX(calc(var(--ws) * -70px)) scaleX(-1); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .hero-sky,
  .hero-skyline i,
  .gull,
  .sea-water,
  .boat,
  .cue .mark,
  .hud-state i,
  .coin,
  .wire-tape,
  .rig,
  .art-ship i,
  .art-crane i,
  .btn-lg::after,
  .lk-load,
  .lk-beacon,
  .hero-stage > *,
  .stack i,
  .cat {
    animation: none !important;
  }

  /* A frozen animation parks its element at the untransformed position, which
     stacks them all on top of each other unless they are laid out here. */
  .gull-1 { transform: translateX(16vw); }
  .gull-2 { transform: translateX(54vw); }
  .gull-3 { transform: translateX(78vw); }
  .rig-1 { transform: translateX(6vw); }
  .rig-2 { transform: translateX(38vw) scaleX(-1); }
  .rig-3 { transform: translateX(52vw); }
  .rig-4 { transform: translateX(82vw) scaleX(-1); }
  .rig-5 { transform: translateX(88vw); }
  .boat { transform: translateX(8vw); }
  .btn-lg::after { opacity: 0.7; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
