/* Perihelion: space data API landing
   1. Tokens, base and browser surfaces themed from the star-atlas palette.
   2. The fixed stage (starfield, fallback globe, canvas, projected tags), nav and camera readout.
   3. Content plates alternating left and right (full-height atlas pages on wide screens), their contents, the footer.
   4. Components: the themed kit that replaces native UI (listbox select, notice, confirmation dialog, tooltip). */

/* ---------- Tokens ---------- */
:root {
  --space: #05070d;          /* deep space, the ground of the page */
  --void: #03050a;           /* wells: code, inputs */
  --plate: #080b14;          /* plate surface */
  --line: #1c2740;           /* hairlines */
  --line-strong: #34435f;    /* control borders, scale ticks */
  --star: #e8ecf4;           /* star white */
  --text: #aab6cc;           /* muted blue-grey body text */
  --mute: #8493ae;           /* labels, secondary */
  --amber: #ffb000;          /* the satellite, and actions */
  --amber-hi: #ffc640;
  --amber-ink: #171000;
  --fault: #ff8a73;          /* form errors only */

  --font: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;
  --gutter: clamp(16px, 4vw, 56px);
  --nav-h: 68px;

  --radius: 2px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background: var(--space);
  color-scheme: dark;
  scrollbar-color: var(--line-strong) var(--space);
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--space) url("assets/stars.svg");
  color: var(--text);
  font: 400 1.0625rem/1.55 var(--font);
  accent-color: var(--amber);
  caret-color: var(--amber);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* Scrollbars: a thin graduated rail in the hairline colours. */
::-webkit-scrollbar { width: 12px; height: 10px; background: var(--space); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border: 3px solid var(--space); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--mute); }
::-webkit-scrollbar-corner { background: var(--space); }

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

a { color: var(--star); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-color: var(--amber); }

h1, h2 { margin: 0; color: var(--star); font-weight: 560; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 5.4vw + 0.55rem, 6rem); line-height: 0.94; letter-spacing: -0.036em; }
h2 { font-size: clamp(1.875rem, 2.2vw + 1.1rem, 3.25rem); line-height: 1.02; letter-spacing: -0.028em; }
p { margin: 0; text-wrap: pretty; }

button, input, select, pre code { font: inherit; color: inherit; }
button { cursor: pointer; }

.mono { font-family: var(--mono); }

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

.skip {
  position: fixed; left: var(--s-4); top: var(--s-4); z-index: 30;
  padding: var(--s-3) var(--s-4); background: var(--amber); color: var(--amber-ink);
  font-weight: 600; text-decoration: none; border-radius: var(--radius);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- Stage ---------- */
.stage {
  position: fixed; inset: 0 0 auto 0; height: 100vh; height: 100lvh; z-index: 0;
  overflow: hidden; background: var(--space) url("assets/stars.svg");
  pointer-events: none;
}

.stage__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  opacity: 0; transition: opacity 0.5s linear;
}
.has-gl .stage__canvas { opacity: 1; }

/* Fallback globe: the radius-1 disc is 1/1.6 of the SVG box. Mirrors the WebGL framing. */
.stage__globe {
  position: absolute; left: 73%; top: 46.5%;
  width: calc(min(76vh, 54vw) * 1.6); aspect-ratio: 1;
  translate: -50% -50%;
  transition: opacity 0.5s linear, visibility 0s 0.5s;
}
.stage__globe > * { display: block; width: 100%; height: 100%; }
.has-gl .stage__globe { opacity: 0; visibility: hidden; }

.tag {
  position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform;
  transition: opacity 0.3s linear;
}
.tag[data-off] { opacity: 0; }
/* Each name carries a small dark slip so it stays legible over the land dots. */
.tag--city {
  padding: 4px 6px 4px 24px; color: var(--star); font-size: 0.875rem; font-weight: 560; line-height: 1;
  background: linear-gradient(rgb(5 7 13 / 0.84) 0 0) 18px 0 / calc(100% - 18px) 100% no-repeat;
}
.tag--city::before {            /* leader from the marker ring to the name */
  content: ""; position: absolute; left: 3px; top: 50%; width: 12px; height: 1px; background: var(--star); opacity: 0.6;
}
.tag--sat {
  margin-left: 12px; padding: 3px 5px; color: var(--amber); font: 500 0.6875rem/1 var(--mono); letter-spacing: 0.04em;
  background: rgb(5 7 13 / 0.84);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 10; height: var(--nav-h);
  display: flex; align-items: center; gap: var(--s-6);
  padding-inline: var(--gutter); border-bottom: 1px solid transparent;
  background: linear-gradient(to bottom, rgb(5 7 13 / 0.92), rgb(5 7 13 / 0.6) 60%, rgb(5 7 13 / 0));
  transition: background-color 0.4s, border-color 0.4s;
}
/* Once the page moves, the bar closes so plates pass cleanly beneath it. */
.nav[data-stuck] { background-color: var(--space); border-bottom-color: var(--line); }
/* The same closing, driven by scroll alone where the browser can, so it also holds without the script. */
@supports (animation-timeline: scroll()) {
  .nav { animation: nav-close linear both; animation-timeline: scroll(root); animation-range: 0 48px; }
  .nav[data-open] { animation: none; }
  @keyframes nav-close { to { background-color: var(--space); border-bottom-color: var(--line); } }
}

