/* ==========================================================
   Teamstoviewticker — Retro Sunset Arcade
   Spacing scale: 4, 8, 16, 24, 40, 64
   ========================================================== */
:root {
  --c-bg: #1a0f2e;
  --c-bg-soft: #24163f;
  --c-forest: #2a1a4a;
  --c-forest-2: #34205a;
  --c-forest-3: #402a6b;
  --c-sand: #fff4d6;
  --c-sand-muted: #c9b6e4;
  --c-copper: #ff4f9a;
  --c-copper-2: #ff7ab5;
  --c-copper-deep: #b0246a;
  --c-neon: #3ff2e8;
  --c-sun: #ffd23f;
  --c-orange: #ff8c42;
  --c-danger: #ff8c42;
  --c-ink: #12081f;
  --c-line: rgba(255, 244, 214, 0.22);
  --shadow-hard: 6px 6px 0 #07030d;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 16px;
  --s-4: 24px;
  --s-5: 40px;
  --s-6: 64px;
  --radius: 6px;
  --radius-sm: 4px;
  --header-h: 60px;
  --container: 1200px;
  --font-display: "Courier New", "Lucida Console", ui-monospace, Menlo, Consolas, monospace;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--c-sand);
  background-color: var(--c-bg);
  background-image:
    radial-gradient(900px 480px at 50% -8%, rgba(255, 79, 154, 0.28), transparent 65%),
    radial-gradient(700px 420px at 100% 30%, rgba(255, 140, 66, 0.12), transparent 60%),
    linear-gradient(180deg, #1d0c33 0%, #1a0f2e 45%, #12081f 100%);
  min-height: 100vh;
  overflow-wrap: anywhere;
}
/* Retro CRT scanlines */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 250;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.14) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
body.is-nav-locked { overflow: hidden; }

h1, h2, h3, h4, p, li, a, dt, dd, span, label, td, th, figcaption, address, button, code {
  overflow-wrap: anywhere;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0;
  color: var(--c-sand);
  letter-spacing: 0.02em;
  font-weight: 700;
}
h1, h2 { text-transform: uppercase; text-shadow: 3px 3px 0 var(--c-copper-deep); }
p { margin: 0; }
img, svg, canvas { max-width: 100%; }

a { color: var(--c-neon); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--c-sun); }

:focus-visible { outline: 3px dashed var(--c-sun); outline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, canvas:focus-visible {
  outline: 3px dashed var(--c-sun);
  outline-offset: 3px;
}

/* Retro palette remap for inline SVG artwork used across pages */
svg [fill="#62f0a0"] { fill: var(--c-neon); }
svg [stroke="#62f0a0"] { stroke: var(--c-neon); }
svg [fill="#d98c4e"] { fill: var(--c-copper); }
svg [stroke="#d98c4e"] { stroke: var(--c-copper); }
svg [fill="#eadcbc"] { fill: var(--c-sand); }
svg [stroke="#eadcbc"] { stroke: var(--c-sand); }
svg [fill="#cbb892"] { fill: var(--c-sand-muted); }
svg [fill="#0f2a1b"] { fill: #1d0c33; }

.skip-link {
  position: absolute;
  left: var(--s-3);
  top: -80px;
  z-index: 300;
  background: var(--c-sun);
  color: var(--c-ink);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--c-copper);
}
.skip-link:focus { top: var(--s-2); color: var(--c-ink); background: var(--c-sun); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s-4); }

.text-accent { color: var(--c-sun); text-shadow: 3px 3px 0 var(--c-copper); }

/* ---------- Header ---------- */
.site-header {
  position: relative;
  z-index: 50;
  height: var(--header-h);
  background: #12081f;
  color: var(--c-sand);
  box-shadow: 0 3px 0 var(--c-copper), 0 6px 0 var(--c-orange), 0 9px 0 var(--c-sun);
  margin-bottom: 9px;
}
.header-inner {
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.header-inner > * { min-width: 0; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--c-sand);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  min-width: 0;
  flex: 0 1 auto;
}
.brand:hover { color: var(--c-sand); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-size: 1.05rem; line-height: 1.1; letter-spacing: 0.04em; text-transform: uppercase; }
.brand-accent { color: var(--c-copper); }

