/* ============================================================
   Launch Window — time-of-day "sky" design system
   The palette follows the visitor's local hour (night / dawn /
   day / dusk) via [data-theme] and can be cycled with the rocket
   button. Components are token-driven, so each phase is just a
   token set. Phase-independent tokens (the ignition accent, radii,
   status, shared textures) live on :root.
   Seed stylesheet for the utility-engine shared design system.
   ============================================================ */

/* ---- webfonts (self-hosted latin subsets, immutable-cached) ---- */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/plex-mono-600.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/newsreader-600.woff2") format("woff2");
}
/* metric-compatible fallbacks so the swap doesn't shift layout */
@font-face {
  font-family: "Newsreader-fallback";
  src: local("Georgia");
  size-adjust: 94%;
  ascent-override: 88%;
}
@font-face {
  font-family: "PlexMono-fallback";
  src: local("Consolas"), local("Menlo"), local("Courier New");
  size-adjust: 108%;
}

:root {
  /* ignition accent — reserved for urgency in EVERY phase */
  --ignite: #ff6a2b;
  --ignite-bg: rgba(255, 106, 43, 0.16);

  /* type system: mono for telemetry/digits, editorial serif for display */
  --font-mono: "IBM Plex Mono", "PlexMono-fallback", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-display: "Newsreader", "Newsreader-fallback", Georgia, "Times New Roman", serif;

  /* status (dark-phase defaults; the day phase overrides for contrast) */
  --success: #34d399; --success-bg: rgba(52, 211, 153, 0.16);
  --warn: #fbbf24;    --warn-bg: rgba(251, 191, 36, 0.16);
  --danger: #f87171;  --danger-bg: rgba(248, 113, 113, 0.16);

  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 600px;

  /* shared texture images, selected per phase via --tex */
  --stars:
    radial-gradient(1px 1px at 18px 32px, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1px 1px at 64px 14px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 122px 48px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 174px 22px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 40px 88px, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(1px 1px at 96px 104px, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 150px 92px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.4px 1.4px at 190px 70px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 26px 150px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 80px 168px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 134px 150px, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 186px 176px, rgba(255, 255, 255, 0.55), transparent);
  --grid:
    linear-gradient(rgba(20, 60, 120, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 60, 120, 0.05) 1px, transparent 1px);
  /* brighter, faintly-tinted stars for the twinkle layer (body::after) */
  --stars2:
    radial-gradient(1.5px 1.5px at 50px 60px, rgba(255, 255, 255, 0.95), transparent),
    radial-gradient(1.6px 1.6px at 150px 30px, rgba(190, 210, 255, 0.9), transparent),
    radial-gradient(1.3px 1.3px at 100px 130px, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1.5px 1.5px at 24px 118px, rgba(255, 235, 210, 0.85), transparent),
    radial-gradient(1.4px 1.4px at 210px 96px, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1.5px 1.5px at 252px 170px, rgba(210, 225, 255, 0.85), transparent),
    radial-gradient(1.3px 1.3px at 70px 208px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 170px 198px, rgba(255, 245, 225, 0.85), transparent);
}

/* ---- DUSK (default / fallback) ---- */
:root, :root[data-theme="dusk"] {
  --bg: #0b0a1f;
  --panel: rgba(24, 18, 52, 0.55);
  --panel-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --text: #eef1f8; --muted: #aab0d6; --faint: #7b82a8;
  --border: rgba(255, 255, 255, 0.10); --border-strong: rgba(255, 255, 255, 0.20);
  --accent: #7aa2ff; --accent-bg: rgba(122, 162, 255, 0.16);
  --sky:
    radial-gradient(900px 480px at 50% 122%, rgba(255, 122, 60, 0.10), transparent 62%),
    radial-gradient(1100px 720px at 50% -12%, #261658 0%, #160e38 42%, #0b0a1f 100%);
  --tex: var(--stars); --tex-opacity: 0.5; --tex-size: 220px 220px;
  --tex2-opacity: 0.7;
  --sweep-color: rgba(255, 122, 60, 0.5);
}

/* ---- NIGHT ---- */
:root[data-theme="night"] {
  --bg: #06050e;
  --panel: rgba(16, 16, 40, 0.55);
  --panel-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --text: #eef1f8; --muted: #a6adcf; --faint: #737aa0;
  --border: rgba(255, 255, 255, 0.10); --border-strong: rgba(255, 255, 255, 0.20);
  --accent: #8ab4ff; --accent-bg: rgba(138, 180, 255, 0.16);
  --sky:
    radial-gradient(800px 500px at 50% 120%, rgba(60, 80, 160, 0.12), transparent 60%),
    radial-gradient(1200px 820px at 50% -10%, #12122e 0%, #0a0a1c 45%, #06050e 100%);
  --tex: var(--stars); --tex-opacity: 0.85; --tex-size: 200px 200px;
  --tex2-opacity: 0.95;
  --sweep-color: rgba(138, 180, 255, 0.45);
}

/* ---- DAWN (rosier + lighter than dusk, sun about to crest) ---- */
:root[data-theme="dawn"] {
  --bg: #241641;
  --panel: rgba(52, 34, 78, 0.5);
  --panel-shadow: 0 18px 50px rgba(0, 0, 0, 0.30);
  --surface: rgba(255, 255, 255, 0.055);
  --surface-2: rgba(255, 255, 255, 0.09);
  --text: #f6eef6; --muted: #d4bdd1; --faint: #ab90a8;
  --border: rgba(255, 255, 255, 0.13); --border-strong: rgba(255, 255, 255, 0.24);
  --accent: #c9b2ff; --accent-bg: rgba(201, 178, 255, 0.20);
  --sky:
    radial-gradient(1300px 760px at 50% 116%, rgba(255, 158, 110, 0.48), rgba(255, 120, 155, 0.24) 36%, rgba(150, 110, 195, 0.12) 60%, transparent 76%),
    radial-gradient(1100px 840px at 50% -8%, #412c63 0%, #30214f 46%, #241641 100%);
  --tex: var(--stars); --tex-opacity: 0.26; --tex-size: 220px 220px;
  --tex2-opacity: 0.42;
  --sweep-color: rgba(255, 150, 105, 0.55);
}

/* ---- DAY (Daylight Aerospace) ---- */
:root[data-theme="day"] {
  --bg: #eef4fb;
  --panel: #ffffff;
  --panel-shadow: 0 14px 40px rgba(20, 40, 80, 0.12);
  --surface: #f1f6fc;
  --surface-2: #e6eef8;
  --text: #14233f; --muted: #51607d; --faint: #8b93ad;
  --border: rgba(20, 40, 80, 0.12); --border-strong: rgba(20, 40, 80, 0.20);
  --accent: #0a6cff; --accent-bg: rgba(10, 108, 255, 0.10);
  --success: #047857; --success-bg: rgba(4, 120, 87, 0.10);
  --warn: #b45309;    --warn-bg: rgba(180, 83, 9, 0.10);
  --danger: #dc2626;  --danger-bg: rgba(220, 38, 38, 0.10);
  --sky: radial-gradient(1000px 560px at 50% -10%, #dcebfb 0%, #eaf2fb 45%, #f4f8fc 100%);
  --tex: var(--grid); --tex-opacity: 0.6; --tex-size: 38px 38px;
  --tex2-opacity: 0;
  --sweep-color: rgba(10, 108, 255, 0.32);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  background-image: var(--sky);
  background-attachment: fixed;
  background-repeat: no-repeat;
  min-height: 100vh;
  transition: background-color 0.7s ease, color 0.5s ease;
}

/* sky texture — stars at night/dawn/dusk, a precision grid by day */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--tex-opacity, 0.5);
  background-image: var(--tex);
  background-size: var(--tex-size, 220px 220px);
  transition: opacity 0.6s ease;
}

/* twinkle layer — brighter stars that gently pulse (dark phases only; --tex2-opacity:0 by day) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--stars2);
  background-size: 300px 300px;
  opacity: var(--tex2-opacity, 0);
  animation: twinkle 4.2s ease-in-out infinite;
  transition: opacity 0.6s ease;
}
@keyframes twinkle {
  0%, 100% { opacity: var(--tex2-opacity, 0); }
  50% { opacity: calc(var(--tex2-opacity, 0) * 0.35); }
}

/* occasional shooting stars (dark phases only) */
.sky-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.sky-fx i {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.55);
  opacity: 0;
}
.sky-fx i::after {
  content: "";
  position: absolute;
  top: 50%; left: 2px;
  width: 92px; height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.55), transparent);
}
.sky-fx i:nth-child(1) { top: 8%;  left: 80%; animation: shoot 11s ease-in 4s infinite; }
.sky-fx i:nth-child(2) { top: 16%; left: 94%; animation: shoot 16s ease-in 10s infinite; }
@keyframes shoot {
  0%   { opacity: 0; transform: translate(0, 0) rotate(-29deg); }
  2%   { opacity: 1; }
  10%  { opacity: 0; transform: translate(-340px, 190px) rotate(-29deg); }
  100% { opacity: 0; transform: translate(-340px, 190px) rotate(-29deg); }
}
[data-theme="day"] .sky-fx { display: none; }