.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--star); font-size: 1.25rem; font-weight: 620; letter-spacing: -0.02em; text-decoration: none;
}
.brand__mark { flex: none; }

.nav__links { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 36px); margin-left: auto; }
.nav__links a:not(.btn) {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--text); font-size: 0.9375rem; text-decoration: none; transition: color 0.2s;
}
.nav__links a:not(.btn):hover { color: var(--star); }
.nav__toggle { display: none; }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border: 1px solid transparent; border-radius: var(--radius);
  font-size: 1rem; font-weight: 620; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, translate 0.2s var(--ease-out);
}
.btn:active { translate: 0 1px; }
.btn--solid { background: var(--amber); color: var(--amber-ink); }
.btn--solid:hover { background: var(--amber-hi); }
.btn:disabled, .btn[aria-disabled="true"]:not([data-busy]) { border-color: var(--line); background: var(--line); color: var(--mute); cursor: not-allowed; }
.btn--line { border-color: var(--line-strong); color: var(--star); background: rgb(5 7 13 / 0.6); }
.btn--line:hover { border-color: var(--amber); color: var(--amber); }
.btn--small { min-height: 44px; padding: 0 10px; font-size: 0.875rem; width: 100%; }
.btn--wide { width: 100%; min-height: 52px; }
.nav__cta { min-height: 40px; padding: 0 16px; font-size: 0.9375rem; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  color: var(--star); font-weight: 560; text-decoration: underline; text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px; text-underline-offset: 0.3em;
}
.link-arrow svg { transition: translate 0.3s var(--ease-out); }
.link-arrow:hover svg { translate: 4px 0; }
.link-arrow--btn { padding: 0; border: 0; background: none; }

/* ---------- Camera readout ---------- */
/* An instrument in the header: full labels on wide screens, figures only below that, two rows on phones. */
.readout {
  display: flex; align-items: baseline; gap: 10px; padding: 7px 12px;
  border: 1px solid var(--line); background: rgb(5 7 13 / 0.86);
  font: 400 0.71875rem/1 var(--mono); letter-spacing: 0.02em; white-space: nowrap;
  font-variant-numeric: tabular-nums; pointer-events: none;
}
.readout__k { color: var(--mute); }
.readout__v { color: var(--star); }
.readout__v--alt { min-width: 9ch; text-align: right; }
.readout__v + .readout__k { margin-left: 8px; }

@media (max-width: 1180px) {
  .readout__k { display: none; }
  .readout__v + .readout__k { margin: 0; }
}

/* ---------- Passes (sections) and plates ---------- */
main, .foot { position: relative; z-index: 1; }

.pass {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; min-height: 100vh; min-height: 100svh;
  padding: calc(var(--nav-h) + var(--s-6)) var(--gutter) var(--s-8);
}

.plate {
  position: relative; width: 100%; max-width: 33rem;
  padding: clamp(28px, 3vw, 44px) clamp(20px, 2.8vw, 40px) clamp(24px, 2.8vw, 40px);
  border: 1px solid var(--line);
  /* The graduated top edge of an atlas plate: a minor tick every 8px, a major one every 40px. */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='9'%3E%3Cpath d='M.5 0v9' stroke='%238493ae'/%3E%3Cpath d='M8.5 0v5M16.5 0v5M24.5 0v5M32.5 0v5' stroke='%2334435f'/%3E%3C/svg%3E") 0 0 / 40px 9px repeat-x,
    rgb(8 11 20 / 0.955);
}
.plate--wide { max-width: 41rem; }
.pass[data-side="right"] .plate { justify-self: end; }

.plate > h2, .plate > div > h2 { margin-bottom: var(--s-4); }
.plate h2 + p { max-width: 34em; }
.note { margin-top: var(--s-4); color: var(--mute); font-size: 0.875rem; line-height: 1.5; }
.note span { color: var(--star); }

/* Wide screens: each plate becomes a full-height atlas page flush to its edge, facing the open chart.
   Its inner edge carries the graduation, running down the page like a latitude scale. */
@media (min-width: 961px) {
  .pass:not(.pass--hero) { padding: 0; }
  .plate, .plate--wide {
    display: flex; flex-direction: column; justify-content: center;
    width: max(42vw, 33rem); max-width: 100%; min-height: 100vh;
    padding: calc(var(--nav-h) + var(--s-7)) clamp(36px, 4.6vw, 76px) var(--s-8) var(--gutter);
    border: 0; border-right: 1px solid var(--line-strong);
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='40'%3E%3Cpath d='M0 .5h9' stroke='%238493ae'/%3E%3Cpath d='M4 8.5h5M4 16.5h5M4 24.5h5M4 32.5h5' stroke='%2334435f'/%3E%3C/svg%3E") 100% 0 / 9px 40px repeat-y,
      var(--plate);
  }
  .plate--wide { width: max(47vw, 41rem); }
  .pass[data-side="right"] .plate {
    padding-inline: clamp(36px, 4.6vw, 76px) var(--gutter);
    border-right: 0; border-left: 1px solid var(--line-strong);
    background-position: 0 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='40'%3E%3Cpath d='M0 .5h9' stroke='%238493ae'/%3E%3Cpath d='M0 8.5h5M0 16.5h5M0 24.5h5M0 32.5h5' stroke='%2334435f'/%3E%3C/svg%3E");
  }
  .plate > h2, .plate > div > h2 { margin-bottom: var(--s-5); }
  .plate h2 + p { font-size: 1.125rem; }
}

