/* ============================================================================
   INTERSTELLAR — Field Guide & Command Deck
   A starship mission-control / star-atlas theme. No-build, server-served.
   Tokens → base → chrome (nav/footer) → hero → sections → deck → modal → motion
   ========================================================================== */

/* ---- tokens ------------------------------------------------------------- */
:root {
  /* space */
  --space-950: #04060c;
  --space-900: #05070d;
  --space-850: #070b14;
  --space-800: #0a1120;
  --space-700: #0f1830;
  --space-600: #16233f;

  /* lines */
  --line: rgba(143, 183, 255, 0.14);
  --line-strong: rgba(143, 183, 255, 0.28);

  /* signal colors */
  --glow: #37e0c8;          /* life-support teal — primary */
  --glow-soft: rgba(55, 224, 200, 0.16);
  --glow-glow: rgba(55, 224, 200, 0.45);
  --alert: #ffb454;         /* amber — Vael / restricted / warning */
  --alert-soft: rgba(255, 180, 84, 0.16);
  --ice: #8fb7ff;           /* data / info */
  --danger: #ff6f6f;        /* failure / uprising */

  /* ink */
  --ink: #e9eef7;
  --ink-dim: #93a2c0;
  --ink-faint: #5f6e8c;

  /* type */
  --font-display: "Chakra Petch", "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --font-body: "Spectral", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* rhythm */
  --nav-h: 66px;
  --maxw: 1180px;
  --r-sm: 3px;
  --r-md: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- reset / base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.72;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(55, 224, 200, 0.10), transparent 60%),
    radial-gradient(900px 600px at 8% 4%, rgba(143, 183, 255, 0.09), transparent 55%),
    radial-gradient(1000px 900px at 50% 120%, rgba(255, 180, 84, 0.05), transparent 60%),
    var(--space-900);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, canvas, svg { display: block; max-width: 100%; }
a { color: var(--ice); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--glow); color: #04201c; }

/* scrollbars (subtle, on-theme) */
* { scrollbar-width: thin; scrollbar-color: var(--space-600) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--space-600); border-radius: 20px; border: 2px solid var(--space-900); }

/* ---- fixed atmosphere layers ------------------------------------------- */
#starfield {
  position: fixed; inset: 0; z-index: -3; width: 100%; height: 100%;
  pointer-events: none;
}
.fx-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(143,183,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143,183,255,0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(120% 100% at 50% 0%, #000 30%, transparent 82%);
  -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, #000 30%, transparent 82%);
  opacity: 0.5;
}
.fx-scan {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.02) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay; opacity: 0.5;
}
.fx-vignette {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(140% 120% at 50% 30%, transparent 55%, rgba(2,4,9,0.7) 100%);
}

/* ---- shared bits -------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.34em;
  text-transform: uppercase; color: var(--glow);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--glow); box-shadow: 0 0 8px var(--glow-glow); }

/* HUD panel with corner brackets */
.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(15,24,48,0.55), rgba(7,11,20,0.55));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  backdrop-filter: blur(6px);
}
.bracket::before, .bracket::after,
.bracket > .corner::before, .bracket > .corner::after {
  content: ""; position: absolute; width: 12px; height: 12px;
  border: 1px solid var(--glow); opacity: 0.8;
}
.bracket::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.bracket::after  { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.bracket > .corner::before { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.bracket > .corner::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ---- nav ---------------------------------------------------------------- */
.hud-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center;
  background: linear-gradient(180deg, rgba(5,7,13,0.82), rgba(5,7,13,0.55));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.hud-nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--glow) 40%, var(--glow) 60%, transparent);
  opacity: 0.5; box-shadow: 0 0 12px var(--glow-glow);
}
.nav-inner { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  color: var(--glow); position: relative;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.22em; font-size: 15px; line-height: 1; }
.brand-text small { display: block; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.34em; color: var(--ink-faint); margin-top: 4px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-dim); padding: 8px 11px; border-radius: var(--r-sm); position: relative; white-space: nowrap;
}
.nav-links a:hover { color: var(--ink); background: rgba(143,183,255,0.06); }
.nav-links a.active { color: var(--glow); }
.nav-links a.active::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 2px; height: 1px; background: var(--glow); box-shadow: 0 0 8px var(--glow-glow); }