/* moon — soft glowing disc behind the content (full at night, faint at dusk) */
.sky-fx .moon {
  position: absolute;
  top: 64px; right: 7%;
  width: 78px; height: 78px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 66% 70%, rgba(150, 160, 195, 0.38), transparent 22%),
    radial-gradient(circle at 40% 58%, rgba(150, 160, 195, 0.30), transparent 16%),
    radial-gradient(circle at 60% 34%, rgba(150, 160, 195, 0.24), transparent 13%),
    radial-gradient(circle at 36% 33%, #fefdf8, #e9ecf5 52%, #c4cad8 100%);
  box-shadow: 0 0 38px 8px rgba(214, 226, 255, 0.22), inset -7px -7px 16px rgba(85, 95, 130, 0.45);
  opacity: 0;
  transition: opacity 0.6s ease;
}
[data-theme="night"] .sky-fx .moon { opacity: 1; }
[data-theme="dusk"] .sky-fx .moon { opacity: 0.5; }

/* occasional rocket blastoff — rises behind the content (dark phases only) */
.sky-fx .rocket {
  position: absolute;
  left: 14%; bottom: -10%;
  width: 16px; height: 30px;
  opacity: 0;
  animation: blastoff 24s ease-in 5s infinite;
}
.sky-fx .rocket svg { display: block; width: 16px; height: 30px; filter: drop-shadow(0 0 4px rgba(180, 200, 255, 0.5)); }
.sky-fx .rocket::after {
  content: "";
  position: absolute;
  left: 50%; top: 95%;
  transform: translateX(-50%);
  width: 7px; height: 30px;
  background: linear-gradient(to bottom, rgba(255, 190, 110, 0.95), rgba(255, 120, 40, 0.45) 45%, transparent);
  border-radius: 50% 50% 40% 40% / 18% 18% 100% 100%;
  filter: blur(1.5px);
}
@keyframes blastoff {
  0% { transform: translateY(0); opacity: 0; }
  3% { opacity: 1; }
  17% { transform: translateY(-122vh); opacity: 1; }
  19%, 100% { transform: translateY(-122vh); opacity: 0; }
}
/* smaller, lower moon on narrow screens so it nestles behind the hero instead of the header chips */
@media (max-width: 600px) {
  .sky-fx .moon { top: 86px; right: 6%; width: 64px; height: 64px; }
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-weight: 600; letter-spacing: -0.01em; }
svg { width: 1em; height: 1em; }

