/* ============================================================
   INK DUELS — TELEMETRY BLUEPRINT
   A small, dependency-free design system for a data-driven doc.
   ============================================================ */

:root {
  --bg: #05080f;
  --bg-2: #070c16;
  --panel: rgba(13, 21, 35, 0.72);
  --panel-2: rgba(17, 27, 44, 0.78);
  --panel-hard: #0b1321;
  --line: rgba(125, 170, 220, 0.14);
  --line-strong: rgba(125, 190, 240, 0.28);
  --text: #e9f2ff;
  --muted: #94a9c4;
  --muted-2: #6d8099;
  --cyan: #35e0ff;
  --cyan-soft: rgba(53, 224, 255, 0.12);
  --lime: #c8f65a;
  --pink: #ff4fa3;
  --amber: #ffb84d;
  --violet: #a98bff;
  --red: #ff6170;
  --green: #5df2a3;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 70px -30px rgba(0, 0, 0, 0.9);
  --font: "Inter", "Segoe UI", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

::selection { background: rgba(53, 224, 255, 0.3); color: #fff; }

a { color: var(--cyan); text-decoration: none; }
button { font-family: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--cyan);
  color: #041018;
  font-weight: 800;
  border-radius: 8px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 14px; }

.wrap { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }

/* ---------- atmosphere ---------- */

.page-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(42, 92, 160, 0.22), transparent 60%),
    radial-gradient(900px 600px at 0% 30%, rgba(23, 74, 92, 0.18), transparent 55%),
    linear-gradient(180deg, #060a12 0%, #050810 55%, #04070d 100%);
}
.grid-wash {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 170, 220, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 170, 220, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 10%, transparent 75%);
  opacity: 0.55;
}
.ink-blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  animation: drift 26s ease-in-out infinite alternate;
}
.blob-a { width: 520px; height: 520px; top: -180px; right: 4%; background: rgba(53, 224, 255, 0.16); }
.blob-b { width: 460px; height: 460px; top: 38%; left: -180px; background: rgba(255, 79, 163, 0.12); animation-delay: -9s; }
.blob-c { width: 520px; height: 520px; bottom: -260px; right: 22%; background: rgba(200, 246, 90, 0.08); animation-delay: -17s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(40px, -30px, 0) scale(1.12); }
}

.scroll-rail {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  background: transparent;
}
.scroll-rail span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--lime), var(--pink));
  box-shadow: 0 0 12px rgba(53, 224, 255, 0.6);
  transition: width 0.08s linear;
}

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 8, 15, 0.72);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border-bottom: 1px solid var(--line);
}
.head-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 72px;
}
.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; color: var(--text); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(53, 224, 255, 0.16), rgba(255, 79, 163, 0.1));
  border: 1px solid var(--line-strong);
}
.brand-mark svg { width: 30px; height: 30px; fill: var(--cyan); }
.brand-mark circle { fill: var(--lime); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14px; letter-spacing: 0.18em; }
.brand-text em { font-style: normal; font-size: 11px; color: var(--muted-2); letter-spacing: 0.09em; }

.tabs-wrap { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs-wrap::-webkit-scrollbar { display: none; }
.tabs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  width: max-content;
  min-width: 100%;
  justify-content: center;
}
.tab {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 22px 10px 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.22s var(--ease);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab .tab-num {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted-2);
  margin-right: 5px;
  transform: translateY(-1px);
}
.tab[aria-selected="true"] .tab-num { color: var(--cyan); }
.tab-rail {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 2;
  height: 2px;
  width: 10px;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  border-radius: 2px;
  box-shadow: 0 0 14px rgba(53, 224, 255, 0.7);
  transition: transform 0.32s var(--ease), width 0.32s var(--ease);
}

