/* Colour lives in tokens. Every rule below reads a var() or a color-mix() of
   one, so a palette change is one edit at the top of this file.

   The look is borrowed from the game's own HUD rather than invented for the
   page: green instruments and purple selection on a near-black ground, corner
   brackets around anything framed, and the pixel face for section titles and
   readouts. The tagline, names and body stay in a heavy system sans, because a
   sentence in the pixel face is a texture, not a sentence. */
:root {
  --bg: #040a07;
  --bg-raised: #0a120e;
  --bg-plate: #0f1913;
  --ink: #f5f5f4;
  --ink-muted: #a9b6ad;
  --ink-faint: #82918a;
  --rule: #1d2a22;
  --primary: #30b339;
  --primary-bright: #5fd768;
  --accent: #8860b3;
  --accent-bright: #c084fc;
  --warn: #f2b84b;
  --sea: #2f6f80;

  --step-0: clamp(0.9375rem, 0.9rem + 0.15vw, 1rem);
  --step-1: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-2: clamp(1.15rem, 1.05rem + 0.45vw, 1.4rem);
  --step-3: clamp(1.4rem, 1.2rem + 1vw, 2rem);

  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --measure: 1200px;
  --inset: max(var(--gutter), calc((100% - var(--measure)) / 2));
  --radius: 6px;
  --bar: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --display: 'Press Start 2P', ui-monospace, 'Courier New', monospace;
  --heading: system-ui, -apple-system, 'Segoe UI Variable Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Menlo, Consolas, monospace;
}

@font-face {
  font-family: 'Press Start 2P';
  src: url('/fonts/press-start-2p.woff2') format('woff2');
  font-display: swap;
}

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

html {
  scroll-behavior: smooth;
  /* In-page links land below the fixed bar. */
  scroll-padding-top: calc(var(--bar) + 1rem);
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  transition: color 160ms var(--ease);
}

a:hover {
  color: var(--accent-bright);
}

:focus-visible {
  outline: 3px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: color-mix(in srgb, var(--accent) 70%, transparent);
  color: var(--ink);
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  overflow-wrap: anywhere;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.75rem 1rem;
  background: var(--primary);
  color: var(--bg);
  font-weight: 700;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* --- actions ------------------------------------------------------------- */

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--primary-bright), var(--primary));
  color: var(--bg);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--primary-bright) 30%, transparent) inset,
    0 10px 30px -10px color-mix(in srgb, var(--primary) 70%, transparent);
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}

.action:hover {
  color: var(--bg);
  transform: translateY(-1px);
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary-bright) 80%, var(--ink)), var(--primary-bright));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--ink) 30%, transparent) inset,
    0 14px 40px -10px color-mix(in srgb, var(--primary) 90%, transparent);
}

.action:active {
  transform: translateY(1px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary-bright) 30%, transparent) inset;
}

.action--large {
  padding: 0.95rem 1.5rem;
  font-size: var(--step-0);
}

/* The hero was signed off at the earlier, larger body size; keep its action there. */
.hero .action--large {
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
}

.action--small {
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
}

.action--block {
  width: 100%;
}

.icon {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
}

.icon--inline {
  width: 1.15em;
  height: 1.15em;
  stroke-width: 2.25;
}

/* --- masthead ------------------------------------------------------------ */

.masthead {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: var(--bar);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

@media (scripting: enabled) {
  /* Keyboard focus reveals the shortcuts even before the first scroll. */
  :root:not([data-scrolled]) .masthead:not(:has(:focus-visible)) {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
  }
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
  padding-inline: var(--inset);
}

.wordmark {
  display: block;
  flex: none;
  width: 108px;
  aspect-ratio: 1024 / 419;
  background: url('/assets/logo.webp') center / contain no-repeat;
  transition: transform 200ms var(--ease), filter 200ms var(--ease);
}

.wordmark:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--primary) 55%, transparent));
}

.masthead nav {
  margin-left: auto;
}

