/* ==========================================================================
   vvv — VEPA Version Vault
   Dark observatory theme: near-black field, hairline grids, per-version accents.
   ========================================================================== */

:root {
  --bg: #06080c;
  --bg-raised: #0b0f16;
  --bg-card: #0d121b;
  --line: #1b2432;
  --line-strong: #2a3648;
  --ink: #e6edf6;
  --ink-dim: #93a1b5;
  --ink-faint: #5f6d80;
  --amber: #f59e0b;
  --cyan: #22d3ee;
  --green: #4ade80;
  --blue: #38bdf8;
  --pink: #f472b6;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 78% -12%, rgba(34, 211, 238, 0.09), transparent 60%),
    radial-gradient(900px 480px at 8% -10%, rgba(245, 158, 11, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- top bar ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(6, 8, 12, 0.82);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--ink);
  text-transform: uppercase;
  font-size: 15px;
}
.brand span { color: var(--amber); }
.navlinks { display: flex; gap: 22px; font-size: 14px; }
.navlinks a { color: var(--ink-dim); font-family: var(--mono); }
.navlinks a:hover { color: var(--ink); text-decoration: none; }

/* ---------- hero ---------- */
.hero { padding: 76px 0 46px; }
.hero h1 {
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.06;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(92deg, var(--amber), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede {
  max-width: 720px;
  color: var(--ink-dim);
  font-size: 18px;
  margin: 0 0 30px;
}
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: var(--bg-card);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; border-color: var(--cyan); }
.btn.primary {
  background: linear-gradient(92deg, rgba(245, 158, 11, 0.16), rgba(34, 211, 238, 0.16));
  border-color: rgba(245, 158, 11, 0.55);
}
.btn.primary:hover { border-color: var(--amber); }
.btn.ghost { background: transparent; }

/* ---------- section scaffolding ---------- */
section { padding: 46px 0; }
.section-title {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 30px;
}

/* ---------- version cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.card {
  position: relative;
  background: linear-gradient(180deg, var(--bg-card), var(--bg-raised));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 22px 20px;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent, var(--amber));
  opacity: 0.85;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.9);
}
.card h3 {
  margin: 6px 0 4px;
  font-family: var(--mono);
  font-size: 24px;
  letter-spacing: -0.01em;
}
.card .tagline { color: var(--ink-dim); font-size: 14.5px; min-height: 44px; margin: 0 0 14px; }
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.03);
}
.badge.role { color: var(--accent, var(--amber)); border-color: color-mix(in srgb, var(--accent, var(--amber)) 45%, transparent); }
.badge.warn { color: var(--amber); border-color: rgba(245, 158, 11, 0.5); }
.meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  font-size: 13px;
  font-family: var(--mono);
  margin: 14px 0 18px;
  color: var(--ink-dim);
}
.meta dt { color: var(--ink-faint); }
.meta dd { margin: 0; color: var(--ink-dim); text-align: right; }
.card-actions { display: flex; flex-direction: column; gap: 9px; }
.card-actions .btn { justify-content: center; width: 100%; }
.btn.disabled {
  opacity: 0.55;
  pointer-events: none;
  border-style: dashed;
}
.card-note { font-size: 12px; color: var(--ink-faint); font-family: var(--mono); margin-top: 10px; }

/* ---------- lineage strip ---------- */
.lineage {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-raised);
  padding: 26px 22px;
  overflow-x: auto;
}
.lineage-track {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: 780px;
}
.lineage-node {
  flex: 1;
  padding: 0 16px;
  border-left: 1px dashed var(--line-strong);
}
.lineage-node:first-child { border-left: none; padding-left: 0; }
.lineage-node .when { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); }
.lineage-node .who { font-family: var(--mono); font-size: 15px; margin: 5px 0 6px; color: var(--ink); }
.lineage-node .what { font-size: 13px; color: var(--ink-dim); }
.lineage-node .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent, var(--amber));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, var(--amber)) 18%, transparent);
  margin-bottom: 12px;
}