.head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--muted-2);
  font-family: var(--mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.head-meta b { color: var(--muted); font-weight: 500; }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(93, 242, 163, 0.08);
  animation: pulse 2.8s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ---------- panels / tab transitions ---------- */

main { padding: 0 0 100px; }
.panel { display: none; }
.panel.is-active { display: block; animation: panelIn 0.45s var(--ease) both; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.section { padding: 72px 0 0; }
.section:first-child { padding-top: 56px; }
.section-head { max-width: 760px; margin-bottom: 30px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}
.section-title {
  margin: 0 0 12px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 750;
}
.section-lead { margin: 0; color: var(--muted); font-size: 16px; max-width: 70ch; }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 48px;
  align-items: center;
  padding: 64px 0 12px;
}
.hero-copy .eyebrow { color: var(--lime); }
.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(38px, 4.3vw, 54px);
  line-height: 1.03;
  letter-spacing: -0.045em;
  font-weight: 800;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--cyan) 0%, #8ff7ef 35%, var(--lime) 68%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lead {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 17px;
  max-width: 58ch;
  line-height: 1.65;
}
.hero .lead b { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--cyan); color: #041019; box-shadow: 0 12px 34px -14px rgba(53, 224, 255, 0.75); }
.btn-ghost { background: rgba(255, 255, 255, 0.03); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.hero-visual {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(53, 224, 255, 0.12), transparent 55%),
    linear-gradient(160deg, rgba(18, 30, 48, 0.9), rgba(8, 13, 23, 0.92));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.015) 3px 4px);
  pointer-events: none;
  border-radius: inherit;
}
.hv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted-2);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hv-head .live { color: var(--green); display: inline-flex; align-items: center; gap: 6px; }
.hv-head .live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.hv-ring { display: grid; place-items: center; margin: 4px 0 18px; position: relative; }
.hv-ring svg { width: 190px; height: 190px; transform: rotate(-90deg); }
.hv-ring .ring-track { fill: none; stroke: rgba(255, 255, 255, 0.06); stroke-width: 10; }
.hv-ring .ring-value { fill: none; stroke: url(#ringGrad); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 502; stroke-dashoffset: 0; filter: drop-shadow(0 0 7px rgba(53, 224, 255, 0.45)); animation: ringDraw 1.8s 0.4s var(--ease) both; }
@keyframes ringDraw { from { stroke-dashoffset: 502; } to { stroke-dashoffset: 0; } }
.hv-ring .ring-center {
  position: absolute;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hv-ring .ring-center b { font-size: 40px; line-height: 1; letter-spacing: -0.04em; }
.hv-ring .ring-center span { font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; color: var(--muted-2); text-transform: uppercase; }
.hv-bars { display: grid; gap: 11px; position: relative; z-index: 1; }
.hv-bar { display: grid; grid-template-columns: 104px 1fr 36px; align-items: center; gap: 10px; font-size: 10.5px; color: var(--muted); }
.hv-bar span:last-child { font-family: var(--mono); color: var(--text); text-align: right; font-size: 10px; }
.meter { height: 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.meter i { display: block; height: 100%; width: var(--w, 50%); border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--lime)); transform-origin: left; animation: meterGrow 1.2s 0.5s var(--ease) both; }
.hv-bar:nth-child(2) .meter i { background: linear-gradient(90deg, var(--violet), var(--pink)); }
.hv-bar:nth-child(3) .meter i { background: linear-gradient(90deg, var(--amber), var(--pink)); }
.hv-bar:nth-child(4) .meter i { background: linear-gradient(90deg, var(--green), var(--cyan)); }
@keyframes meterGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- KPI cards ---------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 30px;
}
.kpi {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(165deg, rgba(18, 29, 47, 0.65), rgba(9, 15, 26, 0.7));
  padding: 18px 18px 16px;
  overflow: hidden;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.kpi:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.kpi::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent 70%);
  opacity: 0.5;
}
.kpi .kpi-value { display: flex; align-items: baseline; gap: 4px; font-size: clamp(24px, 2.6vw, 34px); font-weight: 780; letter-spacing: -0.035em; line-height: 1.05; }
.kpi .kpi-value small { font-size: 13px; font-weight: 600; color: var(--muted-2); letter-spacing: 0; margin-left: 2px; }
.kpi .kpi-label { margin-top: 7px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted-2); }
.kpi .kpi-note { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.45; }

/* ---------- cards ---------- */