/* ---------- Hero ---------- */
/* Two rows: the statement, then the pass ruler along the foot of the first screen. */
.pass--hero {
  grid-template-rows: minmax(0, 1fr) auto; align-content: stretch;
  padding: calc(var(--nav-h) + var(--s-5)) var(--gutter) var(--s-5);
}

.hero { align-self: center; max-width: 47rem; }
.hero h1 { max-width: 8.6em; }
.lede { max-width: 27em; margin-top: var(--s-5); color: #b9c4d8; font-size: clamp(1.0625rem, 0.5vw + 0.95rem, 1.3125rem); line-height: 1.45; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-6); margin-top: var(--s-6); }

.telemetry {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  color: var(--text); font: 400 0.75rem/1.4 var(--mono); letter-spacing: 0.02em; font-variant-numeric: tabular-nums;
}
.telemetry > span:nth-child(2) { color: var(--amber); }
.telemetry__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.telemetry__rest { color: var(--mute); }

/* ---------- Pass ruler ---------- */
/* A 90 minute scale. Each mark is a button placed at --at (0 = now, 1 = 90 minutes out). */
.ruler { margin-top: var(--s-6); }
.ruler__cap {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px var(--s-5);
  color: var(--text); font-size: 0.875rem; line-height: 1.4;
}
.ruler__track { position: relative; height: 68px; }
.ruler__ticks { position: absolute; inset: auto 0 0 0; width: 100%; height: 10px; overflow: visible; }
.ruler__ticks path { vector-effect: non-scaling-stroke; stroke-width: 1; }
.ruler__minor { stroke: var(--line-strong); }
.ruler__major { stroke: var(--mute); }

.ruler__mark {
  position: absolute; left: calc(var(--at) * 100%); bottom: 6px; translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 48px; min-height: 44px; padding: 4px 2px 0; border: 0; background: none;
}
.ruler__name { padding: 2px 6px; color: var(--star); font-size: 0.9375rem; font-weight: 560; line-height: 1.15; transition: background-color 0.25s, color 0.25s; }
.ruler__t { color: var(--mute); font: 400 0.6875rem/1.3 var(--mono); font-variant-numeric: tabular-nums; }
.ruler__mark::after {          /* the mark itself: a ring that sits on the scale line */
  content: ""; width: 9px; height: 9px; margin-top: 4px; border: 1px solid var(--star); border-radius: 50%; background: var(--space);
  transition: background-color 0.25s;
}
.ruler__mark:hover .ruler__name { color: var(--amber); }
.ruler__mark[aria-pressed="true"] .ruler__name { background: var(--star); color: var(--space); font-weight: 620; }
.ruler__mark[aria-pressed="true"]::after { background: var(--star); }
.ruler__mark[aria-pressed="true"] .ruler__t { color: var(--star); }

.ruler__ends { position: relative; height: 1.2rem; margin-top: 6px; color: var(--mute); font: 400 0.6875rem/1.2rem var(--mono); }
.ruler__ends span { position: absolute; top: 0; translate: -50% 0; white-space: nowrap; }
.ruler__ends span:nth-child(1) { left: 0; translate: 0 0; }
.ruler__ends span:nth-child(2) { left: 33.333%; }
.ruler__ends span:nth-child(3) { left: 66.667%; }
.ruler__ends span:nth-child(4) { left: 100%; translate: -100% 0; }

/* ---------- Coverage ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-5); }
.chip {
  min-height: 44px; padding: 0 17px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: transparent; color: var(--star); font-size: 0.9375rem; font-weight: 500;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}
.chip:hover { border-color: var(--star); }
.chip[aria-pressed="true"] { background: var(--star); border-color: var(--star); color: var(--space); font-weight: 620; }

.pass-log { margin: var(--s-5) 0 0; }
.pass-log div {
  display: grid; grid-template-columns: 8.25rem 1fr; gap: var(--s-3); align-items: baseline;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.pass-log dt { color: var(--mute); font-size: 0.875rem; }
.pass-log dd {
  margin: 0; color: var(--star); font: 400 0.8125rem/1.5 var(--mono); font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* ---------- Code sample ---------- */
.code { margin-top: var(--s-5); border: 1px solid var(--line); background: var(--void); }
.code__bar { display: flex; justify-content: space-between; align-items: stretch; border-bottom: 1px solid var(--line); }
.tabs { display: flex; }
.tab {
  position: relative; min-height: 44px; padding: 0 14px; border: 0; background: none;
  color: var(--mute); font-size: 0.875rem; font-weight: 500; transition: color 0.2s;
}
.tab:hover { color: var(--star); }
.tab[aria-selected="true"] { color: var(--star); }
.tab::after {
  content: ""; position: absolute; inset: auto 14px -1px 14px; height: 2px; background: var(--star);
  scale: 0 1; transition: scale 0.35s var(--ease-out);
}
.tab[aria-selected="true"]::after { scale: 1 1; }
.tab:focus-visible, .copy:focus-visible { outline-offset: -3px; }

.copy {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 14px;
  border: 0; border-left: 1px solid var(--line); background: none;
  color: var(--text); font-size: 0.8125rem; font-weight: 500; transition: color 0.2s;
}
.copy:hover { color: var(--amber); }
.copy__done { opacity: 0; }
.copy[data-done] { color: var(--star); }
.copy[data-done] .copy__icon { opacity: 0; }
.copy[data-done] .copy__done { opacity: 1; }
.copy [data-copy-label] { min-width: 3.4em; text-align: left; }

.code__body {
  margin: 0; padding: 16px 18px; overflow-x: auto; color: #b8c4da;
  font: 400 0.78125rem/1.75 var(--mono); tab-size: 2; white-space: pre;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.code__body:focus-visible { outline-offset: -2px; }
.code__body--response { border-top: 1px solid var(--line); color: var(--mute); }
.t-c { color: var(--mute); }
.t-k { color: #9fb0cf; }
.t-s { color: var(--star); }
.t-n { color: var(--amber); }
.code__body--response .t-c { color: var(--star); }
.code__body--response .t-s { color: #c5cfe2; }

/* ---------- Specification table ---------- */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.spec { margin-top: var(--s-2); }
.spec th, .spec td { padding: 12px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: baseline; }
.spec tr:first-child th, .spec tr:first-child td { border-top: 0; }
.spec th { width: 38%; padding-right: var(--s-4); color: var(--mute); font-size: 0.875rem; font-weight: 500; }
.spec td { position: relative; color: var(--star); font-size: 1.0625rem; line-height: 1.4; }

/* ---------- Plans table ---------- */
.plan-pick, .plans__go { display: none; }
.plans-wrap { margin-top: var(--s-5); }
.plans { table-layout: fixed; font-size: 0.875rem; line-height: 1.35; }
.plans th, .plans td { padding: 11px 10px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.plans thead th, .plans thead td { border-top: 0; padding-top: 14px; }
.plans tr > :first-child { width: 23%; padding-left: 0; }
.plans thead th { color: var(--star); font-size: 1rem; font-weight: 620; }
.plans tbody th { color: var(--mute); font-weight: 500; }
.plans td { color: var(--star); }
.plans [data-col="operational"] { background: rgb(232 236 244 / 0.055); }
.plans__price td { color: var(--text); }
.plans__price b { display: block; color: var(--star); font-size: 1.625rem; font-weight: 560; line-height: 1.1; letter-spacing: -0.01em; }
.plans .no { color: var(--mute); }
.plans tfoot td { padding-block: 14px; }
.plans tfoot td:first-child { background: none; }

/* ---------- Key request form ---------- */
.form { display: grid; gap: var(--s-5); margin-top: var(--s-5); }
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label, .field > legend { padding: 0; color: var(--star); font-size: 0.9375rem; font-weight: 560; }
.field > legend { margin-bottom: 6px; }
.field__opt { margin-left: 6px; color: var(--mute); font-size: 0.8125rem; font-weight: 400; }
.field__hint { color: var(--mute); font-size: 0.8125rem; line-height: 1.45; }

.field input[type="email"], .field input[type="text"] {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--void); color: var(--star); font-size: 1rem; transition: border-color 0.2s;
}
.field input.mono { font-size: 0.9375rem; }
.field input::placeholder { color: #7c8aa5; opacity: 1; }
.field input[type="email"]:hover, .field input[type="text"]:hover { border-color: var(--mute); }
.field input[type="email"]:focus-visible, .field input[type="text"]:focus-visible { outline-offset: 0; border-color: var(--amber); }
.field input[aria-invalid="true"] { border-color: var(--fault); }
.field input:disabled { border-color: var(--line); color: var(--mute); cursor: not-allowed; }
.field input:-webkit-autofill, .field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--star); caret-color: var(--amber);
  box-shadow: 0 0 0 100px var(--void) inset; transition: background-color 9999s;
}
.field--pick { margin-top: var(--s-5); }

.field__err { display: none; color: var(--fault); font-size: 0.8125rem; line-height: 1.45; }
.field__err:not(:empty) { display: block; }
.field[data-invalid] .field__hint { display: none; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.seg label { position: relative; display: grid; }
.seg label + label { border-left: 1px solid var(--line-strong); }
.seg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: grid; place-items: center; min-height: 46px; padding: 0 6px;
  color: var(--text); font-size: 0.9375rem; font-weight: 500; text-align: center;
  transition: background-color 0.25s, color 0.25s;
}
.seg input:hover + span { color: var(--star); }
.seg input:checked + span { background: var(--star); color: var(--space); font-weight: 620; }
.seg input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }
.seg input:disabled { cursor: not-allowed; }
.seg input:disabled + span { color: var(--line-strong); }

.check { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--text); font-size: 0.9375rem; font-weight: 400; cursor: pointer; }
.check input {
  appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--void) center / 16px no-repeat; cursor: pointer; transition: border-color 0.2s, background-color 0.2s;
}
.check input:hover { border-color: var(--mute); }
.check input:checked {
  border-color: var(--amber); background-color: var(--amber);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23171000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
}
.check input[aria-invalid="true"] { border-color: var(--fault); }
.check input:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.check input:disabled { border-color: var(--line); background-color: var(--plate); cursor: not-allowed; }
.check input:disabled:checked { background-color: var(--line-strong); }
.field--check { gap: 0; }

