/* ======================================================================
   Orbit Influence
   Palette from the view from orbit: deep blue-black space, the
   cyan → violet → amber atmospheric limb, warm city-light gold.
   The 3D flight turns on with .webgl; without it the page is a normal,
   flat layout (no WebGL, or reduced motion).
   ====================================================================== */

:root {
  --void: #07080f;
  --void-2: #0a0c16;
  --deep: #0d1020;
  --line: rgba(150, 165, 215, 0.14);
  --line-strong: rgba(150, 165, 215, 0.28);

  --airglow: #5fe3ff;
  --ion: #a676ff;
  --signal: #ffb155;
  --signal-hover: #ffc47a;

  --starlight: #eff2fb;
  --dust: #8a95b6;
  --dust-dim: #6b7598;
  --ink: #070915;

  --font-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, sans-serif;

  --pad: clamp(1rem, 5vw, 6rem);
  --maxw: 1320px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* smooth scroll (Lenis) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--void);
  color: var(--starlight);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Deep space behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -4;
  background: radial-gradient(130% 90% at 50% -10%, #141c3a 0%, var(--void-2) 45%, var(--void) 100%);
  pointer-events: none;
}

/* ---------- The fixed layers: the 3D world and its overlay ---------- */
#world,
#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#world { z-index: -2; display: block; }
#fx { z-index: -1; }
.js:not(.webgl) #world,
.js:not(.webgl) #fx { display: none; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--signal); color: var(--void); }

.skip {
  position: absolute;
  left: 50%;
  top: -60px;
  transform: translateX(-50%);
  background: var(--starlight);
  color: var(--void);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  z-index: 100;
  transition: top 0.2s;
}
.skip:focus { top: 12px; }

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

.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;
}

main { position: relative; z-index: 2; overflow-x: clip; }
section[id] { scroll-margin-top: 72px; }

h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.02;
  margin: 0;
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.82) translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade { to { opacity: 1; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--signal); color: #1a0f03; }
.btn-primary:hover { background: var(--signal-hover); }
.btn-sm { padding: 0.62rem 1.1rem; font-size: 0.92rem; }

/* ---------- Mode switch ---------- */
.mode-switch {
  display: inline-flex;
  min-width: 0;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(7, 8, 15, 0.5);
}
.mode-switch label { position: relative; cursor: pointer; }
.mode-switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.mode-switch span {
  display: block;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--dust);
  transition: background 0.2s, color 0.2s;
}
.mode-switch input:checked + span { background: var(--starlight); color: var(--void); }
.mode-switch input:focus-visible + span { outline: 2px solid var(--airglow); outline-offset: 2px; }

/* ---------- Chips ---------- */
.chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  padding: 0.48rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(7, 8, 15, 0.45);
  font-weight: 500;
  font-size: 0.93rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.25s var(--spring);
}
.chip:hover { border-color: var(--airglow); }
.chip:active { transform: scale(0.95); }
.chip[aria-pressed="true"] { background: var(--signal); border-color: transparent; color: #1a0f03; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem var(--pad);
}
/* a little shade under the bar so the links read over the bright sky */
.nav::before {
  content: "";
  position: absolute;
  inset: 0 0 -40px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 8, 15, 0.7), rgba(7, 8, 15, 0));
  transition: opacity 0.3s;
}
/* no bar and no line when scrolled: only the soft shade above stays, so the links keep reading */
.brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand-mark { color: var(--airglow); display: inline-flex; }
.brand-core { fill: var(--signal); }
.brand-sat { fill: var(--airglow); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand-name em { font-style: normal; color: var(--dust); font-weight: 600; }


.nav-links { display: flex; gap: 0.25rem; margin-left: auto; }
.nav-links a { padding: 0.5rem 0.85rem; border-radius: 999px; color: var(--dust); font-size: 0.95rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--starlight); }
.menu-btn {
  display: none;
  appearance: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(7, 8, 15, 0.6);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}
.nav-cta { padding: 0.6rem 1.15rem; font-size: 0.95rem; }

/* ======================================================================
   HERO: the matchmaker
   ====================================================================== */