.masthead ul {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.masthead nav a {
  display: block;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  color: var(--ink-muted);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}

.masthead nav a:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

/* --- hero ---------------------------------------------------------------- */

/* The first screen must fit any window whole, buttons included. Everything in
   it is sized by the smaller of the window's width and height, so a short
   desktop window or a phone on its side shrinks the logo rather than pushing
   the download action below the fold. */
.hero {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 100svh;
  padding-bottom: 3.5rem;
  overflow: hidden;
  isolation: isolate;
}

.hero__backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

/* The fighter sits just right of the frame's centre, under where the copy
   would be. Wider than the viewport and pinned left, it lands in the clear
   right-hand third instead (57% of the frame is about 77% of the window). */
.hero__backdrop img {
  position: absolute;
  inset: 0;
  width: 135%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  object-position: 0% 42%;
  overflow-wrap: anywhere;
}

/* Two washes: one so the copy reads against the sea, one so the frame melts
   into the page instead of stopping at a hard edge. */
.hero__backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--bg) 82%, transparent) 0%, color-mix(in srgb, var(--bg) 35%, transparent) 50%, transparent 75%),
    linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 40%, transparent) 22%, transparent 45%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 55%, transparent) 0%, transparent 18%);
}

.hero__inner {
  padding: clamp(1rem, 5svh, 4rem) var(--inset);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 clamp(0.75rem, 3.5svh, 2rem);
  padding: 0.5rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
}

.chip__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-bright);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent);
}

.hero__logo {
  height: max(52px, min(28svh, 34vw, 240px));
  aspect-ratio: 1024 / 419;
  max-width: 100%;
  margin: 0 0 clamp(0.5rem, 2.5svh, 1.5rem) -0.5%;
  background: url('/assets/logo.webp') left center / contain no-repeat;
  filter: drop-shadow(0 12px 40px color-mix(in srgb, var(--bg) 90%, transparent));
}

.hero__tagline {
  max-width: 16em;
  margin: 0 0 clamp(1rem, 4.5svh, 2.5rem);
  font-family: var(--heading);
  font-size: max(1.3rem, min(6svh, 7.5vw, 3.4rem));
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
  text-shadow: 0 2px 24px color-mix(in srgb, var(--bg) 80%, transparent);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
}

.hero__scroll {
  position: absolute;
  bottom: 0.5rem;
  justify-self: center;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--ink-muted);
}

.hero__rotation {
  position: absolute;
  bottom: 0.5rem;
  right: var(--inset);
  min-height: 44px;
  padding-inline: 0.8rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.hero__rotation:not(:focus-visible) {
  opacity: 0;
  pointer-events: none;
}

/* --- sections ------------------------------------------------------------ */

.section {
  position: relative;
  border-top: 1px solid var(--rule);
  padding: clamp(3rem, 6vw, 5rem) var(--inset);
}

.section__intro {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.5rem);
  margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
}

.section__intro h2 {
  margin: 0;
}

.mascot {
  display: block;
  flex: none;
  width: clamp(5rem, 9vw, 8rem);
  height: auto;
}

/* Section titles wear the pixel face. It runs a full em per glyph, so it is set
   smaller than a sans headline would be, and never synthesised bold. */
h2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 clamp(1.25rem, 2.5vw, 2rem);
  font-family: var(--display);
  font-size: clamp(1rem, 0.85rem + 0.7vw, 1.5rem);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
}

h2::before {
  content: '';
  flex: none;
  width: 5px;
  height: 1em;
  background: var(--primary-bright);
  box-shadow: 0 0 14px var(--primary);
}