/* ---------- header ---------- */
.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-icon { color: var(--accent); font-size: 1.3rem; filter: drop-shadow(0 0 8px rgba(122, 162, 255, 0.5)); }
.tz-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;                  /* allow the label to truncate on narrow screens */
  max-width: 46vw;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.tz-pill svg { flex: none; }
.tz-pill #tz-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* primary nav — slim pill row under the header (orientation + internal links) */
.site-nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 14px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.site-nav a {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 6px 11px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.12s, background 0.12s;
}
.site-nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-bg); }

.header-right { display: inline-flex; align-items: center; gap: 10px; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  font-size: 1.05rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.theme-toggle:active { transform: scale(0.92); }

/* one-shot color "ignition" sweep that blooms from the rocket on theme change */
.theme-sweep {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: radial-gradient(circle at var(--ox, 50%) var(--oy, 8%), var(--sweep-color), transparent 55%);
  opacity: 0;
  will-change: opacity, transform;
  animation: theme-sweep 0.85s ease forwards;
}
@keyframes theme-sweep {
  0% { opacity: 0; transform: scale(0.5); }
  30% { opacity: 0.95; }
  100% { opacity: 0; transform: scale(1.5); }
}

/* transient label naming the new sky */
.theme-toast {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  z-index: 10000;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  padding: 8px 14px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--panel-shadow);
  opacity: 0;
  animation: theme-toast 1.8s ease forwards;
}
@keyframes theme-toast {
  0% { opacity: 0; transform: translateX(-50%) translateY(8px); }
  12%, 70% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(8px); }
}