.card-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.card-grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 22px;
  overflow: hidden;
  transition: transform 0.28s var(--ease), border-color 0.28s var(--ease), background 0.28s var(--ease);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 100% at 100% 0%, rgba(53, 224, 255, 0.07), transparent 60%);
  opacity: 0;
  transition: opacity 0.28s var(--ease);
  pointer-events: none;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.card:hover::after { opacity: 1; }
.card .card-icon {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--cyan-soft);
  border: 1px solid rgba(53, 224, 255, 0.18);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 12px;
  margin-bottom: 14px;
}
.card h3 { margin: 0 0 7px; font-size: 16px; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.card .card-foot { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.card.is-warn { border-color: rgba(255, 97, 112, 0.22); }
.card.is-warn .card-icon { background: rgba(255, 97, 112, 0.1); border-color: rgba(255, 97, 112, 0.25); color: var(--red); }
.card.is-good .card-icon { background: rgba(93, 242, 163, 0.1); border-color: rgba(93, 242, 163, 0.25); color: var(--green); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.chip.cyan { color: var(--cyan); border-color: rgba(53, 224, 255, 0.22); background: rgba(53, 224, 255, 0.07); }
.chip.lime { color: var(--lime); border-color: rgba(200, 246, 90, 0.22); background: rgba(200, 246, 90, 0.06); }
.chip.pink { color: var(--pink); border-color: rgba(255, 79, 163, 0.22); background: rgba(255, 79, 163, 0.06); }
.chip.amber { color: var(--amber); border-color: rgba(255, 184, 77, 0.22); background: rgba(255, 184, 77, 0.06); }
.chip.red { color: var(--red); border-color: rgba(255, 97, 112, 0.22); background: rgba(255, 97, 112, 0.06); }
.chip.violet { color: var(--violet); border-color: rgba(169, 139, 255, 0.22); background: rgba(169, 139, 255, 0.06); }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.badge.p0 { color: #180904; background: var(--pink); }
.badge.p1 { color: #111002; background: var(--lime); }
.badge.p2 { color: #061017; background: #7fb4cf; }
.badge.tracked { color: var(--green); background: rgba(93, 242, 163, 0.1); border: 1px solid rgba(93, 242, 163, 0.25); }
.badge.missing { color: var(--red); background: rgba(255, 97, 112, 0.08); border: 1px solid rgba(255, 97, 112, 0.22); }
.badge.neutral { color: var(--muted); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }

/* ---------- callout / quote ---------- */

.callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: linear-gradient(90deg, rgba(53, 224, 255, 0.06), rgba(13, 21, 35, 0.35));
  padding: 18px 20px;
}
.callout .co-mark { font-family: var(--mono); font-size: 11px; color: var(--cyan); letter-spacing: 0.1em; padding-top: 2px; }
.callout h4 { margin: 0 0 4px; font-size: 14px; }
.callout p { margin: 0; color: var(--muted); font-size: 13.5px; }
.callout.warn { border-left-color: var(--amber); background: linear-gradient(90deg, rgba(255, 184, 77, 0.06), rgba(13, 21, 35, 0.35)); }
.callout.warn .co-mark { color: var(--amber); }
.callout.danger { border-left-color: var(--red); background: linear-gradient(90deg, rgba(255, 97, 112, 0.06), rgba(13, 21, 35, 0.35)); }
.callout.danger .co-mark { color: var(--red); }
.callout.good { border-left-color: var(--green); background: linear-gradient(90deg, rgba(93, 242, 163, 0.05), rgba(13, 21, 35, 0.35)); }
.callout.good .co-mark { color: var(--green); }

/* ---------- tables ---------- */

.table-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  background: rgba(9, 15, 26, 0.96);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid rgba(125, 170, 220, 0.08); vertical-align: top; color: var(--muted); overflow-wrap: anywhere; }
tbody tr { transition: background 0.18s var(--ease); }
tbody tr:hover { background: rgba(53, 224, 255, 0.035); }
tbody tr:last-child td { border-bottom: 0; }
td.strong { color: var(--text); font-weight: 600; }
td.mono, .mono { font-family: var(--mono); font-size: 11.5px; }
td .sub { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted-2); }
td .hook { display: block; margin-top: 3px; font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }
.ev { white-space: nowrap; }
.event-id { min-width: 158px; }
.table-note { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 11.5px; }

/* event explorer */
.explorer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--line-strong); color: var(--text); }
.filter-chip.is-on { background: rgba(53, 224, 255, 0.12); border-color: rgba(53, 224, 255, 0.35); color: var(--cyan); }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(5, 8, 15, 0.5);
  border-radius: 999px;
  padding: 6px 12px;
  min-width: 220px;
  color: var(--muted-2);
  transition: border-color 0.2s var(--ease);
}
.search-box:focus-within { border-color: rgba(53, 224, 255, 0.4); }
.search-box input { appearance: none; border: 0; background: transparent; color: var(--text); font-family: inherit; font-size: 12px; width: 100%; outline: none; }
.search-box svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; flex: 0 0 auto; }
.event-empty { padding: 40px; text-align: center; color: var(--muted-2); font-size: 13px; }
.event-count { font-family: var(--mono); font-size: 10px; color: var(--muted-2); padding: 0 14px 12px; }

