@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  color-scheme: dark light;
  --bg: #0a0d12;
  --bg-surface: #11161f;
  --bg-card: #161c26;
  --bg-card-hover: #1c2330;
  --bg-glass: rgba(22, 28, 38, 0.55);
  --fg: #e8eaed;
  --fg-dim: #b4b9c2;
  --muted: #6a7180;
  --border: #232b38;
  --border-bright: #36405a;
  --olive: #87a16c;
  --olive-bright: #a8c485;
  --olive-deep: #4a5d3a;
  --ukr-blue: #4a90d9;
  --ukr-yellow: #ffd54f;
  --cyan: #5dd5e8;
  --magenta: #d56dde;
  --danger: #d9534f;
  --success: #5cb85c;
  --grid: rgba(255, 255, 255, 0.022);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 24px rgba(135, 161, 108, 0.18);
  --radius: 6px;
  --radius-lg: 10px;
}
:root[data-theme="light"] {
  --bg: #f5f3ed;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fafaf5;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --fg: #14181f;
  --fg-dim: #3a4250;
  --muted: #6a7180;
  --border: #d6d0c2;
  --border-bright: #a8a094;
  --olive-bright: #4a5d3a;
  --grid: rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  font-feature-settings: 'cv11', 'ss01';
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 36px 36px;
  background-attachment: fixed;
  min-height: 100vh;
  transition: background-color 0.2s, color 0.2s;
}
.mono { font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace; }
.layout { max-width: 1200px; margin: 0 auto; padding: 16px 24px 80px; }

/* === Theme toggle === */
.toolbar { position: fixed; top: 14px; right: 14px; z-index: 1000; display: flex; gap: 6px; }
.toolbar button {
  background: var(--bg-glass); backdrop-filter: blur(8px);
  border: 1px solid var(--border-bright); color: var(--fg);
  width: 38px; height: 38px; border-radius: var(--radius); cursor: pointer;
  font-size: 1.05em; display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.toolbar button:hover { border-color: var(--olive); color: var(--olive-bright); }

/* === Top nav === */
.topnav { display: flex; gap: 4px; padding: 8px 0 14px; margin-bottom: 24px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap; font-family: 'JetBrains Mono', monospace; font-size: 0.85em; }
.topnav a {
  color: var(--fg-dim); text-decoration: none; padding: 6px 12px; border-radius: 4px;
  border: 1px solid transparent; transition: all 0.12s;
}
.topnav a:hover { color: var(--olive-bright); border-color: var(--border-bright); background: var(--bg-card); }
.topnav a.active { color: var(--olive-bright); border-color: var(--olive); }
.topnav .sep { color: var(--muted); padding: 6px 0; user-select: none; }

/* === HUD elements === */
.hud-label {
  font-family: 'JetBrains Mono', monospace; font-size: 0.7em; color: var(--olive);
  text-transform: uppercase; letter-spacing: 0.18em; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
}
.hud-label::before { content: ''; width: 18px; height: 1px; background: var(--olive); display: inline-block; }
.hud-divider {
  display: flex; align-items: center; gap: 12px; margin: 48px 0 20px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.7em; color: var(--olive);
  text-transform: uppercase; letter-spacing: 0.18em;
}
.hud-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* === Hero === */
.hero {
  position: relative;
  padding: 56px 52px;
  background: linear-gradient(135deg, #11161f 0%, #1a2030 55%, #0c1118 100%);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 36px;
  color: #e8eaed;
}
:root[data-theme="light"] .hero { background: linear-gradient(135deg, #455a36 0%, #566b42 55%, #36482a 100%); color: #fff; }
:root[data-theme="light"] .hero h1 { color: #fff; }
:root[data-theme="light"] .hero .meta-tag { color: #cde0b4; }
.hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--ukr-blue) 0%, var(--ukr-blue) 50%, var(--ukr-yellow) 50%, var(--ukr-yellow) 100%);
}
.hero::after {
  content: ''; position: absolute; top: -50px; right: -50px; width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(135, 161, 108, 0.22) 0%, transparent 65%);
  pointer-events: none;
}
.hero .corner { position: absolute; width: 22px; height: 22px; border: 2px solid var(--olive); opacity: 0.55; }
.hero .corner.tl { top: 16px; left: 16px; border-right: none; border-bottom: none; }
.hero .corner.tr { top: 16px; right: 16px; border-left: none; border-bottom: none; }
.hero .corner.bl { bottom: 16px; left: 16px; border-right: none; border-top: none; }
.hero .corner.br { bottom: 16px; right: 16px; border-left: none; border-top: none; }
.hero-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; align-items: center; position: relative; z-index: 2; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } .hero { padding: 36px 28px; } }