h3 {
  margin: 0 0 0.3rem;
  font-family: var(--heading);
  font-size: var(--step-1);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* HUD corner brackets: eight thin bars painted by one pseudo-element, so a
   framed image needs no extra markup. */
.frame {
  position: relative;
  display: block;
  margin: 0;
  min-width: 0;
}

.frame::after {
  --tick: color-mix(in srgb, var(--primary-bright) 85%, transparent);
  content: '';
  position: absolute;
  inset: -6px;
  pointer-events: none;
  background:
    linear-gradient(var(--tick), var(--tick)) top left / 22px 2px,
    linear-gradient(var(--tick), var(--tick)) top left / 2px 22px,
    linear-gradient(var(--tick), var(--tick)) top right / 22px 2px,
    linear-gradient(var(--tick), var(--tick)) top right / 2px 22px,
    linear-gradient(var(--tick), var(--tick)) bottom left / 22px 2px,
    linear-gradient(var(--tick), var(--tick)) bottom left / 2px 22px,
    linear-gradient(var(--tick), var(--tick)) bottom right / 22px 2px,
    linear-gradient(var(--tick), var(--tick)) bottom right / 2px 22px;
  background-repeat: no-repeat;
  transition: inset 220ms var(--ease);
}

.frame img {
  width: 100%;
  border-radius: 3px;
  background: var(--bg-plate);
  overflow-wrap: anywhere;
}

/* --- the fight ----------------------------------------------------------- */

/* Each step's live state is one number, --on, from 0 to 1. It is registered so
   the cycle can animate it, and everything that marks the lit step — the rule,
   the title colour, the dimming of the others — reads it. */
@property --on {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

.sortie {
  --cycle: 15s;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.steps {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps__item {
  --on: 0;
}

/* Without the cycle (no support, reduced motion) the first step is the one shown. */
.steps__item:first-child {
  --on: 1;
}

.steps label {
  position: relative;
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid color-mix(in srgb, var(--primary) calc(var(--on) * 55%), var(--rule));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary) calc(var(--on) * 9%), transparent);
  opacity: calc(0.6 + var(--on) * 0.4);
  cursor: pointer;
  overflow: clip;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}

.steps label:hover {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--rule));
}

.steps input:focus-visible + label {
  outline: 3px solid var(--accent-bright);
  outline-offset: 3px;
}

.steps__number {
  color: var(--accent-bright);
  font-family: var(--display);
  font-size: 0.9rem;
  line-height: 2.1;
}

.steps__text {
  display: grid;
  gap: 0.2rem;
}

.steps__title {
  color: color-mix(in srgb, var(--primary-bright) calc(var(--on) * 100%), var(--ink));
  font-family: var(--heading);
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.3;
}

.steps__body {
  color: var(--ink-muted);
}

/* How long this frame has left, along the bottom of the lit step. */
.steps__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-bright);
  box-shadow: 0 0 8px var(--primary);
  transform: scaleX(0);
  transform-origin: left;
}

.sortie__figure {
  margin: 0;
}

.sortie__stack {
  display: grid;
  border-radius: 3px;
  overflow: clip;
  box-shadow: 0 40px 80px -30px color-mix(in srgb, var(--sea) 60%, transparent);
}

/* The frames sit on top of one another; only the one shown is opaque. */
.sortie__frame {
  position: relative;
  grid-area: 1 / 1;
  opacity: 0;
  transition: opacity 400ms var(--ease);
}

.sortie__frame:first-child {
  opacity: 1;
}

.sortie__frame img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.sortie__tag {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  padding: 0.4rem 0.65rem;
  border-left: 3px solid var(--primary-bright);
  border-radius: 0 3px 3px 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.75rem;
  line-height: 1.5;
  text-transform: uppercase;
}

/* A picked step pins its frame and ends the cycle. Three steps, three rules:
   the list in content.ts is the source of the count. */
.sortie:has(.steps input:checked) :is(.steps__item, .steps__progress, .sortie__frame) {
  animation: none;
}

.sortie:has(.steps input:checked) .steps__item {
  --on: 0;
}

.sortie:has(.steps input:checked) .sortie__frame {
  opacity: 0;
}

/* Restated under the same :has() so it outranks the rule that dims them all. */
.sortie:has(.steps input:checked) .steps__item:has(input:checked) {
  --on: 1;
}

.sortie:has(.steps input:checked) .steps__item:has(input:checked) .steps__progress {
  transform: scaleX(1);
}

