@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin-var.woff2") format("woff2");
}

:root {
  --space: #05070e;
  --thermo: #0c1442;
  --thermo-deep: #090f33;
  --meso: #172a86;
  --strato: #2c51bd;
  --tropo: #b3cdf1;
  --ground: #1f231b;

  --ink: #f2f5ff;
  --ink-soft: #c9d4ff;
  --ink-quiet: #93a2e6;
  --ink-dark: #0c1442;
  --ink-dark-soft: #233a7a;
  --signal: #ff6a2b;
  --signal-hover: #ff8a55;
  --hair: rgba(201, 212, 255, 0.24);
  --hair-dark: rgba(12, 20, 66, 0.22);

  --rail: 104px;
  --gutter: clamp(24px, 5vw, 80px);
  --section-pad: clamp(96px, 14vh, 168px);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--strato) var(--thermo-deep);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--space);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

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

.nowrap { white-space: nowrap; }

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 50;
  background: var(--signal);
  color: var(--ink-dark);
  padding: 10px 16px;
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 16px; }

/* ── Altitude rail ─────────────────────────────────────────── */

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  z-index: 20;
  background: var(--space);
  border-right: 1px solid var(--hair);
}

.rail-scale {
  position: absolute;
  top: 96px;
  bottom: 156px;
  left: 0;
  right: 0;
}

.rail-scale::before {
  content: "";
  position: absolute;
  left: 44px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--hair);
}

.rail-unit {
  position: absolute;
  top: -40px;
  left: 0;
  width: 36px;
  text-align: right;
  font-stretch: 75%;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

.rail-tick {
  position: absolute;
  left: 0;
  top: calc((100 - var(--alt)) * 1%);
  width: 36px;
  transform: translateY(-50%);
  text-align: right;
  font-stretch: 75%;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-quiet);
}

.rail-tick::after {
  content: "";
  position: absolute;
  right: -12px;
  top: 50%;
  width: 8px;
  height: 1px;
  background: var(--ink-quiet);
}

.rail-layers li {
  position: absolute;
  left: 45px;
  right: 0;
  top: calc((100 - var(--from)) * 1%);
  height: calc((var(--from) - var(--to)) * 1%);
}

.rail-layers a {
  display: block;
  height: 100%;
  transition: background-color 200ms var(--ease-out);
}

.rail-layers a:hover { background: rgba(242, 245, 255, 0.12); }

.sonde {
  position: absolute;
  left: 44px;
  top: calc(var(--y, 0) * 1%);
  width: 0;
  height: 0;
  transition: top 420ms var(--ease-out);
  pointer-events: none;
}

.rocket {
  position: absolute;
  left: -10px;
  top: -34px;
  width: 20px;
  height: 40px;
  overflow: visible;
}

/* Exhaust colours follow the altitude (set from script): faint blue-violet near vacuum, blue-white, pale
   gold, then the full orange burn in the troposphere. */