.nav-menu { flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; }
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-1) var(--s-2);
}
.nav-list li { min-width: 0; }
.nav-link {
  display: inline-block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  color: var(--c-sand-muted);
  background: transparent;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.nav-link:hover { color: var(--c-sand); border-color: var(--c-neon); }
.nav-link[aria-current="page"] { color: var(--c-ink); background: var(--c-neon); }

.header-cta { flex: none; }

.nav-toggle {
  display: none;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--c-neon);
  background: transparent;
  color: var(--c-sand);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
}
.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--c-sand);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.is-active .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-active .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.btn:active { transform: translate(2px, 2px); }
.btn-primary { background: var(--c-sun); color: var(--c-ink); border-color: var(--c-ink); box-shadow: 4px 4px 0 var(--c-copper); }
.btn-primary:hover { background: #ffe06b; color: var(--c-ink); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--c-copper); }
.btn-primary:focus-visible { background: #ffe06b; color: var(--c-ink); }
.btn-ghost { background: transparent; color: var(--c-sand); border-color: var(--c-neon); box-shadow: 4px 4px 0 rgba(63, 242, 232, 0.3); }
.btn-ghost:hover { background: rgba(63, 242, 232, 0.14); color: var(--c-sand); border-color: var(--c-neon); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(63, 242, 232, 0.4); }
.btn-ghost:focus-visible { background: rgba(63, 242, 232, 0.14); color: var(--c-sand); }
.btn-small { min-height: 36px; padding: 8px 16px; font-size: 0.82rem; }

/* ---------- Generic ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--c-sun);
}
.eyebrow::before { content: "▶ "; color: var(--c-copper); }
.lede { font-size: 1.1rem; color: var(--c-sand-muted); max-width: 62ch; }
.section { padding: var(--s-6) 0; }
.section-head { display: flex; flex-direction: column; gap: var(--s-3); margin-bottom: var(--s-5); max-width: 760px; }
.section-title { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
.section-lede { color: var(--c-sand-muted); }

.glass-panel {
  background: linear-gradient(180deg, #2a1a4a, #211339);
  color: var(--c-sand);
  border: 2px solid rgba(255, 244, 214, 0.55);
  border-radius: var(--radius);
  padding: var(--s-4);
  box-shadow: 6px 6px 0 var(--c-copper-deep);
  min-width: 0;
}
.panel-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-copper);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.panel-title { font-size: 1.15rem; text-transform: uppercase; }
.panel-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--c-neon);
  color: var(--c-neon);
  background: transparent;
  text-transform: uppercase;
}

.stat { display: flex; flex-direction: column; gap: 12px; min-width: 0; margin: 0; }
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-sand-muted);
  margin: 0;
}
.stat-value { margin: 0; font-family: var(--font-mono); font-size: 1.2rem; font-weight: 700; color: var(--c-sand); }
dl { margin: 0; }
dd { margin: 0; }

/* ---------- Hero ---------- */
.hero { padding: var(--s-6) 0 var(--s-5); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--s-5);
  align-items: center;
}
.hero-grid > * { min-width: 0; }
.hero-copy { display: flex; flex-direction: column; gap: var(--s-4); }
.hero-title { font-size: clamp(2rem, 5vw, 3.4rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.hero-brief { display: flex; flex-direction: column; gap: var(--s-4); }
.hero-brief .stat-value { color: var(--c-sun); }
.brief-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.brief-note { font-size: 0.9rem; color: var(--c-sand-muted); }
.hero-flight {
  margin-top: var(--s-5);
  border-radius: var(--radius);
  border: 3px solid var(--c-neon);
  background: linear-gradient(180deg, #12081f 0%, #2b0f45 60%, #4a1656 100%);
  box-shadow: 8px 8px 0 var(--c-copper);
  overflow: hidden;
}
.hero-flight-trajectory-graphic { display: block; width: 100%; height: auto; }
.hero-impact { opacity: 0; transform-origin: 1112px 170px; transform-box: view-box; }
.hero-impact.is-hit { animation: impactPulse 1.2s ease-out forwards; }
@keyframes impactPulse {
  0% { opacity: 0.9; transform: scale(0.3); }
  100% { opacity: 0; transform: scale(2.4); }
}

/* ---------- Range ---------- */
.range-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--s-4);
  align-items: start;
}
.range-layout > * { min-width: 0; }
.range-main { display: flex; flex-direction: column; gap: var(--s-4); }
.range-controls { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: flex-end; }
.control-group { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.control-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-sand-muted);
}
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  padding: var(--s-1);
  border-radius: var(--radius-sm);
  background: #12081f;
  border: 2px solid var(--c-line);
}
.seg-btn {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 2px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--c-sand);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.seg-btn:hover { background: rgba(255, 79, 154, 0.2); color: var(--c-sand); }
.seg-btn[aria-pressed="true"] { background: var(--c-copper); color: var(--c-ink); box-shadow: 3px 3px 0 var(--c-sun); }