.hero .meta-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72em; color: var(--olive);
  text-transform: uppercase; letter-spacing: 0.18em; margin-bottom: 14px;
}
.hero h1 { font-size: 2.9em; font-weight: 800; margin: 0 0 4px; line-height: 1.08; letter-spacing: -0.02em; color: #fff; }
.hero .callsign { font-size: 1.6em; color: var(--ukr-yellow); font-weight: 600; margin: 0 0 22px; font-family: 'JetBrains Mono', monospace; }
.hero .position { font-size: 1.05em; line-height: 1.55; margin: 0 0 8px; opacity: 0.96; max-width: 560px; }
.hero .position-en { font-size: 0.9em; opacity: 0.65; max-width: 560px; margin: 0 0 24px; font-style: italic; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.hero .badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; font-size: 0.78em; font-weight: 500;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 100px; color: #fff;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.02em;
}
.hero .badge.gold { background: rgba(255,213,79,0.12); border-color: rgba(255,213,79,0.4); color: var(--ukr-yellow); }
.hero .badge.blue { background: rgba(74,144,217,0.12); border-color: rgba(74,144,217,0.4); color: var(--ukr-blue); }
.hero .badge.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--success); animation: pulse 1.4s infinite ease-in-out; }

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(92,184,92,0.5); }
  50% { opacity: 0.7; box-shadow: 0 0 0 5px rgba(92,184,92,0); }
}

/* === Portrait placeholder === */
.portrait-card {
  position: relative; aspect-ratio: 1/1.15; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(135,161,108,0.18), rgba(74,144,217,0.10));
  border: 1px solid rgba(135,161,108,0.3); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.portrait-card svg { width: 70%; height: 70%; opacity: 0.55; }
.portrait-card .stamp {
  position: absolute; top: 12px; left: 12px; font-family: 'JetBrains Mono', monospace;
  font-size: 0.65em; color: var(--olive-bright); letter-spacing: 0.15em; text-transform: uppercase;
}
.portrait-card .id {
  position: absolute; bottom: 12px; right: 12px; font-family: 'JetBrains Mono', monospace;
  font-size: 0.65em; color: var(--fg-dim); letter-spacing: 0.1em;
}

/* === Stat dashboard === */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 18px 0; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; position: relative; transition: all 0.18s; overflow: hidden;
}
.stat-card:hover { border-color: var(--olive); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 0%; height: 2px; background: var(--olive);
  transition: width 0.25s;
}
.stat-card:hover::before { width: 100%; }
.stat-card .stat-icon { display: none; }
.stat-card .stat-num {
  font-family: 'JetBrains Mono', monospace; font-size: 1.85em; font-weight: 700;
  color: var(--olive-bright); letter-spacing: -0.02em; line-height: 1; margin-bottom: 6px;
  display: flex; align-items: baseline; gap: 4px;
}
.stat-card .stat-num .unit { font-size: 0.55em; color: var(--muted); font-weight: 500; }
.stat-card .stat-label { font-size: 0.84em; color: var(--fg-dim); line-height: 1.4; }
.stat-card .stat-context {
  font-family: 'JetBrains Mono', monospace; font-size: 0.65em; color: var(--muted);
  margin-top: 6px; letter-spacing: 0.05em;
}

