/* ══════════════════════════════════════════════════════════════════
   WARTABLE — COMMAND CONSOLE UI
   Tactical HUD / grimdark aesthetic — Revamped
   ══════════════════════════════════════════════════════════════════ */

:root {
  --bg: #09090b;
  --panel: #111113;
  --panel-alt: #0d0d0f;
  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.1);
  --muted: #888a8d;
  --text: #f4f4f5;
  --accent: #c81e2c;
  --accent-dim: rgba(200,30,44,0.12);
  --accent-glow: rgba(200,30,44,0.22);
  --valid: #22c55e;
  --valid-dim: rgba(34,197,94,0.1);
  --valid-border: rgba(34,197,94,0.3);
  --glass: rgba(255,255,255,0.03);
  --radius: 10px;
  --nav-w: 260px;
  --header-h: 52px;
  --drawer-w: 520px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}


/* ══════════════════════════════════════════════════════════════════
   LAYER 0: BACKGROUND VIDEO
   ══════════════════════════════════════════════════════════════════ */
#bg-layer {
  position: fixed; inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
#bg-layer video {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.18;
  will-change: transform;
  transform: translateZ(0);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.85) 30%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0.1) 80%, transparent 95%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.85) 30%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0.1) 80%, transparent 95%);
}


/* ══════════════════════════════════════════════════════════════════
   LAYER 1: DARK OVERLAY
   ══════════════════════════════════════════════════════════════════ */
#bg-overlay {
  position: fixed; inset: 0;
  z-index: 1;
  background: rgba(0,0,0,0.55);
  pointer-events: none;
}


/* ══════════════════════════════════════════════════════════════════
   LAYER 2: GRID + SCANLINES
   ══════════════════════════════════════════════════════════════════ */
#grid-layer {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 2;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 72px 72px;
}

/* Vignette */
#grid-layer::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 42%, transparent 30%, rgba(9,9,11,0.55) 100%);
  pointer-events: none;
}

/* Noise overlay */
.noise-overlay {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 3;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* Radar sweep (red scanline) */
.radar-sweep {
  position: fixed; left: 0; right: 0;
  height: 100px;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(200,30,44,0.035) 35%,
    rgba(200,30,44,0.06) 50%,
    rgba(200,30,44,0.035) 65%,
    transparent 100%);
  pointer-events: none; z-index: 3;
  animation: radarSweep 12s linear infinite;
  will-change: transform;
}
@keyframes radarSweep {
  0%   { transform: translateY(-100px); }
  100% { transform: translateY(100vh); }
}


/* ══════════════════════════════════════════════════════════════════
   SKIP LINK
   ══════════════════════════════════════════════════════════════════ */
.skip-link {
  position: absolute; left: -999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  left: 1rem; top: 1rem; width: auto; height: auto;
  padding: .5rem .75rem; background: #fff; color: #000;
  border-radius: 4px; z-index: 9999;
}

a { color: inherit; text-decoration: none; }


/* ══════════════════════════════════════════════════════════════════
   APP SHELL (z-index: 10)
   ══════════════════════════════════════════════════════════════════ */
#app-shell {
  position: fixed; inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
}


/* ══════════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════════ */
.site-header {
  position: relative;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem;
  background: rgba(9,9,11,0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  flex-shrink: 0;
}

.header-left, .header-center, .header-right {
  display: flex; align-items: center;
}
.header-left { gap: .5rem; }
.header-center { gap: .4rem; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.header-right { gap: .6rem; margin-left: auto; }

/* Brand */
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; }
.logo { width: 22px; height: 22px; object-fit: contain; border-radius: 2px; }
.brand-text { font-weight: 700; font-size: .82rem; letter-spacing: .04em; }
.brand-status {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--valid);
  margin-left: .05rem; margin-bottom: 5px;
  flex-shrink: 0;
  animation: pulseGreen 3.5s ease-in-out infinite;
}
@keyframes pulseGreen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50%      { box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}

