/* Space Exploration hero v3 (12 Nov 2026): the twelve years as a mission.
   Loads after space.css. Palette and tokens are the page's own (.sx-void re-points them; the hero is dark in both themes).
   Three planes: the star canvas and nebula behind, the rings, planet and spacecraft in the middle, the labels on top. */

.sx-hero { --sxh-out: cubic-bezier(0.23, 1, 0.32, 1); --sxh-move: cubic-bezier(0.77, 0, 0.175, 1); }

/* ---- H1: rises 0.4em into place, painted at frame 0 and finished by 0.35 s (CSS only, no opacity gate) ---- */
@keyframes sxh-rise { from { transform: translate3d(0, 6px, 0); } to { transform: none; } }
.sx-hero h1 { animation: sxh-rise .32s var(--sxh-out) both; }

/* tighter hero so the facts sit in the first screen on a laptop */
.sx-hero { padding-block: clamp(4.25rem, 8.5vh, 6.5rem) clamp(2.5rem, 6vh, 4.5rem); }
.sx-facts { margin-top: clamp(1.75rem, 4vh, 3rem); }

/* ---- fact row: three cells at every width ---- */
.sx-facts { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .sx-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- figure ---- */
.sxh-wrap { max-width: 34rem; aspect-ratio: auto; display: block; }
@media (min-width: 1000px) { .sx-hero-grid { grid-template-columns: .95fr 1.05fr; gap: 3rem; } }
.sxh-stage {
  position: relative; aspect-ratio: 1 / 1; width: 100%;
  animation: sxh-cam 1.6s var(--sxh-out) both;
  --sxh-p: 0;
  opacity: calc(1 - var(--sxh-p) * .7);
  translate: 0 calc(var(--sxh-p) * -2.5rem);
}
@keyframes sxh-cam { from { transform: scale(1.1) rotate(-5deg); } to { transform: none; } }
.sxh-svg { display: block; position: absolute; inset: 0; }
.sxh-svg text { font-size: 11px; letter-spacing: .14em; }

/* parallax by depth: far plane (planet) moves least, labels most */
.sxh-p-far  { transform: translate3d(calc(var(--sx-px, 0) * 3px),  calc(var(--sx-py, 0) * 3px), 0); }
.sxh-p-mid  { transform: translate3d(calc(var(--sx-px, 0) * -5px), calc(var(--sx-py, 0) * -5px), 0); }
.sxh-p-near { transform: translate3d(calc(var(--sx-px, 0) * -10px), calc(var(--sx-py, 0) * -10px), 0); }

/* rings: dim until the craft reaches them, then lit in the accent colour */
.sxh-svg .ring { stroke: rgba(242, 239, 232, .16); stroke-dasharray: none; transition: stroke .5s var(--sxh-out), stroke-width .5s var(--sxh-out); }
.sxh-svg .ring.is-lit { stroke: rgba(240, 140, 100, .95); stroke-width: 1.9; }
.sxh-svg .ring.is-now { stroke: var(--ib-accent); stroke-width: 2.2; filter: drop-shadow(0 0 5px rgba(232, 132, 94, .65)); }
.sxh-svg .label { transition: fill .5s var(--sxh-out); }
.sxh-svg .label.is-lit { fill: rgba(242, 239, 232, .8); }
.sxh-svg .label.is-now { fill: var(--ib-accent); }
.sxh-svg .label { fill: rgba(242, 239, 232, .5); }

.sxh-xfer { fill: none; stroke: var(--ib-accent); stroke-width: 1.4; stroke-dasharray: 5 5; stroke-linecap: round; opacity: .9; }
.sxh-trail { fill: none; stroke: var(--ib-accent); stroke-width: 1.6; stroke-linecap: round; opacity: .55; }
.sxh-hull { fill: #E9E4DA; stroke: #0C0B0A; stroke-width: .5; stroke-linejoin: round; }
.sxh-nose { fill: var(--ib-accent); stroke: #0C0B0A; stroke-width: .4; stroke-linejoin: round; }
.sxh-band { fill: none; stroke: #8C867D; stroke-width: .7; }
.sxh-bell { fill: #3A3631; stroke: #0C0B0A; stroke-width: .4; stroke-linejoin: round; }
.sxh-panel { fill: #2A2723; stroke: var(--ib-accent); stroke-width: .45; stroke-linejoin: round; }
.sxh-grid { fill: none; stroke: rgba(232, 132, 94, .55); stroke-width: .3; }
.sxh-win { fill: #14110F; stroke: #CAC4BA; stroke-width: .35; }
.sxh-puff { fill: #F2EFE8; opacity: 0; }
.sxh-svg .planet { filter: none; }
.sxh-field { position: absolute; left: -14%; top: -14%; width: 128%; height: 128%; pointer-events: none; }
.sxh-flash { position: absolute; inset: -8%; pointer-events: none; opacity: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 150, .55) 0%, rgba(232, 132, 94, .22) 38%, rgba(232, 132, 94, 0) 70%); }
.sxh-flash.is-go { animation: sxh-flash .7s var(--sxh-out) both; }
@keyframes sxh-flash { from { opacity: 1; transform: scale(.6); } to { opacity: 0; transform: scale(1.15); } }
.sxh-flame-out { fill: var(--ib-accent); opacity: .92; }
.sxh-flame-in { fill: #FFE3C7; }
.sxh-bloom { opacity: 0; }
.sxh-pulse { fill: none; stroke: var(--ib-accent); stroke-width: 1.6; opacity: 0; }

/* readouts */
.sxh-rail {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px;
  margin-top: .25rem; background: var(--ib-line); border: 1px solid var(--ib-line); border-radius: var(--ib-radius, 8px);
  overflow: hidden;
}
.sxh-rail:not(.is-on), .sxh-note:not(.is-on) { visibility: hidden; }
.sxh-cell { background: rgba(12, 11, 10, .72); padding: .55rem .65rem .6rem; min-width: 0; }
.sxh-k { display: block; font-family: var(--ib-font-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ib-ink-muted); white-space: nowrap; }
.sxh-v { display: block; margin-top: .2rem; font-family: var(--ib-font-mono); font-size: .8rem; color: var(--ib-ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sxh-v b { font-weight: 500; font-size: 1.05rem; color: var(--ib-ink); letter-spacing: -.02em; }
.sxh-cell.is-hot .sxh-v b { color: var(--ib-accent); }
.sxh-note { margin-top: .55rem; display: flex; flex-wrap: wrap; gap: .15rem 1.1rem; font-family: var(--ib-font-mono); font-size: .66rem; letter-spacing: .04em; color: var(--ib-ink-muted); }
.sxh-note b { font-weight: 500; color: var(--ib-ink-soft); font-variant-numeric: tabular-nums; }
.sxh-note [data-sxh="hint"] { color: var(--ib-accent); }
.sxh-scale { flex-basis: 100%; opacity: .75; }
@media (min-width: 1000px) { .sxh-scale { white-space: nowrap; } }

/* fine pointer: drag the outer orbit */
@media (hover: hover) and (pointer: fine) {
  .sxh-wrap[data-sxh-live] .sxh-svg { cursor: grab; touch-action: pan-y; }
  .sxh-wrap.is-drag .sxh-svg { cursor: grabbing; }
}

/* mobile: the figure leads (compact), the readouts follow the buttons, a tap anywhere fires the next burn */
@media (max-width: 999px) {
  .sx-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
  .sxh-wrap { display: contents; }
  .sxh-stage { order: -1; max-width: 19.5rem; margin-inline: auto; width: 100%; }
  .sxh-rail { order: 2; }
  .sxh-note { order: 3; flex-direction: column; min-height: 3.6em; }
  .sx-hero { padding-top: clamp(3.75rem, 8vh, 5rem); }
}
@media (min-width: 640px) and (max-width: 999px) { .sxh-stage { max-width: 24rem; } }
@media (max-width: 520px) {
  .sx-hero h1 { font-size: clamp(1.9rem, 8.9vw, 2.6rem); }
  .sx-hero-sub { font-size: 1rem; max-width: 30ch; }
  .sxh-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sxh-rail .sxh-cell:last-child { grid-column: 1 / -1; }
  .sxh-v b { font-size: .95rem; }
}

/* reduced motion: one meaningful frame, nothing moves */
@media (prefers-reduced-motion: reduce) {
  .sx-hero h1, .sx-hero h1 .sx-accent, .sxh-stage { animation: none; }
  .sxh-svg .ring, .sxh-svg .label { transition: none; }
  .sxh-p-far, .sxh-p-mid, .sxh-p-near { transform: none; }
}