.stage {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(5rem, 12vh, 8rem) var(--pad) clamp(5rem, 14vh, 9rem);
}
/* Keeps the copy legible where orbits pass behind it */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(7, 8, 15, 0.55) 0%, rgba(7, 8, 15, 0.22) 36%, rgba(7, 8, 15, 0) 52%);
  bottom: -35vh;
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 50vh), transparent 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 50vh), transparent 100%);
}
.stage-copy { position: relative; z-index: 3; width: min(36rem, 46vw); }
.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 1.2rem + 4.6vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 1.4rem 0 1.1rem;
}
.hero-title .l { display: block; white-space: nowrap; }
.hero-sub { color: var(--dust); font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.3rem); max-width: 34ch; margin: 0; }
.picker-label { margin: 0 0 0.65rem; font-weight: 600; font-size: 0.92rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.verdict {
  margin-top: 1.6rem;
  max-width: 31rem;
  padding: 1.05rem 1.2rem 1.15rem;
  border: 1px solid var(--line-strong);
  border-radius: 20px 20px 20px 6px;
  background: rgba(13, 16, 32, 0.85);
  transform-origin: 0 100%;
}
.verdict[hidden] { display: none; }
.verdict.pop { animation: pop 0.6s var(--spring) var(--d, 0s) both; }
.verdict-text { margin: 0 0 0.9rem; font-size: 0.98rem; line-height: 1.5; }
.verdict-text strong { color: var(--signal); font-weight: 600; }

.matches-wrap { position: absolute; z-index: 3; top: 50%; transform: translateY(-46%); right: var(--pad); width: clamp(11.5rem, 17vw, 14rem); }
.matches { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.match {
  display: block;
  padding: 0.75rem 0.9rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 16px 16px 16px 6px;
  background: rgba(13, 16, 32, 0.85);
  transform-origin: 0 50%;
}
.match.pop { animation: pop 0.6s var(--spring) var(--d, 0s) both; }
.match-name { display: flex; align-items: center; gap: 0.5rem; min-width: 0; font-weight: 600; font-size: 0.92rem; }
.match-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--ink); }
.match-meta { display: block; margin: 0.1rem 0 0 1.05rem; font-size: 0.8rem; color: var(--dust); }
.match-bar { display: block; height: 4px; margin: 0.65rem 0 0.4rem; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.match-bar i { display: block; width: var(--fit); height: 100%; border-radius: inherit; background: var(--signal); transform-origin: left; }
.match.pop .match-bar i { animation: grow 0.9s var(--ease) calc(var(--d, 0s) + 0.15s) both; }
@keyframes grow { from { transform: scaleX(0); } }
.match-score { font-size: 0.8rem; font-weight: 600; color: var(--signal); }
.demo-note { margin: 0.75rem 0 0; font-size: 0.75rem; color: var(--dust-dim); }

/* Labels that ride along with the 3D (positioned by main.js) */
.core-label,
.sat-label,
.core-hint {
  position: absolute; /* inside the hero, so they scroll away with it */
  left: 0;
  top: 0;
  z-index: 3;
  margin: 0;
  pointer-events: none;
  will-change: transform;
}
.js:not(.webgl) .core-label,
.js:not(.webgl) .sat-label,
.js:not(.webgl) .core-hint { display: none; }
.past-hero .core-label,
.past-hero .core-hint,
.past-hero .sat-label { visibility: hidden; }
.core-label { font-weight: 600; font-size: 0.85rem; white-space: nowrap; text-shadow: 0 1px 10px rgba(7, 8, 15, 0.95); }
.core-hint { font-size: 0.82rem; color: var(--dust); white-space: nowrap; opacity: 0; }
.sat-label {
  display: grid;
  gap: 0.05rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 14px 14px 14px 5px;
  background: rgba(13, 16, 32, 0.9);
  font-size: 0.8rem;
  white-space: nowrap;
  animation: pop 0.3s var(--spring) both;
}
.sat-label[hidden] { display: none; }
.sat-label b { font-size: 0.9rem; }
.sat-label span { color: var(--dust); }
.sat-label em { font-style: normal; font-weight: 600; color: var(--signal); }

/* ======================================================================
   SECTIONS (flat layout first)
   ====================================================================== */
.sec { max-width: var(--maxw); margin: 0 auto; padding: clamp(5rem, 12vh, 8rem) var(--pad); position: relative; }
.sec-head { max-width: 46rem; margin-bottom: 3rem; }
.sec-head h2 { font-size: clamp(2.2rem, 1.4rem + 3vw, 3.8rem); margin-bottom: 1rem; }
.sec-intro { margin: 0; max-width: 52ch; color: var(--dust); }

/* How it works */
.steps { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.25rem; }
.steps[hidden] { display: none; }
.step { position: relative; }
.step:nth-child(1) { --i: 0; }
.step:nth-child(2) { --i: 1; }
.step:nth-child(3) { --i: 2; }
.step:nth-child(4) { --i: 3; }
.step:nth-child(5) { --i: 4; }
.step-node {
  display: block;
  width: 14px;
  height: 14px;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--deep);
  border: 2px solid var(--signal);
}
.step-bubble {
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px 18px 18px 18px;
  background: rgba(13, 16, 32, 0.88);
  transform-origin: 0 0;
}
.step-n { display: block; margin-bottom: 0.35rem; font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; color: var(--signal); }
.step h3 { margin: 0 0 0.3rem; font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; line-height: 1.2; }
.step p { margin: 0; color: var(--dust); font-size: 0.95rem; line-height: 1.5; }
.js .how:not(.run) .step-bubble { opacity: 0; }
.how.run .step-bubble { animation: pop 0.6s var(--spring) calc(var(--i) * 0.12s) both; }