.sysop-btn {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
  color: var(--ink); background: linear-gradient(180deg, rgba(55,224,200,0.16), rgba(55,224,200,0.05));
  border: 1px solid var(--glow); padding: 9px 15px; border-radius: var(--r-sm);
  position: relative; overflow: hidden; transition: all 0.25s var(--ease);
}
.sysop-btn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--alert); box-shadow: 0 0 8px var(--alert); }
.sysop-btn:hover { box-shadow: 0 0 0 1px var(--glow), 0 0 22px var(--glow-soft); transform: translateY(-1px); }
.sysop-btn.authed { color: #04201c; background: var(--glow); border-color: var(--glow); font-weight: 700; }
.sysop-btn.authed .dot { background: #04201c; box-shadow: none; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: var(--r-sm); width: 40px; height: 36px; color: var(--ink); }

/* ---- hero --------------------------------------------------------------- */
.hero { position: relative; padding: calc(var(--nav-h) + 72px) 0 70px; }
.hero-grid { display: grid; grid-template-columns: 1.35fr 0.9fr; gap: 40px; align-items: center; }
.hero-title {
  font-family: var(--font-display); font-weight: 700; letter-spacing: 0.04em;
  font-size: clamp(52px, 11vw, 132px); line-height: 0.9; margin: 18px 0 20px;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff 0%, #cfe6ff 55%, var(--glow) 130%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(55,224,200,0.12);
}
.hero-tag {
  font-size: clamp(17px, 2.1vw, 21px); color: var(--ink-dim); max-width: 46ch; line-height: 1.6;
}
.hero-tag b { color: var(--ink); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.btn {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 13px 22px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); color: var(--ink);
  display: inline-flex; align-items: center; gap: 10px; transition: all 0.25s var(--ease); background: rgba(143,183,255,0.04);
}
.btn:hover { border-color: var(--ice); background: rgba(143,183,255,0.1); transform: translateY(-1px); }
.btn-primary { border-color: var(--glow); color: var(--glow); background: var(--glow-soft); }
.btn-primary:hover { box-shadow: 0 0 24px var(--glow-soft); background: rgba(55,224,200,0.22); }
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* live status strip */
.status-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 40px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.status-cell { background: var(--space-850); padding: 14px 16px; }
.status-cell .k { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-faint); }
.status-cell .v { font-family: var(--font-mono); font-size: 20px; margin-top: 6px; color: var(--ink); }
.status-cell .v small { font-size: 12px; color: var(--ink-dim); }
.status-cell .v.glow { color: var(--glow); }
.status-cell .v.ice { color: var(--ice); }

/* radar scope (hero right) */
.scope { position: relative; aspect-ratio: 1; width: 100%; max-width: 380px; margin: 0 auto; }
.scope .ring { position: absolute; border: 1px solid var(--line); border-radius: 50%; }
.scope .r1 { inset: 0; } .scope .r2 { inset: 15%; } .scope .r3 { inset: 30%; border-color: var(--line-strong); }
.scope .cross::before, .scope .cross::after { content: ""; position: absolute; background: var(--line); }
.scope .cross::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.scope .cross::after { top: 50%; left: 0; right: 0; height: 1px; }
.scope .sweep { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; }
.scope .sweep::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(55,224,200,0.35), rgba(55,224,200,0.0) 55deg);
  animation: sweep 4.5s linear infinite;
}
.scope .blip { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 10px var(--glow); animation: blip 4.5s linear infinite; }
.scope .b1 { top: 32%; left: 62%; }
.scope .b2 { top: 60%; left: 40%; background: var(--alert); box-shadow: 0 0 10px var(--alert); animation-delay: 1.4s; }
.scope .b3 { top: 44%; left: 70%; animation-delay: 2.6s; }
.scope .label { position: absolute; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em; color: var(--ink-faint); }
.scope .tl { top: 8%; left: 12%; }
.scope .br { bottom: 10%; right: 12%; color: var(--glow); }

/* ---- sections ------------------------------------------------------------ */
.section { position: relative; padding: 92px 0; }
.section + .section { border-top: 1px solid var(--line); }
.sec-head { max-width: 62ch; margin-bottom: 40px; }
.sec-code { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.3em; color: var(--glow); text-transform: uppercase; }
.sec-title { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; font-size: clamp(30px, 5vw, 52px); line-height: 1.02; margin: 12px 0 14px; color: var(--ink); }
.sec-lead { font-size: 18px; color: var(--ink-dim); }
.sec-lead b, .sec-lead em { color: var(--ink); font-style: normal; font-weight: 600; }

.cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card { padding: 22px; }
.card h4 { font-family: var(--font-display); font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); margin-bottom: 8px; display: flex; align-items: center; gap: 9px; }
.card h4 .num { font-family: var(--font-mono); font-size: 11px; color: var(--glow); border: 1px solid var(--line); padding: 1px 6px; border-radius: var(--r-sm); }
.card p { color: var(--ink-dim); font-size: 15px; line-height: 1.65; }
.card p b { color: var(--ink); font-weight: 600; }
.card .tick { list-style: none; padding: 0; margin-top: 6px; }
.card .tick li { color: var(--ink-dim); font-size: 14.5px; padding: 6px 0 6px 20px; position: relative; border-top: 1px solid var(--line); }
.card .tick li::before { content: "▸"; position: absolute; left: 0; color: var(--glow); }
.card .tick li b { color: var(--ink); font-weight: 600; }