.range-viewport {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 3px solid var(--c-neon);
  box-shadow: 6px 6px 0 #07030d;
  background: #1a0a2e;
}
.range-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  background: #1a0a2e;
  color: var(--c-sand);
}

.hud-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: var(--s-2);
}
.hud-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--s-3);
  border-radius: var(--radius-sm);
  background: #12081f;
  color: var(--c-sand);
  border: 2px solid rgba(63, 242, 232, 0.35);
  min-width: 0;
}
.hud-item-wide { grid-column: span 2; }
.hud-value { font-family: var(--font-mono); font-size: 1.05rem; font-weight: 700; color: var(--c-sand); }
.hud-value-accent { color: var(--c-sun); }
.hud-sub { font-family: var(--font-mono); font-size: 0.75rem; color: var(--c-sand-muted); }
.hud-wind { flex-direction: row; align-items: center; gap: var(--s-3); }
.hud-wind-text { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wind-compass-dial { width: 48px; height: 48px; flex: none; }
.draw-meter-bar { display: block; width: 100%; height: 10px; }
.draw-meter-track { fill: rgba(255, 244, 214, 0.14); }
.draw-meter-fill { fill: var(--c-copper); }
.draw-meter-fill.is-full { fill: var(--c-neon); }
.draw-meter-fill.is-strained { fill: var(--c-sun); }

.range-status {
  padding: var(--s-3);
  border-radius: var(--radius-sm);
  background: #12081f;
  color: var(--c-neon);
  border-left: 4px solid var(--c-copper);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
.range-status::before { content: "> "; color: var(--c-sun); }
.range-help {
  margin: 0;
  padding: 0 0 0 var(--s-4);
  color: var(--c-sand-muted);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.range-help strong { color: var(--c-sun); }

.range-side { display: flex; flex-direction: column; gap: var(--s-4); }
.telemetry-panel, .match-panel { display: flex; flex-direction: column; gap: var(--s-4); }
.tele-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: var(--s-2); }
.tele-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--s-3);
  border-radius: var(--radius-sm);
  background: #12081f;
  color: var(--c-sand);
  border: 2px solid var(--c-line);
  min-width: 0;
}
.tele-value { font-family: var(--font-mono); font-size: 0.98rem; font-weight: 700; color: var(--c-sand); }
.tele-value-accent { color: var(--c-sun); }
.profile-figure { margin: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.profile-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2.4 / 1;
  border-radius: var(--radius-sm);
  border: 2px solid var(--c-neon);
  background: #1a0a2e;
  color: var(--c-sand);
}
.profile-note { font-size: 0.82rem; color: var(--c-sand-muted); font-family: var(--font-mono); }

