:root {
  --brand: #ff6600;
  --brand-dim: rgba(255, 102, 0, 0.18);
  --ink: #f4f4f5;
  --muted: #71717a;
  --line: #18181b;
  --bg: #050508;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Thin tactical scrollbars, kills default Windows chrome */
* {
  scrollbar-width: thin;
  scrollbar-color: #3f3f46 transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 0;
}

*::-webkit-scrollbar-thumb:hover {
  background: #52525b;
}

*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: #050508;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: rgba(244, 244, 245, 0.18);
  color: #fff;
}

#starfield {
  display: none;
}

/* Static CSS starfield, zero JS cost */
.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 8% 12%, rgba(244,244,245,0.45), transparent),
    radial-gradient(1px 1px at 22% 28%, rgba(161,161,170,0.35), transparent),
    radial-gradient(1.5px 1.5px at 36% 8%, rgba(244,244,245,0.3), transparent),
    radial-gradient(1px 1px at 48% 42%, rgba(161,161,170,0.4), transparent),
    radial-gradient(1px 1px at 62% 18%, rgba(244,244,245,0.35), transparent),
    radial-gradient(1px 1px at 74% 55%, rgba(161,161,170,0.3), transparent),
    radial-gradient(1.5px 1.5px at 88% 22%, rgba(244,244,245,0.4), transparent),
    radial-gradient(1px 1px at 12% 68%, rgba(161,161,170,0.35), transparent),
    radial-gradient(1px 1px at 28% 82%, rgba(244,244,245,0.25), transparent),
    radial-gradient(1px 1px at 55% 74%, rgba(161,161,170,0.4), transparent),
    radial-gradient(1px 1px at 70% 88%, rgba(244,244,245,0.3), transparent),
    radial-gradient(1px 1px at 92% 64%, rgba(161,161,170,0.35), transparent),
    radial-gradient(1px 1px at 42% 58%, rgba(244,244,245,0.2), transparent),
    radial-gradient(1px 1px at 18% 48%, rgba(161,161,170,0.25), transparent),
    radial-gradient(1px 1px at 80% 40%, rgba(244,244,245,0.35), transparent);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 40% at 48% 34%, rgba(255, 102, 0, 0.06), transparent 65%);
}

.vignette {
  display: none;
}

.app {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 48px;
}

/* Demo disclaimer: must always be visible; this is a Phase I concept, not a live system */
.demo-banner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-align: center;
  color: #ffb380;
  background: rgba(255, 102, 0, 0.08);
  border-bottom: 1px solid rgba(255, 102, 0, 0.3);
}

.demo-banner-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}

/* Problem callout: the engineering "why" (SEEs), placed right under the hero */
.problem-callout {
  max-width: 720px;
  margin: 4px 0 28px;
  padding: 16px 18px;
  border: 1px solid rgba(39, 39, 42, 0.75);
  border-left: 2px solid var(--brand);
  background: rgba(255, 102, 0, 0.04);
}

.problem-kicker {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}

.problem-callout p:not(.problem-kicker) {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: #a1a1aa;
}

.problem-callout strong {
  color: #f4f4f5;
  font-weight: 600;
}

/* Entrance, disabled for perf */
.reveal {
  opacity: 1;
  transform: none;
  animation: none;
}

/* Header: compact, no giant empty band */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  padding: 0;
  border-bottom: 1px solid rgba(39, 39, 42, 0.7);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  min-width: 0;
}

.logo-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-name {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #fafafa;
  white-space: nowrap;
}

.brand-tag {
  font-size: 10px;
  color: #71717a;
  letter-spacing: 0.04em;
}

.header-nav {
  display: none;
  gap: 22px;
}

.header-nav a {
  font-size: 12px;
  color: #71717a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.header-nav a:hover {
  color: #f4f4f5;
}

@media (min-width: 800px) {
  .header-nav { display: flex; }
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.status-pill,
.feed-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px;
  color: #a1a1aa;
  letter-spacing: 0.04em;
}

.feed-pill {
  color: #71717a;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}

.utc-clock {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: #a1a1aa;
  font-variant-numeric: tabular-nums;
}

/* Hero */
.hero {
  padding: 20px 0 20px;
  max-width: 640px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.65rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: #fafafa;
}

.lede {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.65;
  color: #71717a;
  max-width: 520px;
}

/* Workspace */
.workspace {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid rgba(39, 39, 42, 0.75);
  background: rgba(8, 8, 12, 0.92);
  overflow: hidden;
}

@media (min-width: 980px) {
  .workspace {
    grid-template-columns: minmax(0, 8fr) minmax(260px, 4fr);
  }
}

.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(39, 39, 42, 0.75);
  background: rgba(0, 0, 0, 0.25);
}

