/*
  Token plan (single dark theme, derived from the key art):
  - night / night-deep / night-ink: the sky, from the top of the painting down to the pixel frames
  - dusk / dusk-2 / line: raised surfaces and borders, the mountain purples
  - fg / fg-muted / fg-dim: canvas cream for text, stepped down for secondary copy
  - gold / gold-bright / orange: the sun and the wordmark, used for emphasis and the primary button
  - pink / magenta: the sunset band, used for glows and accents only
  - teal / teal-deep: the wagon body, used for links and the meter chrome
  - canvas / wood: the wagon cover and bed, used for frames
  - meter: the game's own HUD green, used only for the decorative meters
  - shadow / scrim / sunset-glow / glow-end: translucent helpers so gradients and shadows stay on tokens
*/
:root {
  color-scheme: dark;
  --night: #1a1437;
  --night-deep: #110d27;
  --night-ink: #0b0819;
  --dusk: #2b2152;
  --dusk-2: #382a66;
  --line: #4a3b7d;
  --fg: #f5ecd9;
  --fg-muted: #c6bbda;
  --fg-dim: #9a8fb8;
  --gold: #f4b544;
  --gold-bright: #ffd474;
  --orange: #ee7d39;
  --pink: #e65c88;
  --magenta: #a73a7c;
  --teal: #2ba6a8;
  --teal-bright: #5fd3d4;
  --teal-deep: #156a6e;
  --canvas: #f2e8d2;
  --wood: #8b5a2b;
  --meter: #6ee86e;
  --shadow: rgba(11, 8, 25, 0.55);
  --scrim: rgba(11, 8, 25, 0.9);
  --sunset-glow: rgba(230, 92, 136, 0.38);
  --gold-glow: rgba(244, 181, 68, 0.22);
  --glow-end: rgba(26, 20, 55, 0);
  --focus: var(--gold-bright);
  --bg: var(--night);

  --font-display: "Alfa Slab One", Rockwell, "Roboto Slab", Georgia, serif;
  --font-body: Barlow, "Helvetica Neue", Arial, sans-serif;
  --font-pixel: Silkscreen, ui-monospace, Menlo, Consolas, monospace;

  --wrap: 1120px;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-bright); text-underline-offset: 0.15em; }
a:hover { color: var(--gold-bright); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
button { font: inherit; color: inherit; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.1; text-wrap: balance; letter-spacing: 0.01em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.6rem); }
p { text-wrap: pretty; }
ul[role="list"] { list-style: none; padding: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 50;
  background: var(--gold); color: var(--night-ink);
  padding: 0.5rem 1rem; border-radius: 6px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 16px; }

/* Bands and gutters */
.band { width: 100%; }
.band--deep { background: var(--night-deep); }
.band--ink { background: var(--night-ink); }
.band + .band { border-top: 1px solid var(--line); }
.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: clamp(3rem, 2rem + 4vw, 5.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 1.5rem + 2vw, 3rem);
}
.wrap > * { min-width: 0; }

.overline {
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
}
.section-head { display: flex; flex-direction: column; gap: 0.75rem; max-width: 62ch; }
.lede { color: var(--fg-muted); font-size: 1.125rem; }

/* Top bar */
.band--top { background: var(--night-ink); }
.topbar {
  padding-block: 0.9rem;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--fg); text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 8px; }
.brand span { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.02em; }
.topnav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.topnav a {
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-muted); text-decoration: none; padding: 0.8rem 0; min-height: 44px; display: inline-flex; align-items: center;
}
.topnav a:hover { color: var(--gold-bright); }

