:root {
  --bg: #03060d;
  --bg-2: #07101f;
  --panel: rgba(10, 22, 42, 0.55);
  --panel-solid: #0a162a;
  --line: rgba(0, 229, 255, 0.18);
  --line-strong: rgba(0, 229, 255, 0.45);
  --text: #dbe7f5;
  --muted: #7f93ad;
  --blue: #0057b7;
  --blue-bright: #2f8bff;
  --gold: #ffd500;
  --cyan: #00e5ff;
  --red: #ff3b5c;
  --green: #3dffa8;
  --radius: 14px;
  --font-display: "Orbitron", system-ui, sans-serif;
  --font-body: "Rajdhani", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --max: 1200px;
}

html[lang="uk"] {
  --font-display: "Exo 2", system-ui, sans-serif;
  --font-body: "Exo 2", system-ui, sans-serif;
}
html[lang="uk"] body { font-size: 17px; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold); color: var(--bg); }

a { color: inherit; text-decoration: none; }

/* ---------- Background layers ---------- */
#grid-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

.bg-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 15% 10%, rgba(0, 87, 183, 0.28), transparent 70%),
    radial-gradient(50vw 40vh at 90% 20%, rgba(255, 213, 0, 0.08), transparent 70%),
    radial-gradient(70vw 60vh at 50% 110%, rgba(0, 229, 255, 0.12), transparent 70%);
}

.scanlines {
  position: fixed; inset: 0; z-index: 100; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.018) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

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

main, header, footer { position: relative; z-index: 2; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Top status bar ---------- */
.statusbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: 28px;
  display: flex; align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: rgba(3, 6, 13, 0.85);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.statusbar .wrap { display: flex; justify-content: space-between; gap: 16px; }
.statusbar .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px var(--green);
  margin-right: 8px; vertical-align: middle;
  animation: pulse 2s infinite;
}
.statusbar .hide-sm { display: inline; }
.statusbar .ok { color: var(--green); }

/* ---------- Nav ---------- */
nav.main-nav {
  position: fixed; top: 28px; left: 0; right: 0; z-index: 49;
  transition: background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
nav.main-nav.scrolled {
  background: rgba(3, 6, 13, 0.78);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
nav.main-nav .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand svg { width: 38px; height: 38px; filter: drop-shadow(0 0 8px rgba(0,229,255,0.5)); }
.brand-text {
  font-family: "Orbitron", var(--font-display); font-weight: 900;
  letter-spacing: 0.3em; font-size: 18px;
}
.brand-text small {
  display: block; font-family: var(--font-mono); font-weight: 400;
  font-size: 9px; letter-spacing: 0.25em; color: var(--cyan); margin-top: 2px;
}

.nav-right { display: flex; align-items: center; gap: 14px; }

.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-links a {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
  padding: 8px 14px; border: 1px solid transparent; border-radius: 6px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--cyan); border-color: var(--line); background: rgba(0,229,255,0.05); }
.nav-links a::before { content: "/"; color: var(--gold); margin-right: 4px; }

/* Language switch */
.lang {
  display: flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: rgba(0,229,255,0.04);
}
.lang button {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  color: var(--muted); background: none; border: none; cursor: pointer;
  padding: 6px 10px; border-radius: 5px;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.lang button:hover { color: var(--cyan); }
.lang button[aria-pressed="true"] {
  color: #0a0a0a; background: var(--gold);
  box-shadow: 0 0 14px rgba(255,213,0,0.45);
}
.lang button:focus-visible, .nav-toggle:focus-visible, .btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  color: var(--cyan); width: 42px; height: 42px; border-radius: 8px; cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 140px 0 80px;
  position: relative;
}
.hero-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2em;
  color: var(--cyan); text-transform: uppercase;
  padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 100px;
  background: rgba(0,229,255,0.05);
}
.eyebrow .flag {
  width: 18px; height: 12px; border-radius: 2px; flex-shrink: 0;
  background: linear-gradient(to bottom, var(--blue) 50%, var(--gold) 50%);
  box-shadow: 0 0 8px rgba(255,213,0,0.4);
}