.form__alert { padding: 12px 14px; border: 1px solid var(--fault); color: var(--fault); font-size: 0.875rem; line-height: 1.45; }

.btn__spin {
  display: none; width: 16px; height: 16px; border: 2px solid rgb(23 16 0 / 0.3); border-top-color: var(--amber-ink); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn[data-busy] { pointer-events: none; background: var(--amber-hi); }
.btn[data-busy] .btn__spin { display: block; }
@keyframes spin { to { rotate: 1turn; } }

.issued:focus { outline: none; }
.issued__key {
  display: flex; align-items: stretch; margin-top: var(--s-5); border: 1px solid var(--line-strong); background: var(--void);
}
.issued__key code {
  flex: 1; min-width: 0; padding: 14px; color: var(--star); font: 400 0.8125rem/1.5 var(--mono); overflow-wrap: anywhere;
}
.issued .link-arrow { margin-top: var(--s-4); }

/* =====================================================================================================
   Components: the themed kit. Nothing here is drawn by the browser or the operating system.
   Every piece is built from the tokens above: plate surfaces, the graduated edge, reticle and satellite marks.
   ===================================================================================================== */

/* Shared marks, as images: a reticle (the ring that marks a place on the globe) and a satellite dot. */
:root {
  --ticks-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='9'%3E%3Cpath d='M.5 0v9' stroke='%238493ae'/%3E%3Cpath d='M8.5 0v5M16.5 0v5M24.5 0v5M32.5 0v5' stroke='%2334435f'/%3E%3C/svg%3E");
  --mark-reticle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23e8ecf4'%3E%3Ccircle cx='10' cy='10' r='5.5'/%3E%3Cpath d='M10 .5v3M10 16.5v3M.5 10h3M16.5 10h3'/%3E%3C/svg%3E");
  --mark-sat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='3.2' fill='%23ffb000'/%3E%3C/svg%3E");
  --mark-fault: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='3.2' fill='%23ff8a73'/%3E%3C/svg%3E");
}

/* ----- Select (listbox). script.js turns every <select data-pick> into this; the select stays in the form. ----- */
.pick { position: relative; }
.pick > select[data-pick] { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); }
/* Before the script runs (or without it) the select is still the theme's own well. */
select[data-pick] {
  appearance: none; width: 100%; height: 48px; padding: 0 44px 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--void) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8ecf4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E") right 12px center / 20px no-repeat;
  color: var(--star); font-size: 1rem;
}
.pick__button {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  width: 100%; min-height: 48px; padding: 0 12px 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--void); color: var(--star); font-size: 1rem; text-align: left; transition: border-color 0.2s;
}
.pick__button:hover { border-color: var(--mute); }
.pick__button:focus-visible { outline-offset: 0; border-color: var(--amber); }
.pick__button[aria-expanded="true"] { border-color: var(--star); }
.pick__button[aria-invalid="true"] { border-color: var(--fault); }
.pick__button:disabled { border-color: var(--line); color: var(--mute); cursor: not-allowed; }
.pick__value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick__value[data-empty] { color: #7c8aa5; }
.pick__chev { flex: none; transition: rotate 0.35s var(--ease-out); }
.pick__button[aria-expanded="true"] .pick__chev { rotate: 180deg; }

.pick__list {
  position: absolute; inset: calc(100% + 6px) 0 auto 0; z-index: 20;
  max-height: 320px; margin: 0; padding: 13px 0 4px; overflow-y: auto; overscroll-behavior: contain; list-style: none;
  border: 1px solid var(--line-strong); background: var(--ticks-top) 0 0 / 40px 9px repeat-x, var(--plate);
  box-shadow: 0 18px 36px -8px rgb(0 0 0 / 0.7);
  scrollbar-width: thin; scrollbar-color: var(--line-strong) var(--plate);
  visibility: hidden; opacity: 0; clip-path: inset(0 0 100% 0);
  transition: clip-path 0.32s var(--ease-out), opacity 0.16s linear, visibility 0s 0.32s;
}
.pick[data-up] .pick__list { inset: auto 0 calc(100% + 6px) 0; clip-path: inset(100% 0 0 0); box-shadow: 0 -18px 36px -8px rgb(0 0 0 / 0.7); }
.pick[data-open] .pick__list { visibility: visible; opacity: 1; clip-path: inset(0 0 -40px 0); transition-delay: 0s; }
.pick[data-open][data-up] .pick__list { clip-path: inset(-40px 0 0 0); }
.pick__option {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 44px; padding: 6px 14px 6px 12px; color: var(--text); font-size: 0.9375rem; line-height: 1.3; cursor: pointer;
}
.pick__option::before { content: ""; width: 20px; height: 20px; background: center / 20px no-repeat; }
/* The reticle rides the option under the pointer or the arrow keys; the chosen one carries the satellite. */
.pick__option[data-active] { background-color: rgb(232 236 244 / 0.07); color: var(--star); }
.pick__option[data-active]::before { background-image: var(--mark-reticle); }
.pick__option[aria-selected="true"] { color: var(--star); font-weight: 560; }
.pick__option[aria-selected="true"]::before { background-image: var(--mark-sat); }
.pick__option[aria-selected="true"][data-active]::before { background-image: var(--mark-sat), var(--mark-reticle); }
.pick__code { color: var(--mute); font: 400 0.75rem/1 var(--mono); white-space: nowrap; }

/* ----- Notice (toast). One line per event, stamped in UTC like a downlink log. ----- */
.toasts {
  position: fixed; left: var(--gutter); bottom: var(--s-5); z-index: 40;
  display: grid; gap: var(--s-2); width: min(27rem, 100vw - 2 * var(--gutter)); pointer-events: none;
}
.toast {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: start; gap: 0 10px;
  padding: 19px 6px 10px 12px; border: 1px solid var(--line-strong);
  background: var(--ticks-top) 0 0 / 40px 9px repeat-x, var(--plate);
  box-shadow: 0 18px 36px -8px rgb(0 0 0 / 0.75); pointer-events: auto;
  animation: toast-in 0.45s var(--ease-out) both;
}
.toast::before { content: ""; width: 20px; height: 20px; margin-top: 1px; background: var(--mark-sat), var(--mark-reticle); background-size: 20px; }
.toast[data-tone="fault"] { border-color: var(--fault); }
.toast[data-tone="fault"]::before { background-image: var(--mark-fault), var(--mark-reticle); }
.toast__body { padding-block: 1px 4px; color: var(--star); font-size: 0.9375rem; line-height: 1.4; }
.toast__time { display: block; margin-bottom: 2px; color: var(--mute); font: 400 0.6875rem/1.4 var(--mono); letter-spacing: 0.02em; }
.toast__close {
  display: grid; place-items: center; width: 36px; height: 36px; margin-top: -7px; padding: 0; border: 0; background: none; color: var(--mute);
  transition: color 0.2s;
}
.toast__close:hover { color: var(--star); }
.toast[data-leaving] { animation: toast-out 0.2s ease-in both; }
@keyframes toast-in { from { opacity: 0; translate: 0 14px; clip-path: inset(0 0 100% 0); } to { opacity: 1; translate: 0 0; clip-path: inset(0 0 -40px 0); } }
@keyframes toast-out { to { opacity: 0; translate: 0 8px; } }

/* ----- Confirmation dialog. A plate laid over the chart; the chart dims but stays in view. ----- */
.confirm {
  width: min(31rem, 100vw - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: 41px clamp(20px, 5vw, 36px) clamp(20px, 5vw, 32px);
  overflow-y: auto; border: 1px solid var(--line-strong); color: var(--text);
  background: var(--ticks-top) 0 0 / 40px 9px repeat-x, var(--plate);
  box-shadow: 0 32px 64px -12px rgb(0 0 0 / 0.8);
}
.confirm::backdrop { background: rgb(3 5 10 / 0.78); }
.confirm[open] { animation: confirm-in 0.42s var(--ease-out) both; }
.confirm[open]::backdrop { animation: veil-in 0.3s linear both; }
.confirm[data-closing] { animation: confirm-out 0.18s ease-in both; }
.confirm[data-closing]::backdrop { animation: veil-in 0.18s linear reverse both; }
.confirm h2 { font-size: clamp(1.625rem, 1vw + 1.3rem, 2rem); }
.confirm h2 + p { margin-top: var(--s-3); }
.confirm__subject {
  display: flex; align-items: center; gap: 8px; margin-top: var(--s-4); padding: 10px 12px 10px 8px; border: 1px solid var(--line); background: var(--void);
  color: var(--star); font: 400 0.8125rem/1.5 var(--mono); overflow-wrap: anywhere;
}
.confirm__subject::before { content: ""; flex: none; width: 20px; height: 20px; background: var(--mark-sat), var(--mark-reticle); background-size: 20px; }
.confirm__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-3); margin-top: var(--s-5); }
@keyframes confirm-in { from { opacity: 0; translate: 0 10px; clip-path: inset(0 0 100% 0); } to { opacity: 1; translate: 0 0; clip-path: inset(-80px); } }
@keyframes confirm-out { to { opacity: 0; translate: 0 6px; } }
@keyframes veil-in { from { opacity: 0; } }
@media (max-width: 480px) {
  .confirm__actions { flex-direction: column-reverse; }
  .confirm__actions .btn { width: 100%; white-space: normal; }
}

