/* ============================================================
   spacetrain.ing — cockpit console theme
   Single dark world by design: this page is meant to feel like
   deep space at all times, so it does not switch with the host
   light/dark setting — every color below is painted explicitly.
   ============================================================ */

:root {
  --void: #05070d;
  --panel: #0b1020;
  --panel-2: #111a2e;
  --line: #26334c;
  --line-soft: #1a2438;
  --text: #eef3f8;
  --muted: #8d9ab3;
  --muted-dim: #5d6a83;
  --accent: #57e6c8;
  --accent-dim: rgba(87, 230, 200, 0.16);
  --warn: #ffb454;

  --font-display: 'Michroma', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

  --console-w: 216px;
  --gutter: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.25;
  text-wrap: balance;
  letter-spacing: 0.01em;
  margin: 0;
}

p { margin: 0; }

code {
  font-family: var(--font-mono);
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 0.05em 0.4em;
  font-size: 0.92em;
  color: var(--accent);
}

a { color: inherit; }

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

/* ---------- starfield + atmosphere ---------- */

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: radial-gradient(ellipse at 30% 20%, #0d1730 0%, var(--void) 60%);
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(3, 4, 8, 0.75) 100%);
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0.05;
  background: repeating-linear-gradient(
    to bottom,
    #fff 0px,
    #fff 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

/* ---------- boot sequence ---------- */

body[data-boot] .console,
body[data-boot] .hud-frame,
body[data-boot] .viewport {
  animation: boot-flicker 900ms ease-out both;
}
@keyframes boot-flicker {
  0%   { opacity: 0; filter: brightness(2.4); }
  8%   { opacity: 1; }
  12%  { opacity: 0.2; }
  20%  { opacity: 1; filter: brightness(1.6); }
  28%  { opacity: 0.4; }
  36%  { opacity: 1; filter: brightness(1); }
  100% { opacity: 1; filter: brightness(1); }
}
@media (prefers-reduced-motion: reduce) {
  body[data-boot] .console,
  body[data-boot] .hud-frame,
  body[data-boot] .viewport {
    animation: none;
  }
}

/* ---------- HUD corner readouts ---------- */

.hud-frame {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  padding: 18px 22px;
}
.hud-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.hud-key {
  color: var(--muted-dim);
  text-transform: uppercase;
}
.hud-val {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(87, 230, 200, 0.5);
}
.hud-blink { animation: hud-pulse 2.4s ease-in-out infinite; }
@keyframes hud-pulse { 50% { opacity: 0.45; } }

.hud-tl { top: 18px; left: calc(var(--console-w) + var(--gutter)); }
.hud-tr { top: 18px; right: 22px; text-align: right; align-items: flex-end; }

/* ---------- console (ship nav rail) ---------- */

.console {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--console-w);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px 16px;
  background: linear-gradient(180deg, var(--panel) 0%, #090d18 100%);
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
}

.console-brand {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text);
  letter-spacing: 0.04em;
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.brand-suffix { color: var(--accent); font-size: 12px; }

.switches {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.switch {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 10px 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 100ms ease;
}
.switch:hover {
  color: var(--text);
  border-color: var(--line);
  background: #16203a;
}
.switch:active { transform: scale(0.98); }

.switch-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-dim);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.4);
  flex-shrink: 0;
  transition: background 200ms ease, box-shadow 200ms ease;
}
.switch.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}
.switch.is-active .switch-light {
  background: var(--accent);
  box-shadow: 0 0 8px 2px rgba(87, 230, 200, 0.7);
}
.switch-label { flex: 1; text-align: left; }
.switch-code { color: var(--muted-dim); font-size: 10px; }
.switch.is-active .switch-code { color: var(--accent); }

.console-status {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warn);
  text-decoration: none;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 8px 2px rgba(255, 180, 84, 0.7);
  animation: hud-pulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
}

/* ---------- viewport / content ---------- */

.viewport {
  position: relative;
  z-index: 2;
  margin-left: var(--console-w);
}