#main { max-width: var(--maxw); margin: 0 auto; padding: 4px 18px 40px; }

.data-notice {
  margin: 0 0 14px;
  padding: 9px 12px;
  font-size: 0.8rem;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ---------- hero / detail panel (frosted glass) ---------- */
.hero, .detail-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--panel-shadow);
}
.hero { min-height: 332px; }
.detail-card { min-height: 300px; }

/* ignition glow behind the hero when a launch is imminent */
.hero.ignite::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 60px rgba(255, 106, 43, 0.25) inset, 0 18px 60px rgba(255, 106, 43, 0.18);
}

.hero-top { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;                        /* allow the text child to shrink */
  font-size: 0.78rem;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip svg { flex: none; }
.chip-provider { color: var(--accent); background: var(--accent-bg); max-width: 62%; }
.chip-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }  /* BUG FIX: truncate long provider names */

.status {
  margin-left: auto;                   /* pin status to the right; never pushed off-canvas */
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.status.s-go { color: var(--success); background: var(--success-bg); }
.status.s-warn { color: var(--warn); background: var(--warn-bg); }
.status.s-info { color: var(--accent); background: var(--accent-bg); }
.status.s-danger { color: var(--danger); background: var(--danger-bg); }
.status.s-muted { color: var(--muted); background: var(--surface-2); }
.status.live::before { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.hero-eyebrow { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hero-mission {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 4px 0 14px;
}

/* flight-number telemetry strip (static; data from the feed's attempt counters) */
.telemetry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--faint);
  white-space: nowrap;
}
.telemetry .tel-sep { color: var(--border-strong); }
.ignite .telemetry { color: var(--muted); }
[data-theme="day"] .telemetry { color: var(--muted); }  /* --faint is sub-AA on the light sky */

/* launch-window arc dial — the window mapped onto an arc, NET tick marked */
.win-arc {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 10px;
  color: var(--muted);
}
.win-arc svg { width: 30px; height: 30px; flex: none; }
.win-arc .wa-track { fill: none; stroke: var(--border-strong); stroke-width: 3; stroke-linecap: round; }
.win-arc .wa-net { fill: var(--accent); }
.ignite .win-arc .wa-net { fill: var(--ignite); }
.win-arc .wa-lab { font-size: 0.74rem; letter-spacing: 0.04em; }

/* ---------- segmented launch clock (the signature) ---------- */
.clock { display: flex; align-items: stretch; gap: 8px; }
/* permanent T− prefix cell — CSS-only so every render path gets it for free */
.clock::before {
  content: "T−";
  flex: none;
  align-self: center;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--faint);
  letter-spacing: 0.02em;
  padding-right: 2px;
}
.clock:has(.clock-approx)::before, .clock:has(.clock-msg)::before { content: none; }
.seg {
  flex: 1;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 6px 10px;
}
.seg-num {
  display: block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.5px;
}
.seg-lab { display: block; font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 7px; }
/* digit roll — retriggered per change, gated to the final minute (.t60) */
.seg-num.flip { animation: seg-roll 0.32s ease; }
@keyframes seg-roll {
  0% { transform: translateY(-0.24em); opacity: 0.2; }
  100% { transform: translateY(0); opacity: 1; }
}
/* non-precise / liftoff / awaiting states render as one centered cell */
.clock-msg, .clock-approx {
  flex: 1;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 12px;
  font-size: 1.4rem;
  font-weight: 600;
}
.clock-approx { font-size: 1.15rem; color: var(--muted); }