/* HUD table */
.hud-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 4px; }
.hud-table th { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--glow); text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-strong); }
.hud-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink-dim); }
.hud-table td:first-child { color: var(--ink); font-family: var(--font-mono); font-size: 13px; }
.hud-table tr:hover td { background: rgba(143,183,255,0.03); }
.hud-table .hi { color: var(--glow); }

/* stat block / readout (mono, boxed) */
.readout {
  font-family: var(--font-mono); font-size: 13px; line-height: 1.9;
  background: var(--space-900); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 18px 20px; color: var(--ink-dim); overflow-x: auto; white-space: pre;
}
.readout .g { color: var(--glow); }
.readout .a { color: var(--alert); }
.readout .i { color: var(--ice); }
.readout .d { color: var(--ink); }

/* pullquote / lore */
.pullquote {
  font-family: var(--font-display); font-size: clamp(22px, 3.4vw, 34px); line-height: 1.28;
  color: var(--ink); border-left: 2px solid var(--glow); padding: 6px 0 6px 24px; margin: 8px 0;
}
.pullquote .attr { display: block; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2em; color: var(--ink-faint); margin-top: 16px; }

/* getting-started steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; padding: 22px; counter-increment: step; }
.step .idx { font-family: var(--font-display); font-size: 40px; color: var(--space-600); line-height: 1; font-weight: 700; }
.step .idx::before { content: "0" counter(step); }
.step h4 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.05em; margin: 12px 0 8px; font-size: 15px; }
.step p { color: var(--ink-dim); font-size: 14.5px; }
.step p b { color: var(--ink); }

/* ---- Command Deck ------------------------------------------------------- */
.deck { position: relative; padding: 92px 0; }
.deck::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(900px 400px at 50% 0%, rgba(255,180,84,0.08), transparent 70%);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.deck-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 34px; }
.deck-badge {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 7px 13px; border-radius: var(--r-sm); border: 1px solid var(--alert); color: var(--alert);
  background: var(--alert-soft); display: inline-flex; align-items: center; gap: 9px;
}
.deck-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--alert); box-shadow: 0 0 10px var(--alert); }
.deck-badge.authed { border-color: var(--glow); color: var(--glow); background: var(--glow-soft); }
.deck-badge.authed .dot { background: var(--glow); box-shadow: 0 0 10px var(--glow); }
.deck-sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--ink-faint); text-transform: uppercase; }

/* locked state */
.deck-locked { text-align: center; padding: 60px 24px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.deck-locked .lock { width: 54px; height: 54px; margin: 0 auto 20px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--alert); }
.deck-locked h3 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.06em; font-size: 22px; }
.deck-locked p { color: var(--ink-dim); max-width: 46ch; margin: 12px auto 24px; }

/* dashboard gauges */
.gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.gauge { padding: 16px 18px; }
.gauge .k { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-faint); }
.gauge .v { font-family: var(--font-mono); font-size: 26px; margin-top: 8px; color: var(--ink); }
.gauge .v small { font-size: 13px; color: var(--ink-dim); }
.gauge .bar { height: 3px; margin-top: 10px; background: var(--space-600); border-radius: 3px; overflow: hidden; }
.gauge .bar > i { display: block; height: 100%; background: var(--glow); box-shadow: 0 0 10px var(--glow-glow); transition: width 0.6s var(--ease); }
.gauge.alert .v { color: var(--alert); }
.gauge.ice .v { color: var(--ice); }

.deck-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.deck-panel { padding: 20px 22px; }
.deck-panel h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--glow); display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.deck-panel h4 .live { color: var(--ink-faint); letter-spacing: 0.1em; }
.deck-panel h4 .live.on { color: var(--glow); }

/* controls */
.field { margin-bottom: 18px; }
.field label { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 9px; }
.field label .val { color: var(--glow); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; background: var(--space-600); border-radius: 4px; outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--glow); border: 2px solid var(--space-900); box-shadow: 0 0 12px var(--glow-glow); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--glow); border: 2px solid var(--space-900); box-shadow: 0 0 12px var(--glow-glow); cursor: pointer; }
input[type="number"], input[type="text"], select {
  width: 100%; background: var(--space-900); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink); font-family: var(--font-mono); font-size: 13px; padding: 10px 12px; outline: none;
}
input:focus, select:focus { border-color: var(--glow); box-shadow: 0 0 0 1px var(--glow-soft); }
.preset-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.preset { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; padding: 6px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink-dim); background: transparent; }
.preset:hover { border-color: var(--glow); color: var(--glow); }
.ctrl-actions { display: flex; gap: 10px; margin-top: 6px; }
.btn-sm { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 9px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: transparent; color: var(--ink); transition: all 0.2s var(--ease); }
.btn-sm:hover { border-color: var(--glow); color: var(--glow); }
.btn-sm.warn { border-color: var(--alert); color: var(--alert); }
.btn-sm.warn:hover { background: var(--alert-soft); }
.btn-sm.ok { border-color: var(--glow); color: var(--glow); background: var(--glow-soft); }