/* === Dossier nav cards === */
.dossier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 18px 0; }
.dossier-card {
  background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--olive);
  border-radius: var(--radius); padding: 20px 22px; text-decoration: none; color: var(--fg);
  transition: all 0.18s; position: relative; display: block;
}
.dossier-card:hover { background: var(--bg-card-hover); border-left-color: var(--ukr-blue); transform: translateY(-2px); }
.dossier-card .d-icon { display: none; }
.dossier-card h3 { margin: 0 0 6px; font-size: 1.05em; color: var(--fg); font-weight: 600; }
.dossier-card p { margin: 0 0 10px; color: var(--fg-dim); font-size: 0.88em; line-height: 1.5; }
.dossier-card .d-cta {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72em; color: var(--olive);
  letter-spacing: 0.1em; display: inline-flex; align-items: center; gap: 6px;
}
.dossier-card:hover .d-cta { color: var(--ukr-blue); }
.dossier-card .d-cta::after { content: '→'; transition: transform 0.15s; }
.dossier-card:hover .d-cta::after { transform: translateX(3px); }

/* === Section headings === */
h2 { font-size: 1.6em; font-weight: 700; color: var(--fg); margin: 28px 0 12px; letter-spacing: -0.01em; }
h3 { color: var(--fg); font-weight: 600; }
p { margin: 10px 0; color: var(--fg); }
a { color: var(--ukr-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Two-column info block === */
.info-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; margin: 22px 0; }
@media (max-width: 860px) { .info-grid { grid-template-columns: 1fr; } }
.info-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; }
.info-box h3 { margin: 0 0 12px; font-size: 1.1em; }
.info-box ul { padding-left: 22px; margin: 8px 0; }
.info-box li { margin: 7px 0; color: var(--fg-dim); font-size: 0.95em; }
.info-box li strong { color: var(--fg); }

