/* ============================================================
   To The Moon STEM — design system
   Display: Archivo · Body: IBM Plex Sans · Data/labels: IBM Plex Mono
   Deep-space ground, warm coral accent, dark-first with a light theme.
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, picture, svg, iframe, canvas { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; }
ul[class], ol[class] { list-style: none; padding: 0; }
:target { scroll-margin-top: 6rem; }

/* ---------- Tokens: dark (default world) ---------- */
:root {
  --ground:        #090d18;
  --ground-2:      #0d1424;
  --raised:        #121a2c;
  --surface:       rgba(150, 194, 220, 0.055);
  --surface-solid: #141d31;
  --border:        rgba(155, 199, 223, 0.16);
  --border-strong: rgba(155, 199, 223, 0.30);

  --ink:      #e9eff7;
  --ink-mid:  #b7c3d6;
  --ink-dim:  #8592a8;

  --accent:      #ff7a4d;   /* coral — the one bold move */
  --accent-ink:  #1a0d06;   /* text on accent fills */
  --accent-deep: #e0561f;
  --accent-text: var(--accent); /* accent used as small text on page surfaces */
  --accent-glow: rgba(255, 122, 77, 0.32);
  --gold:        #f2b65a;   /* "coming soon" / highlight only */
  --sky:         #9cc9e1;   /* links + cool accent */
  --sky-strong:  #bfe0f0;
  --pale:        #e0fbfc;

  --hero-scrim: linear-gradient(180deg, rgba(9,13,24,0.35) 0%, rgba(9,13,24,0.72) 55%, var(--ground) 100%);
  --starfield-opacity: 0.5;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.35);
  --shadow-md: 0 18px 40px -22px rgba(0,0,0,0.75);
  --shadow-lg: 0 40px 90px -40px rgba(0,0,0,0.85);

  --measure: 66ch;
  --edge: clamp(1.15rem, 5vw, 3rem);
  --radius: 12px;
  --radius-lg: 18px;

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: clamp(0.83rem, 0.79rem + 0.18vw, 0.94rem);
  --step-0:  clamp(1rem, 0.95rem + 0.25vw, 1.14rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --step-2:  clamp(1.45rem, 1.28rem + 0.85vw, 2.05rem);
  --step-3:  clamp(1.8rem, 1.5rem + 1.5vw, 2.9rem);
  --step-4:  clamp(2.3rem, 1.75rem + 2.75vw, 4.2rem);
  --step-5:  clamp(2.9rem, 1.9rem + 5vw, 6rem);
}

/* ---------- Tokens: light ---------- */
:root[data-theme="light"] {
  --ground:        #eef3f8;
  --ground-2:      #f5f8fb;
  --raised:        #ffffff;
  --surface:       #ffffff;
  --surface-solid: #ffffff;
  --border:        rgba(20, 43, 74, 0.12);
  --border-strong: rgba(20, 43, 74, 0.26);

  --ink:      #14233c;
  --ink-mid:  #41536e;
  --ink-dim:  #63748c;

  --accent:      #d9531d;
  --accent-ink:  #fff4ee;
  --accent-deep: #b23f12;
  --accent-text: #bd4415;   /* AA on white for small text */
  --accent-glow: rgba(217, 83, 29, 0.18);
  --gold:        #a5701a;
  --sky:         #2b6d8d;
  --sky-strong:  #1f5872;
  --pale:        #12405a;

  --hero-scrim: linear-gradient(180deg, rgba(9,14,26,0.30) 0%, rgba(9,14,26,0.55) 45%, rgba(20,30,50,0.70) 72%, var(--ground) 100%);
  --starfield-opacity: 0.16;

  --shadow-sm: 0 1px 2px rgba(20,43,74,0.08);
  --shadow-md: 0 22px 48px -30px rgba(20,43,74,0.35);
  --shadow-lg: 0 44px 90px -46px rgba(20,43,74,0.4);
}