/* ---------- stats band ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-raised);
  padding: 18px 18px 16px;
}
.stat .num { font-family: var(--mono); font-size: 30px; color: var(--ink); font-weight: 700; }
.stat .lbl { font-size: 12.5px; color: var(--ink-faint); font-family: var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- comparison article ---------- */
.doc { padding: 56px 0 90px; }
.doc h1 {
  font-size: clamp(30px, 4.6vw, 46px);
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  line-height: 1.1;
}
.doc .doc-meta {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 36px;
}
.doc h2 {
  font-size: 26px;
  margin: 54px 0 8px;
  letter-spacing: -0.01em;
  scroll-margin-top: 84px;
}
.doc h3 {
  font-size: 19px;
  margin: 34px 0 8px;
  scroll-margin-top: 84px;
  color: var(--ink);
}
.doc h4 { font-size: 15.5px; margin: 24px 0 6px; color: var(--ink-dim); font-family: var(--mono); }
.doc p, .doc li { color: var(--ink-dim); }
.doc p { margin: 10px 0; }
.doc strong { color: var(--ink); }
.doc code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  color: #c8f2ff;
}
.doc pre {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  color: #b9c7db;
}
.doc pre code { background: none; border: none; padding: 0; color: inherit; }
.doc .callout {
  border-left: 3px solid var(--amber);
  background: rgba(245, 158, 11, 0.06);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin: 22px 0;
  color: var(--ink-dim);
}
.doc .callout.cyan { border-color: var(--cyan); background: rgba(34, 211, 238, 0.06); }

.toc {
  border: 1px solid var(--line);
  background: var(--bg-raised);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 30px 0 10px;
}
.toc .toc-title { font-family: var(--mono); font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 36px; }
.toc li { font-size: 14px; margin: 5px 0; }
@media (max-width: 720px) { .toc ol { columns: 1; } }

.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 18px 0 26px;
  background: var(--bg-raised);
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 720px;
  font-size: 14px;
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: 11px 14px;
  text-align: left;
  vertical-align: top;
}
th {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: rgba(255, 255, 255, 0.03);
  position: sticky;
  top: 0;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
td.rowhead, th.rowhead {
  font-family: var(--mono);
  color: var(--ink);
  white-space: nowrap;
  position: sticky;
  left: 0;
  background: var(--bg-raised);
  border-right: 1px solid var(--line);
}
.yes { color: var(--green); }
.no { color: var(--ink-faint); }
.partial { color: var(--amber); }

.profile {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent, var(--amber));
  background: var(--bg-raised);
  border-radius: 0 12px 12px 0;
  padding: 22px 24px;
  margin: 18px 0 30px;
}
.profile h3 { margin-top: 0; font-family: var(--mono); }
.profile .facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }

ul.tight li, ol.tight li { margin: 6px 0; }

/* ---------- interactive source inventory ---------- */
.inventory-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.inventory-summary-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-raised);
  padding: 14px 16px;
}
.inventory-summary-card h3 { font: 600 14px var(--mono); margin: 0 0 8px; color: var(--ink); }
.inventory-summary-card .inventory-main { font: 700 21px var(--mono); color: var(--cyan); }
.inventory-summary-card .inventory-sub { font: 12px var(--mono); color: var(--ink-faint); margin-top: 4px; }
.inventory-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  background: var(--bg-raised);
  margin-top: 20px;
}
.inventory-controls label { display: grid; gap: 4px; color: var(--ink-faint); font: 11px var(--mono); }
.inventory-controls select, .inventory-controls input {
  min-height: 38px;
  min-width: 140px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 7px 10px;
  background: var(--bg);
  color: var(--ink);
  font: 13px var(--mono);
}
.inventory-controls input { min-width: 190px; }
.inventory-count { color: var(--ink-dim); font: 12px var(--mono); align-self: center; }
.inventory-area-table td, .inventory-file-table td { font-size: 13px; }
.inventory-area-table td.numeric, .inventory-file-table td.numeric { text-align: right; font-family: var(--mono); white-space: nowrap; }
.inventory-file-wrap { margin-top: 0; border-radius: 0 0 12px 12px; max-height: 680px; }
.inventory-file-table { min-width: 840px; }
.inventory-file-table td.path { font-family: var(--mono); overflow-wrap: anywhere; }
.inventory-file-table td.role { color: var(--ink-dim); min-width: 210px; }
.inventory-file-table td.repo { white-space: nowrap; font-family: var(--mono); }
.inventory-file-table .line-bar { display: inline-block; height: 5px; border-radius: 99px; margin-left: 8px; background: var(--cyan); vertical-align: middle; opacity: .7; }
.feature-matrix { min-width: 1050px; }
.inventory-area-table { min-width: 840px; }
.inventory-area-table td:first-child { min-width: 220px; }
@media (max-width: 640px) {
  .inventory-controls { align-items: stretch; }
  .inventory-controls label, .inventory-controls select, .inventory-controls input { width: 100%; }
}

footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 46px;
  color: var(--ink-faint);
  font-size: 13px;
  font-family: var(--mono);
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

@media (max-width: 640px) {
  .hero { padding-top: 52px; }
  .topbar .wrap { flex-direction: column; align-items: flex-start; gap: 8px; }
  .navlinks { gap: 16px; flex-wrap: wrap; }
}