/* ----- Tooltip. A term you can point at or tab to; the note is a small plate beside it. ----- */
.term {
  margin: -3px 0; padding: 3px 0; border: 0; background: none; color: inherit; cursor: help;
  text-decoration: underline dotted var(--mute); text-decoration-thickness: 1px; text-underline-offset: 0.25em;
}
.term:hover, .term:focus-visible { text-decoration-color: var(--amber); }
.tip {
  position: absolute; left: 0; bottom: calc(100% - 4px); z-index: 15; width: min(17rem, 72vw); padding: 17px 12px 10px;
  border: 1px solid var(--line-strong); background: var(--ticks-top) 0 0 / 40px 9px repeat-x, var(--plate);
  box-shadow: 0 14px 28px -8px rgb(0 0 0 / 0.75);
  color: var(--text); font-size: 0.8125rem; font-weight: 400; line-height: 1.45; pointer-events: none;
  visibility: hidden; opacity: 0; translate: 0 4px;
  transition: opacity 0.16s linear, translate 0.3s var(--ease-out), visibility 0s 0.3s;
}
.term:hover ~ .tip, .term:focus ~ .tip, .tip:hover { visibility: visible; opacity: 1; translate: 0 0; transition-delay: 0s; pointer-events: auto; }
.term[data-dismissed] ~ .tip { visibility: hidden; opacity: 0; }

