:root {
  --bg: #06080c;
  --ink: #e7eef6;
  --muted: #93a3b5;
  --dim: #6d7d90;
  --line: rgba(166, 214, 255, 0.16);
  --line-strong: rgba(142, 231, 255, 0.45);
  --cyan: #8ee7ff;
  --amber: #f0a63c;
  --green: #7dffb3;
  --red: #ff6d5c;
  --glass: rgba(10, 16, 24, 0.72);
  --card: rgba(12, 18, 26, 0.82);
  --sans: "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, monospace;
  --wrap: 1120px;
  --radius: 18px;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  background:
    radial-gradient(1000px 520px at 88% -10%, rgba(26, 120, 150, 0.22), transparent 60%),
    radial-gradient(820px 480px at -12% 8%, rgba(240, 166, 60, 0.09), transparent 55%),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(142, 231, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(142, 231, 255, 0.035) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
}

img, svg, iframe { max-width: 100%; }

a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: #d8f7ff; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--amber);
  color: #1a1204;
  padding: 8px 12px;
  z-index: 20;
  border-radius: 8px;
}
.skip:focus { top: 12px; }

.wrap {
  width: min(var(--wrap), calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(6, 8, 12, 0.78);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  min-height: 64px;
  padding: 10px 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  font-size: 13px;
  text-transform: uppercase;
}

.brand svg { display: block; }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links a:hover { color: var(--ink); }

.clock {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--amber);
  letter-spacing: 0.08em;
}

.hero { padding: 48px 0 24px; }

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin: 0 0 14px;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(125, 255, 179, 0.7);
  animation: pulse 2.4s ease-out infinite;
}

h1, h2, h3 { line-height: 1.12; font-weight: 620; letter-spacing: -0.03em; }

h1 {
  margin: 0 0 14px;
  font-size: clamp(2.5rem, 8vw, 5rem);
}

.deck {
  margin: 0 0 16px;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  color: #d5e2ef;
  max-width: 38rem;
}

.lede, .section-intro { color: var(--muted); max-width: 46rem; }
.lede { margin: 0 0 18px; }

