/* ===========================================================
   SZL Khipu Constellation — deep-space dark, teal/cyan/violet
   Self-authored SZL build. Doctrine v11.
   =========================================================== */

:root {
  /* Type scale (fluid) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.85rem);
  --text-sm: clamp(0.85rem, 0.8rem + 0.3vw, 0.95rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.08rem);
  --text-lg: clamp(1.1rem, 1rem + 0.6vw, 1.4rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  --text-2xl: clamp(2rem, 1.4rem + 2.4vw, 3.2rem);

  /* Spacing (4px system) */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem; --space-20: 5rem; --space-24: 6rem;

  /* Deep-space palette */
  --bg: #05080f;
  --bg-2: #070b16;
  --surface: rgba(16, 26, 44, 0.55);
  --surface-solid: #0b1322;
  --border: rgba(120, 170, 200, 0.16);
  --border-strong: rgba(120, 200, 220, 0.30);

  --teal: #01696F;
  --teal-bright: #2bd9c8;
  --cyan: #38e0ff;
  --violet: #9a6bff;
  --violet-bright: #b58bff;

  --text: #e8f1f6;
  --text-muted: #9fb2c4;
  --text-faint: #6a7d92;

  --ok: #4fd39a;
  --warn: #e8b54a;
  --bad: #e8736a;

  --radius-sm: 0.5rem;
  --radius-md: 0.85rem;
  --radius-lg: 1.15rem;
  --radius-full: 9999px;

  --content: 1180px;
  --glow-teal: 0 0 40px rgba(43, 217, 200, 0.18);
  --glow-violet: 0 0 40px rgba(154, 107, 255, 0.16);

  /* SOVEREIGN: system fonts only — 0 runtime CDN, no Google Fonts. */
  --font-display: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  min-height: 100dvh;
  line-height: 1.65;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  position: relative;
}

/* Starfield + nebula background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 60% 50% at 18% 12%, rgba(1, 105, 111, 0.22), transparent 60%),
    radial-gradient(ellipse 50% 50% at 85% 20%, rgba(154, 107, 255, 0.15), transparent 60%),
    radial-gradient(ellipse 70% 60% at 60% 95%, rgba(56, 224, 255, 0.10), transparent 65%),
    linear-gradient(180deg, #05080f 0%, #060a14 50%, #04060d 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 70% 65%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(180,220,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 88% 42%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 12% 78%, rgba(200,230,255,0.5), transparent),
    radial-gradient(1px 1px at 55% 18%, rgba(255,255,255,0.4), transparent);
  background-repeat: repeat;
  opacity: 0.6;
  pointer-events: none;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--teal-bright); }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; text-wrap: balance; letter-spacing: 0; }
p { text-wrap: pretty; }

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

/* ---------- Layout shell ---------- */
.wrap { width: min(100% - 2.5rem, var(--content)); margin-inline: auto; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(5, 8, 15, 0.72);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); padding-block: var(--space-3); flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: var(--space-3); }
.brand-mark { width: 38px; height: 38px; flex-shrink: 0; filter: drop-shadow(0 0 10px rgba(43,217,200,0.4)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm); letter-spacing: 0.02em; }
.brand-sub { font-size: 0.72rem; color: var(--text-faint); font-family: var(--font-mono); letter-spacing: 0.04em; }
.topbar-status { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }

/* ---------- Live pill ---------- */
.live-pill {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 0.3rem 0.7rem; border-radius: var(--radius-full);
  font-family: var(--font-mono); font-size: var(--text-xs);
  border: 1px solid var(--border-strong); background: var(--surface);
  white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot.live { background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: pulse 2s ease-in-out infinite; }
.dot.snapshot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.dot.down { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.28rem 0.65rem; border-radius: var(--radius-full);
  font-family: var(--font-mono); font-size: var(--text-xs);
  border: 1px solid var(--border); background: rgba(154, 107, 255, 0.08);
  color: var(--violet-bright); white-space: nowrap;
}
.badge.teal { background: rgba(43,217,200,0.08); color: var(--teal-bright); border-color: rgba(43,217,200,0.25); }
.badge.warn { background: rgba(232,181,74,0.09); color: var(--warn); border-color: rgba(232,181,74,0.28); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(var(--space-12), 8vw, var(--space-24)) var(--space-12); position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: var(--space-12); align-items: center; }
.eyebrow {
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--teal-bright); margin-bottom: var(--space-4);
}
.hero h1 { font-size: var(--text-2xl); font-weight: 600; margin-bottom: var(--space-5); letter-spacing: 0.005em; word-spacing: 0.04em; line-height: 1.18; }
.hero h1 .accent {
  background: linear-gradient(120deg, var(--teal-bright), var(--cyan) 45%, var(--violet-bright));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
  padding-right: 0.04em;
}
.hero-lede { font-size: var(--text-lg); color: var(--text-muted); margin-bottom: var(--space-6); max-width: 36ch; }
.hero-badges { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-6); }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 0.7rem 1.3rem; border-radius: var(--radius-full);
  font-weight: 500; font-size: var(--text-sm); cursor: pointer;
  transition: transform 180ms cubic-bezier(.16,1,.3,1), box-shadow 180ms, background 180ms;
}
.btn-primary {
  background: linear-gradient(120deg, var(--teal), var(--teal-bright));
  color: #04141a; box-shadow: var(--glow-teal); font-weight: 600;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 50px rgba(43,217,200,0.35); }
.btn-ghost { border: 1px solid var(--border-strong); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--cyan); transform: translateY(-2px); }