/* ---------- Footer ---------- */
.foot {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-7) var(--s-8);
  padding: var(--s-8) var(--gutter) 84px; border-top: 1px solid var(--line); background: rgb(5 7 13 / 0.95);
}
.foot__brand p { max-width: 24em; margin-top: var(--s-3); font-size: 0.9375rem; }
.foot__nav { display: flex; gap: clamp(28px, 5vw, 80px); }
.foot__nav ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.foot__nav a {
  display: inline-flex; align-items: center; min-height: 36px; color: var(--text); font-size: 0.9375rem; text-decoration: none;
  transition: color 0.2s;
}
.foot__nav a:hover { color: var(--star); }
.foot__small { grid-column: 1 / -1; padding-top: var(--s-5); border-top: 1px solid var(--line); color: var(--mute); font-size: 0.8125rem; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Without WebGL the still globe swells and centres as you descend, an echo of the flight. */
  @supports (animation-timeline: scroll()) {
    html:not(.has-gl) .stage__globe { animation: descend linear both; animation-timeline: scroll(root); }
    @keyframes descend { to { left: 50%; scale: 2.6; } }
  }
}

/* ---------- Mid widths: smaller globe, nav folds into a menu ---------- */
@media (max-width: 1100px) {
  .lede { max-width: 25em; }
  .stage__globe { left: 76%; top: 50%; width: calc(min(62vh, 40vw) * 1.6); }
}
@media (max-width: 1100px) and (min-width: 761px) and (orientation: portrait) {
  .stage__globe { left: 62%; top: 34%; width: calc(min(50vh, 72vw) * 1.6); }
  .hero { align-self: end; }
}