/* Past work */
.work-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 4vw, 4rem); align-items: center; }
.constellation { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.collab {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(13, 16, 32, 0.88);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.collab:hover { border-color: var(--airglow); }
.collab b { display: block; font-weight: 600; font-size: 0.92rem; line-height: 1.25; white-space: nowrap; }
.collab small { display: block; font-size: 0.8rem; color: var(--dust); white-space: nowrap; }
.collab[aria-pressed="true"] { background: var(--signal); border-color: transparent; color: #1a0f03; }
.collab[aria-pressed="true"] small { color: rgba(26, 15, 3, 0.75); }

.collab-card { min-height: 15rem; }
.collab-detail {
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--line-strong);
  border-radius: 24px 24px 24px 6px;
  background: rgba(13, 16, 32, 0.9);
  transform-origin: 0 100%;
}
.collab-detail[hidden] { display: none; }
.collab-detail.pop { animation: pop 0.55s var(--spring) both; }
.collab-sector { margin: 0 0 0.4rem; font-size: 0.85rem; font-weight: 600; color: var(--airglow); }
.collab-detail h3 { margin: 0 0 0.6rem; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); letter-spacing: -0.02em; line-height: 1.1; }
.collab-detail > p:not(.collab-sector) { margin: 0 0 1.4rem; color: var(--dust); }
.collab-stats { display: flex; flex-wrap: wrap; gap: 2rem; margin: 0; }
.collab-stats div { display: flex; flex-direction: column; }
.collab-stats dt { order: 2; font-size: 0.85rem; color: var(--dust); }
.collab-stats dd { order: 1; margin: 0; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--signal); font-variant-numeric: tabular-nums; }

.work-reach { margin: 3rem 0 0; max-width: 40ch; color: var(--dust); font-size: clamp(1rem, 0.95rem + 0.35vw, 1.25rem); }
.work-reach-num {
  display: block;
  margin-bottom: 0.2rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--starlight);
}

.dive { height: 0; }