/* ---------- Glass card ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}

/* ---------- Constellation graph ---------- */
.graph-shell {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border-strong);
  background: radial-gradient(ellipse at 50% 40%, rgba(8,16,30,0.6), rgba(4,7,14,0.9));
  box-shadow: var(--glow-teal), inset 0 0 60px rgba(0,0,0,0.5);
  min-height: 420px;
}
#graph { width: 100%; height: 460px; }
.graph-overlay {
  position: absolute; top: var(--space-3); left: var(--space-3);
  display: flex; gap: var(--space-2); flex-wrap: wrap; pointer-events: none; z-index: 5;
}
.graph-controls {
  position: absolute; bottom: var(--space-3); left: 50%; transform: translateX(-50%);
  display: flex; gap: var(--space-2); z-index: 5; flex-wrap: wrap; justify-content: center;
  width: calc(100% - 1.5rem);
}
.seg {
  display: inline-flex; border: 1px solid var(--border-strong);
  border-radius: var(--radius-full); overflow: hidden; backdrop-filter: blur(10px);
  background: rgba(5,8,15,0.7);
}
.seg button {
  padding: 0.4rem 0.9rem; font-size: var(--text-xs); font-family: var(--font-mono);
  color: var(--text-muted); background: transparent; white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: rgba(43,217,200,0.18); color: var(--teal-bright); }
.graph-legend {
  position: absolute; top: var(--space-3); right: var(--space-3); z-index: 5;
  display: flex; flex-direction: column; gap: var(--space-2);
  font-size: var(--text-xs); font-family: var(--font-mono);
  background: rgba(5,8,15,0.6); padding: var(--space-3); border-radius: var(--radius-md);
  border: 1px solid var(--border); backdrop-filter: blur(8px);
}
.legend-row { display: flex; align-items: center; gap: var(--space-2); color: var(--text-muted); }
.legend-swatch { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

/* ---------- Section ---------- */
.section { padding-block: clamp(var(--space-12), 6vw, var(--space-20)); }
.section-head { max-width: 60ch; margin-bottom: var(--space-10); }
.section-head .eyebrow { margin-bottom: var(--space-3); }
.section-head h2 { font-size: var(--text-xl); font-weight: 600; margin-bottom: var(--space-3); }
.section-head p { color: var(--text-muted); }

/* ---------- KPI cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-4); }
.kpi {
  padding: var(--space-5); border-radius: var(--radius-md);
  position: relative; overflow: hidden;
}
.kpi::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--teal-bright), var(--violet-bright));
  opacity: 0.7;
}
.kpi-label { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-faint); letter-spacing: 0.06em; text-transform: uppercase; }
.kpi-value { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; margin-block: var(--space-2); }
.kpi-value.teal { color: var(--teal-bright); }
.kpi-value.violet { color: var(--violet-bright); }
.kpi-value.cyan { color: var(--cyan); }
.kpi-meta { font-size: var(--text-xs); color: var(--text-muted); font-family: var(--font-mono); }

/* ---------- Generic grid ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-5); }
.card { padding: var(--space-6); border-radius: var(--radius-md); }
.card h3 { font-size: var(--text-lg); margin-bottom: var(--space-3); color: var(--text); display: flex; align-items: center; gap: var(--space-2); }
.card p { color: var(--text-muted); font-size: var(--text-sm); }
.card .icon { width: 28px; height: 28px; flex-shrink: 0; color: var(--teal-bright); }

/* ---------- Witness table ---------- */
.table-shell { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
.tbl-scroll { overflow-x: auto; }
table.witness { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 560px; }
table.witness th, table.witness td { padding: var(--space-3) var(--space-4); text-align: left; }
table.witness thead th {
  font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-faint); background: rgba(8,16,30,0.6);
  border-bottom: 1px solid var(--border);
}
table.witness tbody tr { border-bottom: 1px solid var(--border); }
table.witness tbody tr:last-child { border-bottom: none; }
table.witness td.mono { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.tag { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.18rem 0.55rem; border-radius: var(--radius-full); font-family: var(--font-mono); font-size: var(--text-xs); }
.tag.sov { background: rgba(43,217,200,0.12); color: var(--teal-bright); }
.tag.host { background: rgba(154,107,255,0.12); color: var(--violet-bright); }
.tag.ok { background: rgba(79,211,154,0.14); color: var(--ok); }
.tag.down { background: rgba(232,115,106,0.14); color: var(--bad); }

/* ---------- Quorum receipt knot ---------- */
.receipt {
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted);
  background: rgba(4,7,14,0.6); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--space-4); overflow-x: auto; line-height: 1.7;
}
.receipt .k { color: var(--cyan); }
.receipt .v { color: var(--teal-bright); }
.receipt .c { color: var(--text-faint); }