/* Breadcrumb */
.bc-section { color: var(--muted); }
.bc-sep { color: rgba(255,255,255,0.15); margin: 0 .15rem; }
.bc-page { color: var(--text); font-weight: 600; }

/* Nav drawer button (mobile) */
.nav-drawer-btn {
  display: none;
  background: none; border: 0; padding: .35rem; border-radius: 6px; cursor: pointer;
}
.nav-drawer-btn .hamburger {
  width: 20px; height: 2px; background: var(--text); display: block; position: relative;
}
.nav-drawer-btn .hamburger::before,
.nav-drawer-btn .hamburger::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--text);
}
.nav-drawer-btn .hamburger::before { top: -6px; }
.nav-drawer-btn .hamburger::after  { bottom: -6px; }


/* ══════════════════════════════════════════════════════════════════
   AUDIO CONTROL
   ══════════════════════════════════════════════════════════════════ */
.audio-control {
  position: relative;
}
.music-btn {
  width: 32px; height: 32px;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: 6px; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s, border-color .15s;
  flex-shrink: 0;
}
.music-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); border-color: var(--border-light); }
.music-btn.active { color: var(--text); border-color: rgba(200,30,44,0.35); }

.volume-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--panel);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: .6rem .8rem;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  z-index: 60;
  min-width: 140px;
}
.volume-dropdown.open {
  display: flex;
}
.volume-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border-light);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--text);
  cursor: pointer;
}
.volume-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--text);
  cursor: pointer;
}
.volume-value {
  font-size: .65rem;
  color: var(--muted);
  letter-spacing: .05em;
}


/* ══════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1.1rem; border-radius: 7px;
  font-weight: 600; font-size: .82rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s, color .15s, border-color .15s;
  white-space: nowrap; position: relative;
  font-family: inherit;
}
.btn-lg { padding: .7rem 1.5rem; font-size: .9rem; }
.btn-sm { padding: .35rem .7rem; font-size: .75rem; }

.btn-primary {
  background: var(--accent); color: #fff;
  border-color: rgba(255,80,80,0.12);
  box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary::before,
.btn-primary::after {
  content: ""; position: absolute;
  width: 7px; height: 7px;
  border-color: rgba(255,255,255,0.5);
  border-style: solid; opacity: 0;
  transition: opacity .2s, transform .2s;
}
.btn-primary::before {
  top: -3px; left: -3px;
  border-width: 1.5px 0 0 1.5px;
  transform: translate(3px,3px);
}
.btn-primary::after {
  bottom: -3px; right: -3px;
  border-width: 0 1.5px 1.5px 0;
  transform: translate(-3px,-3px);
}
.btn-primary:hover::before,
.btn-primary:hover::after { opacity: 1; transform: translate(0); }
.btn-primary:hover {
  background: #d42232;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px var(--accent-glow);
}

.btn-ghost {
  background: transparent; color: var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-light);
  transform: translateY(-1px);
}


/* ══════════════════════════════════════════════════════════════════
   CONSOLE SHELL — two-column layout
   ══════════════════════════════════════════════════════════════════ */
.console-shell {
  flex: 1;
  display: flex;
  min-height: 0;
}


/* ══════════════════════════════════════════════════════════════════
   LEFT NAV CONSOLE
   ══════════════════════════════════════════════════════════════════ */
.nav-console {
  width: var(--nav-w); flex-shrink: 0;
  background: var(--panel-alt);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 1rem 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-group { margin-bottom: .75rem; }
.nav-group-label {
  font-size: .62rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); padding: .5rem 1.2rem .35rem;
}

.nav-item {
  display: flex; align-items: center; gap: .6rem;
  width: 100%; padding: .55rem 1.2rem;
  background: none; border: none; color: var(--muted);
  font-size: .82rem; font-weight: 500;
  cursor: pointer; position: relative;
  transition: color .15s, background .15s;
  text-decoration: none;
  font-family: inherit;
  text-align: left;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.03); }