/* === Entity pills === */
.entity-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.entity-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: 0.82em;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 100px;
  color: var(--fg-dim); font-family: 'JetBrains Mono', monospace; letter-spacing: 0.01em;
}
.entity-pill .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* === Graph preview === */
.graph-preview {
  position: relative; background: var(--bg-card); border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg); padding: 0; margin: 22px 0; overflow: hidden;
  aspect-ratio: 16/8; min-height: 380px;
}
.graph-preview .overlay {
  position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(10,13,18,0.85) 100%);
  pointer-events: none; z-index: 2;
}
.graph-preview .label {
  position: absolute; bottom: 20px; left: 24px; right: 24px; z-index: 3; display: flex;
  justify-content: space-between; align-items: flex-end; pointer-events: none;
}
.graph-preview .label .info h3 { margin: 0 0 2px; color: #fff; font-size: 1.15em; }
.graph-preview .label .info p { margin: 0; color: rgba(255,255,255,0.7); font-size: 0.85em; }
.graph-preview .cta-link {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; background: rgba(135,161,108,0.18); border: 1px solid var(--olive);
  border-radius: var(--radius); color: var(--olive-bright); text-decoration: none;
  font-family: 'JetBrains Mono', monospace; font-size: 0.85em; letter-spacing: 0.05em;
  font-weight: 500; transition: all 0.15s;
}
.graph-preview .cta-link:hover { background: var(--olive); color: #fff; }
.graph-preview canvas { display: block; width: 100%; height: 100%; cursor: grab; }

/* === Source tree === */
.source-tree { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin: 18px 0; }
.source-group {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px;
}
.source-group .group-title {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72em; color: var(--olive);
  text-transform: uppercase; letter-spacing: 0.15em; margin: 0 0 14px; display: flex; align-items: center; gap: 8px;
}
.source-group .group-title::before { content: ''; width: 18px; height: 1px; background: var(--olive); }
.source-list { list-style: none; padding: 0; margin: 0; }
.source-list li { margin: 8px 0; padding: 10px 12px; background: var(--bg-surface); border-radius: 4px;
  border-left: 2px solid var(--border-bright); transition: all 0.15s; }
.source-list li:hover { border-left-color: var(--olive); background: var(--bg-card-hover); }
.source-list a { color: var(--fg); text-decoration: none; font-size: 0.92em; font-weight: 500; display: block; }
.source-list a:hover { color: var(--olive-bright); }
.source-list .pub {
  font-family: 'JetBrains Mono', monospace; font-size: 0.7em; color: var(--muted);
  display: block; margin-top: 3px; letter-spacing: 0.02em;
}
.source-list .type-badge {
  display: inline-block; font-size: 0.68em; padding: 1px 6px; border-radius: 3px;
  background: var(--bg); color: var(--olive); font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em; margin-left: 6px; vertical-align: middle;
}

/* === LLM/RAG block === */
.llm-block {
  background: linear-gradient(135deg, rgba(74,144,217,0.06), rgba(135,161,108,0.04));
  border: 1px solid var(--border-bright); border-radius: var(--radius-lg);
  padding: 28px 32px; margin: 28px 0;
}
.llm-block .label { color: var(--ukr-blue); }
.llm-block h2 { margin: 8px 0 14px; font-size: 1.5em; }
.llm-block .desc { color: var(--fg-dim); font-size: 0.95em; max-width: 720px; margin-bottom: 18px; }
.llm-data-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.llm-data-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; text-decoration: none; color: var(--fg); display: block; transition: all 0.15s;
}
.llm-data-card:hover { border-color: var(--ukr-blue); transform: translateY(-2px); }
.llm-data-card .file { font-family: 'JetBrains Mono', monospace; font-size: 0.78em; color: var(--ukr-blue); font-weight: 500; }
.llm-data-card .desc-mini { font-size: 0.78em; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* === Disclaimer === */
.disclaimer {
  background: var(--bg-card); border-left: 3px solid var(--ukr-yellow);
  padding: 14px 18px; margin: 24px 0; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.88em; color: var(--fg-dim);
}
.disclaimer strong { color: var(--ukr-yellow); }

/* === Social media block === */
.social-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 18px 0; }
.social-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; text-decoration: none; color: var(--fg); display: block; transition: all 0.15s;
  border-left: 3px solid var(--ukr-blue);
}
.social-card:hover { background: var(--bg-card-hover); border-left-color: var(--cyan); transform: translateY(-2px); }
.social-card .s-platform { font-family: 'JetBrains Mono', monospace; font-size: 0.72em; color: var(--ukr-blue); text-transform: uppercase; letter-spacing: 0.1em; }
.social-card .s-handle { font-weight: 600; margin: 4px 0; color: var(--fg); font-size: 0.98em; }
.social-card .s-role { font-size: 0.78em; color: var(--muted); margin-bottom: 8px; }
.social-card .s-metric { font-family: 'JetBrains Mono', monospace; font-size: 1.35em; color: var(--olive-bright); font-weight: 700; margin-top: 8px; }
.social-card .s-meta { font-size: 0.72em; color: var(--muted); font-family: 'JetBrains Mono', monospace; margin-top: 3px; }

/* === Reliability tiers === */
.reliability-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 14px 0; }
.tier-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; position: relative; padding-left: 38px; }
.tier-card .tier-letter { position: absolute; left: 10px; top: 10px; width: 22px; height: 22px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--bg); font-size: 0.85em; }
.tier-card .tier-label { font-weight: 600; font-size: 0.92em; color: var(--fg); }
.tier-card .tier-desc { font-size: 0.78em; color: var(--muted); line-height: 1.45; margin-top: 4px; }

/* === System architecture layers === */
.arch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 16px 0; }
.arch-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; border-top: 3px solid var(--olive); position: relative; }
.arch-card .arch-num { position: absolute; top: -10px; right: 14px; background: var(--olive); color: var(--bg); width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 0.85em; }
.arch-card h4 { color: var(--olive-bright); margin: 0 0 6px; font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.08em; }
.arch-card h3 { font-size: 1.04em; margin: 4px 0 8px; color: var(--fg); }
.arch-card p { font-size: 0.85em; color: var(--fg-dim); margin: 0; line-height: 1.5; }