/* Contact: a letter with blanks */
.contact-inner { max-width: 46rem; margin: 0; text-align: left; position: relative; }
/* a soft shadow behind the words, so characters behind them never fight the text */
.contact-inner::before {
  content: "";
  position: absolute;
  inset: -4rem -5rem;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(7, 8, 15, 0.82), rgba(7, 8, 15, 0.55) 60%, rgba(7, 8, 15, 0));
}
.contact-inner h2 { font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4.4rem); letter-spacing: -0.035em; line-height: 1.02; margin: 1.4rem 0 1.4rem; }
.letter-line {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 0.95rem + 1.25vw, 2rem);
  line-height: 1.8;
  letter-spacing: -0.01em;
  color: var(--starlight);
}
.letter-line[hidden] { display: none; }
.letter-line input {
  font: inherit;
  letter-spacing: inherit;
  color: var(--signal);
  background: transparent;
  border: 0;
  border-bottom: 2px solid rgba(239, 242, 251, 0.35);
  border-radius: 0;
  padding: 0 0.06em;
  margin: 0 0 0 0.06em;
  min-width: 3ch;
  max-width: 100%;
  transition: border-color 0.2s;
}
.letter-line input::placeholder { color: rgba(239, 242, 251, 0.36); }
.letter-line input:focus { outline: none; border-bottom-color: var(--signal); }
.letter.tried .letter-line input:invalid { border-bottom-color: #ff8a5c; }
.letter-send { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; margin-top: 2.2rem; }
.letter-note { margin: 0; max-width: 34ch; color: var(--dust); font-size: 0.95rem; line-height: 1.5; }
.form-hint { margin: 1rem 0 0; min-height: 1.2em; font-size: 0.92rem; color: var(--signal); }
.contact-direct { margin: 2.4rem 0 0; color: var(--dust); }
.contact-direct a { color: var(--starlight); border-bottom: 1px solid var(--line-strong); }
.contact-direct a:hover { border-color: var(--airglow); }

.foot {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  padding: 2rem var(--pad);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--dust-dim);
}

/* ======================================================================
   THE FLIGHT (.webgl): sections pin while the camera flies, and the
   HTML rides along with the 3D
   ====================================================================== */
.webgl .how,
.webgl .work { max-width: none; padding: 0; }
.webgl .how { height: 330vh; }
.webgl .work { height: 170vh; }
.webgl .pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  padding: clamp(5.5rem, 12vh, 7.5rem) var(--pad) 2rem;
}
.webgl .how .sec-head,
.webgl .work .sec-head { position: relative; z-index: 3; max-width: 34rem; margin-bottom: 0; }
.webgl .how .sec-head h2 { text-shadow: 0 2px 24px rgba(7, 8, 15, 0.8); }

/* How: each bubble rides along with its beacon */
.webgl .trajectory { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.webgl .steps { position: absolute; inset: 0; display: block; }
.webgl .steps[hidden] { display: none; }
.webgl .step {
  position: absolute;
  left: 0;
  top: 0;
  width: min(17rem, 38vw);
  visibility: hidden;
  will-change: transform, opacity;
  transform-origin: 0 0;
  pointer-events: auto;
}
.webgl .step-node { display: none; }
/* the script fades each bubble in with its planet (the flat layout's hide-until-run rule doesn't apply here) */
.webgl .how:not(.run) .step .step-bubble { opacity: 1; }

/* Work: the planets are 3D; the labels sit under them */
.webgl .work-grid { display: block; }
.webgl .constellation { position: fixed; inset: 0; z-index: 2; display: block; pointer-events: none; opacity: 0; }
.webgl .collab {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  pointer-events: auto;
  will-change: transform;
  border-radius: 14px;
  padding: 0.45rem 0.8rem;
}
.webgl .collab-card {
  position: absolute;
  z-index: 3;
  right: var(--pad);
  top: 50%;
  transform: translateY(-50%);
  width: min(24rem, 32vw);
  min-height: 0;
}
.webgl .work-reach { position: absolute; z-index: 3; right: var(--pad); bottom: clamp(1.5rem, 5vh, 3rem); width: min(24rem, 32vw); margin: 0; }
.webgl .work-reach-num { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.4rem); }

/* The dive: scroll room while the camera drops through the clouds */
/* room for the dive and the switch to characters */
.webgl .dive { height: 170vh; }

/* Contact: the letter sits on the left, the ASCII planet turns on the right */
.webgl .contact { max-width: none; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; }
.webgl .contact-inner { opacity: 0; visibility: hidden; }
.webgl .foot { background: rgba(7, 8, 15, 0.6); }

/* ======================================================================
   Load sequence for the hero (gated on .js so nothing stays hidden without it)
   ====================================================================== */
.js .hero-switch,
.js .hero-title .l,
.js .hero-sub,
.js .picker,
.js .matches-wrap { opacity: 0; }
.loaded .hero-switch { animation: rise 0.8s var(--ease) forwards; }
.loaded .hero-title .l { animation: rise 0.9s var(--ease) 0.08s forwards; }
.loaded .hero-title .l:nth-child(2) { animation-delay: 0.16s; }
.loaded .hero-sub { animation: rise 0.9s var(--ease) 0.28s forwards; }
.loaded .picker { animation: rise 0.9s var(--ease) 0.4s forwards; }
.loaded .matches-wrap { animation: fade 1.2s ease 0.8s forwards; }