.score-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: var(--s-2);
}
.score-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  min-height: 64px;
  padding: var(--s-2) var(--s-1);
  border-radius: var(--radius-sm);
  background: #12081f;
  color: var(--c-sand);
  border: 2px solid var(--c-line);
  text-align: center;
  min-width: 0;
}
.score-cell-label { font-family: var(--font-mono); font-size: 0.68rem; opacity: 0.85; }
.score-cell-value { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 800; }
.score-cell.is-current { border-color: var(--c-neon); box-shadow: 3px 3px 0 var(--c-copper); background: rgba(63, 242, 232, 0.1); color: var(--c-sand); }
.score-cell.ring-gold { background: #f2cf45; color: #1a1204; border-color: #1a1204; }
.score-cell.ring-red { background: #b93a2f; color: #ffffff; border-color: #b93a2f; }
.score-cell.ring-blue { background: #2a65a8; color: #ffffff; border-color: #2a65a8; }
.score-cell.ring-black { background: #111110; color: var(--c-sand); border-color: #555; }
.score-cell.ring-white { background: #ece6d6; color: #1a1204; border-color: #ece6d6; }
.score-cell.ring-miss { background: transparent; color: var(--c-danger); border: 2px dashed var(--c-danger); }

.match-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.stat-span { grid-column: 1 / -1; }
.ring-dist { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.ring-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: #12081f;
  color: var(--c-sand);
  border: 2px solid var(--c-line);
}
.ring-chip strong { color: var(--c-neon); }
.match-summary {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--radius-sm);
  background: #12081f;
  color: var(--c-sand);
  border: 3px solid var(--c-sun);
  box-shadow: 5px 5px 0 var(--c-copper);
}
.summary-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--c-sun); text-transform: uppercase; }
.summary-text { color: var(--c-sand); font-size: 0.95rem; }

/* ---------- Modules ---------- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--s-4);
}
.module-card { display: flex; flex-direction: column; gap: var(--s-4); transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
.module-card:hover { border-color: var(--c-neon); transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--c-copper); }
.module-card p { color: var(--c-sand-muted); }
.module-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); }
.module-code { font-family: var(--font-mono); font-size: 0.78rem; color: var(--c-sun); letter-spacing: 0.1em; }
.module-icon { width: 32px; height: 32px; flex: none; }
.module-title { font-size: 1.2rem; text-transform: uppercase; }
.readout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--radius-sm);
  background: #12081f;
  color: var(--c-sand);
  border: 2px dashed var(--c-line);
}
.readout-grid .stat-value { font-size: 1rem; color: var(--c-neon); }
.card-link { margin-top: auto; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; color: var(--c-copper-2); text-decoration: none; }
.card-link:hover { color: var(--c-sun); text-decoration: underline; }

/* ---------- Engine ---------- */
.engine-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.engine-grid > * { min-width: 0; }
.pipeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.pipeline-step { display: flex; flex-direction: column; gap: var(--s-3); }
.pipeline-step p { color: var(--c-sand-muted); font-size: 0.95rem; }
.step-num { font-family: var(--font-mono); color: var(--c-sun); font-weight: 700; font-size: 1.3rem; }
.step-title { font-size: 1.1rem; text-transform: uppercase; }
.formula-panel { display: flex; flex-direction: column; gap: var(--s-4); }
.formula {
  padding: var(--s-3);
  border-radius: var(--radius-sm);
  background: #0d0518;
  color: var(--c-neon);
  border-left: 4px solid var(--c-copper);
  overflow-x: auto;
}
.formula code { font-family: var(--font-mono); font-size: 0.92rem; color: var(--c-neon); }

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 2px solid var(--c-line); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table caption {
  text-align: left;
  padding: var(--s-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-copper);
}
.data-table th, .data-table td { padding: 12px var(--s-3); text-align: left; border-top: 1px solid var(--c-line); vertical-align: top; }
.data-table th { background: rgba(255, 79, 154, 0.14); color: var(--c-sun); font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; }
.data-table td { color: var(--c-sand); }
.data-table tbody tr:nth-child(even) td { background: rgba(255, 244, 214, 0.03); }

/* ---------- Sub-pages ---------- */
.page-hero { padding: var(--s-6) 0 var(--s-5); }
.page-hero-inner { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--s-5); align-items: end; }
.page-hero-inner > * { min-width: 0; }
.page-hero-copy { display: flex; flex-direction: column; gap: var(--s-4); }
.page-title { font-size: clamp(1.9rem, 4.4vw, 3rem); }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); font-family: var(--font-mono); font-size: 0.8rem; color: var(--c-sand-muted); text-transform: uppercase; }
.breadcrumb li + li::before { content: "»"; margin-right: var(--s-2); color: var(--c-copper); }
.breadcrumb a { color: var(--c-sand-muted); }
.breadcrumb a:hover { color: var(--c-sun); }
.hero-stats-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.hero-stats-panel .stat-value { color: var(--c-sun); font-size: 1.1rem; }

.article-layout { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.article-layout > * { min-width: 0; }
.prose { display: flex; flex-direction: column; gap: var(--s-4); }
.prose h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin-top: var(--s-4); color: var(--c-sand); }
.prose h3 { font-size: 1.15rem; color: var(--c-copper-2); }
.prose p, .prose li { color: var(--c-sand); max-width: 72ch; }
.prose ul, .prose ol { margin: 0; padding-left: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.prose li::marker { color: var(--c-copper); }
.prose strong { color: var(--c-sun); }
.callout {
  padding: var(--s-4);
  border-radius: var(--radius-sm);
  background: #12081f;
  color: var(--c-sand);
  border: 2px solid var(--c-copper);
  box-shadow: 5px 5px 0 var(--c-copper-deep);
}
.article-aside { display: flex; flex-direction: column; gap: var(--s-4); }
.toc-panel, .figures-panel { display: flex; flex-direction: column; gap: var(--s-3); }
.toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.toc-list a { color: var(--c-sand); text-decoration: none; display: block; padding: 6px 0; font-family: var(--font-mono); font-size: 0.9rem; }
.toc-list a::before { content: "▸ "; color: var(--c-copper); }
.toc-list a:hover { color: var(--c-sun); }
.figure-list { display: flex; flex-direction: column; gap: var(--s-4); }
.figure-list .stat-value { color: var(--c-neon); }
.diagram { margin: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.diagram svg { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); border: 2px solid var(--c-neon); background: #12081f; box-shadow: 5px 5px 0 var(--c-copper-deep); }
.diagram figcaption { font-size: 0.85rem; color: var(--c-sand-muted); }

.next-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--s-4); }
.next-card { display: flex; flex-direction: column; gap: var(--s-3); }
.next-card p { color: var(--c-sand-muted); }
.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-6);
  border-color: var(--c-sun);
}
.cta-band p { color: var(--c-sand); max-width: 60ch; }