.sortie:has(#leg-1:checked) .sortie__frame:nth-child(1),
.sortie:has(#leg-2:checked) .sortie__frame:nth-child(2),
.sortie:has(#leg-3:checked) .sortie__frame:nth-child(3) {
  opacity: 1;
}

/* --- airframes ----------------------------------------------------------- */

/* A hangar floor: a faint instrument grid under a sea-coloured glow. */
.section--hangar {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, color-mix(in srgb, var(--sea) 22%, transparent), transparent 70%),
    linear-gradient(color-mix(in srgb, var(--ink) 3.5%, transparent) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 3.5%, transparent) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--bg-raised);
  border-block: 1px solid var(--rule);
}

.airframes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.airframe {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--rule);
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, color-mix(in srgb, var(--sea) 45%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--sea) 8%, var(--bg)), var(--bg) 75%);
  /* clip, not hidden: hidden makes the card a scroll container, and the jet's
     view() timeline would then track the card instead of the page. */
  overflow: clip;
  isolation: isolate;
  transition: border-color 260ms var(--ease), transform 260ms var(--ease), box-shadow 260ms var(--ease);
}

.airframe:hover {
  border-color: color-mix(in srgb, var(--primary) 70%, transparent);
  transform: translateY(-4px);
  box-shadow: 0 40px 80px -40px color-mix(in srgb, var(--primary) 60%, transparent);
}

.airframe__image {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  padding: 0.5rem 1rem 0;
  filter: drop-shadow(0 26px 22px color-mix(in srgb, var(--bg) 85%, transparent));
  transition: transform 420ms var(--ease);
  overflow-wrap: anywhere;
}

.airframe:hover .airframe__image {
  transform: translate(-2%, -4%) rotate(-2deg) scale(1.05);
}

.airframe__body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1.5rem;
  align-items: end;
  padding: 0 clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 3vw, 2rem);
}

.airframe__role {
  grid-column: 1 / -1;
  margin: 0 0 0.35rem;
  color: var(--accent-bright);
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  line-height: 1.6;
  text-transform: uppercase;
}

.airframe h3 {
  margin: 0;
  font-size: var(--step-3);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.airframe__trait {
  grid-column: 1;
  margin: 0.4rem 0 0;
  color: var(--primary-bright);
  font-weight: 600;
}

.airframe__specs {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 1.25rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}

.airframe__specs dt {
  margin-bottom: 0.35rem;
  color: var(--ink-faint);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.airframe__specs dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.88rem;
}

.armament {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.armament__weapon img {
  display: block;
  width: 2.5rem;
  height: auto;
}

/* Ten voxels, filled against the fastest jet. */
.meter {
  display: flex;
  gap: 3px;
  margin-top: 0.5rem;
}

.meter span {
  width: 10px;
  height: 10px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}

.meter .on {
  background: var(--primary-bright);
  box-shadow: 0 0 8px color-mix(in srgb, var(--primary) 60%, transparent);
}

/* --- campaign ------------------------------------------------------------ */

.campaign {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
  padding: 2rem clamp(1.5rem, 5vw, 4rem);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--rule));
  border-radius: calc(var(--radius) + 6px);
  background:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent) 0 14px, transparent 14px 28px),
    radial-gradient(ellipse 60% 120% at 0% 50%, color-mix(in srgb, var(--accent) 25%, transparent), transparent 70%),
    var(--bg-raised);
  overflow: hidden;
}

.campaign > .mascot {
  align-self: start;
}

.campaign__copy {
  display: grid;
  gap: 1rem;
}

.campaign h2 {
  margin: 0;
}

.campaign h2::before {
  background: var(--accent-bright);
  box-shadow: 0 0 14px var(--accent);
}

.campaign__location {
  margin: 0;
  color: var(--accent-bright);
  font-family: var(--display);
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 12px var(--accent);
}

.campaign h3 {
  margin: 0;
  font-family: var(--display);
  font-size: var(--step-3);
  line-height: 1.15;
}

.campaign__brief {
  max-width: 52ch;
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.7;
}

.campaign__copy .action {
  justify-self: start;
}