/* ---------- Honesty callout ---------- */
.callout {
  border-left: 3px solid var(--warn); padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-md); background: rgba(232,181,74,0.06);
}
.callout h3 { color: var(--warn); font-size: var(--text-lg); margin-bottom: var(--space-2); }
.callout p { color: var(--text-muted); font-size: var(--text-sm); }
.callout p + p { margin-top: var(--space-2); }

/* ---------- Conjecture explainer steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: var(--space-4); counter-reset: step; }
.step { padding: var(--space-5); border-radius: var(--radius-md); position: relative; }
.step-num {
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--teal-bright);
  border: 1px solid var(--border-strong); border-radius: var(--radius-full);
  width: 28px; height: 28px; display: grid; place-items: center; margin-bottom: var(--space-3);
}
.step h3 { font-size: var(--text-base); margin-bottom: var(--space-2); }
.step p { font-size: var(--text-sm); color: var(--text-muted); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding-block: var(--space-10); margin-top: var(--space-12); }
.footer-grid { display: flex; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; align-items: flex-start; }
.footer p { color: var(--text-faint); font-size: var(--text-sm); max-width: 48ch; }
.footer-links { display: flex; gap: var(--space-5); flex-wrap: wrap; font-size: var(--text-sm); font-family: var(--font-mono); }
.footer-doctrine { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-faint); margin-top: var(--space-4); }

/* ---------- Updated stamp ---------- */
.stamp { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-faint); }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .hero-lede { max-width: none; }
  #graph { height: 380px; }
  .graph-legend { position: static; margin: var(--space-3); }
}
@media (max-width: 560px) {
  .topbar-inner { gap: var(--space-2); }
  .brand-sub { display: none; }
  #graph { height: 340px; }
  .graph-legend { display: none; }
}

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

/* ===========================================================
   LLM Router — additional components
   =========================================================== */

/* ---------- Routing diagram ---------- */
.router-shell {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border-strong);
  background: radial-gradient(ellipse at 50% 30%, rgba(8,16,30,0.6), rgba(4,7,14,0.92));
  box-shadow: var(--glow-teal), inset 0 0 60px rgba(0,0,0,0.5);
  padding: var(--space-5);
}
.router-svg { width: 100%; height: auto; display: block; }

/* animated dash flow on routing edges */
.flow-edge { stroke-dasharray: 6 8; animation: flow 1.4s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -28; } }
.flow-edge.cool { animation-duration: 2.2s; }

.node-box {
  fill: rgba(11,19,34,0.92); stroke-width: 1.5;
}
.node-box.sov { stroke: #2bd9c8; }
.node-box.free { stroke: #38e0ff; }
.node-box.paid { stroke: #9a6bff; }
.node-box.src { stroke: rgba(255,255,255,0.4); }
.node-label { font-family: var(--font-mono); font-size: 14px; fill: var(--text); }
.node-sub { font-family: var(--font-mono); font-size: 12px; fill: var(--text-faint); }

/* ---------- Tier ladder ---------- */
.ladder { display: grid; gap: var(--space-3); }
.rung {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-4); align-items: center;
  padding: var(--space-4) var(--space-5); border-radius: var(--radius-md);
  border-left: 3px solid var(--border-strong);
}
.rung.sov { border-left-color: var(--teal-bright); }
.rung.free { border-left-color: var(--cyan); }
.rung.paid { border-left-color: var(--violet-bright); }
.rung-rank { font-family: var(--font-mono); font-size: var(--text-lg); font-weight: 600; color: var(--text-faint); }
.rung-body h3 { font-size: var(--text-base); margin-bottom: 0.15rem; }
.rung-body p { font-size: var(--text-sm); color: var(--text-muted); }
.rung-flag { font-family: var(--font-mono); font-size: var(--text-xs); white-space: nowrap; }

/* ---------- Provenance fields ---------- */
.prov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: var(--space-4); }
.prov-field { padding: var(--space-5); border-radius: var(--radius-md); }
.prov-key { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--cyan); margin-bottom: var(--space-2); }
.prov-field p { font-size: var(--text-sm); color: var(--text-muted); }
.prov-field code { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--teal-bright); background: rgba(43,217,200,0.08); padding: 0.1rem 0.4rem; border-radius: 0.3rem; }