/* ---------- Base ---------- */
body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 78% -8%, rgba(255,122,77,0.10), transparent 60%),
    radial-gradient(900px 520px at 8% 4%, rgba(60,90,128,0.22), transparent 62%),
    var(--ground);
  overflow-x: hidden;
}
:root[data-theme="light"] body {
  background:
    radial-gradient(1100px 620px at 80% -10%, rgba(217,83,29,0.08), transparent 60%),
    radial-gradient(900px 520px at 6% 2%, rgba(152,193,217,0.35), transparent 62%),
    var(--ground);
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; color: var(--ink); }
p { text-wrap: pretty; }

::selection { background: var(--accent); color: var(--accent-ink); }

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

.skip-link {
  position: fixed;
  left: 1rem; top: 1rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  border-radius: 8px;
  transform: translateY(-160%);
  transition: transform 0.18s ease;
}
.skip-link:focus-visible { transform: translateY(0); }

/* ---------- Starfield ---------- */
.starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: var(--starfield-opacity);
  transition: opacity 0.4s ease;
}
.page { position: relative; z-index: 1; }

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 120;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  box-shadow: 0 0 14px var(--accent-glow);
  transition: width 0.08s linear;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.25s ease, border-color 0.25s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-stuck {
  background: color-mix(in srgb, var(--ground) 78%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.site-header__inner {
  max-width: 1200px;
  margin-inline: auto;
  padding: 0.75rem var(--edge);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.12rem;
  flex-shrink: 0;
}
.brand__mark {
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  color: var(--accent);
  flex-shrink: 0;
}
.brand__mark svg { width: 100%; height: 100%; }

.primary-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.primary-nav a {
  --pad: 0.55rem 0.85rem;
  position: relative;
  padding: var(--pad);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink-mid);
  font-size: var(--step--1);
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.primary-nav a:hover { color: var(--ink); background: var(--surface); }
.primary-nav a[aria-current="page"] { color: var(--ink); }
.primary-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.85rem; right: 0.85rem; bottom: 0.15rem;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* sits above the off-canvas drawer (a sibling inside the header) so the
   close button and theme toggle stay tappable while the menu is open */
.header-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; position: relative; z-index: 96; }
.brand { position: relative; z-index: 96; }

.icon-btn {
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--ink-mid);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.icon-btn:hover { color: var(--ink); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 20px; height: 20px; }

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Header floats over a dark hero until it sticks onto the page — keep its
   chrome legible there regardless of the active theme. */
.site-header:not(.is-stuck) .brand { color: #fff; }
.site-header:not(.is-stuck) .icon-btn {
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.10);
}
.site-header:not(.is-stuck) .icon-btn:hover { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
@media (min-width: 861px) {
  .site-header:not(.is-stuck) .primary-nav a { color: rgba(255, 255, 255, 0.82); }
  .site-header:not(.is-stuck) .primary-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
  .site-header:not(.is-stuck) .primary-nav a[aria-current="page"] { color: #fff; }
  .site-header:not(.is-stuck) .primary-nav a[aria-current="page"]::after { background: #fff; }
}

.nav-toggle { display: none; }
.nav-toggle .bars { position: relative; width: 20px; height: 14px; }
.nav-toggle .bars span {
  position: absolute; left: 0; right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}
.nav-toggle .bars span:nth-child(1) { top: 0; }
.nav-toggle .bars span:nth-child(2) { top: 6px; }
.nav-toggle .bars span:nth-child(3) { top: 12px; }
body.nav-open .nav-toggle .bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
body.nav-open .nav-toggle .bars span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle .bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(4, 7, 14, 0.6);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.35rem;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.btn svg { width: 1.1em; height: 1.1em; }
.btn--primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, white), var(--accent-deep));
  color: var(--accent-ink);
  box-shadow: 0 14px 30px -14px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -14px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.3); }
.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--ink); }
.btn:active { transform: translateY(0); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: clamp(30rem, 82vh, 46rem);
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}
.hero--compact { min-height: clamp(24rem, 64vh, 34rem); }