/* Hero */
.hero {
  background:
    radial-gradient(70% 60% at 50% 110%, var(--sunset-glow) 0%, var(--glow-end) 70%),
    linear-gradient(180deg, var(--night-ink) 0%, var(--night) 55%, var(--dusk) 100%);
  overflow-x: clip;
}
.hero-grid {
  gap: 2.5rem;
  align-items: center;
}
.hero-copy { display: flex; flex-direction: column; gap: 1.5rem; max-width: 36rem; }
.wordmark { width: min(100%, 520px); filter: drop-shadow(0 10px 24px var(--shadow)); }
.tagline {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.25rem);
  line-height: 1.15;
  color: var(--gold-bright);
  text-wrap: balance;
}
.pitch { font-size: 1.125rem; color: var(--fg-muted); max-width: 48ch; }
.cta { display: flex; flex-direction: column; gap: 0.9rem; align-items: flex-start; }
.cta-meta {
  font-size: 1rem; color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 3.25rem; padding: 0.85rem 1.75rem;
  border-radius: 6px; border: 2px solid var(--night-ink);
  font-weight: 700; font-size: 1rem; line-height: 1;
  text-transform: uppercase; letter-spacing: 0.09em; text-decoration: none;
  box-shadow: 0 4px 0 var(--night-ink), 0 10px 30px var(--shadow);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}
.btn--primary {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 55%, var(--orange) 100%);
  color: var(--night-ink);
}
.btn--primary:hover { filter: brightness(1.06); transform: translateY(-1px); color: var(--night-ink); }
.btn--primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--night-ink), 0 6px 20px var(--shadow); }
.btn--secondary { background: var(--dusk); color: var(--fg); border-color: var(--teal-bright); }
.btn--secondary:hover { background: var(--dusk-2); transform: translateY(-1px); color: var(--fg); }
.btn--secondary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--night-ink), 0 6px 20px var(--shadow); }
.hero-art {
  aspect-ratio: 15 / 16;
  width: min(100%, 520px);
  max-width: 100%;
  overflow: hidden;
  border: 6px solid var(--canvas);
  border-radius: 10px;
  box-shadow: 0 0 0 2px var(--wood), 0 28px 60px var(--shadow);
  background: var(--dusk);
  justify-self: center;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 0% 50%; }

/* Meter strip */
.meters-wrap { padding-block: 1.75rem; gap: 1.25rem; }
.meters-intro { display: flex; flex-direction: column; gap: 0.25rem; }
.meters-intro p { color: var(--fg-muted); }
.meters-intro .big { color: var(--fg); font-family: var(--font-display); font-size: 1.25rem; }
.meters { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; }
.meter { display: flex; flex-direction: column; gap: 0.4rem; flex: 1 1 160px; min-width: 0; }
.meter-label {
  font-family: var(--font-pixel); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--fg-muted);
}
.meter-bar {
  height: 14px; border: 2px solid var(--teal-deep); background: var(--night-ink); border-radius: 2px;
  padding: 2px;
}
.meter-bar span {
  display: block; height: 100%; width: var(--fill);
  background: repeating-linear-gradient(90deg, var(--meter) 0 8px, var(--night-ink) 8px 10px);
  image-rendering: pixelated;
}