/* Target wedge — active indicator */
.nav-wedge {
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 0;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transition: height .2s ease, box-shadow .2s ease;
}
.nav-item[aria-current="true"] { color: var(--text); background: rgba(200,30,44,0.06); }
.nav-item[aria-current="true"] .nav-wedge {
  height: 60%;
  box-shadow: 0 0 8px rgba(200,30,44,0.4);
}
.nav-item.drawer-active { color: var(--text); background: rgba(200,30,44,0.06); }
.nav-item.drawer-active .nav-wedge {
  height: 60%;
  box-shadow: 0 0 8px rgba(200,30,44,0.4);
}

/* Scan pulse on activate */
@keyframes navScanPulse {
  0%   { opacity: 0; width: 0; }
  30%  { opacity: 0.12; width: 100%; }
  100% { opacity: 0; width: 100%; }
}
.nav-item.scan-pulse::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--accent), transparent);
  pointer-events: none;
  animation: navScanPulse .4s ease forwards;
}

.nav-icon { flex-shrink: 0; color: inherit; opacity: .7; }
.nav-item[aria-current="true"] .nav-icon { opacity: 1; }
.nav-item.drawer-active .nav-icon { opacity: 1; }

.nav-footer {
  margin-top: auto;
  padding: 1rem 1.2rem 0;
  border-top: 1px solid var(--border);
}
.nav-disclaimer { color: rgba(255,255,255,0.2); font-size: .65rem; margin: 0; }


/* ══════════════════════════════════════════════════════════════════
   MAIN CONTENT AREA (Hero)
   ══════════════════════════════════════════════════════════════════ */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 720px;
  width: 100%;
  text-align: center;
}

.hero-primary {
  width: 100%;
  position: relative;
}

/* Subtle watermark (opacity <= 0.04) */
.hero-watermark {
  position: absolute;
  width: 500px; height: 500px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: url("../assets/WarTable.png") center / contain no-repeat;
  opacity: 0.035;
  pointer-events: none;
  filter: blur(1.5px);
}