.panel-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.panel-icon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}

.panel-icon.telemetry-icon {
  background: var(--brand);
}

.panel-title {
  font-size: 11px;
  font-weight: 500;
  color: #e4e4e7;
}

.panel-sub {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px;
  color: #52525b;
}

.mode-chip {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #71717a;
  padding: 3px 7px;
  border: 1px solid #27272a;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.mode-chip.live {
  color: #ff6600;
  border-color: rgba(255, 102, 0, 0.45);
  background: var(--brand-dim);
}

.sandbox {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-bottom: 1px solid rgba(39, 39, 42, 0.75);
}

@media (min-width: 980px) {
  .sandbox {
    border-bottom: none;
    border-right: 1px solid rgba(39, 39, 42, 0.75);
  }
}

.orbit-stage {
  position: relative;
  height: clamp(240px, 34vh, 340px);
  background:
    radial-gradient(ellipse 70% 55% at 50% 48%, rgba(255, 102, 0, 0.06), transparent 60%),
    rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.orbit-hud-tl,
.orbit-hud-tr,
.orbit-hud-bl,
.orbit-hud-br {
  position: absolute;
  z-index: 2;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #52525b;
  pointer-events: none;
}

.orbit-hud-tl { top: 12px; left: 14px; }
.orbit-hud-tr { top: 12px; right: 14px; }
.orbit-hud-bl { bottom: 12px; left: 14px; color: #71717a; }
.orbit-hud-br { bottom: 12px; right: 14px; }

.orbit-hud-belt {
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  color: #71717a;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.orbit-stage.warn .orbit-hud-bl {
  color: #ff6600;
}

.orbit-stage.warn .orbit-hud-belt {
  color: #ff6600;
}

.orbit-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Hidden at rest by design. This is a soft filled glow (not a stroked ring),
   so it can never be mistaken for a 4th orbit track or overlap-flicker
   against the real rings. Only appears during a storm replay. */
.belt-boundary {
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.orbit-stage.warn .belt-boundary {
  opacity: 1;
  animation: belt-pulse 2.4s ease-in-out infinite;
}

@keyframes belt-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

.leo-ring {
  transition: stroke 0.3s ease;
}

.leo-ring.warn {
  stroke: #ff6600;
}

.plane-ring {
  transition: stroke-opacity 0.3s ease;
}

.orbit-stage.warn .plane-ring {
  stroke-opacity: 0.75;
}

.threat-ring {
  transition: stroke-opacity 0.3s ease;
  pointer-events: none;
}

.orbit-stage.warn .threat-ring {
  stroke-opacity: 0.55;
  animation: threat-glow 1.6s ease-in-out infinite;
}

@keyframes threat-glow {
  0%, 100% { stroke-opacity: 0.25; }
  50% { stroke-opacity: 0.7; }
}

/* Satellite positions are set every frame directly via JS transform="translate(x,y)"
   so they always land exactly on their ring's parametric ellipse. */
.sat-halo,
.sat-dot {
  transition: fill 0.3s ease, stroke 0.3s ease;
}

.orbit-stage.warn .sat-halo {
  stroke: #ff6600;
}

.orbit-stage.warn .sat-dot {
  fill: #ff6600;
}

/* Satellite currently inside the predicted (compressed) belt boundary.
   Distinct from the general "replay active" orange, this reflects actual
   geometric intersection computed each frame. */
.sat-group.at-risk .sat-halo {
  stroke: #ff2e2e;
}

.sat-group.at-risk .sat-dot {
  fill: #ff2e2e;
}

.sat-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: sat-ring 2.4s ease-out infinite;
}

@keyframes sat-ring {
  0% { opacity: 0.4; transform: scale(0.7); }
  100% { opacity: 0; transform: scale(2.2); }
}

.sat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  padding: 8px 14px;
  margin: 0;
  border-top: 1px solid rgba(39, 39, 42, 0.6);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  color: #71717a;
  letter-spacing: 0.01em;
}

.sat-strip .sep { color: #27272a; }

.sat-row {
  transition: color 0.3s ease;
}

.sat-row.flag {
  color: #f4f4f5;
}

.sandbox-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(39, 39, 42, 0.6);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 220px;
  flex-shrink: 0;
}

.btn-primary,
.btn-ghost {
  width: 100%;
  box-sizing: border-box;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn-primary {
  padding: 8px 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #050508;
  background: #ff6600;
  border: 1px solid #ff6600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
  background: transparent;
  color: #ff6600;
  box-shadow: 0 0 0 1px rgba(255, 102, 0, 0.35);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  padding: 8px 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #71717a;
  background: transparent;
  border: 1px solid #27272a;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.btn-ghost:hover:not(:disabled) {
  color: #f4f4f5;
  border-color: #71717a;
}

.btn-ghost:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.console {
  flex: 1;
  min-width: 200px;
  height: 88px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  line-height: 1.55;
  color: #71717a;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(39, 39, 42, 0.7);
  scrollbar-width: thin;
  scrollbar-color: #3f3f46 transparent;
}

.console::-webkit-scrollbar {
  width: 5px;
}

.console::-webkit-scrollbar-track {
  background: transparent;
}

.console::-webkit-scrollbar-thumb {
  background: #3f3f46;
}

.console::-webkit-scrollbar-button {
  display: none;
  height: 0;
}

.console .ok { color: #a1a1aa; }
.console .alert { color: #ff6600; }
.console .dim { color: #52525b; }

/* Telemetry */
.telemetry {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(0, 0, 0, 0.18);
}

.telemetry-list {
  flex: 1;
}

.metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(39, 39, 42, 0.65);
  transition: background 0.25s ease;
}

.metric.warn {
  background: rgba(255, 102, 0, 0.06);
}

.metric-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.metric-name {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #71717a;
}

.metric-val {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: #fafafa;
  transition: color 0.25s ease;
}

.metric.warn .metric-val {
  color: #ff6600;
}

.metric-val .unit {
  margin-left: 5px;
  font-size: 10px;
  font-weight: 400;
  color: #52525b;
}

.spark path {
  fill: none;
  stroke: #3f3f46;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}

.spark.warn path {
  stroke: #ff6600;
}

.telemetry-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 16px;
  padding: 12px 14px;
  margin-top: auto;
  border-top: 1px solid rgba(39, 39, 42, 0.65);
}

.latency-target {
  color: #71717a;
}

.latency {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.latency-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #52525b;
}

.latency-val {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: #a1a1aa;
}

/* Science */
.science {
  margin-top: 56px;
}

.section-head {
  margin-bottom: 24px;
}

.section-head.row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.science-grid {
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(39, 39, 42, 0.75);
}

@media (min-width: 800px) {
  .science-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.science-card {
  padding: 22px 0 8px;
  border-bottom: 1px solid rgba(39, 39, 42, 0.5);
}

@media (min-width: 800px) {
  .science-card {
    padding: 22px 24px 8px 0;
    border-bottom: none;
    border-right: 1px solid rgba(39, 39, 42, 0.5);
  }
  .science-card:last-child {
    border-right: none;
    padding-right: 0;
  }
  .science-card:first-child {
    padding-left: 0;
  }
}

.step {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: #52525b;
}

.science-card h3 {
  margin: 10px 0 0;
  font-size: 15px;
  font-weight: 600;
}

.science-card p {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: #71717a;
}

.metric-target {
  margin: 10px 0 0 !important;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px !important;
  letter-spacing: 0.02em;
  color: var(--brand) !important;
}

/* Archive */
.archive {
  margin-top: 48px;
}

.archive-meta {
  font-size: 11px;
  color: #52525b;
}

.archive-list {
  border-top: 1px solid rgba(39, 39, 42, 0.75);
}

.archive-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(39, 39, 42, 0.55);
  transition: background 0.2s ease;
}

.archive-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #f4f4f5;
}

.archive-desc {
  margin: 4px 0 0;
  font-size: 12px;
  color: #52525b;
}

.btn-download {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #a1a1aa;
  background: transparent;
  border: 1px solid #27272a;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn-download:hover {
  color: #ff6600;
  border-color: #ff6600;
  background: rgba(255, 102, 0, 0.06);
}

/* Footer */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid rgba(39, 39, 42, 0.65);
  font-size: 12px;
  color: #52525b;
}

.footer > div {
  min-width: 0;
}

.footer > div p:first-child {
  margin: 0;
}

.footer-legal {
  margin: 4px 0 0;
  color: #3f3f46;
  font-size: 11px;
}

@media (max-width: 900px) {
  .feed-pill { display: none; }
}

@media (max-width: 640px) {
  .app { width: calc(100% - 24px); }
  .status-pill { display: none; }
  .brand-tag { display: none; }
  .brand-name { font-size: 10px; letter-spacing: 0.04em; }
  .logo-img { width: 44px; height: 44px; }
  .header { height: 48px; min-height: 48px; max-height: 48px; }
  .demo-banner { font-size: 9px; padding: 6px 10px; }
  .orbit-hud-belt { font-size: 9px; }
}