.hero__media {
  position: absolute;
  inset: -18% 0 -4% 0;
  background-size: cover;
  background-position: center 30%;
  z-index: -2;
  will-change: transform;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--hero-scrim);
}
/* lighter wash for the illustrated banners so the artwork stays visible */
.hero--illus .hero__scrim {
  background: linear-gradient(180deg,
    rgba(7,11,20,0.20) 0%,
    rgba(7,11,20,0.34) 42%,
    rgba(7,11,20,0.72) 74%,
    var(--ground) 100%);
}
.hero--illus .hero__title,
.hero--illus .hero__lede { text-shadow: 0 2px 18px rgba(0,0,0,0.75), 0 1px 3px rgba(0,0,0,0.6); }
.hero__inner {
  max-width: 1200px;
  margin-inline: auto;
  width: 100%;
  padding: 0 var(--edge) clamp(3rem, 8vh, 6rem);
}
.hero__content { max-width: 46rem; }
.hero__title {
  font-size: var(--step-5);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  text-shadow: 0 2px 30px rgba(0,0,0,0.5);
}
.hero__title .spark { color: var(--accent); }
.hero__lede {
  margin-top: 1rem;
  font-size: var(--step-1);
  color: rgba(255,255,255,0.9);
  max-width: 40ch;
  text-shadow: 0 1px 16px rgba(0,0,0,0.55);
}
.hero__cta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* Tri-colour wordmark for Rocket Mission UK */
.hero--illus .hero__content { max-width: 52rem; }
.hero--illus .hero__title { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.5rem); }
.wordmark-rmuk { display: inline; }
.wordmark-rmuk span:nth-child(1) { color: #ff6a5c; }
.wordmark-rmuk span:nth-child(2) { color: #ffffff; }
.wordmark-rmuk span:nth-child(3) { color: #7db4ff; }
.eyebrow .wordmark-rmuk span { color: inherit; }

/* ---------- Layout / sections ---------- */
main { display: block; position: relative; }
.section {
  padding-block: clamp(3.25rem, 8vw, 6rem);
}
.section + .section { padding-top: 0; }
.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--edge);
}
.col {
  max-width: var(--measure);
}
.col--wide { max-width: 78rem; }

.section-head { margin-bottom: 1.75rem; max-width: var(--measure); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-text);
}
.hero .eyebrow { color: #ff8256; } /* hero sits on a dark scrim in both themes */
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-glow);
}
.section-title {
  margin-top: 0.75rem;
  font-size: var(--step-3);
}
.section-head .lede {
  margin-top: 0.85rem;
  color: var(--ink-mid);
  font-size: var(--step-1);
}

/* ---------- Prose ---------- */
.prose { max-width: var(--measure); color: var(--ink-mid); }
.prose > * + * { margin-top: 1.1rem; }
.prose p { font-size: var(--step-0); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a {
  color: var(--sky);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--sky) 45%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}
.prose a:hover { color: var(--sky-strong); text-decoration-color: currentColor; }

blockquote {
  margin: 1.6rem 0;
  padding: 1.25rem 1.4rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-1);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
}
blockquote cite {
  display: block;
  margin-top: 0.8rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
}
blockquote cite::before { content: "— "; }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
a.card:hover, .card--interactive:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.card__index {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--accent-text);
  letter-spacing: 0.05em;
}
.card__title { font-size: var(--step-1); letter-spacing: -0.01em; }
.card__body { color: var(--ink-mid); font-size: var(--step--1); }
.card__cta {
  margin-top: auto;
  padding-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--sky);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
a.card:hover .card__cta { color: var(--sky-strong); }
a.card:hover .card__cta svg { transform: translateX(3px); }
.card__cta svg { width: 1em; height: 1em; transition: transform 0.15s ease; }

.badge {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
}

/* ---------- Feature list (checklist) ---------- */
.feature-list { display: grid; gap: 0.75rem; max-width: var(--measure); }
.feature-list li {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-mid);
  font-size: var(--step--1);
}
.feature-list li svg { width: 1.25rem; height: 1.25rem; color: var(--accent); margin-top: 0.15rem; }
.feature-list li a { color: var(--sky); text-decoration: underline; text-underline-offset: 3px; }
.feature-list li a:hover { color: var(--sky-strong); }