/* roster list */
.roster { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.roster-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.roster-row:last-child { border-bottom: 0; }
.roster-row .name { font-family: var(--font-mono); color: var(--ink); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-row .sub { color: var(--ink-faint); font-family: var(--font-mono); font-size: 11px; }
.roster-row .num { font-family: var(--font-mono); color: var(--ice); font-size: 12px; text-align: right; }
.roster-row.sel { background: var(--glow-soft); }
.roster-row.sel .name { color: var(--glow); }
.mini-btn { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; padding: 4px 9px; border: 1px solid var(--line); border-radius: var(--r-sm); background: transparent; color: var(--ink-dim); }
.mini-btn:hover { border-color: var(--glow); color: var(--glow); }
.mini-btn.warn:hover { border-color: var(--alert); color: var(--alert); }

/* live log */
.log-stream { max-height: 300px; overflow-y: auto; font-family: var(--font-mono); font-size: 12px; line-height: 1.9; background: var(--space-900); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.log-line { display: flex; gap: 10px; color: var(--ink-dim); }
.log-line .t { color: var(--ink-faint); flex-shrink: 0; }
.log-line .a { color: var(--glow); flex-shrink: 0; }
.log-line .d { color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-line.sysop .a { color: var(--alert); }

/* ---- footer ------------------------------------------------------------- */
.foot { border-top: 1px solid var(--line); padding: 46px 0 40px; position: relative; }
.foot::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--glow) 50%, transparent); opacity: 0.4; }
.foot-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.foot .brand-text { font-size: 14px; }
.foot-meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--ink-faint); text-align: right; line-height: 2; }
.foot-meta a { color: var(--ink-dim); }
.foot-meta a:hover { color: var(--glow); }

/* ---- modal -------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(3,5,10,0.72); backdrop-filter: blur(8px); opacity: 0; visibility: hidden; transition: opacity 0.25s var(--ease), visibility 0.25s;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 440px; padding: 30px 30px 28px; position: relative;
  background: linear-gradient(180deg, var(--space-800), var(--space-850));
  transform: translateY(14px) scale(0.98); transition: transform 0.3s var(--ease);
}
.modal-backdrop.open .modal { transform: none; }
.modal .m-code { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--alert); }
.modal h3 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.05em; font-size: 24px; margin: 12px 0 6px; }
.modal p { color: var(--ink-dim); font-size: 14px; margin-bottom: 22px; }
.modal .field { margin-bottom: 18px; }
.modal .row { display: flex; gap: 10px; margin-top: 6px; }
.modal .err { color: var(--danger); font-family: var(--font-mono); font-size: 12px; min-height: 16px; margin-top: 12px; }
.modal .close { position: absolute; top: 14px; right: 14px; background: none; border: 1px solid var(--line); width: 30px; height: 30px; border-radius: var(--r-sm); color: var(--ink-dim); }
.modal .close:hover { border-color: var(--danger); color: var(--danger); }
.modal .hint { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--ink-faint); margin-top: 14px; }

/* ---- toast -------------------------------------------------------------- */
.toast-host { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; padding: 11px 18px;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--space-800); color: var(--ink);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5); opacity: 0; transform: translateY(12px); transition: all 0.3s var(--ease);
  display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: none; }
.toast.ok { border-color: var(--glow); color: var(--glow); }
.toast.err { border-color: var(--danger); color: var(--danger); }
.toast .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---- reveal / motion ---------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
[data-scramble] { will-change: transform; }

@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes blip { 0%,100% { opacity: 0.15; } 8% { opacity: 1; } 30% { opacity: 0.35; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.pulse { animation: pulse 2s ease-in-out infinite; }

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .scope { max-width: 300px; }
  .nav-links { display: none; }
  .nav-toggle { display: grid; place-items: center; }
  .deck-cols { grid-template-columns: 1fr; }
  .gauges { grid-template-columns: repeat(2, 1fr); }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch; position: absolute;
    top: var(--nav-h); left: 0; right: 0; background: var(--space-850); border-bottom: 1px solid var(--line);
    padding: 12px; gap: 2px; margin: 0;
  }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .section, .deck { padding: 66px 0; }
  .cols, .cols-3, .steps { grid-template-columns: 1fr; }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  .brand-text small { display: none; }
  .hero { padding-top: calc(var(--nav-h) + 48px); }
}

/* ---- reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scope .sweep::before, .scope .blip { animation: none; }
}