.campaign__frame {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.campaign__frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* --- download ------------------------------------------------------------ */

.section--download {
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 70% at 15% 0%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 70%),
    radial-gradient(ellipse 50% 60% at 95% 100%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    var(--bg-raised);
  border-top: 1px solid var(--rule);
}

.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.download {
  display: flex;
  flex-direction: column;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: calc(var(--radius) + 6px);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: 0 30px 60px -40px var(--bg);
  transition: border-color 220ms var(--ease);
}

.download:hover {
  border-color: color-mix(in srgb, var(--primary) 50%, transparent);
}

.download p {
  margin: 0;
}

.download__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.download__head h3 {
  margin: 0;
  font-size: var(--step-2);
}

.download__icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  flex: none;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
}

.download__icon .icon {
  width: 1.75rem;
  height: 1.75rem;
}

.download__meta {
  color: var(--ink-faint);
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  line-height: 2;
  text-transform: uppercase;
}

.download__state {
  align-self: flex-start;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent-bright);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.download__reason {
  margin-top: 0.75rem !important;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.download__reason--warn {
  padding: 0.7rem 0.9rem;
  border-left: 2px solid var(--warn);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: color-mix(in srgb, var(--warn) 8%, transparent);
  color: color-mix(in srgb, var(--warn) 35%, var(--ink));
}

/* --- footer -------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 0.85rem;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem var(--inset);
}

.footer p {
  margin: 0;
}

/* A third-party badge stays quiet until the visitor reaches for it. */
.badge {
  display: inline-flex;
  opacity: 0.7;
}

.badge:hover,
.badge:focus-visible {
  opacity: 1;
}

.badge img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Keep social links beside the download section, with room for touch and focus. */
.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink-muted);
  text-decoration: none;
}

.socials a:hover {
  color: var(--primary-bright);
  border-color: var(--primary);
}

/* --- motion -------------------------------------------------------------- */

@keyframes settle {
  from {
    transform: scale(1.08);
    opacity: 0.4;
  }
}

/* Reveals move with `translate`, not `transform`: an animation holds whatever
   property it animates, and hover lifts are written in `transform`. */
@keyframes rise {
  from {
    opacity: 0;
    translate: 0 28px;
  }
}

/* Parallax: each layer drifts at its own rate as its section crosses the
   window. All of it is `translate` or `object-position`, so it composes with
   the hover transforms and never moves anything outside its own box. */
@keyframes drift-hero {
  to {
    translate: 0 30%;
  }
}

@keyframes lift-hero {
  to {
    translate: 0 -12vh;
    opacity: 0.15;
  }
}

@keyframes drift {
  from {
    translate: 0 var(--drift, 40px);
  }

  to {
    translate: 0 calc(var(--drift, 40px) * -1);
  }
}

/* One step's share of the cycle: lit for the first third, then dark. Each
   step and frame runs it a third of a cycle apart, so exactly one is lit. */
@keyframes leg-on {
  0%, 31% {
    --on: 1;
  }

  34%, 97% {
    --on: 0;
  }

  100% {
    --on: 1;
  }
}