.when { text-align: center; font-size: 0.84rem; color: var(--muted); margin-top: 12px; }

/* ignition: the clock heats up inside the last hour */
.ignite .seg-num { color: var(--ignite); text-shadow: 0 0 18px rgba(255, 106, 43, 0.65); }
.ignite .seg { border-color: rgba(255, 106, 43, 0.40); background: rgba(255, 106, 43, 0.06); }
.ignite .clock-msg { color: var(--ignite); }
.ignite .clock::before { color: var(--ignite); }
.hero.ignite .status, .detail-card.ignite .status { color: #fff; background: var(--ignite); }
.hero.ignite .btn-primary, .detail-card.ignite .btn-primary { background: var(--ignite); }

/* klaxon ladder: T-10m slow pulse on the clock frame, T-60s seconds heartbeat */
.t10 .seg { animation: t10-pulse 2.4s ease-in-out infinite; }
@keyframes t10-pulse {
  0%, 100% { border-color: rgba(255, 106, 43, 0.4); }
  50% { border-color: rgba(255, 106, 43, 0.9); box-shadow: 0 0 14px rgba(255, 106, 43, 0.25); }
}
.t60 .seg:last-child { animation: t60-beat 1s ease-in-out infinite; }
@keyframes t60-beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.045); }
  24% { transform: scale(1); }
}
/* T-1h sitewide warm-up: the ambient rocket hurries, the trajectory heats */
.lw-ignite .sky-fx .rocket { animation-duration: 10s; }
.lw-ignite .launch-list::before {
  background: linear-gradient(180deg, var(--ignite-bg), rgba(255, 106, 43, 0.05));
}

/* ---------- buttons ---------- */
.hero-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.btn {
  flex: 1;
  min-width: 130px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease, filter 0.12s ease, transform 0.05s ease;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: scale(0.985); }