/* ---------- Media / figures ---------- */
.frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-solid);
  box-shadow: var(--shadow-md);
  max-width: 62rem;
}
.frame img { width: 100%; height: auto; }
figure { max-width: 62rem; }
figcaption {
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-dim);
}

/* ---------- Lazy video ---------- */
.video {
  position: relative;
  max-width: 62rem;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #05070d var(--video-thumb) center / cover no-repeat;
  box-shadow: var(--shadow-md);
  cursor: pointer;
}
.video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,7,13,0.15), rgba(5,7,13,0.55));
  transition: background 0.2s ease;
}
.video:hover::after { background: linear-gradient(180deg, rgba(5,7,13,0.05), rgba(5,7,13,0.4)); }
.video__play {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 0.8rem;
  align-content: center;
  color: #fff;
}
.video__play .disc {
  width: clamp(3.75rem, 9vw, 5rem);
  height: clamp(3.75rem, 9vw, 5rem);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 18px 44px -12px var(--accent-glow);
  transition: transform 0.2s ease;
}
.video:hover .video__play .disc { transform: scale(1.08); }
.video__play .disc svg { width: 44%; height: 44%; margin-left: 8%; }
.video__label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(6, 9, 16, 0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.video__yt {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: 0.3rem 0.55rem;
  border-radius: 7px;
  background: rgba(6, 9, 16, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.16);
  opacity: 0.75;
  transition: opacity 0.18s ease, color 0.15s ease;
}
.video:hover .video__yt,
.video:focus-within .video__yt { opacity: 1; }
.video__yt:hover { color: #fff; text-decoration: underline; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video.is-playing { cursor: default; }
.video.is-playing::after, .video.is-playing .video__play { display: none; }

.video-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  max-width: 78rem;
}
.video-grid .video { max-width: none; }

/* ---------- Stats / counters ---------- */
.stat-strip {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--border);
  max-width: 78rem;
}
.stat {
  padding: 1.6rem 1.4rem;
  background: var(--surface-solid);
  display: grid;
  gap: 0.35rem;
}
.stat__num {
  font-family: var(--font-mono);
  font-size: var(--step-3);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat__num .unit { color: var(--accent); }
.stat__label {
  font-size: var(--step--1);
  color: var(--ink-dim);
}

/* ---------- Spaceport cards ---------- */
.port-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  max-width: 78rem;
}
.port {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--surface-solid);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.port:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.port__img {
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  filter: saturate(1.05);
}
.port__meta { padding: 1rem 1.15rem; display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.port__name { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); letter-spacing: -0.01em; }
.port__go { font-family: var(--font-mono); font-size: var(--step--1); color: var(--sky); }
.port:hover .port__go { color: var(--sky-strong); }

/* ---------- Download cards ---------- */
.download-list { display: grid; gap: 0.9rem; max-width: 52rem; }
.download {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.1rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.download:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.download__icon {
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  flex-shrink: 0;
}
.download__icon svg { width: 1.4rem; height: 1.4rem; }
.download__title { font-family: var(--font-display); font-weight: 600; font-size: var(--step-0); letter-spacing: -0.01em; color: var(--ink); }
.download__meta { font-family: var(--font-mono); font-size: var(--step--1); color: var(--ink-dim); margin-top: 0.15rem; }
.download__arrow { color: var(--ink-dim); display: grid; place-items: center; transition: transform 0.15s ease, color 0.15s ease; }
.download__arrow svg { width: 1.3rem; height: 1.3rem; }
.download:hover .download__arrow { transform: translateY(3px); color: var(--accent); }

/* ---------- Contact ---------- */
.contact-card {
  display: grid;
  gap: 1rem;
  padding: 1.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  max-width: 40rem;
}
.contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.contact-row .label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  min-width: 4.5rem;
}
.contact-row .value { font-size: var(--step-0); color: var(--ink); word-break: break-word; }
.contact-row a.value { color: var(--sky); text-decoration: none; }
.contact-row a.value:hover { color: var(--sky-strong); text-decoration: underline; }
.copy-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.6rem;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  color: var(--ink-mid);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.copy-btn:hover { color: var(--ink); border-color: var(--accent); }
.copy-btn.is-done { color: var(--accent); border-color: var(--accent); }