/* ---------- Provider status grid ---------- */
.prov-status { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: var(--space-4); }
.provider-card { padding: var(--space-5); border-radius: var(--radius-md); display: flex; flex-direction: column; gap: var(--space-2); }
.provider-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.provider-name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-base); }
.provider-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.provider-note { font-size: var(--text-xs); color: var(--text-faint); }

/* logical model chips */
.model-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { font-family: var(--font-mono); font-size: var(--text-xs); padding: 0.3rem 0.7rem; border-radius: var(--radius-full); border: 1px solid var(--border-strong); background: rgba(43,217,200,0.08); color: var(--teal-bright); }
.chip.dim { background: rgba(120,140,170,0.08); color: var(--text-muted); border-color: var(--border); }

/* private notice */
.private-note {
  display: flex; gap: var(--space-3); align-items: flex-start;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
  padding: var(--space-5); background: rgba(154,107,255,0.05);
}
.private-note svg { width: 26px; height: 26px; color: var(--violet-bright); flex-shrink: 0; }
.private-note p { font-size: var(--text-sm); color: var(--text-muted); }

@media (max-width: 560px) {
  .rung { grid-template-columns: auto 1fr; }
  .rung-flag { grid-column: 2; }
}

/* ===========================================================
   DEV B · MOBILE REFINEMENT (investor-grade on a phone)
   12px type floor · 44px touch targets · safe-area · 0 CDN
   Doctrine v11 honest · system fonts only.
   =========================================================== */

/* Safe-area: notch / home-bar clearance (viewport-fit=cover) */
.topbar { padding-top: env(safe-area-inset-top, 0px); }
.topbar-inner { padding-inline: max(0px, env(safe-area-inset-left)) max(0px, env(safe-area-inset-right)); }
.footer { padding-bottom: max(var(--space-10), calc(var(--space-6) + env(safe-area-inset-bottom))); }

/* Type floor — nothing readable under 12px. Caption tokens bumped on phones. */
@media (max-width: 768px) {
  :root {
    --text-xs: clamp(0.78rem, 0.74rem + 0.2vw, 0.85rem);   /* 12.5px floor */
    --text-sm: clamp(0.875rem, 0.83rem + 0.25vw, 0.95rem); /* 14px floor */
  }
  .brand-sub { font-size: 0.78rem; }                        /* was 11.5px */
  .footer-doctrine, .stamp, .kpi-label, .kpi-meta,
  .provider-note, .prov-field code, .chip, .badge,
  .live-pill, .seg button, .rung-flag, table.witness td.mono,
  .receipt, .step-num { font-size: 0.78rem; }
  .node-label { font-size: 15px; }
  .node-sub { font-size: 12.5px; }
}

/* Touch targets ≥ 44px hit area (WCAG 2.5.5). Links lifted via padding. */
@media (pointer: coarse), (max-width: 768px) {
  .footer-links a,
  .topbar a, .brand,
  .prov-field, .provider-card { -webkit-tap-highlight-color: transparent; }
  .footer-links { gap: var(--space-3) var(--space-6); }
  .footer-links a {
    display: inline-flex; align-items: center;
    min-height: 44px; padding-block: 2px;
  }
  .brand { min-height: 44px; }   /* wordmark link — full 44px tap height */
  .hero-cta .btn { min-height: 44px; }
  .badge, .chip, .live-pill { min-height: 30px; } /* non-interactive status pills: legible, not tap targets */
}

/* Focus rings already present (:focus-visible). AA contrast retained. */

/* ===========================================================
   VISUAL POLISH · additive presentation upgrade (Doctrine v11)
   Motion / hover / focus / a11y only — no copy, no logic.
   0 CDN · system fonts only. Reduced-motion honored (block above
   uses !important, which always wins over these normal rules).
   =========================================================== */