/* === Confidence/decree inline badges === */
.cb { display: inline-block; padding: 1px 7px; border-radius: 8px; font-family: 'JetBrains Mono', monospace; font-size: 0.7em; letter-spacing: 0.04em; margin-left: 6px; vertical-align: baseline; }
.cb-decree { background: rgba(92,184,92,0.14); color: var(--success); border: 1px solid rgba(92,184,92,0.3); }
.cb-official { background: rgba(74,144,217,0.14); color: var(--ukr-blue); border: 1px solid rgba(74,144,217,0.3); }
.cb-media { background: rgba(135,161,108,0.14); color: var(--olive-bright); border: 1px solid rgba(135,161,108,0.3); }
.cb-social { background: rgba(255,213,79,0.14); color: var(--ukr-yellow); border: 1px solid rgba(255,213,79,0.3); }
.cb-volatile { background: rgba(213,109,222,0.14); color: var(--magenta); border: 1px solid rgba(213,109,222,0.3); }

/* === Footer === */
.layout footer {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.78em; color: var(--muted);
}
.layout footer a { color: var(--fg-dim); }
.layout footer a:hover { color: var(--olive-bright); }
.layout footer .meta-stamp { display: flex; gap: 14px; align-items: center; }
.layout footer .live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block;
  animation: pulse 1.4s infinite ease-in-out;
}

/* === Generic content for inner pages === */
.nav-back { margin-bottom: 1em; font-size: 0.9em; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.nav-back a { color: var(--olive); text-decoration: none; margin-right: 16px; font-family: 'JetBrains Mono', monospace; font-size: 0.9em; }
.nav-back a:hover { color: var(--ukr-blue); }
.layout h1 { font-size: 2em; color: var(--fg); margin: 0 0 0.4em; line-height: 1.2; font-weight: 700; }
.layout h2 { border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.layout .meta { color: var(--muted); font-size: 0.9em; margin: 0 0 22px; padding: 12px 18px;
  background: var(--bg-card); border-radius: var(--radius); border-left: 3px solid var(--olive); }
.layout blockquote { border-left: 3px solid var(--ukr-yellow); padding: 8px 18px;
  margin: 14px 0; background: var(--bg-card); border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic; color: var(--fg-dim); }
.layout table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.94em; }
.layout th, .layout td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.layout th { background: var(--bg-card); color: var(--olive-bright); font-weight: 600; font-family: 'JetBrains Mono', monospace; font-size: 0.85em; }
.layout code { background: var(--bg-card); border: 1px solid var(--border); padding: 1px 5px; border-radius: 3px; font-size: 0.88em; color: var(--cyan); }
.layout .sources { border-top: 1px solid var(--border); margin-top: 32px; padding-top: 18px; color: var(--muted); font-size: 0.85em; }
.layout .sources h3 { color: var(--muted); margin: 0 0 8px; font-size: 0.95em; }

/* === Responsive === */
@media (max-width: 720px) {
  .layout { padding: 12px 16px 60px; }
  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 2.1em; }
  .hero .callsign { font-size: 1.25em; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card .stat-num { font-size: 1.5em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* === v3.12: Media-kit copy buttons === */
.copyable-block { margin: 18px 0; }
.copyable-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px; flex-wrap: wrap;
}
.copy-btn {
  background: var(--bg-card); border: 1px solid var(--olive); color: var(--olive);
  padding: 7px 14px; border-radius: 100px; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 0.78em; font-weight: 500;
  letter-spacing: 0.02em; transition: background 0.15s, color 0.15s, border-color 0.15s;
  min-height: 32px;
}
.copy-btn:hover { background: var(--olive); color: var(--bg); }
.copy-btn--ok { background: var(--success); color: var(--bg); border-color: var(--success); }
.copy-btn:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }

/* === v3.11: Reader / Research mode toggle (additive) === */
/* Default = Reader: technical research-only layer is hidden. */
.research-only { display: none; }
.research-only-inline { display: none; }
html[data-mode="research"] .research-only { display: block; }
html[data-mode="research"] .research-only-inline { display: inline; }
html[data-mode="research"] tr.research-only { display: table-row; }
html[data-mode="research"] li.research-only { display: list-item; }
.reader-only { display: block; }
html[data-mode="research"] .reader-only { display: none; }
.reader-only-inline { display: inline; }
html[data-mode="research"] .reader-only-inline { display: none; }

#mode-toggle {
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-bright);
  color: var(--fg);
  width: 38px; height: 38px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84em;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