/* ---------- Callout ---------- */
.callout {
  display: grid;
  gap: 1rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 200px at 12% 0%, var(--accent-glow), transparent 70%),
    var(--surface);
  max-width: 62rem;
}
.callout h3 { font-size: var(--step-2); }
.callout p { color: var(--ink-mid); max-width: 54ch; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: clamp(1rem, 4vw, 2rem);
  bottom: clamp(1rem, 4vw, 2rem);
  z-index: 80;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 14px 34px -12px var(--accent-glow);
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.to-top.is-visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.to-top:hover { transform: translateY(-2px); }
.to-top svg { width: 18px; height: 18px; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: clamp(3rem, 10vw, 7rem);
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--ground-2) 92%, transparent);
}
.site-footer__inner {
  max-width: 1200px;
  margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 4rem) var(--edge) 2rem;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.4fr 1fr 1.6fr;
}
.site-footer__brand p { margin-top: 0.8rem; color: var(--ink-dim); font-size: var(--step--1); max-width: 28ch; }
.site-footer h2 {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  margin-bottom: 0.9rem;
}
.site-footer__links { display: grid; gap: 0.5rem; align-content: start; }
.site-footer__links a { color: var(--ink-mid); text-decoration: none; font-size: var(--step--1); width: fit-content; }
.site-footer__links a:hover { color: var(--ink); }
.site-footer__credits p { color: var(--ink-mid); font-size: var(--step--1); line-height: 1.7; }
.site-footer__credits p + p { margin-top: 0.7rem; }
.site-footer__credits a { color: var(--sky); text-decoration: none; word-break: break-word; }
.site-footer__credits a:hover { color: var(--sky-strong); text-decoration: underline; }
.site-footer__base {
  border-top: 1px solid var(--border);
  padding: 1.25rem var(--edge);
  text-align: center;
}
.site-footer__base p { font-family: var(--font-mono); font-size: var(--step--1); color: var(--ink-dim); max-width: 1200px; margin-inline: auto; }

/* ---------- Reveal ----------
   Hidden only once JS has confirmed it can animate them back in, so a
   broken or blocked script never leaves content invisible. */
.reveal-on [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal-on [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  /* The off-canvas drawer needs JS to open — only engage it when JS is present.
     Without JS the nav simply wraps under the bar and stays reachable. */
  .js .nav-toggle { display: grid; place-items: center; }

  /* backdrop-filter would make the header a containing block for the
     position:fixed drawer nested inside it — use a solid header instead */
  .js .site-header.is-stuck {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--ground-2);
  }
  .js .primary-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(20rem, 84vw);
    z-index: 95;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 5.5rem 1.25rem 2rem;
    background: var(--ground-2);
    border-left: 1px solid var(--border);
    box-shadow: -30px 0 80px -30px rgba(0,0,0,0.7);
    transform: translateX(102%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
  }
  .js body.nav-open .primary-nav { transform: translateX(0); }

  .primary-nav {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.15rem;
  }
  .primary-nav a {
    padding: 0.65rem 0.7rem;
  }
  .js .primary-nav a {
    padding: 0.9rem 0.85rem;
    font-size: var(--step-0);
    border-radius: 10px;
  }
  .js .primary-nav a[aria-current="page"] { background: var(--surface); }
  .js .primary-nav a[aria-current="page"]::after { display: none; }
}

@media (max-width: 720px) {
  .site-footer__inner { grid-template-columns: 1fr; gap: 1.75rem; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-on [data-reveal] { opacity: 1 !important; transform: none !important; }
  .hero__media { inset: 0; transform: none !important; }
}

@media (prefers-contrast: more) {
  :root { --border: rgba(155,199,223,0.4); --ink-mid: #d3ddec; }
}