.btn-primary { color: #fff; background: var(--accent); border-color: transparent; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: default; pointer-events: none; }
.hero-hint { flex-basis: 100%; font-size: 0.76rem; color: var(--faint); text-align: center; margin-top: 2px; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--muted);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta svg { color: var(--faint); }

/* ---------- upcoming list (timeline / trajectory) ---------- */
.upcoming { margin-top: 26px; }
.upcoming-head h2 { font-size: 1.05rem; margin: 0 0 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.filter-chip {
  font-size: 0.78rem;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.filter-chip:hover { color: var(--text); border-color: var(--border-strong); }
.filter-chip[aria-pressed="true"] { color: var(--accent); border-color: transparent; background: var(--accent-bg); }

.launch-list { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; gap: 9px; }
/* WS-4: #filters and #list ship empty and are filled only after the upstream
   fetch resolves, so without a reserve everything below them jumps on mount.
   :empty stops matching the instant app.js writes the first child.

   These numbers are MEASURED in a browser, not derived. The first version of
   this rule used a hand-computed 59px item height that does not exist —
   .launch-item settles at 68.8px unwrapped — and sized .filters for two chips
   when launch-window's all-provider feed emits the full 6-chip cap and wraps to 2 rows. Both under-reserved, which is the direction that still shifts
   the page down on mount. */
.launch-list:empty { min-height: 613px; }   /* 8 x 68.8 + 7 x 9 gap */
.filters:empty { min-height: 65px; }
@media (max-width: 767px) {
  /* items wrap to ~87.5px and the chip row wraps further */
  .launch-list:empty { min-height: 763px; }
  .filters:empty { min-height: 152px; }
}
/* faint trajectory line linking the launches chronologically */
.launch-list::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-bg), rgba(122, 162, 255, 0.04));
  pointer-events: none;
}
.launch-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px 12px 40px;       /* room for the node */
}
.launch-item::before {                 /* node on the trajectory */
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 8px rgba(122, 162, 255, 0.4);
}
.launch-item .li-name { font-size: 0.92rem; font-weight: 500; }
.li-badge { font-size: 0.72rem; color: var(--accent); margin-left: 6px; }
.launch-item .li-when { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.li-right { text-align: right; flex-shrink: 0; }
.li-rel { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text); font-variant-numeric: tabular-nums; }
.li-status { font-size: 0.72rem; margin-top: 3px; }
.li-status.s-go { color: var(--success); }
.li-status.s-warn { color: var(--warn); }
.li-status.s-info { color: var(--accent); }
.li-status.s-danger { color: var(--danger); }
.li-status.s-muted { color: var(--faint); }
.li-end { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.li-chev { color: var(--faint); font-size: 1.25rem; line-height: 1; }

a.launch-item { text-decoration: none; color: inherit; transition: background .12s, border-color .12s; }
a.launch-item:hover { background: var(--surface-2); border-color: var(--border-strong); text-decoration: none; }
a.launch-item:hover::before { box-shadow: 0 0 12px rgba(122, 162, 255, 0.7); }

/* ---------- ad slot (reserved, no shift) ---------- */
.ad-slot {
  margin: 26px 0;
  min-height: 100px;            /* reserves space → no layout shift when the ad loads */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.ad-slot::before {
  content: "Advertisement";
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.ad-slot .adsbygoogle { display: block; width: 100%; }
.ad-slot[data-empty] { display: none; }   /* JS hides slots AdSense didn't fill, so no orphan "Advertisement" box */

/* ---------- static intro (crawlable H1 + lede) ---------- */
.static-intro { margin: 4px 0 18px; }
.static-intro h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.65rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.static-intro p { font-size: 0.9rem; color: var(--muted); line-height: 1.55; margin: 0; }

/* ---------- about / footer ---------- */
.about { margin-top: 8px; }
.about h2 { font-size: 1.0rem; margin: 0 0 8px; }
.about p { font-size: 0.88rem; color: var(--muted); margin: 0 0 10px; }
.about p:last-child { margin-bottom: 0; }

.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 18px 40px;
  font-size: 0.76rem;
  color: var(--faint);
  text-align: center;
}
.site-footer a { color: var(--muted); }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 0 0 14px;
}
.footer-nav a { color: var(--muted); }

/* ---------- long-form content pages (guides / FAQ / glossary) ---------- */
.article { margin-top: 6px; }
.article > h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.1rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 6px 0 8px;
}
.article .lede { font-size: 1rem; color: var(--muted); line-height: 1.6; margin: 0 0 8px; }
.article .updated { font-size: 0.74rem; color: var(--faint); margin: 0 0 18px; }
.prose { font-size: 0.94rem; line-height: 1.7; color: var(--text); }
.prose h2 { font-size: 1.18rem; margin: 30px 0 10px; }
.prose h3 { font-size: 1.02rem; margin: 22px 0 8px; }
.prose p { margin: 0 0 14px; color: var(--text); }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin: 0 0 7px; }
.prose a { color: var(--accent); }
.prose strong { font-weight: 600; }
.prose .muted { color: var(--muted); }

/* callout / tip box */
.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin: 0 0 18px;
  font-size: 0.9rem;
  color: var(--muted);
}
.callout strong { color: var(--text); }

/* affiliate module card (used on guides) */
.aff-module {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 18px 0;
}
.aff-module h3 { margin: 0 0 6px; font-size: 1.02rem; }
.aff-module .aff-sub { font-size: 0.84rem; color: var(--muted); margin: 0 0 12px; }
.aff-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.aff-disclosure { font-size: 0.72rem; color: var(--faint); margin: 12px 0 0; line-height: 1.5; }