#mode-toggle:hover { border-color: var(--olive); color: var(--olive-bright); }
#mode-toggle[aria-pressed="true"] {
  background: var(--bg-card);
  border-color: var(--olive);
  color: var(--olive-bright);
}
#mode-toggle:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }

/* === v3.9: Comprehensive mobile polish (additive — does not modify desktop rules) === */
@media (max-width: 720px) {
  /* Toolbar: smaller buttons, less crowding next to H1 */
  .toolbar { top: 10px; right: 10px; gap: 4px; }
  .toolbar button { width: 34px !important; height: 34px !important; font-size: 0.95em !important; }
  /* Hero: leave room for toolbar */
  .hero { padding-top: 56px; }
  .hero h1 { font-size: 1.95em; line-height: 1.15; }
  .hero .callsign { font-size: 1.1em; margin-bottom: 14px; }
  .hero .position { font-size: 1em; }
  .hero .position-en { font-size: 0.85em; }
  .hero .badges { gap: 6px; }
  .hero .badge { padding: 5px 10px; font-size: 0.76em; }
  .hero .meta-tag { font-size: 0.7em; margin-bottom: 12px; }
  /* Hud dividers: less margin */
  .hud-divider { margin: 48px 0 18px; font-size: 1em; gap: 10px; }
  /* Info box / dossier card / arch card: less padding */
  .info-box { padding: 18px 18px; }
  .dossier-card { padding: 16px 16px; }
  .arch-card { padding: 16px 16px; }
  .stat-card { padding: 16px 16px; }
  .stat-card .stat-num { font-size: 1.45em; }
  .stat-card .stat-label { font-size: 0.82em; }
  .stat-card .stat-context { font-size: 0.74em; }
  /* Topnav: more compact */
  .topnav { font-size: 0.82em; gap: 3px; }
  .topnav a { padding: 5px 10px; }
  /* Video featured: stacks vertically */
  .video-featured { grid-template-columns: 1fr !important; }
  .video-featured-thumb { min-height: 160px; }
  .video-featured-body { padding: 20px 18px; }
  .video-featured-body h3 { font-size: 1.18em; }
  /* Video chips: touch-friendly */
  .video-chip { padding: 7px 13px; font-size: 0.8em; min-height: 32px; }
  /* Filter button bar gap */
  .video-filter { gap: 5px !important; }
  /* Gallery: 2-col on tablets */
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
  .gallery-card figcaption { padding: 12px 14px; }
  .gc-caption { font-size: 0.88em; }
  /* Timeline: tighter padding */
  .tl-item { padding: 10px 14px 10px 26px; }
  .tl-item .tl-date { font-size: 0.74em; }
  .tl-item .tl-title { font-size: 0.96em; }
  .tl-item .tl-desc { font-size: 0.84em; }
  /* Source tree: stack */
  .source-tree { gap: 12px; }
  /* Sources: compact */
  .source-group { padding: 14px 16px; }
  /* LLM data grid: smaller min */
  .llm-data-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
  /* Disclaimer */
  .disclaimer { padding: 16px 16px; font-size: 0.86em; }
}