/* ---------- Legal ---------- */
.legal-doc { max-width: 860px; display: flex; flex-direction: column; gap: var(--s-4); }
.legal-doc section { display: flex; flex-direction: column; gap: var(--s-3); }
.legal-doc h2 { font-size: 1.35rem; }
.legal-doc p, .legal-doc li { color: var(--c-sand); }
.legal-doc ul { margin: 0; padding-left: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.legal-meta { font-family: var(--font-mono); font-size: 0.85rem; color: var(--c-sand-muted); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.contact-grid > * { min-width: 0; }
.contact-form { display: flex; flex-direction: column; gap: var(--s-4); }
.field { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.field label, .field-label { font-weight: 700; font-size: 0.92rem; color: var(--c-sand); }
.field input, .field select, .field textarea {
  width: 100%;
  min-width: 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255, 244, 214, 0.4);
  background: #12081f;
  color: var(--c-sand);
  font-family: var(--font-mono);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #9b86b8; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--c-neon); background: #12081f; color: var(--c-sand); }
.field input:focus, .field select:focus, .field textarea:focus { box-shadow: 4px 4px 0 var(--c-copper); }
.field input.is-invalid, .field select.is-invalid, .field textarea.is-invalid { border-color: var(--c-danger); box-shadow: 0 0 0 1px var(--c-danger); }
.check-field { display: flex; gap: var(--s-2); align-items: flex-start; }
.check-field input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--c-copper); }
.check-field input.is-invalid { outline: 2px solid var(--c-danger); outline-offset: 2px; }
.field-error { display: none; font-size: 0.85rem; color: var(--c-danger); }
.field-error.is-visible { display: block; }
.form-hint { font-size: 0.85rem; color: var(--c-sand-muted); }
.form-success {
  padding: var(--s-4);
  border-radius: var(--radius-sm);
  background: #12081f;
  color: var(--c-sand);
  border: 2px solid var(--c-neon);
  box-shadow: 4px 4px 0 var(--c-copper);
}
.contact-info { display: flex; flex-direction: column; gap: var(--s-4); }
.info-list { display: flex; flex-direction: column; gap: var(--s-4); }
.info-list address { font-style: normal; color: var(--c-sand); }

.map-block {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 3px solid var(--c-neon);
  box-shadow: 6px 6px 0 var(--c-copper-deep);
  background-color: #1d0c33;
  color: var(--c-sand);
  background-image:
    radial-gradient(circle at 72% 30%, rgba(255, 210, 63, 0.2) 0 14%, transparent 15%),
    linear-gradient(115deg, transparent 46%, rgba(63, 242, 232, 0.35) 46% 51%, transparent 51%),
    linear-gradient(0deg, transparent 48%, rgba(255, 79, 154, 0.3) 48% 52%, transparent 52%),
    linear-gradient(90deg, transparent 36%, rgba(255, 79, 154, 0.25) 36% 39%, transparent 39%),
    repeating-linear-gradient(0deg, rgba(63, 242, 232, 0.08) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(63, 242, 232, 0.08) 0 1px, transparent 1px 28px);
}
.map-pin-marker { position: absolute; left: 50%; top: 50%; width: 44px; height: 56px; transform: translate(-50%, -100%); }
.map-label {
  position: absolute;
  left: var(--s-3);
  bottom: var(--s-3);
  right: var(--s-3);
  padding: 12px var(--s-3);
  border-radius: var(--radius-sm);
  background: #12081f;
  color: var(--c-sand);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border: 2px solid var(--c-line);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--s-6);
  padding: var(--s-6) 0 var(--s-5);
  background: linear-gradient(180deg, #1d0c33, #0d0518);
  color: var(--c-sand);
  border-top: 3px solid var(--c-sun);
  box-shadow: 0 -6px 0 var(--c-orange), 0 -9px 0 var(--c-copper);
}
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
.footer-grid > * { min-width: 0; }
.footer-col { display: flex; flex-direction: column; gap: var(--s-3); }
.footer-title { font-size: 0.85rem; font-family: var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-copper); text-shadow: none; }
.footer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.footer-list a, .footer-text a { color: var(--c-sand); text-decoration: none; }
.footer-list a:hover, .footer-text a:hover { color: var(--c-sun); text-decoration: underline; }
.footer-text { color: var(--c-sand-muted); font-size: 0.92rem; }
.footer-address { font-style: normal; color: var(--c-sand-muted); font-size: 0.92rem; }
.footer-link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--c-sand);
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.footer-link-btn:hover { color: var(--c-sun); background: transparent; text-decoration: underline; }
.footer-bottom {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 2px dashed var(--c-line);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  font-size: 0.85rem;
  color: var(--c-sand-muted);
  font-family: var(--font-mono);
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: var(--s-3);
  right: var(--s-3);
  bottom: var(--s-3);
  z-index: 120;
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-4);
  border-radius: var(--radius);
  background: #1d0c33;
  color: var(--c-sand);
  border: 3px solid var(--c-neon);
  box-shadow: 8px 8px 0 var(--c-copper);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.cookie-banner.is-visible { opacity: 1; transform: translateY(0); }