/* ======================================================================
   Responsive
   ====================================================================== */
@media (max-width: 1100px) {
  .steps { grid-template-columns: repeat(3, 1fr); row-gap: 2.5rem; }
}

@media (max-width: 900px) {
  .nav { padding: 0.85rem var(--pad); gap: 0.6rem; }
  .menu-btn { display: inline-flex; margin-left: auto; }
  .nav-links {
    position: absolute;
    top: calc(100% - 0.25rem);
    right: var(--pad);
    display: none;
    flex-direction: column;
    align-items: stretch;
    min-width: 12rem;
    margin: 0;
    padding: 0.4rem;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: rgba(13, 16, 32, 0.97);
  }
  .nav.menu-open .nav-links { display: flex; animation: pop 0.35s var(--spring) both; transform-origin: top right; }
  .nav-links a { padding: 0.75rem 1rem; color: var(--starlight); }
  .nav-cta { display: none; }

  .stage { display: block; min-height: 100svh; padding: calc(64px + 76vw) var(--pad) 2rem; }
  /* Earth's bright horizon sits behind the copy on phones: dim it there */
  /* the shade runs 35vh past the hero (so it fades out with no seam): stops are set for that taller box */
  .stage::after { background: linear-gradient(180deg, rgba(7, 8, 15, 0) 0%, rgba(7, 8, 15, 0) 27%, rgba(7, 8, 15, 0.8) 40%, rgba(7, 8, 15, 0.85) 100%); }
  .hero-sub { color: #b9c1db; }
  .stage-copy { width: auto; }
  .hero-title { margin-top: 1.1rem; }
  .matches-wrap { top: 72px; transform: none; width: 46vw; }
  .matches { gap: 0.45rem; }
  .match { padding: 0.45rem 0.6rem 0.5rem; border-radius: 12px 12px 12px 5px; line-height: 1.3; }
  .match-name { font-size: 0.78rem; gap: 0.4rem; }
  .match-meta { display: none; }
  .match-bar { height: 3px; margin: 0.35rem 0 0.25rem; }
  .match-score { font-size: 0.72rem; }
  .demo-note { margin-top: 0.45rem; font-size: 0.68rem; line-height: 1.3; }
  .stage .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 calc(var(--pad) * -1);
    padding: 0.1rem var(--pad) 0.35rem;
    scrollbar-width: none;
  }
  .stage .chips::-webkit-scrollbar { display: none; }
  .stage .chip { flex: none; }
  .core-hint { display: none; }

  .steps { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; }

  .webgl .step { width: min(17rem, 72vw); transform-origin: 50% 0; }
  .webgl .collab { padding: 0.35rem 0.65rem; }
  .webgl .collab b { font-size: 0.82rem; }
  .webgl .collab small { font-size: 0.72rem; }
  .webgl .collab-card { left: var(--pad); right: var(--pad); top: auto; bottom: 1rem; transform: none; width: auto; }
  .webgl .collab-detail { padding: 1rem 1.1rem; }
  .webgl .collab-detail h3 { font-size: 1.3rem; margin-bottom: 0.3rem; }
  .webgl .collab-detail > p:not(.collab-sector) { margin-bottom: 0.8rem; font-size: 0.92rem; }
  .webgl .collab-stats dd { font-size: 1.25rem; }
  .webgl .work-reach { display: none; }
}

@media (max-width: 900px) {
  /* the planet turns above the letter on phones */
  .webgl .contact { align-items: flex-end; padding-top: 52vh; }
  .contact-inner::before {
    inset: -3rem calc(var(--pad) * -1);
    background: linear-gradient(180deg, rgba(7, 8, 15, 0), rgba(7, 8, 15, 0.88) 3rem, rgba(7, 8, 15, 0.88) calc(100% - 3rem), rgba(7, 8, 15, 0));
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .hero-switch,
  .js .hero-title .l,
  .js .hero-sub,
  .js .picker,
  .js .matches-wrap,
  .js .step-bubble { opacity: 1 !important; }
}