.hero h1 {
  font-family: "Orbitron", var(--font-display);
  font-weight: 900;
  font-size: clamp(56px, 10vw, 132px);
  line-height: 0.95;
  letter-spacing: 0.06em;
  margin: 28px 0 8px;
  position: relative;
}
.glitch {
  position: relative; display: inline-block;
  background: linear-gradient(180deg, #ffffff 0%, #bfe9ff 45%, var(--cyan) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(0,229,255,0.25);
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  background: none; -webkit-background-clip: initial; background-clip: initial;
  opacity: 0.8;
}
.glitch::before { color: var(--gold); transform: translate(3px, 0); clip-path: inset(0 0 100% 0); animation: glitch-a 5s infinite steps(1); }
.glitch::after  { color: var(--blue-bright); transform: translate(-3px, 0); clip-path: inset(100% 0 0 0); animation: glitch-b 5s infinite steps(1); }

.cyr {
  font-family: var(--font-mono); font-size: clamp(14px, 1.6vw, 18px);
  letter-spacing: 0.6em; color: var(--gold);
  display: flex; align-items: center; gap: 16px;
}
.cyr::after { content: ""; flex: 1; max-width: 180px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }

.hero p.lead {
  font-size: clamp(19px, 2vw, 23px);
  color: #b9c8db;
  max-width: 580px;
  margin: 28px 0 36px;
  font-weight: 500;
}
html[lang="uk"] .hero p.lead { font-size: clamp(17px, 1.7vw, 20px); }
.hero p.lead strong { color: var(--text); font-weight: 700; }

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 16px 28px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  cursor: pointer; border: none;
}
.btn-primary { background: var(--gold); color: #0a0a0a; }
.btn-primary:hover { transform: translateY(-2px); background: #ffe34d; box-shadow: 0 10px 40px rgba(255,213,0,0.35); }
.btn-ghost {
  background: rgba(0,229,255,0.06); color: var(--cyan);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn-ghost:hover { transform: translateY(-2px); background: rgba(0,229,255,0.14); }
.btn svg { width: 16px; height: 16px; }

/* HUD panel (hero right) */
.hud {
  position: relative;
  aspect-ratio: 1;
  max-width: 460px; width: 100%;
  margin-left: auto;
}
.hud svg.rings { width: 100%; height: 100%; overflow: visible; }
.ring-spin { transform-origin: 250px 250px; animation: spin 40s linear infinite; }
.ring-spin.rev { animation-direction: reverse; animation-duration: 28s; }
.ring-spin.fast { animation-duration: 12s; }
.sweep { transform-origin: 250px 250px; animation: spin 6s linear infinite; }
.blip { animation: blip 6s infinite; }

.hud-emblem {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
}
.hud-emblem svg { width: 34%; filter: drop-shadow(0 0 18px rgba(0,229,255,0.55)); animation: float 6s ease-in-out infinite; }

.hud-label {
  position: absolute;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.15em;
  color: var(--cyan); text-transform: uppercase;
  background: rgba(3,6,13,0.8); border: 1px solid var(--line); padding: 5px 9px; border-radius: 4px;
  white-space: nowrap;
}
.hud-label b { color: var(--gold); font-weight: 600; }
.hud-label.tl { top: 6%; left: -4%; }
.hud-label.tr { top: 16%; right: -6%; }
.hud-label.br { bottom: 10%; right: -2%; }
.hud-label.bl { bottom: 4%; left: 2%; }

.scroll-cue {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.3em; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-cue span.line { width: 1px; height: 40px; background: linear-gradient(var(--cyan), transparent); animation: drip 2s infinite; }

/* ---------- Ticker ---------- */
.ticker {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: rgba(0, 87, 183, 0.08);
  overflow: hidden; white-space: nowrap;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.15em;
  color: var(--muted);
  padding: 14px 0;
  position: relative; z-index: 2;
}
.ticker-track { display: inline-flex; gap: 48px; animation: marquee 45s linear infinite; padding-left: 48px; }
.ticker-track span::before { content: "◆"; color: var(--gold); margin-right: 14px; font-size: 9px; vertical-align: middle; }

/* ---------- Sections ---------- */
section.block { padding: 120px 0; position: relative; }

.section-head { margin-bottom: 56px; max-width: 760px; }
.section-tag {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.25em;
  color: var(--gold); text-transform: uppercase;
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.section-tag::before { content: ""; width: 28px; height: 1px; background: var(--gold); }
.section-head h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 4.2vw, 50px); line-height: 1.12; letter-spacing: 0.02em;
}
html[lang="uk"] .section-head h2 { font-weight: 800; }
.section-head h2 em { font-style: normal; color: var(--cyan); }
.section-head p { color: var(--muted); font-size: 19px; margin-top: 18px; }

/* Panel base with HUD corners */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  padding: 32px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  overflow: hidden;
}
.panel::before, .panel::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border-color: var(--cyan); border-style: solid; opacity: 0.7; transition: all 0.3s;
}
.panel::before { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.panel::after  { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }
.panel:hover { border-color: var(--line-strong); transform: translateY(-4px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0,229,255,0.07); }
.panel:hover::before, .panel:hover::after { width: 26px; height: 26px; opacity: 1; border-color: var(--gold); }

/* Mission */
.mission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.mission-copy p { color: #b9c8db; font-size: 20px; margin-bottom: 20px; }
html[lang="uk"] .mission-copy p { font-size: 18px; }
.mission-copy p strong { color: var(--gold); font-weight: 600; }

.terminal {
  background: rgba(2, 5, 11, 0.9);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 14px;
  box-shadow: 0 0 60px rgba(0,229,255,0.08), inset 0 0 40px rgba(0,87,183,0.12);
  overflow: hidden;
}
.terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: rgba(0,229,255,0.04);
  font-size: 11px; color: var(--muted); letter-spacing: 0.1em;
}
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.terminal-bar i:nth-child(1) { background: var(--red); }
.terminal-bar i:nth-child(2) { background: var(--gold); }
.terminal-bar i:nth-child(3) { background: var(--green); }
.terminal-bar span { margin-left: auto; }
.terminal-body { padding: 22px 20px; min-height: 320px; color: #a9bdd4; line-height: 1.9; }
.terminal-body .p { color: var(--gold); }
.terminal-body .ok { color: var(--green); }
.terminal-body .warn { color: var(--red); }
.terminal-body .c { color: var(--cyan); }
.cursor { display: inline-block; width: 9px; height: 17px; background: var(--cyan); vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }

/* Tactics */
.cycle-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.step { padding: 28px 22px 30px; }
.step .num {
  font-family: "Orbitron", var(--font-display); font-weight: 900; font-size: 44px; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px var(--line-strong);
  margin-bottom: 18px; transition: color 0.3s, -webkit-text-stroke-color 0.3s;
}
.step:hover .num { color: rgba(255,213,0,0.12); -webkit-text-stroke-color: var(--gold); }
.step .ico {
  width: 46px; height: 46px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(0,229,255,0.08); border: 1px solid var(--line);
  margin-bottom: 18px; color: var(--cyan);
}
.step .ico svg { width: 22px; height: 22px; }
.step h3 { font-family: var(--font-display); font-size: 15px; letter-spacing: 0.08em; margin-bottom: 10px; text-transform: uppercase; }
html[lang="uk"] .step h3 { font-size: 16px; font-weight: 800; letter-spacing: 0.04em; }
.step p { color: var(--muted); font-size: 16px; line-height: 1.5; }
html[lang="uk"] .step p { font-size: 15px; }
.step .bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--blue-bright), var(--gold)); transition: width 0.5s; }
.step:hover .bar { width: 100%; }