.cookie-body { display: flex; flex-direction: column; gap: var(--s-2); }
.cookie-title { font-size: 1.05rem; }
.cookie-body p { font-size: 0.9rem; color: var(--c-sand-muted); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.cookie-prefs { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-3); border-radius: var(--radius-sm); background: #12081f; color: var(--c-sand); border: 2px dashed var(--c-line); }
.check-row { display: flex; gap: var(--s-2); align-items: flex-start; font-size: 0.9rem; }
.check-row input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--c-copper); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .range-layout { grid-template-columns: minmax(0, 1fr); }
  .range-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
  .engine-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1023px) {
  .header-inner { gap: var(--s-2); padding: 0 var(--s-3); }
  .nav-link { font-size: 0.76rem; padding: 6px 6px; }
  .nav-list { gap: 2px var(--s-1); }
  .brand-name { font-size: 0.95rem; }
  .hero-grid, .page-hero-inner, .article-layout, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  :root { --header-h: 50px; }
  .container { padding: 0 var(--s-3); }
  .nav-toggle { display: inline-flex; }
  .header-cta { margin-left: auto; }
  .nav-menu {
    position: absolute;
    top: calc(100% + 9px);
    left: 0;
    right: 0;
    display: none;
    min-height: calc(100vh - var(--header-h));
    padding: var(--s-4) var(--s-3);
    background: #12081f;
    color: var(--c-sand);
    overflow-y: auto;
    z-index: 60;
  }
  .nav-menu.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: var(--s-2); }
  .nav-link { display: block; font-size: 1.05rem; padding: 14px 16px; border-color: var(--c-line); color: var(--c-sand); }
  .nav-link:hover { border-color: var(--c-neon); color: var(--c-sand); }
  .brand-mark { width: 30px; height: 30px; }
  .section { padding: var(--s-6) 0; }
  .range-side { grid-template-columns: minmax(0, 1fr); }
  .range-canvas { aspect-ratio: 4 / 3; }
  .pipeline { grid-template-columns: minmax(0, 1fr); }
  .hero-stats-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .hud-item-wide { grid-column: 1 / -1; }
  .glass-panel { box-shadow: 4px 4px 0 var(--c-copper-deep); }
}

@media (max-width: 399px) {
  .brand-name { font-size: 0.78rem; }
  .brand-mark { width: 26px; height: 26px; }
  .header-inner { gap: 6px; padding: 0 12px; }
  .header-cta { padding: 6px 10px; font-size: 0.7rem; min-height: 32px; }
  .nav-toggle { width: 36px; height: 36px; }
  .glass-panel { padding: 20px 16px; }
  .brief-grid, .match-stats, .readout-grid, .hero-stats-panel { grid-template-columns: minmax(0, 1fr); }
  .hero-actions .btn { width: 100%; }
  .seg-btn { padding: 6px 8px; font-size: 0.76rem; }
  .cookie-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}