@media (max-width: 480px) {
  /* Very small phones (iPhone SE / mini) */
  .layout { padding: 10px 12px 56px; }
  .hud-divider { margin: 36px 0 14px; font-size: 0.95em; }
  .hero { padding: 50px 18px 26px !important; }
  .hero h1 { font-size: 1.65em; }
  .hero .callsign { font-size: 1em; }
  .hero .badges { gap: 5px; }
  .hero .badge { font-size: 0.7em; padding: 4px 9px; }
  /* Stat grid: 2-col compact */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px 12px; }
  .stat-card .stat-num { font-size: 1.3em; }
  .stat-card .stat-label { font-size: 0.78em; line-height: 1.3; }
  .stat-card .stat-context { font-size: 0.7em; }
  /* Dossier/arch single column */
  .dossier-grid, .arch-grid { grid-template-columns: 1fr !important; }
  .dossier-card { padding: 14px 14px; }
  .info-box { padding: 16px 14px; }
  /* Gallery 1-col */
  .gallery-grid { grid-template-columns: 1fr; }
  /* Compact compare grid */
  .compare-grid { grid-template-columns: 1fr !important; padding: 18px 16px; gap: 12px; }
  /* Timeline narrower */
  .tl-item { padding: 8px 12px 8px 24px; }
  .tl-item .tl-title { font-size: 0.92em; }
}

@media (pointer: coarse) {
  /* Touch device tap targets (Apple HIG / Material): ≥44px */
  .topnav a, .video-chip, .dossier-card .d-cta,
  .source-list a, .llm-data-card, .gallery-card a, .gc-meta a,
  .compare-col li, #mode-toggle, #theme-toggle {
    min-height: 44px;
  }
  .topnav a, .video-chip { display: inline-flex; align-items: center; }
  /* Avoid hover-state stuck on touch */
  .dossier-card:hover, .stat-card:hover, .gallery-card:hover, .video-featured:hover { transform: none; }
}

/* === Gallery (photo wall for journalists) === */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin: 18px 0 32px;
}
.gallery-card {
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}
.gallery-card:hover { border-color: var(--olive); transform: translateY(-2px); }
.gallery-img-link {
  display: block;
  flex: 1 1 auto;
  min-height: 200px;
  background: linear-gradient(135deg, #11161f 0%, #1a2030 100%);
  position: relative;
  overflow: hidden;
}
.gallery-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.gallery-card:hover img { transform: scale(1.03); }
.gallery-card figcaption {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface, var(--bg-card));
}
.gc-caption {
  font-size: 0.92em;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.4;
  margin-bottom: 6px;
}
.gc-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74em;
  color: var(--olive);
  margin-bottom: 4px;
}
.gc-meta a { color: var(--olive); text-decoration: none; }
.gc-meta a:hover { color: var(--olive-bright); text-decoration: underline; }
.gc-license {
  font-size: 0.74em;
  color: var(--muted);
  font-style: italic;
  line-height: 1.3;
}
@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* === Timeline (chronology page) === */
.timeline { position: relative; margin: 18px 0 28px; padding-left: 8px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 1px; background: var(--border);
}
.tl-item {
  position: relative; padding: 12px 18px 12px 28px;
  border-radius: var(--radius); margin: 2px 0;
  transition: background 0.15s;
}
.tl-item:hover { background: var(--bg-card); }
.tl-item::before {
  content: ''; position: absolute; left: 3px; top: 18px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--muted);
  box-sizing: border-box;
}
.tl-item.biography::before { border-color: var(--muted); }
.tl-item.career::before    { border-color: var(--olive); }
.tl-item.military::before  { border-color: var(--olive-bright); background: var(--olive-deep); }
.tl-item.operation::before { border-color: var(--ukr-blue); background: rgba(74,144,217,0.25); }
.tl-item.award::before     { border-color: var(--ukr-yellow); background: rgba(255,213,79,0.25); }
.tl-item.external::before  { border-color: var(--magenta); }
.tl-item .tl-date {
  font-family: 'JetBrains Mono', monospace; font-size: 0.78em;
  color: var(--olive); letter-spacing: 0.02em; margin-bottom: 3px;
}
.tl-item .tl-title { font-size: 1em; font-weight: 600; color: var(--fg); margin-bottom: 4px; }
.tl-item .tl-desc { font-size: 0.88em; color: var(--fg-dim); line-height: 1.55; }

.legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin: 0 0 18px; font-size: 0.82em; color: var(--fg-dim);
}
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend .legend-dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid currentColor; background: transparent;
  display: inline-block; box-sizing: border-box;
}