/* ---------- funnels ---------- */

.funnel { display: grid; gap: 8px; }
.funnel-step {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(53, 224, 255, 0.05), rgba(13, 21, 35, 0.55));
  padding: 14px 16px;
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease);
}
.funnel-step:hover { transform: translateX(3px); border-color: var(--line-strong); }
.funnel-step .fs-num {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(53, 224, 255, 0.1);
  border: 1px solid rgba(53, 224, 255, 0.22);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
}
.funnel-step .fs-name { font-size: 14px; font-weight: 650; }
.funnel-step .fs-hook { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); margin-top: 2px; }
.funnel-step .fs-side { text-align: right; font-size: 11px; color: var(--muted); max-width: 240px; }
.funnel-step .fs-side .chip { margin-left: 6px; }

/* ---------- matrix ---------- */

.matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.matrix-col { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 20px; }
.matrix-col h3 { margin: 0 0 14px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; font-family: var(--mono); color: var(--muted); }
.matrix-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.matrix-col li { display: flex; gap: 10px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.matrix-col li b { color: var(--text); font-weight: 600; }
.matrix-col .mi { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; margin-top: 1px; }
.matrix-col.tracked .mi { color: var(--green); background: rgba(93, 242, 163, 0.1); }
.matrix-col.missing .mi { color: var(--red); background: rgba(255, 97, 112, 0.08); }

/* ---------- charts ---------- */

.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.chart-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px;
  min-width: 0;
}
.chart-card .chart-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 4px; }
.chart-card h3 { margin: 0; font-size: 14px; }
.chart-card .chart-unit { font-family: var(--mono); font-size: 9.5px; color: var(--muted-2); letter-spacing: 0.1em; text-transform: uppercase; }
.chart-card .chart-sub { margin: 0 0 16px; font-size: 11.5px; color: var(--muted-2); }
.chart-card .chart-source { margin-top: 12px; font-family: var(--mono); font-size: 9.5px; color: var(--muted-2); opacity: 0.8; }
.chart-svg { width: 100%; height: auto; overflow: visible; }
.chart-svg text { font-family: var(--mono); font-size: 9px; fill: var(--muted-2); }
.chart-svg .bar { transform-box: fill-box; transform-origin: 50% 100%; animation: barGrow 0.8s var(--ease) both; }
@keyframes barGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.chart-svg .bar-h { transform-box: fill-box; transform-origin: 0 50%; animation: barGrowH 0.8s var(--ease) both; }
@keyframes barGrowH { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.chart-svg .donut-seg { fill: none; stroke-linecap: butt; animation: donutIn 0.9s var(--ease) both; }
@keyframes donutIn { from { opacity: 0; } to { opacity: 1; } }
.chart-svg .line-path { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--dash, 900); stroke-dashoffset: var(--dash, 900); animation: lineDraw 1.4s 0.1s var(--ease) forwards; }
@keyframes lineDraw { to { stroke-dashoffset: 0; } }
.chart-svg .dot { animation: dotIn 0.4s 1.1s var(--ease) both; }
@keyframes dotIn { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }

/* ---------- timeline ---------- */