/* --- Cohesion: selection + scrollbar --- */
::selection { background: rgba(43, 217, 200, 0.28); color: #eafcff; }
html { scrollbar-color: var(--teal-bright) var(--bg-2); scrollbar-width: thin; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: var(--bg-2); }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--teal), var(--violet));
  border-radius: var(--radius-full); border: 2px solid var(--bg-2);
}
*::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--teal-bright), var(--violet-bright)); }

/* --- Entrance choreography ---
   opacity:0 lives ONLY in the keyframe `from` + fill:both, so with
   reduced-motion (duration ~0) elements snap straight to the final
   visible state — nothing can get stuck hidden. */
@keyframes szl-rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes szl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes szl-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.hero-grid > div:first-child { animation: szl-rise 0.7s cubic-bezier(.16,1,.3,1) both; }
.router-shell { animation: szl-rise 0.85s cubic-bezier(.16,1,.3,1) 0.12s both; }
.section .section-head { animation: szl-rise 0.6s cubic-bezier(.16,1,.3,1) both; }

/* Staggered card reveals */
.kpi-grid .kpi,
.ladder .rung,
.prov-grid .prov-field {
  animation: szl-rise 0.6s cubic-bezier(.16,1,.3,1) both;
}
.kpi-grid .kpi:nth-child(2)  { animation-delay: 0.07s; }
.kpi-grid .kpi:nth-child(3)  { animation-delay: 0.14s; }
.kpi-grid .kpi:nth-child(4)  { animation-delay: 0.21s; }
.ladder .rung:nth-child(2)   { animation-delay: 0.08s; }
.ladder .rung:nth-child(3)   { animation-delay: 0.16s; }
.prov-grid .prov-field:nth-child(2) { animation-delay: 0.06s; }
.prov-grid .prov-field:nth-child(3) { animation-delay: 0.12s; }
.prov-grid .prov-field:nth-child(4) { animation-delay: 0.18s; }

/* --- Animated headline sheen (subtle, continuous) --- */
.hero h1 .accent { background-size: 220% auto; animation: szl-sheen 7s ease-in-out infinite; }
@keyframes szl-sheen { 0%, 100% { background-position: 0% center; } 50% { background-position: 100% center; } }

/* --- Loading / empty-state affordance --- */
.chip.dim { animation: szl-pulse 1.8s ease-in-out infinite; }

/* --- Depth transitions shared by interactive cards --- */
.kpi, .prov-field, .provider-card, .rung, .card, .step, .glass {
  transition: transform 240ms cubic-bezier(.16,1,.3,1),
              box-shadow 240ms ease, border-color 240ms ease;
}

/* Hover lift only on true pointer devices (no sticky hover on touch) */
@media (hover: hover) {
  .kpi:hover, .prov-field:hover, .provider-card:hover, .step:hover, .card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    box-shadow: 0 20px 52px rgba(0, 0, 0, 0.5), var(--glow-teal);
  }
  .rung:hover {
    transform: translateX(5px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
  }
  .private-note:hover, .callout:hover { transform: translateY(-3px); }

  /* Chips + pills micro-interaction */
  .chip:not(.dim), .live-pill { transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
  .chip:not(.dim):hover { transform: translateY(-2px); border-color: var(--teal-bright); }
  .live-pill:hover { border-color: var(--cyan); }

  /* Router diagram breathes on hover */
  .router-shell:hover { box-shadow: 0 0 60px rgba(43, 217, 200, 0.26), inset 0 0 60px rgba(0, 0, 0, 0.5); }

  /* Footer link underline sweep */
  .footer-links a { position: relative; }
  .footer-links a::after {
    content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
    height: 1px; background: var(--teal-bright); transition: right 240ms cubic-bezier(.16,1,.3,1);
  }
  .footer-links a:hover::after { right: 0; }
}

/* --- Stronger, calmer button motion --- */
.btn:active { transform: translateY(0) scale(0.98); }
.btn-ghost:hover { box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4); }

/* --- Brand mark subtle life on hover --- */
@media (hover: hover) {
  .brand-mark { transition: transform 300ms cubic-bezier(.16,1,.3,1), filter 300ms ease; }
  .brand:hover .brand-mark { transform: rotate(-6deg) scale(1.06); filter: drop-shadow(0 0 14px rgba(43, 217, 200, 0.6)); }
}

/* --- Section headings: accent tick for rhythm --- */
.section-head .eyebrow { position: relative; }

/* --- A11y: honor forced-colors / high-contrast --- */
@media (forced-colors: active) {
  .glass, .kpi, .prov-field, .provider-card, .rung { border: 1px solid CanvasText; }
}