.home-logo {
  display: block;
  max-width: clamp(240px, 40vw, 420px);
  height: auto;
  margin: 0 auto .75rem;
  position: relative;
  opacity: 0.88;
}
.home-sub {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 auto 1.25rem;
  max-width: 42ch;
  text-align: center;
}
.home-ctas { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; justify-content: center; }
.home-chips { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.chip {
  background: var(--glass);
  border: 1px solid var(--border);
  padding: .22rem .65rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .03em;
}


/* ══════════════════════════════════════════════════════════════════
   STATUS STRIP
   ══════════════════════════════════════════════════════════════════ */
.status-strip {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.5rem;
  padding: .45rem .8rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: 0 .6rem;
}

.status-sep {
  width: 1px;
  height: 14px;
  background: var(--border-light);
  flex-shrink: 0;
}

.status-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online {
  background: var(--valid);
  box-shadow: 0 0 4px rgba(34,197,94,0.6);
}

.status-label {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.status-val {
  font-size: .62rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}


/* ══════════════════════════════════════════════════════════════════
   ROSTER DEMO CARD
   ══════════════════════════════════════════════════════════════════ */
.roster-demo {
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 2px solid rgba(200,30,44,0.2);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.roster-demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.roster-demo-chip {
  background: var(--accent-dim);
  border: 1px solid rgba(200,30,44,0.2);
  color: var(--accent);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .15rem .5rem;
  border-radius: 3px;
}
.roster-demo-input {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.roster-input {
  flex: 1;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .45rem .7rem;
  color: var(--text);
  font-size: .78rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.roster-input::placeholder { color: rgba(255,255,255,0.25); }
.roster-input:focus { border-color: rgba(200,30,44,0.4); }

.roster-demo-result {
  min-height: 0;
  transition: min-height .3s ease;
}
.roster-demo-result:empty {
  display: none;
}

/* Roster Preview Card (inside result) */
.roster-preview {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  animation: fadeSlideIn .3s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.rp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: .6rem;
}
.rp-faction {
  font-weight: 700;
  font-size: .88rem;
}
.rp-pts {
  color: var(--muted);
  font-size: .72rem;
  margin-top: .1rem;
}
.rp-badge {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .1em;
  padding: .18rem .45rem;
  border-radius: 4px;
  border: 1px solid;
  flex-shrink: 0;
}
.rp-badge.valid {
  background: var(--valid-dim);
  border-color: var(--valid-border);
  color: var(--valid);
}
.rp-detachment {
  font-size: .72rem;
  color: var(--muted);
  margin-bottom: .5rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.rp-units {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.rp-unit {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  font-size: .74rem;
  padding: .3rem 0;
  border-bottom: 1px solid var(--border);
}
.rp-unit:last-of-type { border-bottom: none; }
.rp-unit-main {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  min-width: 0;
}
.rp-unit-name { font-weight: 600; }
.rp-unit-role {
  font-size: .6rem;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.rp-unit-pts {
  color: var(--muted);
  font-size: .7rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.rp-unit-options {
  font-size: .65rem;
  color: rgba(255,255,255,0.35);
  padding: 0 0 .3rem .4rem;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}


/* ══════════════════════════════════════════════════════════════════
   INTEL DRAWER (z-index: 100)
   ══════════════════════════════════════════════════════════════════ */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.intel-drawer {
  position: fixed;
  top: var(--header-h);
  left: var(--nav-w);
  bottom: 0;
  width: clamp(480px, 42vw, 640px);
  max-width: calc(100vw - var(--nav-w));
  background: var(--panel-alt);
  border-right: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(-18px);
  opacity: 0;
  filter: blur(6px);
  pointer-events: none;
  transition: transform .22s cubic-bezier(0.4, 0, 0.2, 1),
              opacity .2s ease,
              filter .2s ease;
}
.intel-drawer.open {
  transform: translateX(0);
  opacity: 1;
  filter: blur(0);
  pointer-events: auto;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.drawer-title::before {
  content: "";
  flex-shrink: 0;
  width: 3px; height: 1em;
  background: var(--accent);
  border-radius: 2px;
}

.drawer-close {
  width: 32px; height: 32px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s, border-color .15s;
}
.drawer-close:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border-color: var(--border-light);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}


/* ── Drawer Content Styles ── */
.drawer-section-sub {
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.6;
  margin: 0 0 1.5rem;
  max-width: 50ch;
}

/* Features grid inside drawer */
.drawer-features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .7rem;
}
.drawer-feature-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 2px solid rgba(200,30,44,0.15);
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  display: flex;
  gap: .7rem;
  transition: border-top-color .2s;
}
.drawer-feature-card:hover {
  border-top-color: var(--accent);
}
.drawer-feature-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--accent-dim);
  border: 1px solid rgba(200,30,44,0.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.drawer-feature-icon svg { width: 16px; height: 16px; }
.drawer-feature-content h3 { margin: 0 0 .15rem; font-size: .82rem; font-weight: 600; }
.drawer-feature-content p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }

/* Validation demo inside drawer */
.drawer-demo {
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 2px solid rgba(200,30,44,0.2);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  max-width: 460px;
}
.demo-header { display: flex; justify-content: space-between; align-items: center; }
.demo-title-row { display: flex; align-items: center; gap: .6rem; }
.demo-chip {
  background: var(--accent-dim); border: 1px solid rgba(200,30,44,0.2);
  color: var(--accent); font-size: .58rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  padding: .15rem .45rem; border-radius: 3px;
}
.demo-title { margin: 0; font-size: .85rem; font-weight: 600; }
.demo-status-badge {
  font-size: .62rem; font-weight: 700; letter-spacing: .1em;
  padding: .2rem .5rem; border-radius: 4px; border: 1px solid;
  transition: all .25s;
}
.demo-status-badge.valid { background: var(--valid-dim); border-color: var(--valid-border); color: var(--valid); }
.demo-status-badge.error { background: var(--accent-dim); border-color: rgba(200,30,44,0.3); color: var(--accent); }

.demo-unit-row {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: rgba(255,255,255,0.015); border: 1px solid var(--border);
  border-radius: 7px; padding: .7rem .8rem; flex-wrap: wrap;
}
.demo-unit-info { display: flex; flex-direction: column; gap: .1rem; }
.demo-faction { color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; }
.demo-unit-name { font-size: .82rem; font-weight: 600; }
.demo-controls { display: flex; align-items: center; gap: .5rem; }
.demo-ctrl-label { color: var(--muted); font-size: .72rem; }
.demo-stepper { display: flex; align-items: center; gap: .3rem; }
.demo-step {
  width: 26px; height: 26px; background: var(--glass);
  border: 1px solid var(--border); border-radius: 5px;
  color: var(--text); font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
  font-family: inherit;
}
.demo-step:hover:not(:disabled) { background: rgba(255,255,255,0.07); border-color: var(--border-light); }
.demo-step:disabled { opacity: .3; cursor: default; }
.demo-count {
  min-width: 20px; text-align: center;
  font-size: .85rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.demo-result {
  font-size: .78rem; font-weight: 500;
  padding: .45rem .7rem; border-radius: 5px; border-left: 2px solid;
  transition: background .25s, border-color .25s, color .25s;
}
.demo-result.valid { background: rgba(34,197,94,0.06); border-left-color: var(--valid); color: var(--valid); }
.demo-result.error { background: var(--accent-dim); border-left-color: var(--accent); color: var(--accent); }

/* Roadmap inside drawer */
.drawer-roadmap { display: flex; flex-direction: column; gap: .7rem; }
.drawer-roadmap-phase {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  transition: border-color .2s;
}
.drawer-roadmap-phase:hover { border-color: rgba(200,30,44,0.25); }
.phase-header { display: flex; align-items: center; gap: .6rem; margin-bottom: .35rem; }
.phase-chip {
  font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: .18rem .5rem; border-radius: 4px; border: 1px solid;
  flex-shrink: 0;
}
.phase-chip.now  { background: var(--valid-dim); border-color: var(--valid-border); color: var(--valid); }
.phase-chip.next { background: rgba(234,179,8,0.1); border-color: rgba(234,179,8,0.3); color: #eab308; }
.phase-chip.later { background: var(--accent-dim); border-color: rgba(200,30,44,0.25); color: var(--accent); }
.phase-title { margin: 0; font-size: .88rem; font-weight: 600; }
.phase-desc { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }

/* FAQ inside drawer */
.drawer-faq-list { display: flex; flex-direction: column; gap: .5rem; }
.drawer-faq {
  padding: .8rem 1rem;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  transition: border-color .2s;
}
.drawer-faq:hover { border-color: var(--border-light); }
.drawer-faq summary {
  cursor: pointer; font-weight: 600; font-size: .82rem;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
}
.drawer-faq summary::-webkit-details-marker { display: none; }
.drawer-faq summary::after { content: "+"; color: var(--accent); font-size: 1rem; font-weight: 400; flex-shrink: 0; }
.drawer-faq[open] summary::after { content: "\2212"; }
.drawer-faq[open] { border-color: rgba(200,30,44,0.2); }
.drawer-faq p { margin: .6rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }

.drawer-disclaimer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.drawer-disclaimer p { color: rgba(255,255,255,0.2); font-size: .65rem; margin: 0; line-height: 1.5; }


/* ══════════════════════════════════════════════════════════════════
   LAUNCH OVERLAY
   ══════════════════════════════════════════════════════════════════ */
.launch-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(9,9,11,0.97);
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .18s;
}
.launch-overlay.active { opacity: 1; pointer-events: all; }

.launch-scan {
  position: absolute; left: 0; right: 0; height: 2px; top: -2px;
  background: linear-gradient(90deg, transparent 5%, rgba(200,30,44,0.9) 50%, transparent 95%);
}
.launch-overlay.active .launch-scan { animation: launchScan .55s ease-in-out forwards; }
@keyframes launchScan {
  0%   { top: 0; opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.launch-content {
  position: relative; text-align: center;
  padding: 1.6rem 2.8rem;
  border: 1px solid rgba(200,30,44,0.25);
  border-radius: 12px;
  opacity: 0; transform: scale(0.95);
  transition: opacity .28s .18s, transform .28s .18s;
}
.launch-overlay.active .launch-content { opacity: 1; transform: scale(1); }

.lc { position: absolute; width: 9px; height: 9px; }
.lc.tl { top: 8px; left: 8px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.lc.tr { top: 8px; right: 8px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.lc.bl { bottom: 8px; left: 8px; border-bottom: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.lc.br { bottom: 8px; right: 8px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }

.launch-label {
  display: block; color: var(--accent);
  font-size: .62rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; margin-bottom: .5rem;
}
.launch-title {
  display: block; color: var(--text);
  font-size: 1rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
}
.launch-dots { display: flex; justify-content: center; gap: 5px; margin-top: .6rem; }
.launch-dots span {
  display: inline-block; width: 4px; height: 4px;
  border-radius: 50%; background: var(--accent);
  animation: dotPulse .9s ease-in-out infinite;
}
.launch-dots span:nth-child(2) { animation-delay: .3s; }
.launch-dots span:nth-child(3) { animation-delay: .6s; }
@keyframes dotPulse {
  0%, 100% { opacity: .2; transform: scale(.7); }
  50%      { opacity: 1;  transform: scale(1); }
}


/* ══════════════════════════════════════════════════════════════════
   FOCUS STATES
   ══════════════════════════════════════════════════════════════════ */
a:focus-visible, .btn:focus-visible, button:focus-visible, details summary:focus-visible, input:focus-visible {
  outline: 2px solid rgba(200,30,44,0.5);
  outline-offset: 2px;
}


/* ══════════════════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .radar-sweep, .brand-status,
  .launch-scan, .launch-dots span, .launch-content,
  .nav-item.scan-pulse::after {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .intel-drawer { transition: none !important; filter: none !important; transform: none !important; }
  .intel-drawer:not(.open) { opacity: 0; pointer-events: none; }
  .drawer-backdrop { transition: none !important; }
  .roster-preview { animation: none !important; }
  #bg-layer video { display: none; }
}


/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */

/* Video: reduce on smaller screens */
@media (max-width: 768px) {
  #bg-layer video { opacity: 0.04; }
}

/* Tablet: collapsed icon rail */
@media (max-width: 960px) {
  :root { --nav-w: 56px; }
  .nav-group-label { display: none; }
  .nav-label { display: none; }
  .nav-item { justify-content: center; padding: .6rem .5rem; }
  .nav-icon { opacity: 1; }
  .nav-footer { display: none; }

  .main-content {
    padding: 2rem 1.5rem;
  }
  .intel-drawer {
    left: var(--nav-w);
    max-width: calc(100vw - var(--nav-w));
  }
}

/* Mobile: drawer nav */
@media (max-width: 640px) {
  .nav-drawer-btn { display: inline-flex; }
  .btn-header { display: none; }

  .nav-console {
    position: fixed;
    top: var(--header-h); left: 0; bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 90;
    background: var(--bg);
  }
  .nav-console.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0,0,0,0.6);
  }
  .nav-console.open ~ .nav-backdrop { display: block; }

  /* Restore labels in drawer */
  .nav-group-label { display: block; }
  .nav-label { display: inline; }
  .nav-item { justify-content: flex-start; padding: .55rem 1.2rem; }
  .nav-footer { display: block; }

  .main-content { padding: 1.5rem 1rem; }
  .home-logo { max-width: 200px; }
  .hero-watermark { width: 280px; height: 280px; }
  .header-center { display: none; }

  .status-strip {
    flex-wrap: wrap;
    gap: .3rem;
  }
  .status-sep { display: none; }
  .status-item { padding: .15rem .4rem; }

  /* Drawer goes full-width on mobile */
  .intel-drawer {
    left: 0;
    width: 100vw;
    max-width: 100vw;
  }
}

/* Nav backdrop for mobile */
.nav-backdrop {
  display: none;
  position: fixed; inset: 0;
  top: var(--header-h);
  background: rgba(0,0,0,0.5);
  z-index: 89;
}