@media (max-width: 959px) {
  .nav__toggle {
    display: grid; place-items: center; width: 44px; height: 44px; margin-left: auto; margin-right: -10px; padding: 0;
    border: 0; background: none; color: var(--star);
  }
  .nav__bar { transition: transform 0.35s var(--ease-out); transform-origin: 12px 12px; }
  .nav[data-open] .nav__bar--a { transform: translateY(4px) rotate(45deg); }
  .nav[data-open] .nav__bar--b { transform: translateY(-4px) rotate(-45deg); }
  .nav__links {
    position: absolute; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    padding: var(--s-2) var(--gutter) var(--s-5); border-block: 1px solid var(--line); background: var(--plate);
    visibility: hidden; opacity: 0; clip-path: inset(0 0 100% 0);
    transition: clip-path 0.4s var(--ease-out), opacity 0.2s linear, visibility 0s 0.4s;
  }
  .nav[data-open] .nav__links { visibility: visible; opacity: 1; clip-path: inset(0); transition-delay: 0s; }
  .nav[data-open] { background: var(--plate); border-bottom-color: transparent; }
  .nav__links a:not(.btn) { min-height: 52px; border-bottom: 1px solid var(--line); font-size: 1.0625rem; color: var(--star); }
  .nav__cta { min-height: 48px; margin-top: var(--s-5); font-size: 1rem; }
}