.pane {
  position: relative;
  padding: 88px var(--gutter);
  border-bottom: 1px solid var(--line-soft);
}
.pane-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.eyebrow span { color: var(--accent); }

.pane h2 {
  font-size: clamp(22px, 3vw, 30px);
  color: var(--text);
}

/* ---- hero ---- */

.pane-hero {
  padding-top: clamp(96px, 16vh, 160px);
  padding-bottom: 64px;
}
.wordmark {
  font-size: clamp(34px, 6.4vw, 68px);
  color: var(--text);
  text-shadow: 0 0 28px rgba(87, 230, 200, 0.25);
}
.wordmark .dot { color: var(--accent); }

.subhead {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--text);
  max-width: 640px;
}
.subhead strong { color: var(--accent); font-weight: 600; }

.lede {
  color: var(--muted);
  max-width: 620px;
  font-size: 15.5px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #04211c;
  font-weight: 600;
  box-shadow: 0 0 0 rgba(87, 230, 200, 0);
}
.btn-primary:hover {
  box-shadow: 0 0 24px rgba(87, 230, 200, 0.45);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.readout-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 22px 0 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  width: fit-content;
}
.readout-strip > div {
  padding: 12px 20px;
  border-right: 1px solid var(--line-soft);
  text-align: center;
}
.readout-strip > div:last-child { border-right: none; }
.readout-strip dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-dim);
  margin: 0 0 4px;
}
.readout-strip dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.scroll-cue {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 40px auto 0;
  max-width: 800px;
  padding: 0 var(--gutter);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-dim);
}
.scroll-cue span {
  width: 18px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  position: relative;
  flex-shrink: 0;
}
.scroll-cue span::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  width: 3px;
  height: 6px;
  background: var(--accent);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scroll-cue-move 1.8s ease-in-out infinite;
}
@keyframes scroll-cue-move {
  0%, 100% { top: 5px; opacity: 1; }
  60% { top: 14px; opacity: 0.3; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-cue span::after { animation: none; }
}

/* ---- asset cards ---- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.panel-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.panel-index {
  font-family: var(--font-mono);
  color: var(--muted-dim);
  font-size: 12px;
  margin: 0;
}
.panel-card h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16.5px;
  color: var(--text);
}
.panel-card p {
  color: var(--muted);
  font-size: 14.5px;
}

/* ---- mission cards ---- */

.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.mission-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--accent);
  border-radius: 8px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mission-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--warn);
  margin: 0;
}
.mission-card h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}
.mission-card p {
  color: var(--muted);
  font-size: 14px;
}

/* ---- transmit ---- */

.pane-transmit .lede { max-width: 560px; }

/* ---- footer ---- */

.site-footer {
  padding: 40px var(--gutter) 56px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted-dim);
}
.footer-fine { color: var(--muted-dim); opacity: 0.7; }

/* ============================================================
   responsive
   ============================================================ */

@media (max-width: 860px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
  .mission-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --console-w: 0px; }

  .console {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-right: none;
    border-top: 1px solid var(--line);
    transform: translateY(0);
  }
  .console-brand { display: none; }
  .switches {
    flex: 1;
    flex-direction: row;
    justify-content: space-between;
    gap: 6px;
  }
  .switch {
    flex-direction: column;
    gap: 4px;
    padding: 8px 6px;
    text-align: center;
  }
  .switch-label { font-size: 10px; }
  .switch-code { display: none; }
  .console-status { display: none; }

  .viewport { margin-left: 0; padding-bottom: 74px; }

  .hud-tl { left: 16px; }
  .hud-tr { right: 16px; }
  .hud-corner { font-size: 9.5px; }

  .pane { padding: 56px 20px; }
  .card-grid { grid-template-columns: 1fr; }
  .readout-strip { width: 100%; }
  .readout-strip > div { flex: 1; padding: 10px 8px; }
}

@media (max-width: 420px) {
  .hud-tl, .hud-tr { display: none; }
}