/* live next-launch widget embedded on guide pages */
.mini-next {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 73px;             /* reserve the filled height — kills the load shift */
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0 0 18px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.mini-next .mn-clock { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1.1rem; color: var(--accent); white-space: nowrap; }
.mini-next .mn-body { min-width: 0; }
.mini-next .mn-name { font-weight: 600; font-size: 0.94rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-next .mn-when { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.mini-next .mn-cta { margin-left: auto; flex: none; min-width: auto; font-size: 0.82rem; padding: 8px 12px; }

/* FAQ accordions (home + guides) */
.faq { margin-top: 8px; }
.faq h2 { font-size: 1.18rem; margin: 0 0 12px; }
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 9px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 13px 15px;
  font-size: 0.93rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq .faq-a { padding: 0 15px 14px; font-size: 0.9rem; color: var(--muted); line-height: 1.6; }
.faq .faq-a a { color: var(--accent); }

/* "visible tonight" geolocation tool */
.vt-tool { margin-top: 6px; }
.vt-cta { margin: 4px 0 18px; }
.vt-result {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--panel-shadow);
}
.vt-verdict { font-size: 1.25rem; font-weight: 700; margin: 0 0 6px; }
.vt-verdict.yes { color: var(--success); }
.vt-verdict.maybe { color: var(--warn); }
.vt-verdict.no { color: var(--muted); }
.vt-dist { font-size: 0.88rem; color: var(--muted); margin: 0 0 14px; }
.related-pages { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); }
.related-pages h2 { font-size: 1.05rem; margin: 0 0 10px; }
.related-pages ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.related-pages a { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- skeleton ---------- */
.sk { background: var(--surface-2); border-radius: 6px; animation: shimmer 1.3s infinite; }
.sk-row { width: 60%; height: 18px; margin-bottom: 14px; }
.sk-title { width: 80%; height: 26px; margin-bottom: 18px; }
.sk-count { width: 100%; height: 92px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.sk-actions { width: 100%; height: 44px; }
@keyframes shimmer { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

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

/* ---------- detail page ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); margin: 4px 0 14px; }
.detail-hero-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 16px; display: block; }
.mission-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.patch { width: 64px; height: 64px; flex-shrink: 0; border-radius: 8px; object-fit: contain; background: var(--surface-2); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 20px; }
.detail-cell { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.detail-cell .k { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.detail-cell .v { font-size: 0.9rem; font-weight: 500; margin-top: 3px; }
.detail-cell .v a { color: var(--accent); }
.detail-desc { margin-top: 18px; font-size: 0.9rem; color: var(--muted); line-height: 1.6; }

/* collapsible "Viewing guide" — travel moved below the telemetry (answer-first) */
.viewing-guide { margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.viewing-guide > summary {
  cursor: pointer;
  padding: 13px 15px;
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.viewing-guide > summary::-webkit-details-marker { display: none; }
.viewing-guide > summary svg { color: var(--accent); }
.viewing-guide > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform 0.2s ease; }
.viewing-guide[open] > summary::after { transform: rotate(180deg); }
.vg-body { padding: 0 15px 15px; }
.vg-body p { font-size: 0.85rem; color: var(--muted); margin: 0 0 12px; }
.travel-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.vg-gear-lead { font-size: 0.85rem; color: var(--muted); margin: 16px 0 10px; }
.vg-disclosure { font-size: 0.72rem; color: var(--faint); margin: 13px 0 0; line-height: 1.5; }

/* ---------- live-stream embed (click-to-load YouTube facade) ---------- */
.stream { margin-top: 18px; }
.stream-facade {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
}
.stream-thumb { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.82; transition: opacity 0.15s ease, transform 0.3s ease; }
.stream-facade:hover .stream-thumb { opacity: 1; transform: scale(1.03); }
.stream-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 62px; height: 62px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  transition: background 0.15s ease, transform 0.15s ease;
}
.stream-facade:hover .stream-play { background: var(--ignite); transform: translate(-50%, -50%) scale(1.06); }
.stream-cap {
  position: absolute; left: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.78rem; font-weight: 600; color: #fff;
  background: rgba(0, 0, 0, 0.6); padding: 5px 10px; border-radius: 999px;
}
.stream-live {
  display: inline-flex; align-items: center; gap: 5px;
  color: #fff; background: #e23636; padding: 1px 7px; border-radius: 999px;
  font-size: 0.66rem; letter-spacing: 0.06em;
}
.stream-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
.stream-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-sm); display: block; }

.more-launches { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.more-launches h2 { font-size: 1rem; font-weight: 600; margin: 0 0 12px; }

/* ---------- pad map card (detail viewing-trip block) ---------- */
.pad-map {
  position: relative;
  margin: 0 0 14px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.pad-map img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  animation: kenburns 18s ease-in-out infinite alternate;
}
@keyframes kenburns {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); }
}
.pad-map::after {  /* phase-tint scrim melting into the panel */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 40%, var(--bg) 130%);
  opacity: 0.55;
}
.pad-map .pad-beacon {
  position: absolute;
  top: 50%; left: 50%;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--ignite);
  box-shadow: 0 0 0 3px rgba(255, 106, 43, 0.3);
  animation: beacon 1.8s ease-out infinite;
  z-index: 1;
}
@keyframes beacon {
  0% { box-shadow: 0 0 0 3px rgba(255, 106, 43, 0.35); }
  70% { box-shadow: 0 0 0 14px rgba(255, 106, 43, 0); }
  100% { box-shadow: 0 0 0 3px rgba(255, 106, 43, 0); }
}
.pad-map figcaption {
  position: absolute;
  left: 10px; bottom: 8px;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* ---------- orbit ring diagram (detail facts) ---------- */
.orbit-ic {
  width: 20px; height: 20px;
  vertical-align: -5px;
  margin-right: 6px;
  color: var(--accent);
}

/* ---------- visible-tonight horizon dome ---------- */
.vt-dome { display: block; width: 100%; max-width: 340px; height: auto; margin: 2px auto 12px; }
.vt-dome .hd-ground { stroke: var(--border-strong); stroke-width: 1.5; }
.vt-dome .hd-ring { fill: none; stroke: var(--border); stroke-dasharray: 3 3; }
.vt-dome .hd-ring-label, .vt-dome .hd-compass { font-family: var(--font-mono); font-size: 8px; fill: var(--faint); letter-spacing: 0.06em; }
.vt-dome .hd-arc { fill: none; stroke: var(--ignite); stroke-width: 2; stroke-linecap: round; }
.vt-dome .hd-bearing { fill: var(--text); font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; }
.vt-dome .hd-pad { fill: var(--ignite); }
.vt-dome.v-yes .hd-glow { fill: var(--success); opacity: 0.14; }
.vt-dome.v-maybe .hd-glow { fill: var(--warn); opacity: 0.12; }
.vt-dome.v-no .hd-glow { fill: var(--muted); opacity: 0.08; }
.vt-picker { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 4px; }
.vt-picker select {
  flex: 1;
  min-width: 200px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.vt-picker .btn { flex: none; }

/* ---------- layout utilities ---------- */
/* full-bleed band inside the 600px column (media bands, future cine layers) */
.bleed { width: 100vw; margin-left: calc(50% - 50vw); }

/* scroll entrances — lw-core adds .io-pre below the fold, .in-view on entry */
.io-pre { opacity: 0; transform: translateY(8px); }
.io-pre.in-view { opacity: 1; transform: translateY(0); transition: opacity 0.2s ease, transform 0.2s ease; }

/* ---------- cine layer policy (dormant until media/ clips land) ----------
   Contract from the overhaul plan §7: video sits in an absolute .cine layer
   behind the glass; tokens drive the per-phase scrim; day suppresses video
   entirely (cine.js must never call play() when data-theme=day). */
.cine { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; z-index: -1; }
.cine video, .cine img { width: 100%; height: 100%; object-fit: cover; opacity: 0.58; filter: saturate(0.9) brightness(0.9); }
.cine::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, var(--bg) 125%); opacity: 0.55; }
[data-theme="dawn"] .cine video, [data-theme="dawn"] .cine img { opacity: 0.45; }
[data-theme="dusk"] .cine video, [data-theme="dusk"] .cine img { opacity: 0.45; }
[data-theme="day"] .cine video { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 400px) {
  /* drop the long timezone name in the header to avoid crowding the brand;
     the clock icon still cues "your local time" */
  .tz-pill #tz-label { display: none; }
  .tz-pill { padding: 6px 8px; max-width: none; }
}

@media (max-width: 380px) {
  .hero-actions .btn { flex-basis: 100%; }
  .seg-num { font-size: 1.9rem; }
  .seg { padding: 12px 4px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Manual in-content AdSense units now live inside the .ad-slot containers. */