/* Signal vs Noise */
.sn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.sn-card h3 {
  font-family: var(--font-display); font-size: 20px; letter-spacing: 0.12em; text-transform: uppercase;
  display: flex; align-items: center; gap: 12px; margin-bottom: 22px;
}
.sn-card.noise h3 { color: var(--red); }
.sn-card.signal h3 { color: var(--green); }
.sn-card.noise { background: linear-gradient(160deg, rgba(255,59,92,0.07), var(--panel) 50%); }
.sn-card.signal { background: linear-gradient(160deg, rgba(61,255,168,0.07), var(--panel) 50%); }
.sn-card ul { list-style: none; display: grid; gap: 14px; }
.sn-card li {
  display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start;
  color: #b9c8db; font-size: 18px; line-height: 1.45;
  padding-bottom: 14px; border-bottom: 1px dashed rgba(127,147,173,0.18);
}
html[lang="uk"] .sn-card li { font-size: 16px; }
.sn-card li:last-child { border-bottom: none; padding-bottom: 0; }
.sn-card li svg { width: 20px; height: 20px; margin-top: 3px; }
.sn-card.noise li svg { color: var(--red); }
.sn-card.signal li svg { color: var(--green); }
.wave { height: 36px; width: 100%; margin-bottom: 20px; }

/* Badge */
.badge {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 100px; border: 1px solid rgba(255,213,0,0.4); color: var(--gold);
  background: rgba(255,213,0,0.06);
}

/* Principles strip */
.principles {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--panel); backdrop-filter: blur(10px);
}
.principle { padding: 36px 28px; border-right: 1px solid var(--line); position: relative; }
.principle:last-child { border-right: none; }
.principle .k { font-family: var(--font-display); font-weight: 900; font-size: clamp(28px, 3vw, 40px); color: var(--gold); line-height: 1; text-shadow: 0 0 24px rgba(255,213,0,0.35); }
.principle .l { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; color: var(--cyan); text-transform: uppercase; margin: 12px 0 8px; }
.principle p { color: var(--muted); font-size: 16px; line-height: 1.5; }

/* CTA */
.final {
  text-align: center; padding: 80px 32px;
  background:
    linear-gradient(180deg, rgba(0,87,183,0.18), rgba(255,213,0,0.06)),
    var(--panel);
}
.final h2 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 46px); line-height: 1.15; margin-bottom: 18px; }
html[lang="uk"] .final h2 { font-weight: 800; }
.final h2 span { color: var(--gold); }
.final p { color: #b9c8db; max-width: 620px; margin: 0 auto 34px; font-size: 19px; }
.final .cta-row { justify-content: center; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 48px 0 36px; margin-top: 60px; background: rgba(3,6,13,0.7); }
.foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 24px; }
.foot small { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.12em; }
.foot .motto { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.35em; color: var(--gold); }
.flag-bar { height: 3px; background: linear-gradient(90deg, var(--blue) 0 50%, var(--gold) 50% 100%); margin-top: 32px; opacity: 0.8; }