/* Features */
.features { display: flex; flex-direction: column; gap: clamp(3rem, 2rem + 4vw, 5rem); }
.feature { display: grid; gap: 1.75rem; align-items: center; }
.feature-copy { display: flex; flex-direction: column; gap: 0.9rem; max-width: 56ch; min-width: 0; }
.feature-copy p { color: var(--fg-muted); }
.feature-media { min-width: 0; width: 100%; }
.shot {
  display: block; width: 100%; max-width: 640px; padding: 0;
  border: 3px solid var(--night-ink); border-radius: 6px; overflow: hidden;
  background: var(--night-ink);
  box-shadow: 0 0 0 1px var(--line), 0 18px 44px var(--shadow);
}
.shot img { width: 100%; height: auto; image-rendering: pixelated; aspect-ratio: 4 / 3; max-width: 100%; }
.shot--btn { cursor: zoom-in; transition: transform 120ms ease, box-shadow 120ms ease; }
.shot--btn:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--teal), 0 22px 48px var(--shadow); }

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
}
.gallery figure { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.gallery figcaption { font-size: 1rem; color: var(--fg-dim); }
.gallery .shot { max-width: 100%; }

/* Trip possibilities */
.trip-counter { text-align: center; max-width: 850px; margin-inline: auto; padding-block: 1rem; }
.trip-counter h2 { font-size: clamp(1.6rem, 4vw, 2.7rem); }
.trip-counter-number { display: block; font-family: var(--font-display); font-size: clamp(5rem, 17vw, 10rem); line-height: 1.2; color: var(--gold-bright); font-variant-numeric: tabular-nums; margin-block: 1rem; }
.trip-counter-punchline { color: var(--gold-bright); font-size: clamp(1.2rem, 3vw, 1.7rem); margin-top: 1rem; }
.trip-counter-detail { max-width: 590px; margin: 1rem auto; color: var(--fg-muted); }
.cta--center { align-items: center; margin-top: 2.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Footer */
.footer { gap: 1.75rem; padding-block: 2.5rem; }
.footer-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem 2rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.footer-brand img { width: 48px; height: 48px; border-radius: 10px; }
.footer-brand div { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.footer-name { font-family: var(--font-display); font-size: 1.05rem; }
.footer-copy { color: var(--fg-dim); font-size: 1rem; font-variant-numeric: tabular-nums; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.footer-nav a {
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-muted); text-decoration: none; padding: 0.8rem 0; min-height: 44px; display: inline-flex; align-items: center;
}
.footer-nav a:hover { color: var(--gold-bright); }
.disclaimer { color: var(--fg-dim); font-size: 1rem; max-width: 70ch; }

/* Lightbox */
.lightbox {
  border: 0; padding: 0; margin: auto;
  background: var(--night-ink); color: var(--fg);
  width: min(1296px, calc(100vw - 32px));
  max-width: 100%;
  max-height: calc(100vh - 32px);
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line), 0 30px 80px var(--scrim);
  overflow: hidden;
}
.lightbox::backdrop { background: var(--scrim); }
.lightbox-inner { display: flex; flex-direction: column; gap: 0.75rem; padding: 8px; max-height: calc(100vh - 32px); }
.lightbox-stage { min-height: 0; display: flex; align-items: center; justify-content: center; }
.lightbox img {
  image-rendering: pixelated;
  width: auto; height: auto;
  max-width: 100%;
  max-height: calc(100vh - 32px - 16px - 4.25rem);
  border: 2px solid var(--line);
  border-radius: 4px;
}
.lightbox-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 1rem; padding: 0 0.25rem 0.25rem;
}
.lightbox-caption { color: var(--fg-muted); font-size: 1rem; min-width: 0; }
.lightbox-count { font-family: var(--font-pixel); font-size: 0.7rem; color: var(--fg-dim); letter-spacing: 0.1em; font-variant-numeric: tabular-nums; }
.lightbox-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.lb-btn {
  background: var(--dusk); border: 1px solid var(--line); color: var(--fg);
  border-radius: 6px; padding: 0.5rem 1rem; min-height: 44px; font-size: 0.85rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer;
}
.lb-btn:hover { background: var(--dusk-2); border-color: var(--teal); }

@media (min-width: 860px) {
  .hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 3rem; }
  .hero-art { justify-self: end; transform: rotate(-1.5deg); }
  .feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; }
  .feature:nth-of-type(even) .feature-media { order: -1; }
  .feature:nth-of-type(odd) .shot { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .btn--primary:hover, .btn--secondary:hover, .shot--btn:hover { transform: none; }
}

/* Meter fills on the home page (kept out of style attributes so the CSP can drop 'unsafe-inline'). */
.fill-70 { --fill: 70%; }
.fill-50 { --fill: 50%; }
.fill-30 { --fill: 30%; }

/* The status line the 404 page adds above the page. */
.notfound-banner {
  margin: 0;
  padding: 0.9rem max(16px, env(safe-area-inset-right, 0px)) 0.9rem max(16px, env(safe-area-inset-left, 0px));
  background: var(--gold);
  color: var(--night-deep);
  text-align: center;
  font-weight: 600;
}