.tagline {
  margin: 0 0 22px;
  font-family: var(--mono);
  color: var(--cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(142, 231, 255, 0.08);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.btn:hover { background: rgba(142, 231, 255, 0.16); color: white; }

.btn-amber {
  background: var(--amber);
  border-color: #ffd089;
  color: #1c1304;
}
.btn-amber:hover { background: #ffc56a; color: #1c1304; }

.btn-ghost { background: transparent; }

.btn[disabled], .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.fact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fact-row li {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(8, 12, 18, 0.55);
}

.hero-grid {
  display: grid;
  gap: 28px;
  align-items: center;
}

.frame {
  position: relative;
  border-radius: 22px;
  padding: 12px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.frame::before,
.frame::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--cyan);
  pointer-events: none;
}
.frame::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.frame::after { right: 8px; bottom: 8px; border-left: 0; border-top: 0; }

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #020305;
  border-radius: 14px;
  overflow: hidden;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.caption {
  margin: 10px 4px 2px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
}

section { padding: 28px 0 10px; }

h2 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.kicker {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}

.feature-grid, .split, .chapter-list, .source-list {
  display: grid;
  gap: 12px;
}

.feature-grid > *,
.split > *,
.source-list > *,
.chapter-list > *,
.panel,
.frame,
.video,
.term {
  min-width: 0;
  max-width: 100%;
}

.card, .path, .chapter-list a, .source-list article, .quote, .warn, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.card, .path, .source-list article, .panel { padding: 16px 16px 18px; }

.card h3, .path h3, .source-list h3 { margin: 8px 0; font-size: 1.12rem; }

.card p, .path p, .source-list p { margin: 0; color: var(--muted); }

.card-top, .path-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.index, .badge {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.index { color: var(--dim); }

.badge {
  color: var(--cyan);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
}

.badge.warn-badge { color: var(--amber); }
.badge.key-badge { color: #ffd7a1; }

.chapter-list { list-style: none; margin: 18px 0 0; padding: 0; }

.chapter-list a {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
  min-height: 48px;
}

.chapter-list a:hover { border-color: var(--line-strong); }

.chapter-list time {
  font-family: var(--mono);
  color: var(--amber);
  min-width: 4.5rem;
  font-size: 13px;
}

.split { margin-top: 8px; }

.path ol { margin: 10px 0; padding-left: 1.2rem; color: var(--muted); }
.path li + li { margin-top: 6px; }

.term {
  margin: 12px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #05070a;
}

.term-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.term pre {
  margin: 0;
  padding: 12px 14px 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: #d6f6ff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.copy {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.note, .fine { color: var(--muted); }
.fine { font-size: 0.95rem; }

.quote, .warn { padding: 16px 18px; margin: 16px 0; }
.quote { border-left: 3px solid var(--cyan); }
.quote p { margin: 0; }
.quote footer { margin-top: 8px; color: var(--dim); font-family: var(--mono); font-size: 12px; }
.warn { border-left: 3px solid var(--amber); }
.warn p { margin: 0; }

.sky-head { max-width: 46rem; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 16px 0;
}

.segment {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(8, 12, 18, 0.7);
}

.segment button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 44px;
  padding: 0 14px;
  cursor: pointer;
}

.segment button[aria-pressed="true"] {
  background: rgba(142, 231, 255, 0.16);
  color: var(--ink);
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.checks label { display: inline-flex; gap: 6px; align-items: center; min-height: 44px; }

.sky-frame {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #030508;
  min-height: 320px;
}

.sky-stage { position: relative; }

.sky-map,
.aircraft-slot { height: min(72vh, 740px); min-height: 420px; }
.sky-map .maplibregl-canvas { cursor: crosshair; }

.aircraft-slot { display: none; background: #07090d; }
.sky-frame[data-view="aircraft"] .sky-map { display: none; }
.sky-frame[data-view="aircraft"] .aircraft-slot { display: block; }

.aircraft-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #07090d;
}

.sky-frame[data-sensor="nvg"] .sky-map,
.sky-frame[data-sensor="nvg"] .aircraft-slot {
  filter: grayscale(1) sepia(1) hue-rotate(78deg) saturate(4.2) brightness(0.82) contrast(1.28);
}

.sky-frame[data-sensor="thermal"] .sky-map,
.sky-frame[data-sensor="thermal"] .aircraft-slot {
  filter: grayscale(1) sepia(1) hue-rotate(338deg) saturate(5) contrast(1.4) brightness(1.08);
}

.hud-chip {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 12px;
  margin: 0;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(5, 8, 12, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
}

.scanlines, .vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scanlines {
  z-index: 3;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22) 0px,
    rgba(0, 0, 0, 0.22) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.45;
  mix-blend-mode: multiply;
}

.vignette {
  z-index: 2;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.45);
}

.hud-readout {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.hud-readout p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(5, 8, 12, 0.82);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: #d5e4f0;
}

.hud-readout strong { color: var(--cyan); font-weight: 600; }
.hud-readout .is-live strong { color: var(--green); }
.hud-readout .is-down strong { color: var(--red); }
.hud-readout .is-idle strong { color: var(--amber); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  vertical-align: -1px;
  border-radius: 50%;
}
.swatch.quake { background: #ff6d5c; }
.swatch.iss { background: var(--amber); border-radius: 1px; height: 3px; width: 16px; vertical-align: 3px; }
.swatch.plane { background: var(--cyan); clip-path: polygon(50% 0, 100% 100%, 50% 72%, 0 100%); border-radius: 0; }

.iss-marker {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--amber);
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 6px rgba(240, 166, 60, 0.15);
}
.iss-marker span {
  width: 6px;
  height: 6px;
  background: var(--amber);
  border-radius: 50%;
}

.maplibregl-ctrl-attrib {
  background: rgba(6, 8, 12, 0.82) !important;
  color: #c5d2e0 !important;
  font-family: var(--mono) !important;
  font-size: 10px !important;
}
.maplibregl-ctrl-attrib a { color: var(--cyan) !important; }
.maplibregl-popup-content {
  background: #0c1218 !important;
  color: var(--ink) !important;
  border: 1px solid var(--line);
  border-radius: 12px !important;
  font-family: var(--sans);
  padding: 10px 12px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.maplibregl-popup-tip { border-top-color: #0c1218 !important; border-bottom-color: #0c1218 !important; }
.maplibregl-popup-close-button { color: var(--muted); font-size: 18px; }
.pop strong { display: block; font-family: var(--mono); letter-spacing: 0.04em; }
.pop p { margin: 4px 0; }
.pop .pop-meta { color: var(--dim); font-family: var(--mono); font-size: 12px; }

.credits { color: var(--dim); font-size: 13px; }

.site-footer {
  margin-top: 36px;
  padding: 28px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.site-footer p { max-width: 50rem; }
.wordmark {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}

@media (min-width: 720px) {
  .feature-grid, .chapter-list, .source-list { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr 1fr; }
  .hud-readout { grid-template-columns: 1fr 1fr 1fr; }
}

@media (min-width: 980px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; }
  .feature-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 420px) {
  .wrap { width: min(var(--wrap), calc(100% - 24px)); }
  .actions .btn, .toolbar .btn { width: 100%; }
  .sky-map, .aircraft-slot { height: 62vh; min-height: 280px; }
  .hud-readout { grid-template-columns: 1fr; }
  h1 { font-size: 2.45rem; }
  .segment { display: flex; width: 100%; }
  .segment button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot, .iss-marker { animation: none; }
  .scanlines { opacity: 0.2; }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(125, 255, 179, 0.55); }
  100% { box-shadow: 0 0 0 10px rgba(125, 255, 179, 0); }
}