/* Language fade */
[data-i18n] { transition: opacity 0.18s; }
body.lang-swap [data-i18n] { opacity: 0; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; } .reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; } .reveal.d4 { transition-delay: 0.32s; }

/* Keyframes */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes blip { 0%, 30% { opacity: 0; } 35% { opacity: 1; } 70%, 100% { opacity: 0; } }
@keyframes glitch-a {
  0%, 88%, 100% { clip-path: inset(0 0 100% 0); }
  89% { clip-path: inset(10% 0 60% 0); transform: translate(4px, -1px); }
  91% { clip-path: inset(50% 0 20% 0); transform: translate(-3px, 1px); }
  93% { clip-path: inset(80% 0 5% 0); transform: translate(5px, 0); }
}
@keyframes glitch-b {
  0%, 88%, 100% { clip-path: inset(100% 0 0 0); }
  90% { clip-path: inset(65% 0 10% 0); transform: translate(-5px, 1px); }
  92% { clip-path: inset(20% 0 55% 0); transform: translate(3px, -1px); }
  94% { clip-path: inset(5% 0 85% 0); transform: translate(-4px, 0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .cycle-grid { grid-template-columns: repeat(3, 1fr); }
  .principles { grid-template-columns: repeat(2, 1fr); }
  .principle:nth-child(2) { border-right: none; }
  .principle:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .hero-grid, .mission-grid, .sn-grid { grid-template-columns: 1fr; }
  .hud { margin: 20px auto 0; max-width: 360px; }
  .nav-toggle { display: grid; place-items: center; }
  .nav-links {
    position: absolute; top: 72px; left: 16px; right: 16px;
    flex-direction: column; gap: 4px;
    background: rgba(3,6,13,0.96); border: 1px solid var(--line); border-radius: 12px;
    padding: 12px; backdrop-filter: blur(14px);
    opacity: 0; pointer-events: none; transform: translateY(-8px); transition: all 0.25s;
  }
  .nav-links.open { opacity: 1; pointer-events: auto; transform: none; }
  .nav-links a { display: block; padding: 12px 14px; }
  section.block { padding: 90px 0; }
}
@media (max-width: 640px) {
  body, html[lang="uk"] body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .statusbar .hide-sm { display: none; }
  .brand-text { font-size: 15px; letter-spacing: 0.22em; }
  .brand-text small { display: none; }
  .nav-right { gap: 8px; }
  .cycle-grid, .principles { grid-template-columns: 1fr; }
  .principle { border-right: none; border-bottom: 1px solid var(--line); }
  .principle:last-child { border-bottom: none; }
  .hud-label.tl { left: 0; } .hud-label.tr { right: 0; } .hud-label.br { right: 0; }
  .panel { padding: 24px; }
  .final { padding: 56px 20px; }
  .cyr { letter-spacing: 0.4em; }
  .eyebrow { font-size: 10px; letter-spacing: 0.14em; }
}

/* =====================================================================
   Multi-page additions
   ===================================================================== */

/* Active nav item */
.nav-links a[aria-current="page"] { color: var(--gold); border-color: rgba(255,213,0,0.35); background: rgba(255,213,0,0.06); }

/* Reading progress */
.progress {
  position: fixed; top: 28px; left: 0; height: 2px; width: 0; z-index: 60;
  background: linear-gradient(90deg, var(--blue-bright), var(--cyan), var(--gold));
  box-shadow: 0 0 12px var(--cyan);
}

/* Inner page hero */
.page-hero { padding: 190px 0 70px; position: relative; }
.page-hero h1 {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(40px, 7vw, 84px); line-height: 1.02; letter-spacing: 0.02em;
  margin: 26px 0 22px; max-width: 900px;
}
.page-hero h1 em {
  font-style: normal;
  background: linear-gradient(180deg, #ffffff 0%, #bfe9ff 45%, var(--cyan) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-hero .lead { font-size: clamp(18px, 2vw, 22px); color: #b9c8db; max-width: 720px; font-weight: 500; }
html[lang="uk"] .page-hero .lead { font-size: clamp(17px, 1.7vw, 20px); }
.meta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.meta-chip {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted);
  background: rgba(3,6,13,0.6);
}
.meta-chip b { color: var(--cyan); font-weight: 600; }

/* Table of contents */
.toc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; counter-reset: toc; }
.toc a {
  display: flex; gap: 12px; align-items: baseline;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(10,22,42,0.45); color: #b9c8db; font-weight: 600; font-size: 16px; line-height: 1.3;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.toc a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); font-family: var(--font-mono); font-size: 11px; color: var(--gold); }
.toc a:hover { border-color: var(--line-strong); color: var(--cyan); background: rgba(0,229,255,0.05); }

/* Article sections */
.doc section.block { padding: 90px 0; }
.doc .section-head { margin-bottom: 40px; }
.prose { max-width: 820px; }
.prose p { color: #b9c8db; font-size: 19px; margin-bottom: 18px; }
html[lang="uk"] .prose p { font-size: 17px; }
.prose p strong { color: var(--text); }
.prose p em { color: var(--gold); font-style: normal; }
.prose + .two-col, .prose + .three-col, .prose + .panel { margin-top: 30px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

/* Definition quote cards */
.def .src { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; color: var(--cyan); text-transform: uppercase; margin-bottom: 16px; display: block; }
.def blockquote {
  font-size: 20px; line-height: 1.5; color: var(--text); font-weight: 500;
  border-left: 2px solid var(--gold); padding-left: 18px;
}
html[lang="uk"] .def blockquote { font-size: 18px; }
.def .note { margin-top: 16px; color: var(--muted); font-size: 16px; }

/* Glossary */
.term h3 { font-family: var(--font-display); font-size: 17px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; color: var(--cyan); }
.term p { color: var(--muted); font-size: 17px; line-height: 1.5; }
html[lang="uk"] .term p { font-size: 16px; }
.term .tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 12px; }

/* Timeline */
.timeline { position: relative; display: grid; gap: 18px; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--gold), var(--cyan), var(--blue-bright)); opacity: 0.6; }
.tl-item { position: relative; padding: 22px 26px; overflow: visible; }
.tl-dot { position: absolute; left: -33px; top: 28px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--gold); box-shadow: 0 0 12px rgba(255,213,0,0.6); }
.tl-year { font-family: "Orbitron", var(--font-mono); font-weight: 900; font-size: 22px; color: var(--gold); letter-spacing: 0.08em; }
.tl-item h3 { font-family: var(--font-display); font-size: 17px; margin: 4px 0 8px; letter-spacing: 0.03em; }
.tl-item p { color: var(--muted); font-size: 17px; line-height: 1.5; }
html[lang="uk"] .tl-item p { font-size: 16px; }

/* Model lists (firehose / 4D) */
.model h3 { font-family: var(--font-display); font-size: 19px; letter-spacing: 0.06em; margin-bottom: 6px; }
.model .by { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.15em; color: var(--muted); text-transform: uppercase; margin-bottom: 22px; display: block; }
.model ol { list-style: none; display: grid; gap: 16px; counter-reset: m; }
.model li { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; }
.model li::before {
  counter-increment: m; content: counter(m);
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  font-family: "Orbitron", var(--font-mono); font-weight: 700; font-size: 13px; color: var(--bg); background: var(--cyan);
}
.model.gold li::before { background: var(--gold); }
.model li b { display: block; color: var(--text); font-size: 18px; }
.model li span { color: var(--muted); font-size: 16px; line-height: 1.45; }

/* Colour-coded propaganda */
.shade .swatch { height: 6px; border-radius: 6px; margin-bottom: 22px; }
.shade.white .swatch { background: linear-gradient(90deg, #ffffff, #bfe9ff); box-shadow: 0 0 16px rgba(255,255,255,0.4); }
.shade.grey .swatch  { background: linear-gradient(90deg, #6b7a90, #a9b6c8); }
.shade.black .swatch { background: linear-gradient(90deg, #000, #1b2433); border: 1px solid var(--line-strong); }
.shade h3 { font-family: var(--font-display); font-size: 20px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px; }
.shade .who { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.15em; color: var(--cyan); text-transform: uppercase; display: block; margin-bottom: 14px; }
.shade p { color: var(--muted); font-size: 17px; line-height: 1.5; }

/* Case study */
.case { display: grid; grid-template-columns: 1fr 1fr; padding: 0; }
.case > div { padding: 34px; }
.case .claim { border-right: 1px solid var(--line); background: linear-gradient(160deg, rgba(255,59,92,0.08), transparent 60%); }
.case .evidence { background: linear-gradient(160deg, rgba(61,255,168,0.07), transparent 60%); }
.case h3 { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 18px; }
.case .claim h3 { color: var(--red); }
.case .evidence h3 { color: var(--green); }
.case ul { list-style: none; display: grid; gap: 14px; }
.case li { color: #b9c8db; font-size: 17px; line-height: 1.5; padding-left: 18px; position: relative; }
.case li::before { content: ""; position: absolute; left: 0; top: 10px; width: 7px; height: 7px; border-radius: 2px; }
.case .claim li::before { background: var(--red); }
.case .evidence li::before { background: var(--green); }
.case .case-foot { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 22px 34px; color: var(--muted); font-size: 16px; }
.case-foot strong { color: var(--gold); }

/* Callout */
.callout {
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start;
  border-color: rgba(255,213,0,0.35);
  background: linear-gradient(120deg, rgba(255,213,0,0.08), var(--panel) 60%);
}
.callout .ico { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,213,0,0.12); color: var(--gold); }
.callout .ico svg { width: 22px; height: 22px; }
.callout p { color: #d0dcea; font-size: 19px; line-height: 1.55; }
html[lang="uk"] .callout p { font-size: 17px; }
.callout p strong { color: var(--gold); }

/* Sources */
.sources { list-style: none; display: grid; gap: 10px; counter-reset: s; }
.sources li {
  display: grid; grid-template-columns: 36px 1fr; gap: 10px;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: rgba(10,22,42,0.45);
  font-size: 16px; color: #b9c8db; line-height: 1.45;
}
.sources li::before { counter-increment: s; content: "[" counter(s) "]"; font-family: var(--font-mono); font-size: 12px; color: var(--gold); padding-top: 2px; }
.sources a { color: var(--cyan); border-bottom: 1px dashed rgba(0,229,255,0.4); word-break: break-word; }
.sources a:hover { color: var(--gold); border-color: var(--gold); }
sup.ref { font-family: var(--font-mono); font-size: 11px; line-height: 0; }
sup.ref a { color: var(--gold); padding: 0 2px; }

/* Text link with arrow */
.more {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 34px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold);
  border-bottom: 1px solid rgba(255,213,0,0.35); padding-bottom: 6px; transition: gap 0.2s, color 0.2s;
}
.more:hover { gap: 16px; color: #ffe34d; }
.more svg { width: 14px; height: 14px; }

/* =====================================================================
   Units: tabbed command trees + detail drawer
   ===================================================================== */
.units-shell { max-width: 820px; margin: 0 auto; }

/* Structure tabs */
.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(5,12,24,0.75);
  backdrop-filter: blur(8px);
}
.tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 14px 18px; border-radius: 10px; border: 1px solid transparent;
  background: none; color: var(--muted); font: inherit; text-align: left; cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.tab .t-num { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; }
.tab .t-name { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: 0.04em; color: inherit; }
.tab:hover { color: var(--text); background: rgba(0,229,255,0.04); }
.tab[aria-selected="true"] { color: var(--text); background: rgba(255,213,0,0.08); border-color: rgba(255,213,0,0.45); }
.tab[aria-selected="true"] .t-num { color: var(--gold); }
.tab:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.units-hint {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 22px 0 8px; text-align: center;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan);
}
.units-hint svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Structure panel */
.structure { display: none; margin-top: 18px; }
.structure.active { display: block; animation: detailIn 0.3s ease; }
.structure-sub { color: var(--muted); font-size: 16px; margin: 0 0 18px; text-align: center; }
.tree-frame {
  position: relative; padding: 28px 22px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background:
    linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px) 0 0 / 28px 28px,
    rgba(5, 12, 24, 0.7);
  backdrop-filter: blur(8px);
}
.tree-frame::before, .tree-frame::after { content: ""; position: absolute; width: 16px; height: 16px; border: solid var(--cyan); opacity: 0.7; }
.tree-frame::before { top: 9px; left: 9px; border-width: 2px 0 0 2px; }
.tree-frame::after { bottom: 9px; right: 9px; border-width: 0 2px 2px 0; }

/* Vertical tree with elbow connectors */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 33px; }
.tree ul > li { position: relative; padding: 10px 0 0 26px; }
.tree ul > li::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  border-left: 2px solid rgba(0,229,255,0.35);
}
.tree ul > li:last-child::before { bottom: auto; height: 43px; }
.tree ul > li::after {
  content: ""; position: absolute; left: 0; top: 43px; width: 26px;
  border-top: 2px solid rgba(0,229,255,0.35);
}

/* Unit row */
.unit {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 66px;
  padding: 9px 14px 9px 10px; text-align: left;
  font: inherit; color: var(--text); cursor: pointer;
  background: rgba(8, 18, 36, 0.92); border: 1px solid var(--line-strong); border-radius: 12px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.unit:hover { border-color: var(--cyan); background: rgba(12, 28, 52, 0.95); box-shadow: 0 0 22px rgba(0,229,255,0.12); }
.unit:active { transform: scale(0.99); }
.unit:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.unit[aria-expanded="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(255,213,0,0.3), 0 0 26px rgba(255,213,0,0.15); }
.unit .u-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.unit .u-tier { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.unit .u-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.25; letter-spacing: 0.02em; }
html[lang="uk"] .unit .u-name { font-weight: 800; }
.unit .u-code {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.1em; white-space: nowrap;
  padding: 3px 8px; border-radius: 4px; color: var(--cyan); border: 1px solid var(--line); background: rgba(0,229,255,0.05);
}
.unit .chev { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); transition: transform 0.2s, color 0.2s; }
.unit:hover .chev { color: var(--gold); transform: translateX(3px); }

/* Insignia */
.logo { position: relative; width: 46px; height: 46px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.logo img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6)); }
.logo.fallback {
  position: relative;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(160deg, #1d4b7a, #07101f);
}
.logo.fallback::before {
  content: ""; position: absolute; inset: 2px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(160deg, rgba(0,229,255,0.2), rgba(3,6,13,0.95));
}
.logo.fallback::after {
  content: attr(data-initials); position: relative;
  font-family: "Orbitron", var(--font-display); font-weight: 900; font-size: 15px; color: var(--gold);
}
.logo.lg { width: 96px; height: 96px; }
.logo.lg.fallback::after { font-size: 32px; }

.src-note { margin-top: 36px; text-align: center; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; color: var(--muted); line-height: 1.9; }
.src-note a { color: var(--cyan); border-bottom: 1px dashed rgba(0,229,255,0.4); }
.src-note a:hover { color: var(--gold); }

/* "How service works" explainer inside each structure tab */
.svc {
  margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(0,87,183,0.14), rgba(5,12,24,0.8) 60%);
  backdrop-filter: blur(8px);
}
.svc.legion { background: linear-gradient(160deg, rgba(255,213,0,0.08), rgba(5,12,24,0.8) 60%); }
.svc > summary {
  list-style: none; cursor: pointer; padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.svc > summary::-webkit-details-marker { display: none; }
.svc > summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: var(--radius); }
.svc .svc-tag { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.svc .svc-title { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: 0.03em; }
.svc .svc-toggle { width: 20px; height: 20px; flex-shrink: 0; color: var(--cyan); transition: transform 0.2s; }
.svc[open] .svc-toggle { transform: rotate(180deg); }
.svc-body { padding: 0 22px 22px; }
.svc-lead { color: #d0dcea; font-size: 17px; line-height: 1.55; margin-bottom: 18px; }
.svc-lead strong { color: var(--gold); }
.svc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.svc-point { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: rgba(3,6,13,0.45); }
.svc-point h4 { font-family: var(--font-display); font-size: 14px; font-weight: 800; letter-spacing: 0.04em; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.svc-point h4 .n { font-family: var(--font-mono); font-size: 10px; color: var(--bg); background: var(--cyan); border-radius: 4px; padding: 2px 6px; }
.svc.legion .svc-point h4 .n { background: var(--gold); }
.svc-point:last-child:nth-child(odd) { grid-column: 1 / -1; }
.svc-point p { color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.svc-point p strong { color: var(--text); }
.svc-foot { margin-top: 14px; color: var(--muted); font-size: 14.5px; line-height: 1.5; border-left: 2px solid var(--line-strong); padding-left: 12px; }

/* HUR MO vs HUR Legion comparison */
.compare-wrap { margin-top: 48px; }
.compare-wrap h2 { font-family: var(--font-display); font-weight: 900; font-size: clamp(22px, 3vw, 30px); letter-spacing: 0.03em; text-align: center; }
.compare-wrap h2 em { font-style: normal; color: var(--gold); }
.compare-wrap > p { color: var(--muted); text-align: center; font-size: 16px; margin: 8px auto 20px; max-width: 620px; }
.compare { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: rgba(5,12,24,0.75); backdrop-filter: blur(8px); }
.compare th, .compare td { padding: 13px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-size: 15.5px; line-height: 1.45; }
.compare tr:last-child th, .compare tr:last-child td { border-bottom: 0; }
.compare thead th { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; background: rgba(0,229,255,0.06); }
.compare thead th.c-mo { color: var(--cyan); }
.compare thead th.c-lg { color: var(--gold); }
.compare tbody th { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; width: 22%; }
.compare td { color: #c7d5e6; }
.compare td strong { color: var(--text); }
.compare .yes { color: var(--green); font-weight: 700; }
.compare .no { color: var(--red); font-weight: 700; }

@media (max-width: 640px) {
  .svc > summary { padding: 16px; }
  .svc-body { padding: 0 16px 18px; }
  .svc-grid { grid-template-columns: 1fr; }
  .compare thead { display: none; }
  .compare, .compare tbody, .compare tr, .compare th, .compare td { display: block; width: 100%; }
  .compare tr { border-bottom: 1px solid var(--line-strong); padding: 6px 0; }
  .compare tr:last-child { border-bottom: 0; }
  .compare tbody th { width: 100%; border-bottom: 0; padding: 10px 14px 2px; color: var(--cyan); }
  .compare td { border-bottom: 0; padding: 6px 14px; }
  .compare .lbl { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 2px; }
  .compare td.c-mo .lbl { color: var(--cyan); }
  .compare td.c-lg .lbl { color: var(--gold); }
}
@media (min-width: 641px) { .compare .lbl { display: none; } }

/* Detail drawer: slides in from the right on desktop, up from the bottom on phones */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(1, 3, 8, 0.65); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.drawer {
  position: fixed; z-index: 81; top: 0; right: 0; bottom: 0;
  width: min(540px, 100vw);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0a1628, #050b16);
  border-left: 1px solid var(--line-strong);
  box-shadow: -30px 0 80px rgba(0,0,0,0.6);
  transform: translateX(100%); transition: transform 0.32s cubic-bezier(.2,.8,.2,1);
  visibility: hidden;
}
body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
body.drawer-open .drawer { transform: none; visibility: visible; }
body.drawer-open { overflow: hidden; }
.drawer-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cyan);
}
.drawer-grip { display: none; }
.drawer-close {
  width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(0,229,255,0.06); border: 1px solid var(--line-strong); color: var(--text); cursor: pointer;
}
.drawer-close:hover { border-color: var(--gold); color: var(--gold); }
.drawer-close:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.drawer-close svg { width: 18px; height: 18px; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 26px 24px 40px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

.unit-detail { display: none; }
.unit-detail.active { display: block; }
.ud-head { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.ud-head > div { flex: 1 1 auto; min-width: 0; }
.unit-detail h3 { overflow-wrap: anywhere; }
.unit-detail .tier { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cyan); }
.unit-detail h3 { font-family: var(--font-display); font-weight: 900; font-size: 22px; letter-spacing: 0.02em; margin: 6px 0 4px; line-height: 1.2; }
.unit-detail .native { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--gold); }
.unit-detail p.desc { color: #b9c8db; font-size: 17px; line-height: 1.55; }
.unit-detail h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cyan); margin: 24px 0 10px; }
.unit-detail ul.record { list-style: none; display: grid; gap: 10px; }
.unit-detail ul.record li { position: relative; padding-left: 18px; color: #b9c8db; font-size: 16px; line-height: 1.5; }
.unit-detail ul.record li::before { content: ""; position: absolute; left: 0; top: 9px; width: 7px; height: 7px; border-radius: 2px; background: var(--gold); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.facts span {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); background: rgba(3,6,13,0.5);
}
.facts b { color: var(--text); font-weight: 600; }
/* Spec sheet inside the drawer */
.spec { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.spec > div { display: grid; grid-template-columns: 140px 1fr; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.spec > div:nth-child(odd) { background: rgba(0,229,255,0.03); }
.spec > div:last-child { border-bottom: 0; }
.spec dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.spec dd { margin: 0; color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.45; }
.spec dd .code { font-family: var(--font-mono); color: var(--cyan); }
.spec dd q { font-style: italic; color: var(--gold); quotes: "«" "»"; }
.insignia-note { color: #b9c8db; font-size: 16px; line-height: 1.5; }

/* Name history timeline inside a unit card */
.names { margin-top: 4px; list-style: none; display: grid; gap: 0; border-left: 2px solid rgba(255,213,0,0.5); margin-left: 6px; }
.names li { position: relative; padding: 6px 0 6px 18px; font-size: 15px; color: #b9c8db; line-height: 1.45; }
.names li::before { content: ""; position: absolute; left: -6px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--gold); }
.names li b { color: var(--text); }
.names li .when { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--gold); text-transform: uppercase; }
.names li.now::before { background: var(--gold); box-shadow: 0 0 10px rgba(255,213,0,0.7); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 100px; border: 1px solid var(--line-strong); color: var(--text); background: rgba(0,229,255,0.05); }
@keyframes detailIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  .tab { padding: 12px 14px; }
  .tab .t-name { font-size: 16px; }
  .tree-frame { padding: 18px 12px; }
  .tree ul { margin-left: 10px; }
  .tree ul > li { padding-left: 12px; }
  .tree ul > li::after { width: 12px; top: 39px; }
  .tree ul > li:last-child::before { height: 39px; }
  .unit { min-height: 58px; gap: 10px; padding: 8px 10px 8px 8px; }
  .logo { width: 38px; height: 38px; }
  .unit .u-name { font-size: 14px; }
  .unit .u-code { display: none; }

  /* Bottom sheet */
  .drawer {
    top: auto; left: 0; width: 100%; max-height: 86vh;
    border-left: 0; border-top: 1px solid var(--line-strong); border-radius: 18px 18px 0 0;
    box-shadow: 0 -20px 60px rgba(0,0,0,0.6);
    transform: translateY(100%);
  }
  .drawer-grip { display: block; width: 44px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 10px auto 0; }
  .drawer-bar { padding: 10px 16px 12px; }
  .drawer-body { padding: 20px 18px calc(30px + env(safe-area-inset-bottom)); }
  .logo.lg { width: 68px; height: 68px; }
  .ud-head { gap: 14px; }
  .unit-detail h3 { font-size: 20px; }
  .spec > div { grid-template-columns: 1fr; gap: 2px; }
}

/* Footer nav */
.foot-links { display: flex; gap: 22px; list-style: none; flex-wrap: wrap; }
.foot-links a { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); transition: color 0.2s; }
.foot-links a:hover { color: var(--cyan); }

@media (max-width: 1080px) {
  .toc { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .two-col, .three-col, .case { grid-template-columns: 1fr; }
  .case .claim { border-right: none; border-bottom: 1px solid var(--line); }
  .page-hero { padding: 150px 0 50px; }
  .doc section.block { padding: 70px 0; }
}
@media (max-width: 640px) {
  .toc { grid-template-columns: 1fr; }
  .case > div, .case .case-foot { padding: 24px; }
  .callout { grid-template-columns: 1fr; }
  .timeline { padding-left: 28px; }
  .tl-dot { left: -27px; }
  .tl-item { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