.rocket stop.flame-core { stop-color: var(--flame-core, #fff1d6); }
.rocket stop.flame-outer { stop-color: var(--flame-outer, #ff6a2b); }
.rocket path.flame-core { fill: var(--flame-core, #fff1d6); }
.rocket path.flame-mid { fill: var(--flame-mid, #ffb066); }
.rocket path.flame-outer { fill: var(--flame-outer, #ff6a2b); }

/* Cruise: a thin plume while the rocket is high up (--trail, 0 to 1), shortening below 70 km (--trail-len). */
.rocket-trail {
  opacity: var(--trail, 1);
  transform-box: view-box;
  transform-origin: 10px 30px;
  transform: scaleY(var(--trail-len, 1));
  transition: opacity 300ms linear, transform 300ms var(--ease-out);
}

.rocket-trail-flicker {
  transform-box: view-box;
  transform-origin: 10px 30px;
  animation: rocket-trail 90ms steps(2) infinite alternate;
}

@keyframes rocket-trail {
  from { transform: scale(0.8, 0.9); }
  to { transform: scale(1.15, 1.06); }
}

/* The landing burn: short and wide, its size following --burn (0 off, 1 full), set from the altitude. */
.rocket-flame {
  transform-box: view-box;
  transform-origin: 10px 30px;
  transform: scaleY(var(--burn, 0));
  opacity: min(1, calc(var(--burn, 0) * 4));
  transition: transform 260ms var(--ease-out), opacity 200ms linear;
}

.rocket-flicker {
  transform-box: view-box;
  transform-origin: 10px 30px;
  animation: rocket-flicker 120ms steps(2) infinite alternate;
}

@keyframes rocket-flicker {
  from { transform: scale(0.9, 0.86); }
  to { transform: scale(1.05, 1.08); }
}

.rocket-legs {
  transform-box: view-box;
  transform-origin: 10px 26px;
  transform: scaleX(var(--legs, 0.3));
  opacity: var(--legs, 0);
  transition: transform 400ms var(--ease-out), opacity 300ms linear;
}

/* Smoke billowing out across the pad in the last few km (--smoke, 0 to 1). It sits behind the rocket and
   spreads past the ruler; once the engine cuts it drifts outward and fades. */
.rocket-smoke {
  position: absolute;
  left: -78px;
  top: -40px;
  width: 156px;
  height: 46px;
  z-index: -1;
  background:
    radial-gradient(closest-side at 18% 70%, rgba(214, 220, 236, 0.85), rgba(214, 220, 236, 0)),
    radial-gradient(closest-side at 36% 52%, rgba(232, 236, 246, 0.9), rgba(232, 236, 246, 0)),
    radial-gradient(closest-side at 50% 66%, rgba(242, 245, 255, 0.95), rgba(242, 245, 255, 0)),
    radial-gradient(closest-side at 64% 50%, rgba(226, 231, 244, 0.9), rgba(226, 231, 244, 0)),
    radial-gradient(closest-side at 82% 70%, rgba(208, 215, 232, 0.85), rgba(208, 215, 232, 0));
  background-size: 46% 90%, 44% 100%, 48% 80%, 44% 100%, 46% 90%;
  background-position: 0% 100%, 26% 0%, 50% 100%, 74% 0%, 100% 100%;
  background-repeat: no-repeat;
  opacity: var(--smoke, 0);
  transform-origin: 50% 100%;
  transform: scale(calc(0.25 + var(--smoke, 0) * 0.75), calc(0.4 + var(--smoke, 0) * 0.6));
  transition: opacity 250ms linear, transform 300ms var(--ease-out);
  animation: rocket-billow 1.6s ease-in-out infinite alternate;
  pointer-events: none;
}

.rocket { z-index: 1; }

@keyframes rocket-billow {
  from { background-position: 0% 100%, 26% 0%, 50% 100%, 74% 0%, 100% 100%; }
  to { background-position: 3% 90%, 24% 10%, 50% 92%, 77% 6%, 97% 92%; }
}

.sonde.is-landed .rocket-smoke { animation: rocket-smoke-settle 2.4s var(--ease-out) forwards; }

@keyframes rocket-smoke-settle {
  from { opacity: 1; transform: scale(1, 1); }
  to { opacity: 0; transform: scale(1.35, 1.25) translateY(-4px); }
}

/* Just before touchdown the exhaust fans out across the pad (--splash, 0 to 1). */
.rocket-splash {
  position: absolute;
  left: -26px;
  top: -6px;
  width: 52px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 216, 160, 0.95), rgba(255, 106, 43, 0.6) 55%, rgba(255, 106, 43, 0));
  opacity: var(--splash, 0);
  transform: scaleX(calc(0.5 + var(--splash, 0) * 0.7));
  transition: opacity 200ms linear, transform 200ms var(--ease-out);
}

/* Touchdown: a puff of dust either side of the pad. */
.rocket-dust {
  position: absolute;
  left: -14px;
  top: -6px;
  width: 28px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(242, 245, 255, 0.55), rgba(242, 245, 255, 0));
  opacity: 0;
  transform: scaleX(0.4);
}

.sonde.is-landed .rocket-dust { animation: rocket-dust 900ms var(--ease-out) 1; }

@keyframes rocket-dust {
  0% { opacity: 0.9; transform: scaleX(0.4); }
  100% { opacity: 0; transform: scaleX(1.8) translateY(-3px); }
}

.readout {
  position: absolute;
  left: 14px;
  right: 8px;
  bottom: 28px;
  display: grid;
  gap: 2px;
  margin: 0;
  font-stretch: 75%;
  font-variant-numeric: tabular-nums;
}

.readout-values { display: grid; gap: 2px; }

.sections-toggle { display: none; }

.sections {
  position: fixed;
  inset: auto 16px 56px auto;
  margin: 0;
  min-width: 220px;
  padding: 6px 0;
  background: var(--thermo-deep);
  color: var(--ink);
  border: 1px solid var(--hair);
  box-shadow: 0 16px 40px -16px rgba(3, 6, 26, 0.7);
}

.sections a {
  display: block;
  padding: 12px 18px;
  text-decoration: none;
  font-weight: 600;
}

.sections a:hover { background: rgba(201, 212, 255, 0.08); }

.readout [data-alt] {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--signal);
  line-height: 1.1;
}

.readout [data-temp] { font-size: 1rem; color: var(--ink); }

/* ── Sky and layers ────────────────────────────────────────── */

.sky {
  position: relative;
  margin-left: var(--rail);
  overflow: hidden;
}

.profile {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.profile-line {
  fill: none;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.profile-axis line { stroke: rgba(201, 212, 255, 0.35); stroke-width: 1; }

.profile-axis text,
.profile-labels text {
  font-family: "Archivo", system-ui, sans-serif;
  font-stretch: 75%;
  font-size: 12px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.layer,
.ground {
  position: relative;
  padding: var(--section-pad) var(--gutter);
}

.layer > *,
.ground > * {
  position: relative;
  z-index: 2;
}

.layer--thermo { background: var(--space); }

/* Noctilucent clouds sit just under the mesopause, so their canvas covers only the top of the products band. */


.clouds { animation: cloud-drift 120s ease-in-out infinite alternate; }

@keyframes cloud-drift {
  from { transform: translateX(-1.5%); }
  to { transform: translateX(1.5%); }
}
.layer--meso { background: var(--meso); }
.layer--strato { background: var(--strato); }
.layer--tropo { background: var(--tropo); color: var(--ink-dark); }

.layer-head {
  display: flex;
  align-items: last baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--hair);
  margin-bottom: clamp(32px, 5vw, 56px);
}

.layer--tropo .layer-head { border-bottom-color: var(--hair-dark); }

.section-title {
  font-size: clamp(2.5rem, 6vw, 5.25rem);
  line-height: 0.95;
  font-weight: 800;
  font-stretch: 118%;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.range {
  font-stretch: 75%;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  white-space: nowrap;
}

.layer--tropo .range { color: var(--ink-dark-soft); }

.section-lede {
  max-width: 44ch;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.45;
  color: var(--ink-soft);
  margin-bottom: clamp(40px, 5vw, 64px);
}

/* ── Hero ──────────────────────────────────────────────────── */

.layer > .stars,
.layer > .clouds {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Wider than the band so the slow drift never shows a canvas edge. */
.layer > .clouds { left: -4%; width: 108%; }
.layer > .clouds--noctilucent { bottom: auto; height: 220px; }

.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "top top"
    "mark mark"
    "body unit";
  column-gap: clamp(32px, 5vw, 80px);
  padding-top: 32px;
  padding-bottom: clamp(48px, 8vh, 96px);
}

.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-stretch: 112%;
  font-size: 1.125rem;
  letter-spacing: 0.01em;
}

.brand-mark { width: 26px; height: 26px; color: var(--ink); }

.toplinks { display: flex; gap: clamp(20px, 3vw, 40px); }

.toplinks a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  padding: 6px 0;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
  transition: color 200ms var(--ease-out), background-size 300ms var(--ease-out);
}

.toplinks a:hover { color: var(--ink); background-size: 100% 1px; }

.hero-body {
  grid-area: body;
  align-self: end;
}

.wordmark {
  grid-area: mark;
  align-self: end;
  padding-top: clamp(40px, 8vh, 96px);
  margin-bottom: clamp(28px, 4vw, 48px);
  font-size: clamp(3.5rem, 12.5vw, 11.5rem);
  line-height: 0.84;
  font-weight: 850;
  font-stretch: 125%;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  margin-left: -0.04em;
}

.lede {
  max-width: 40ch;
  text-wrap: pretty;
  font-size: clamp(1.1875rem, 1.7vw, 1.5rem);
  line-height: 1.4;
  color: var(--ink-soft);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin-top: 28px;
}

.textlink {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  text-decoration-color: var(--ink-quiet);
  transition: text-decoration-color 200ms var(--ease-out);
}

.textlink:hover { text-decoration-color: currentColor; }

.instrument--hero {
  grid-area: unit;
  align-self: end;
}

/* ── Instruments ───────────────────────────────────────────── */

.instrument {
  background: var(--thermo);
  border: 1px solid var(--hair);
  padding: clamp(22px, 2.4vw, 32px);
  box-shadow: 0 24px 48px -24px rgba(3, 6, 26, 0.6);
}

.layer--thermo .instrument { background: #111c5a; }

.band {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding-top: 14px;
  margin-top: 24px;
  border-top: 1px solid var(--hair);
  font-stretch: 75%;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--signal);
  font-weight: 700;
}

.live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.instrument-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-mark { width: 34px; height: 34px; color: var(--ink); flex: none; }

.instrument-head h2,
.instrument-head h3 {
  font-size: clamp(2rem, 3vw, 2.625rem);
  line-height: 1;
  font-weight: 800;
  font-stretch: 108%;
  letter-spacing: -0.015em;
}

.instrument-copy {
  margin: 12px 0 24px;
  font-size: 1.125rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  background: var(--signal);
  color: var(--ink-dark);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  transition: background-color 200ms var(--ease-out);
}

.button svg {
  width: 16px;
  height: 16px;
  transition: transform 260ms var(--ease-out);
}

.button:hover { background: var(--signal-hover); }
.button:hover svg { transform: translateX(3px); }
.button:active { background: var(--signal); }
.button:focus-visible { outline-color: var(--ink); }

.fleet {
  display: grid;
  grid-template-columns: minmax(0, 860px);
  gap: clamp(20px, 2.5vw, 32px);
  align-items: start;
}

.instrument--full .instrument-copy { max-width: 46ch; }

.readings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(24px, 3vw, 40px);
  margin-bottom: 32px;
}

.readings div {
  padding: 18px 0;
  border-top: 1px solid var(--hair);
}

.readings dt {
  font-stretch: 75%;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 6px;
}

.readings dd { color: var(--ink-soft); line-height: 1.5; }

/* ── Principles ────────────────────────────────────────────── */

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px);
}

.principles li {
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}

.principles h3 {
  font-size: clamp(1.375rem, 2vw, 1.75rem);
  line-height: 1.15;
  font-weight: 750;
  font-stretch: 108%;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  text-wrap: balance;
}

.principles p {
  color: #e6ecff;
  max-width: 38ch;
}

/* ── Contact ───────────────────────────────────────────────── */

.layer--tropo { padding-top: clamp(64px, 10vh, 112px); padding-bottom: clamp(64px, 10vh, 112px); }

.layer--tropo .section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-stretch: 108%;
  letter-spacing: -0.01em;
}

.layer--tropo .layer-head {
  padding-bottom: 14px;
  margin-bottom: 24px;
}

.contact {
  display: grid;
  justify-items: start;
  gap: 24px;
}

.contact-copy {
  max-width: 52ch;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--ink-dark-soft);
}

.contact-mail {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 20px;
  border: 1px solid var(--ink-dark);
  color: var(--ink-dark);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out);
}

.contact-mail:hover { background: var(--ink-dark); color: var(--tropo); }
.layer--tropo :focus-visible { outline-color: var(--ink-dark); }
.layer--tropo ::selection { background: var(--ink-dark); color: var(--tropo); }

/* ── Ground ────────────────────────────────────────────────── */

.ground {
  background: var(--ground);
  color: #e4e7dc;
  padding-top: 40px;
  padding-bottom: 40px;
  border-top: 3px solid #4a5338;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px 40px;
}

.ground-brand { font-weight: 800; font-stretch: 112%; }

.ground-links { display: flex; flex-wrap: wrap; gap: 8px 28px; }

.ground-links a {
  text-decoration: none;
  color: #c7ccb8;
}

.ground-links a:hover { color: #ffffff; text-decoration: underline; text-underline-offset: 0.3em; }

.ground-note {
  margin-left: auto;
  color: #b4baa3;
  font-size: 0.9375rem;
}

/* ── Smaller screens ───────────────────────────────────────── */

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto auto;
    grid-template-areas: "top" "mark" "body" "unit";
  }
  .instrument--hero {
    justify-self: start;
    width: min(100%, 480px);
    margin-top: 48px;
  }
  .fleet { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  :root { --rail: 0px; --gutter: 16px; }

  body { padding-bottom: 48px; }

  .rail {
    inset: auto 0 0 0;
    width: auto;
    height: 48px;
    border-right: 0;
    border-top: 1px solid var(--hair);
  }

  .rail-scale { display: none; }

  .readout {
    position: static;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
  }

  .readout-values { display: flex; align-items: baseline; gap: 14px; }
  .readout [data-alt] { font-size: 1.0625rem; }
  .readout [data-temp] { font-size: 0.9375rem; }

  .sections-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    min-height: 40px;
    padding: 0 4px 0 12px;
    background: none;
    border: 0;
    color: var(--ink);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
  }

  .sections-toggle svg { width: 16px; height: 16px; }
  .sections-toggle:focus-visible { outline-offset: -3px; }

  .toplinks { display: none; }

  .principles { grid-template-columns: minmax(0, 1fr); }
  .readings { grid-template-columns: minmax(0, 1fr); }

  .wordmark { font-stretch: 112%; font-size: clamp(3.25rem, 16.5vw, 6rem); }


  .profile { display: none; }

  .ground-note { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* One near-instant pass, not an endless one: a looping animation cut to 0.01ms would strobe. */
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