.timeline { position: relative; display: grid; gap: 0; margin-left: 6px; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(180deg, var(--cyan), rgba(53, 224, 255, 0.05)); }
.tl-item { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 18px; padding: 0 0 28px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-hard); border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 10px; color: var(--cyan); z-index: 1; }
.tl-body { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); padding: 16px 18px; }
.tl-body h3 { margin: 0 0 4px; font-size: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-body p { margin: 0; font-size: 13px; color: var(--muted); }
.tl-body .tl-list { margin: 10px 0 0; padding-left: 16px; color: var(--muted); font-size: 12.5px; }
.tl-body .tl-list li { margin-bottom: 4px; }

/* ---------- code ---------- */

.code-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #070b13; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.code-head .code-title { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.05em; }
.code-head .code-lang { font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; color: var(--cyan); text-transform: uppercase; }
.code-card pre { margin: 0; padding: 18px 20px; max-height: 540px; overflow: auto; font-family: var(--mono); font-size: 12px; line-height: 1.7; color: #c6d6ea; tab-size: 2; scrollbar-width: thin; scrollbar-color: rgba(53, 224, 255, 0.3) transparent; }
.code-card .tok-k { color: #ff9ad5; }
.code-card .tok-s { color: #b8e986; }
.code-card .tok-c { color: #5c7390; font-style: italic; }
.code-card .tok-n { color: #ffcf7a; }
.code-card .tok-f { color: #7fdcff; }

/* ---------- misc ---------- */

.split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; align-items: start; }
.stack { display: grid; gap: 14px; }
.note-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; color: var(--muted-2); font-size: 11.5px; }
.sep { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); margin: 8px 0; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; color: var(--muted-2); }
.two-col-list { columns: 2; column-gap: 32px; margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.two-col-list li { margin-bottom: 6px; break-inside: avoid; }

/* reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.65s var(--ease), transform 0.65s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { opacity: 0; transform: translateY(14px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.reveal-stagger.in > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.in > *:nth-child(2) { transition-delay: 0.05s; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: 0.1s; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: 0.15s; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: 0.2s; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: 0.25s; }
.reveal-stagger.in > *:nth-child(7) { transition-delay: 0.3s; }
.reveal-stagger.in > *:nth-child(8) { transition-delay: 0.35s; }

/* ---------- footer ---------- */

.site-foot { border-top: 1px solid var(--line); background: rgba(4, 7, 12, 0.6); padding: 38px 0; }
.foot-inner { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; align-items: flex-start; }
.foot-mark { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--cyan); }
.site-foot p { margin: 8px 0 0; max-width: 56ch; color: var(--muted-2); font-size: 12px; }
.site-foot p b { color: var(--muted); font-weight: 600; }
.foot-links { display: flex; flex-direction: column; gap: 8px; font-size: 12px; text-align: right; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--cyan); }
.foot-links span { font-family: var(--mono); color: var(--muted-2); font-size: 10px; }

/* ---------- responsive ---------- */

@media (max-width: 1360px) {
  .head-meta { display: none; }
}

@media (max-width: 1080px) {
  .card-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; gap: 34px; padding-top: 46px; }
  .hero-visual { max-width: 520px; }
  .head-meta { display: none; }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .head-inner { gap: 14px; min-height: 64px; }
  .brand-text em { display: none; }
  .tabs { justify-content: flex-start; }
  .tab { padding: 18px 9px 16px; font-size: 12px; }
  .tab .tab-num { display: none; }
  .section { padding-top: 56px; }
  .matrix { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .wrap { width: calc(100% - 32px); }
  .brand-text strong { font-size: 12px; }
  .brand-mark { width: 34px; height: 34px; }
  .hero h1 { font-size: clamp(34px, 10vw, 48px); }
  .hero .lead { font-size: 15px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .funnel-step { grid-template-columns: 34px 1fr; }
  .funnel-step .fs-side { grid-column: 2; text-align: left; max-width: none; padding-top: 6px; }
  .foot-inner { flex-direction: column; }
  .foot-links { text-align: left; }
  .two-col-list { columns: 1; }
  .chart-grid { grid-template-columns: 1fr; }
  .card-grid.cols-3 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal, .reveal-stagger > * { opacity: 1; transform: none; }
}