@keyframes leg-frame {
  0%, 31% {
    opacity: 1;
  }

  34%, 97% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes leg-progress {
  0% {
    transform: scaleX(0);
  }

  33.33% {
    transform: scaleX(1);
  }

  33.34%, 100% {
    transform: scaleX(0);
  }
}

@keyframes stripes {
  to {
    background-position: 160px 0, 0 0;
  }
}

/* Motion is opt-in twice over: the reader has not asked for less, and the
   browser can tie it to scrolling. Anything else gets the finished page.
   Nothing above the fold fades in on a clock: a throttled or restored tab can
   hold a timed animation at its first frame, and the headline would sit there
   invisible. Only the backdrop moves, and it starts visible. */
@media (prefers-reduced-motion: no-preference) {
  .hero__backdrop img[fetchpriority="high"] {
    animation: settle 2.4s var(--ease) both;
  }

  /* The cycle: step, progress bar and frame share a clock, offset by thirds.
     A negative delay starts each one partway through, so they are in phase
     from the first frame. Hovering pauses it so a frame can be read. */
  .steps__item,
  .sortie__frame {
    animation: leg-on var(--cycle) linear infinite;
  }

  .sortie__frame {
    animation-name: leg-frame;
  }

  .steps__progress {
    animation: leg-progress var(--cycle) linear infinite;
  }

  .steps__item:nth-child(2),
  .steps__item:nth-child(2) .steps__progress,
  .sortie__frame:nth-child(2) {
    animation-delay: calc(var(--cycle) * -2 / 3);
  }

  .steps__item:nth-child(3),
  .steps__item:nth-child(3) .steps__progress,
  .sortie__frame:nth-child(3) {
    animation-delay: calc(var(--cycle) * -1 / 3);
  }

  .sortie:hover :is(.steps__item, .steps__progress, .sortie__frame) {
    animation-play-state: paused;
  }

  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }

    /* The sea falls behind the copy as the hero scrolls away. */
    .hero__backdrop img {
      animation: drift-hero linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100vh;
    }

    .hero__backdrop img[fetchpriority="high"] {
      animation: settle 2.4s var(--ease) both, drift-hero linear both;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0 100vh;
    }

    .hero__inner {
      animation: lift-hero linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100vh;
    }

    /* Jets climb faster than their cards. */
    .airframe__image {
      --drift: 28px;
      animation: drift linear both;
      animation-timeline: view();
    }

    .campaign {
      animation: stripes linear both;
      animation-timeline: view();
    }
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* --- smaller screens ----------------------------------------------------- */

@media (max-width: 900px) {
  .sortie {
    grid-template-columns: 1fr;
  }

  .sortie__figure {
    order: -1;
  }

  .airframes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .masthead__inner {
    justify-content: space-between;
    gap: 0.25rem;
    padding-inline: 0.5rem;
  }

  .masthead .wordmark {
    display: none;
  }

  .masthead nav {
    margin-left: 0;
  }

  .masthead nav a,
  .masthead .action {
    padding-inline: 0.45rem;
    font-size: 0.8rem;
  }

  .campaign {
    padding-inline: 1rem;
    gap: 0.75rem;
  }

  .campaign__location {
    font-size: 0.75rem;
  }

  /* A phone stacks the copy down the middle of the screen, which is where the
     fighter sits in the frame. Here the frame fills only the band above the
     copy, so the jet lands over the chip instead of behind the logo, and fades
     out downward into the page. A mask reads only alpha, so any opaque token
     serves; --bg is the one the page fades to anyway. */
  .hero__backdrop img {
    width: 100%;
    height: 44%;
    object-position: 60% 50%;
    mask-image: linear-gradient(180deg, var(--bg) 70%, transparent 100%);
  }

  .hero__backdrop::after {
    background:
      linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 45%, color-mix(in srgb, var(--bg) 25%, transparent) 100%);
  }

  .hero__actions .action {
    flex: 1 1 100%;
  }

  .airframe__specs {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* A short window — a laptop with its browser chrome, a phone on its side —
   keeps the first screen whole with a smaller logo and tighter controls. */
@media (max-height: 560px) {
  .hero .action--large {
    padding-block: 0.7rem;
  }

  .hero__logo {
    height: max(44px, min(22svh, 34vw));
  }

  .chip {
    padding-block: 0.35rem;
  }

  .hero__actions .action {
    flex: 0 1 auto;
  }
}

/* Optional support before an installer download. */
.donation {
  width: min(90vw, 30rem);
  max-height: 90vh;
  overflow: auto;
  padding: 2rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--ink);
  box-shadow: 0 20px 60px var(--bg);
}
.donation::backdrop { background: color-mix(in srgb, var(--bg) 85%, transparent); }
.donation h2 { margin: 0 2rem 1rem 0; font-size: clamp(0.875rem, 3.5vw, 1.125rem); line-height: 1.7; }
.donation p { color: var(--ink-muted); line-height: 1.6; }
.donation__close {
  float: right;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 2rem;
  cursor: pointer;
}
.donation__continue { display: block; margin-top: 1rem; text-align: center; color: var(--ink); }