/* ---------- Narrow screens: globe above the copy, full-width plates ---------- */
@media (max-width: 760px) {
  :root { --nav-h: 60px; }

  .stage__globe { left: 50%; top: 31%; width: calc(min(40vh, 84vw) * 1.6); }

  .nav { gap: var(--s-2); background: linear-gradient(to bottom, rgb(5 7 13 / 0.96), rgb(5 7 13 / 0.8) 70%, rgb(5 7 13 / 0)); }
  .nav__toggle { margin-left: 0; }
  .readout {
    display: grid; grid-template-columns: auto auto; gap: 4px 7px; margin-left: auto; padding: 6px 9px;
    font-size: 0.625rem;
  }
  .readout__v--alt { grid-column: 1 / -1; min-width: 0; color: var(--text); }

  .pass { min-height: 0; padding-block: 16vh; }
  .pass--hero { min-height: 100vh; min-height: 100svh; padding-top: calc(var(--nav-h) + 40vh); padding-bottom: 40px; }
  /* The copy rides up over the fixed globe as the page scrolls, so it carries its own night. */
  .hero {
    margin-inline: calc(var(--gutter) * -1); padding: 44px var(--gutter) 56px;
    background: linear-gradient(to bottom, rgb(5 7 13 / 0), rgb(5 7 13 / 0.9) 64px, rgb(5 7 13 / 0.9) calc(100% - 72px), rgb(5 7 13 / 0));
  }
  .telemetry__rest { display: none; }
  .hero__actions { margin-top: var(--s-5); }

  /* The ruler staggers its marks above and below the line so five names fit a phone. */
  .ruler { margin-top: var(--s-7); }
  .ruler__cap { font-size: 0.8125rem; }
  .ruler__scale { margin-inline: 20px; }
  .ruler__track { height: 116px; margin-top: var(--s-3); }
  .ruler__ticks { inset: 58px 0 auto 0; }
  .ruler__mark { bottom: 54px; }
  .ruler__mark:nth-of-type(even) { bottom: auto; top: 54px; flex-direction: column-reverse; padding: 0 2px 4px; }
  .ruler__mark:nth-of-type(even)::after { margin: 0 0 4px; }
  .ruler__ends { display: none; }

  .plate, .plate--wide { max-width: none; }
  .pass-log div { grid-template-columns: 6.75rem 1fr; }
  .tab { padding: 0 11px; }
  .tab::after { inset-inline: 11px; }
  .copy { padding: 0 12px; }

  .spec th { width: 42%; }
  .tip { left: auto; right: 0; }
  .toasts { left: var(--s-4); bottom: var(--s-4); width: calc(100vw - 2 * var(--s-4)); }

  /* The comparison becomes one plan at a time, chosen with a segmented control. */
  .plan-pick {
    display: grid; grid-template-columns: repeat(3, 1fr); margin-top: var(--s-5);
    border: 1px solid var(--line-strong); border-radius: var(--radius);
  }
  .plan-pick button {
    min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--text); font-size: 0.875rem; font-weight: 500;
    transition: background-color 0.25s, color 0.25s;
  }
  .plan-pick button + button { border-left: 1px solid var(--line-strong); }
  .plan-pick button[aria-pressed="true"] { background: var(--star); color: var(--space); font-weight: 620; }
  .plans-wrap { margin-top: var(--s-2); }
  .plans thead, .plans tfoot { display: none; }
  .plans[data-show="explorer"] [data-col]:not([data-col="explorer"]),
  .plans[data-show="operational"] [data-col]:not([data-col="operational"]),
  .plans[data-show="constellation"] [data-col]:not([data-col="constellation"]) { display: none; }
  .plans tr > :first-child { width: 42%; }
  .plans [data-col="operational"] { background: none; }
  .plans th, .plans td { padding-inline: 0; }
  .plans tbody tr:first-child > * { border-top: 0; }
  .plans tbody tr:last-child > * { border-bottom: 1px solid var(--line); }
  .plans__go { display: flex; margin-top: var(--s-5); }

  .foot { grid-template-columns: 1fr; padding-top: var(--s-7); }
  .foot__nav { justify-content: space-between; gap: var(--s-4); }
  .foot__nav a { min-height: 44px; }
}

@media (max-width: 380px) {
  .pass-log div { grid-template-columns: 5.75rem 1fr; gap: var(--s-2); }
  .pass-log dd { font-size: 0.75rem; }
  .hero__actions { column-gap: var(--s-5); }
}

@media (max-width: 760px) and (max-height: 700px) {
  .pass--hero { padding-top: calc(var(--nav-h) + 30vh); }
}

/* ---------- Phones: the globe becomes an instrument window pinned above the page ---------- */
/* Plates would cover a backdrop globe on a narrow screen, so the page scrolls beneath the stage instead
   and the Earth stays in view from the first line to the footer. Short landscape screens keep the backdrop. */
@media (max-width: 760px) and (min-height: 560px) {
  :root { --stage-h: clamp(232px, 39vh, 340px); }
  @supports (height: 1svh) { :root { --stage-h: clamp(232px, 39svh, 340px); } }

  html { scroll-padding-top: calc(var(--stage-h) + var(--s-4)); }

  .stage {
    height: var(--stage-h); z-index: 5;
    border-bottom: 1px solid var(--line-strong);
    box-shadow: 0 10px 20px rgb(5 7 13 / 0.92);
  }
  .stage::after {                 /* the window's lower edge carries the same graduation as a plate */
    content: ""; position: absolute; inset: auto 0 0 0; height: 9px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='9'%3E%3Cpath d='M.5 0v9' stroke='%238493ae'/%3E%3Cpath d='M8.5 4v5M16.5 4v5M24.5 4v5M32.5 4v5' stroke='%2334435f'/%3E%3C/svg%3E") 16px 0 / 40px 9px repeat-x;
  }
  .stage__globe { top: calc(50% + var(--nav-h) / 2); width: calc(min(var(--stage-h) * 0.71, 80vw) * 1.6); }

  .nav { animation: none; }
  .nav[data-stuck]:not([data-open]) { background-color: transparent; border-bottom-color: transparent; }

  main { padding-top: var(--stage-h); }
  .pass { min-height: 0; padding: 0 var(--gutter) var(--s-6); }
  .pass:last-child { padding-bottom: var(--s-7); }
  .pass--hero { grid-template-rows: auto; align-content: start; min-height: 0; padding-block: 36px var(--s-7); }
  .hero { margin: 0; padding: 0; background: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .btn__spin { animation-duration: 0.7s !important; animation-iteration-count: infinite !important; }
}
