/* ============================================================================
   LinkProven website — "Signal Instrument" design system.

   LinkProven is a LAN measurement tool, so the site reads like an instrument:
   a dark oscilloscope panel with a cyan signal traveling the Server↔Client
   link. The brand palette mirrors the app's Dark theme
   (linkproven/theme.py PALETTES["dark"]) and logo.svg so the site and the app
   read as one product.

     Slate   #0b1220 / #16213a / #1b2942
     Cyan    #22d3ee / #67e8f9 / #0891b2   (the one sharp accent)

   Two themes: dark is the default; a light palette — mirroring the app's
   Light theme (PALETTES["light"]) — applies under html[data-theme="light"],
   which the head script sets from the header toggle (Light / Dark / System,
   like the app's Appearance combo) or, on System, the OS. Every panel
   follows the page — the topology stage, the case matrix, the card-count
   flow, diagrams (each has a light PNG), code blocks and the lightbox are
   light in the light theme and dark in the dark one. (The app keeps its
   charts dark; the site does not.)

   Typography: Inter (bundled — the same face the app ships) carries body/UI;
   a monospace stack carries the technical "readout" voice (eyebrows, metrics,
   version chips). No external CDNs — every asset is local.

   The site is the first half of the LinkProven platform: the portal
   (app.linkproven.com) and the phone apps will reuse these tokens, header and
   footer, so treat the :root custom properties below as the shared palette.
   ========================================================================= */

/* ---- Bundled Inter (same face the app ships; no external CDN) ----
   Latin-subset WOFF2 (~39 KB/weight vs ~410 KB full TTF) built from the
   app's TTFs (Software/src/linkproven/resources/fonts/) via
   `python -m fontTools.subset … --flavor=woff2` — see site/README.md. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/Inter-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/Inter-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/Inter-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/Inter-Bold.woff2") format("woff2");
}

/* ============================ Design tokens ============================== */
/* Dark tokens — the default theme. */
:root {
  color-scheme: dark;

  /* Surfaces */
  --bg: #0b1220;
  --bg-soft: #0f172a;
  --surface: #16213a;
  --card: #1b2942;
  --card-2: #16223c;
  --border: #2a3a57;
  --border-strong: #4d6790;

  /* Ink */
  --text: #f1f5f9;
  --subtext: #94a3b8;
  --muted: #8794ab;          /* ≥4.5:1 on --bg and cards (was #64748b, 4.0:1) */
  --ink-body: #cbd5e1;       /* long-form doc copy */

  /* Cyan signal */
  --accent: #22d3ee;
  --accent-hover: #67e8f9;
  --accent-press: #0891b2;
  --accent-deep: #06b6d4;
  --link: #38bdf8;
  --link-hover: #67e8f9;
  --on-accent: #06283a;
  /* --accent is the brand FILL / line colour; --accent-ink is accent-coloured
     TEXT and must clear 4.5:1 on --bg, so it darkens in the light theme. */
  --accent-ink: #22d3ee;
  --accent-line: #22d3ee;
  --accent-text-glow: 0 0 34px rgba(34, 211, 238, 0.4);

  /* Glow / shadow */
  --glow: rgba(34, 211, 238, 0.55);
  --shadow-lg: 0 30px 80px rgba(2, 6, 16, 0.6);
  --shadow-md: 0 18px 44px rgba(2, 6, 16, 0.45);

  /* Page atmosphere + translucent bands */
  --atmos-a: rgba(34, 211, 238, 0.14);
  --atmos-b: rgba(8, 145, 178, 0.12);
  --grid-line: rgba(80, 130, 180, 0.05);
  --header-bg: rgba(11, 18, 32, 0.66);
  --header-bg-scrolled: rgba(9, 15, 27, 0.86);
  --stats-bg: linear-gradient(180deg, rgba(27, 41, 66, 0.6), rgba(22, 33, 58, 0.35));
  --how-bg: rgba(15, 23, 42, 0.5);
  --band-bg: rgba(15, 23, 42, 0.55);
  --footer-bg: rgba(9, 14, 26, 0.6);
  --ghost-bg: rgba(255, 255, 255, 0.02);
  --row-alt: rgba(255, 255, 255, 0.015);
  /* Logo V6 soft glow: the bright cyan, lower on dark than on light. */
  --logo-glow: drop-shadow(0 0 4px rgba(34, 211, 238, 0.32));

  /* Plot panels, code and overlays */
  --panel-bg: #0d1526;                  /* matrix, flow, topology stage */
  --fig-bg: rgba(11, 18, 32, 0.5);      /* diagram frames */
  --code-bg: #070c14;
  --code-box-bg: #0a1019;
  --scrim: rgba(5, 9, 17, 0.9);
  --glass-bg: rgba(22, 33, 58, 0.92);
  --chip-bg: rgba(11, 18, 32, 0.72);
  --cell-ring: #e2e8f0;
  --img-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);

  /* Status inks (changelog tags, verdict chips) */
  --ok-ink: #86efac;
  --warn-ink: #fcd34d;
  --info-ink: #7dd3fc;
  --bad-ink: #fca5a5;
  --idle-ink: #cbd5e1;

  /* Type */
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "SF Mono",
    "Roboto Mono", Menlo, Consolas, monospace;

  /* Rhythm */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --maxw: 1140px;
  --gutter: 24px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --reveal-dur: 0.7s;

  color: var(--text);
}

/* Light theme. The head script sets html[data-theme] before first paint:
   the reader's saved choice (the header toggle), else the OS preference.
   Only :root changes; every panel reads these tokens. Without JavaScript the
   attribute is never set and the page stays on the dark default. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3f9;
  --bg-soft: #e2eaf4;
  --surface: #ffffff;
  --card: #ffffff;
  --card-2: #f6f9fc;
  --border: #c6d3e4;
  --border-strong: #8aa1c0;

  --text: #0f1e36;
  --subtext: #44546b;
  --muted: #556479;
  --ink-body: #26354d;

  --link: #0c6880;
  --link-hover: #155e75;
  --accent-ink: #0c6880;        /* ≥5:1 on every light surface */
  --accent-line: #0891b2;
  --accent-text-glow: none;

  --glow: rgba(8, 145, 178, 0.35);
  --shadow-lg: 0 28px 64px rgba(15, 30, 54, 0.16);
  --shadow-md: 0 14px 34px rgba(15, 30, 54, 0.11);

  --atmos-a: rgba(34, 211, 238, 0.16);
  --atmos-b: rgba(8, 145, 178, 0.08);
  --grid-line: rgba(15, 30, 54, 0.05);
  --header-bg: rgba(238, 243, 249, 0.74);
  --header-bg-scrolled: rgba(246, 249, 252, 0.92);
  --stats-bg: linear-gradient(180deg, #ffffff, #f6f9fc);
  --how-bg: rgba(219, 229, 241, 0.55);
  --band-bg: rgba(226, 234, 244, 0.7);
  --footer-bg: #e2eaf4;
  --ghost-bg: rgba(255, 255, 255, 0.6);
  --row-alt: rgba(15, 30, 54, 0.03);
  --logo-glow: drop-shadow(0 0 4px rgba(34, 211, 238, 0.40));

  --panel-bg: #ffffff;
  --fig-bg: #ffffff;
  --code-bg: #f3f7fb;
  --code-box-bg: #f6f9fc;
  --scrim: rgba(226, 234, 244, 0.92);
  --glass-bg: rgba(255, 255, 255, 0.94);
  --chip-bg: rgba(255, 255, 255, 0.9);
  --cell-ring: #0f1e36;
  --img-shadow: 0 30px 80px rgba(15, 30, 54, 0.28);

  --ok-ink: #166534;
  --warn-ink: #854d0e;
  --info-ink: #075985;
  --bad-ink: #991b1b;
  --idle-ink: #334155;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Instrument atmosphere: a fixed scope-graticule grid + two cyan phosphor
   glows, painted behind everything. Pointer-events off so it never blocks. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 560px at 82% -8%, var(--atmos-a), transparent 60%),
    radial-gradient(720px 520px at -6% 4%, var(--atmos-b), transparent 58%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center;
  -webkit-mask-image: radial-gradient(circle at 50% 22%, #000 0%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 22%, #000 0%, transparent 78%);
}

a { color: var(--link); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--link-hover); }

/* One visible keyboard focus ring everywhere (mouse clicks don't show it). */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Controls that do nothing without JavaScript are hidden without it. */
html:not(.js) .js-only { display: none; }

/* Visually hidden, still read by screen readers. */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

img { max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* Monospace "instrument readout" eyebrow above section heads */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-line);
  box-shadow: 0 0 0 0 var(--glow);
  animation: blip 2.6s var(--ease) infinite;
}
@keyframes blip {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(34, 211, 238, 0); }
}

/* ============================ Header / nav ============================== */
/* One header on every page, written by publish/build-site-shell.py. The
   portal and the phone apps are meant to reuse it, so it carries only the
   brand, four destinations and three actions. */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 60;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.skip-link:focus { top: 10px; color: var(--on-accent); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px) saturate(140%);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.site-header.scrolled {
  background: var(--header-bg-scrolled);
  border-bottom-color: var(--border);
}
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 66px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--text);
  flex: none;
}
.brand:hover { color: var(--text); }
/* The brand mark is the app icon (branding.tile_svg): a navy tile that
   carries its own colours, so it reads the same on both page themes. */
.mark { width: 34px; height: 34px; display: block; overflow: visible; flex: none; }
/* Navy tile on a dark page, white tile on a light one (no JS = dark). */
.mark-light { display: none; }
:root[data-theme="light"] .mark-light { display: block; }
:root[data-theme="light"] .mark-dark { display: none; }
/* The flat line mark: only the sample report card, because the Word/PDF
   report header still uses it. Geometry = branding.THIN. */
.mark-flat { width: 60px; height: 28px; filter: var(--logo-glow); }
.mark-flat path { fill: none; stroke: var(--accent-line); stroke-width: 4.5; stroke-linecap: round;
  stroke-linejoin: miter; stroke-miterlimit: 12; }
.mark-flat circle { fill: var(--accent-line); }
.word-ping { color: var(--text); font-weight: 700; }
.word-pair { color: var(--accent-ink); font-weight: 700; }

.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--subtext); font-weight: 500; font-size: 14.5px; position: relative; }
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-line);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
}
.nav-links a[aria-current="page"], .nav-links a.is-active { color: var(--text); }
.nav-links a[aria-current="page"]::after, .nav-links a.is-active::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.icon-btn {
  appearance: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--ghost-bg);
  color: var(--subtext);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
/* The theme button shows the CHOICE (System / Light / Dark), not the result. */
.theme-btn svg { display: none; }
html:not([data-theme-pref]) .theme-btn .ic-system,
html[data-theme-pref="system"] .theme-btn .ic-system,
html[data-theme-pref="light"] .theme-btn .ic-light,
html[data-theme-pref="dark"] .theme-btn .ic-dark { display: block; }

.nav-portal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--subtext);
  font-weight: 500;
  font-size: 14.5px;
  white-space: nowrap;
}
.nav-portal:hover { color: var(--text); }
.soon {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 1px 7px;
}
.btn.btn-sm { padding: 9px 16px; font-size: 14px; border-radius: 9px; }

/* Phone menu: the four links drop into a panel under the bar. Without JS the
   button is hidden and the links wrap onto a second row instead. */
.menu-btn { display: none; }
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  position: relative;
  transition: transform 0.18s ease, background 0.18s ease;
}
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
.menu-btn span::before { top: -5px; }
.menu-btn span::after { top: 5px; }
.menu-btn[aria-expanded="true"] span { background: transparent; }
.menu-btn[aria-expanded="true"] span::before { transform: translateY(5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span::after { transform: translateY(-5px) rotate(-45deg); }

/* ============================== Buttons ================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease,
    box-shadow 0.2s ease, color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-hover), var(--accent));
  color: var(--on-accent);
  box-shadow: 0 10px 30px rgba(34, 211, 238, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover {
  color: var(--on-accent);
  box-shadow: 0 14px 38px rgba(34, 211, 238, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-ghost { background: var(--ghost-bg); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent-line); color: var(--link-hover); background: rgba(34, 211, 238, 0.06); }
.btn-lg { padding: 16px 28px; font-size: 16.5px; }

/* =============================== Hero ================================== */
/* scroll-margin > header height: the #home anchor jump clamps to scrollY 0. */
.hero { padding: 78px 0 26px; position: relative; scroll-margin-top: 100px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 1.1fr;
  gap: 52px;
  align-items: center;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.32);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.pill { flex-wrap: wrap; row-gap: 2px; }
.hero-copy { min-width: 0; }
.pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #57c970;
  box-shadow: 0 0 8px #57c970;
}
.hero h1 {
  font-size: clamp(38px, 5.2vw, 60px);
  line-height: 1.04;
  margin: 0 0 20px;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.hero h1 .accent {
  color: var(--accent-ink);
  text-shadow: var(--accent-text-glow);
}
.hero p.lead { font-size: clamp(17px, 1.5vw, 20px); color: var(--subtext); margin: 0 0 32px; max-width: 40ch; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-sub { margin-top: 18px; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.02em; color: var(--muted); }
.hero-sub b { color: var(--subtext); font-weight: 600; }

/* The product screenshot, framed like an instrument readout with corner ticks */
.scope-frame { position: relative; }
.scope-frame::before,
.scope-frame::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid var(--accent-line);
  opacity: 0.55;
}
.scope-frame::before { top: -8px; left: -8px; border-right: 0; border-bottom: 0; }
.scope-frame::after { bottom: -8px; right: -8px; border-left: 0; border-top: 0; }

.shot {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.shot-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.shot-bar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.shot-bar i:nth-child(1) { background: #ef5f5f; }
.shot-bar i:nth-child(2) { background: #f1c453; }
.shot-bar i:nth-child(3) { background: #57c970; }
.shot img { display: block; width: 100%; height: auto; }

/* ---- Signal-trace divider: the ping pulse traveling the link ---- */
.signal-divider {
  display: block;
  width: 100%;
  max-width: var(--maxw);
  margin: 8px auto 0;
  padding: 0 var(--gutter);
  height: 52px;
  overflow: visible;
}
.signal-divider svg { width: 100%; height: 100%; overflow: visible; display: block; }
.sig-base { stroke: var(--border-strong); stroke-width: 2; fill: none; opacity: 0.5; }
.sig-pulse {
  stroke: var(--accent-line);
  stroke-width: 2.5;
  fill: none;
  filter: drop-shadow(0 0 6px var(--glow));
  stroke-dasharray: 60 460;
  animation: trace 4s linear infinite;
}
.sig-node { fill: var(--accent-line); }
@keyframes trace { to { stroke-dashoffset: -520; } }

/* ============================ Stats band =============================== */
.stats { padding: 30px 0; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--stats-bg);
  padding: 26px 28px;
}
.stat { text-align: center; position: relative; }
.stat + .stat::before {
  content: "";
  position: absolute;
  left: -9px; top: 14%;
  height: 72%;
  width: 1px;
  background: var(--border);
}
.stat .num {
  font-family: var(--mono);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.stat .num span { color: var(--accent-ink); }
.stat .lbl { margin-top: 6px; font-size: 13px; color: var(--subtext); }

/* ========================= Section scaffolding ========================= */
section { padding: 64px 0; position: relative; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head .eyebrow { margin-bottom: 14px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 34px); margin: 0 0 12px; letter-spacing: -0.02em; }
.section-head p { color: var(--subtext); font-size: 17px; margin: 0; }

/* ============================ Feature cards ============================ */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  position: relative;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s ease, box-shadow 0.25s ease;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px 160px at 50% -30%, rgba(34, 211, 238, 0.12), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.card:hover::after { opacity: 1; }
.card .ico {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
  margin-bottom: 18px;
  font-size: 21px;
}
.card h3 { margin: 0 0 9px; font-size: 18px; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--subtext); font-size: 15px; }
.card .tag {
  position: absolute;
  top: 18px; right: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ========================== How it works ============================== */
.how { background: linear-gradient(180deg, transparent, var(--how-bg)); }
.how-stage {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  padding: 30px 28px 24px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-md);
}
/* Animated topology: Server ◉ ╌╌pulse╌╌ ◉ Client */
.topo { width: 100%; height: auto; display: block; overflow: visible; }
.topo .wire { stroke: var(--border-strong); stroke-width: 2.5; fill: none; }
.topo .wave-base { stroke: rgba(34, 211, 238, 0.25); stroke-width: 3; fill: none; }
.topo .wave-pulse {
  stroke: var(--accent);
  stroke-width: 3.5;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 7px var(--glow));
  stroke-dasharray: 48 320;
  animation: topoTrace 3.4s linear infinite;
}
@keyframes topoTrace { to { stroke-dashoffset: -368; } }
.topo .endpoint { fill: var(--accent-deep); }
.topo .endpoint-core { fill: #ecfeff; }
.topo .halo { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0; transform-origin: center; }
.topo .halo.server { animation: halo 3.4s ease-out infinite; }
.topo .halo.client { animation: halo 3.4s ease-out infinite 1.7s; }
@keyframes halo {
  0% { opacity: 0.7; r: 22px; }
  60%, 100% { opacity: 0; r: 40px; }
}
.topo text {
  font-family: var(--mono);
  font-size: 13px;
  fill: var(--subtext);
  letter-spacing: 0.04em;
}
.topo .ip { fill: var(--accent-ink); }

.steps-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.flow-step {
  position: relative;
  padding: 22px 22px 22px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), var(--card-2));
}
.flow-step .idx {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
  display: block;
  margin-bottom: 10px;
}
.flow-step h3 { margin: 0 0 7px; font-size: 17px; }
.flow-step p { margin: 0; color: var(--subtext); font-size: 14.5px; }

/* ========================= Screenshot tour ============================ */
.theme-toggle {
  display: flex;
  width: max-content;
  gap: 4px;
  padding: 4px;
  margin: 0 auto 30px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.tt-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--subtext);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 8px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tt-btn:hover { color: var(--text); }
.tt-btn.is-active { background: var(--accent); color: var(--on-accent); }
#screenshots .section-head { margin-bottom: 22px; }

.tour { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.tour figure { margin: 0; }
/* An odd tab count leaves the final row holding one figure; centre it rather
   than letting it hang off the left edge. Only fires when the last item also
   starts a row, so an exactly-full grid is untouched. */
.tour figure:last-child:nth-child(3n + 1) { grid-column: 2; }
.tour .shot { box-shadow: var(--shadow-md); transition: transform 0.25s var(--ease), box-shadow 0.25s ease; }
.tour figure:hover .shot { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
/* Reserve the screenshot's box (all tour shots are 1920×1032) so the lazy
   image doesn't shift the grid as it loads — kills cumulative layout shift. */
.tour-img { display: block; width: 100%; height: auto; aspect-ratio: 1920 / 1032; }
.tour figcaption {
  margin-top: 14px;
  text-align: center;
  color: var(--subtext);
  font-size: 13.5px;
}
.tour figcaption b { color: var(--text); font-weight: 600; }

/* Zoomable screenshot button — strip native chrome, reuse .shot frame */
button.shot {
  appearance: none;
  font: inherit;
  color: inherit;
  text-align: left;
  padding: 0;
  width: 100%;
  cursor: zoom-in;
  position: relative;
}
button.shot:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button.shot::after {
  content: "⤢";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--chip-bg);
  border: 1px solid var(--border-strong);
  color: var(--accent-ink);
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
button.shot:hover::after, button.shot:focus-visible::after { opacity: 1; }

/* ====================== Sample report callout ========================= */
.sample {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 42px;
  padding: 30px 34px;
  position: relative;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.sample::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 200px at 0% 0%, rgba(34, 211, 238, 0.1), transparent 60%);
  pointer-events: none;
}
.sample-text { max-width: 560px; position: relative; }
.sample-text h3 { margin: 0 0 9px; font-size: 21px; letter-spacing: -0.01em; }
.sample-text p { margin: 0; color: var(--subtext); font-size: 15px; }
.sample-note { margin-top: 9px !important; font-family: var(--mono); font-size: 12px !important; color: var(--muted); }
.sample-cta { display: flex; gap: 12px; flex-wrap: wrap; position: relative; }

/* ============================ Trust strip ============================= */
.trust {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--band-bg);
}
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.trust .item { text-align: center; }
.trust .item .ico {
  width: 46px; height: 46px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 22px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.26);
}
.trust .item h3 { margin: 0 0 7px; font-size: 17px; }
.trust .item p { margin: 0; color: var(--subtext); font-size: 14.5px; }

/* =============================== FAQ ================================= */
.faq-list { max-width: 780px; margin: 0 auto; display: grid; gap: 12px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
/* cyan "+" that rotates to "×" when the item opens */
.faq-item summary::after {
  content: "+";
  flex: none;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  color: var(--accent-ink);
  transition: transform 0.25s var(--ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--link-hover); }
.faq-item[open] { border-color: var(--border-strong); }
.faq-a { padding: 0 20px 18px; }
.faq-a p { margin: 0; color: var(--subtext); font-size: 15px; }

/* ============================== Footer =============================== */
.site-footer {
  padding: 52px 0 34px;
  border-top: 1px solid var(--border);
  color: var(--subtext);
  font-size: 14px;
  background: var(--footer-bg);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 32px;
}
.footer-brand p { margin: 14px 0 0; max-width: 34ch; }
.footer-brand .brand { font-size: 18px; }
.footer-brand .mark { width: 40px; height: 40px; }
.footer-ver { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
/* The app version as a labelled pill (header, intro, footer): a tinted
   brand fill and outline, so it reads as a version tag, not stray text. */
.ver-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
/* Header: the wordmark with the version pill under it, as on the splash. */
.brand-stack { display: flex; flex-direction: column; align-items: center; gap: 3px; line-height: 1; }
.ver-badge-nav { font-size: 10.5px; padding: 1px 8px; letter-spacing: 0.03em; }
.footer-col { display: flex; flex-direction: column; gap: 9px; }
.footer-col h2 {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}
.footer-col a { color: var(--subtext); width: max-content; max-width: 100%; overflow-wrap: anywhere; }
.footer-col a:hover { color: var(--text); }
.footer-fine {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.footer-fine a { color: var(--subtext); }

/* ============================= Lightbox ============================== */
body.no-scroll { overflow: hidden; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 4vmin;
  background: var(--scrim);
  backdrop-filter: blur(5px);
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--img-shadow);
}
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--glass-bg);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.lightbox-close:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ===================== Scroll-reveal (JS only) ======================= */
/* Without JS the .js class is absent, so content is fully visible. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--reveal-dur) var(--ease), transform var(--reveal-dur) var(--ease);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
.js [data-reveal].in { opacity: 1; transform: none; }

/* ==================== Docs / Changelog pages ========================= */
.doc-main { padding: 44px 0 72px; }
.doc-layout { display: grid; grid-template-columns: 232px 1fr; gap: 52px; align-items: start; }
.doc-toc {
  position: sticky;
  top: 88px;
  font-size: 14px;
  border-left: 1px solid var(--border);
  padding-left: 18px;
}
.doc-toc strong {
  display: block;
  color: var(--accent-ink);
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.doc-toc a { display: block; color: var(--subtext); padding: 5px 0; font-family: var(--mono); font-size: 13px; }
.doc-toc a:hover { color: var(--link-hover); }
.doc-body { max-width: 770px; min-width: 0; }
.doc-body > h1 { font-size: clamp(30px, 4vw, 40px); margin: 0 0 10px; letter-spacing: -0.02em; }
.doc-lead { color: var(--subtext); font-size: 18px; margin: 0 0 38px; }
.doc-body h2 {
  font-size: 23px;
  margin: 48px 0 16px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 88px;
  letter-spacing: -0.01em;
}
.doc-body h2 .sec-no {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent-ink);
  margin-right: 10px;
}
.doc-body h3 { font-size: 17px; margin: 28px 0 8px; }
.doc-body p, .doc-body li { color: var(--ink-body); font-size: 15.5px; }
.doc-body ul, .doc-body ol { padding-left: 22px; }
.doc-body li { margin: 6px 0; }
.doc-body a { color: var(--link); }
.doc-body strong { color: var(--text); }
.doc-body code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--accent-ink);
}
.doc-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 14px 0;
}
.doc-body pre code { background: none; border: 0; padding: 0; color: var(--text); font-size: 13px; line-height: 1.7; }
.doc-fig {
  margin: 24px 0;
  text-align: center;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--fig-bg);
  color: var(--text);
}
.doc-fig img {
  max-width: 100%;
  border-radius: 10px;
}
.doc-fig figcaption { margin-top: 12px; color: var(--subtext); font-size: 13.5px; }
.callout {
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent-line);
  background: rgba(34, 211, 238, 0.06);
  border-radius: var(--radius-sm);
  padding: 15px 18px;
  margin: 18px 0;
}
.callout p { margin: 0; }
.doc-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14.5px;
}
.doc-body th, .doc-body td {
  text-align: left;
  padding: 11px 14px;
  border: 1px solid var(--border);
  vertical-align: top;
}
.doc-body th {
  background: var(--bg-soft);
  color: var(--text);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.03em;
}
.doc-body td { color: var(--ink-body); }
/* A table wider than a phone scrolls inside its own box, never the page. */
.table-scroll { overflow-x: auto; margin: 16px 0; }
.table-scroll table { margin: 0; }
.doc-body tbody tr:nth-child(even) td { background: var(--row-alt); }
.doc-foot-note { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--subtext); }
.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin: 16px 0;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.34);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
}

/* Changelog */
/* padding: 0 — the global `section { padding: 64px 0 }` would otherwise put
   ~220 px of empty band between consecutive releases. */
.cl-release { margin: 0 0 40px; padding: 0; }
.cl-release + .cl-release { border-top: 1px solid var(--border); padding-top: 34px; }
.cl-release h2 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-top: 0; padding-top: 0; margin-top: 0; }
.cl-release h2 .ver { font-family: var(--mono); color: var(--accent-ink); }
.cl-date { color: var(--subtext); font-size: 14px; font-weight: 400; font-family: var(--mono); }
.cl-tag { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; letter-spacing: 0.04em; font-family: var(--mono); text-transform: uppercase; }
.cl-added    { background: rgba(87, 201, 112, 0.14); border: 1px solid rgba(87, 201, 112, 0.4); color: var(--ok-ink); }
.cl-changed  { background: rgba(241, 196, 83, 0.14); border: 1px solid rgba(241, 196, 83, 0.4); color: var(--warn-ink); }
.cl-fixed    { background: rgba(56, 189, 248, 0.14); border: 1px solid rgba(56, 189, 248, 0.4); color: var(--info-ink); }
.cl-security { background: rgba(239, 95, 95, 0.14);  border: 1px solid rgba(239, 95, 95, 0.4);  color: var(--bad-ink); }
.cl-group { margin: 16px 0; }
.cl-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--subtext); margin: 0 0 8px; font-family: var(--mono); }

/* =============================== 404 ================================= */
.notfound { text-align: center; padding: 110px 0; }
.notfound .glyph { font-family: var(--mono); font-size: clamp(72px, 14vw, 128px); margin: 0; color: var(--accent-ink); letter-spacing: -0.04em; line-height: 1; text-shadow: var(--accent-text-glow); }
.notfound p { color: var(--subtext); font-size: 18px; margin: 12px 0 30px; }

/* ========================= Inline text links ============================ */
.card-link { font-weight: 600; }
.card-link::after { content: " \2192"; }

/* ===================== Verdict chips (shared) =========================== */
.vchip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}
.v-pass   { color: var(--ok-ink);   background: rgba(87, 201, 112, 0.14); border-color: rgba(87, 201, 112, 0.45); }
.v-fail   { color: var(--bad-ink);  background: rgba(239, 95, 95, 0.14);  border-color: rgba(239, 95, 95, 0.45); }
.v-repeat { color: var(--warn-ink); background: rgba(241, 196, 83, 0.16); border-color: rgba(241, 196, 83, 0.5); }
.v-incomplete { color: var(--idle-ink); background: rgba(148, 163, 184, 0.14); border-color: rgba(148, 163, 184, 0.5); }

/* ===================== Case-matrix demo (home) ========================== */
/* A plot panel that follows the page theme. Cell
   colours are FIXED best→worst scales per metric (never rescaled to the
   data), and every cell also prints its value, so colour is never the only
   carrier of meaning. */
.matrix-panel {
  max-width: 900px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  padding: 24px 26px 22px;
  box-shadow: var(--shadow-md);
}
.mx-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.mx-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.mx-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--subtext);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.mx-btn:hover { color: var(--text); }
.mx-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.mx-run { font-size: 13.5px; color: var(--subtext); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mx-run b { color: var(--text); font-weight: 600; }

.mx-scroll { overflow-x: auto; }
.mx-table {
  width: 100%;
  min-width: 300px;
  border-collapse: separate;
  border-spacing: 5px;
  table-layout: fixed;
  font-family: var(--mono);
}
.mx-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--subtext);
  padding: 4px 2px;
  text-align: center;
  letter-spacing: 0.02em;
}
.mx-table thead th:first-child { width: 96px; text-align: left; font-weight: 400; font-size: 11px; color: var(--muted); }
.mx-table tbody th { text-align: left; }
.mx-table td { padding: 0; }
.mx-cell {
  appearance: none;
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 6px 2px;
  border: 1px solid transparent;
  border-radius: 9px;
  font: 700 13px/1.2 var(--mono);
  color: #0b1220;
  background: #334155;
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.mx-cell:hover, .mx-cell.is-sel { transform: translateY(-1px); box-shadow: 0 0 0 2px var(--cell-ring); }
.mx-cell:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.mx-cell .mk { font-weight: 400; margin-left: 2px; }
/* Fixed scale: s0 best → s4 worst. Ink #0b1220 clears 6.5:1 on every step. */
.mx-cell.s0 { background: #4ade80; }
.mx-cell.s1 { background: #a3e635; }
.mx-cell.s2 { background: #facc15; }
.mx-cell.s3 { background: #fb923c; }
.mx-cell.s4 { background: #f87171; }
.mx-cell.sn { background: #94a3b8; }

.mx-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 16px 2px 0;
  font-size: 12.5px;
  color: var(--subtext);
}
.mx-legend .sw { display: inline-flex; align-items: center; gap: 6px; }
.mx-legend .sw i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.mx-legend .lg-title { font-family: var(--mono); color: var(--text); font-weight: 600; }
.mx-note { margin: 10px 2px 0; font-size: 12.5px; color: var(--muted); }
.mx-detail {
  margin: 16px 0 0;
  padding: 13px 16px;
  min-height: 3.3em;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-size: 14px;
  color: var(--ink-body);
}
.mx-detail b { color: var(--text); }
.matrix-foot { text-align: center; margin: 22px 0 0; color: var(--subtext); font-size: 15px; }

/* ===================== Cable validation page ============================ */
.v-hero-lead { max-width: 62ch; }
.crit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 18px 0; }
.crit {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), var(--card-2));
  padding: 18px 18px 16px;
}
.crit .no { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--accent-ink); }
.crit h3 { margin: 4px 0 6px; font-size: 16.5px; }
.doc-body .crit p { margin: 0; font-size: 14.5px; }
.crit .def { display: block; margin-top: 9px; font-family: var(--mono); font-size: 12px; color: var(--muted); }

.verdict-list { display: grid; gap: 10px; margin: 18px 0; }
.verdict-row {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
}
.verdict-row .vchip { justify-self: start; margin-top: 2px; }
.doc-body .verdict-row p { margin: 0; font-size: 15px; }

/* Card-count flow: Client card → cable → Server card → iperf3 */
.flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 8px;
  margin: 18px 0 6px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  color: var(--text);
}
.flow .node {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 12px 12px 10px;
  text-align: center;
}
.flow .node b { display: block; font-size: 13.5px; color: var(--text); }
.flow .node span { display: block; font-family: var(--mono); font-size: 13px; color: var(--accent-ink); margin-top: 4px; }
.flow .node small { display: block; font-size: 12px; color: var(--subtext); margin-top: 4px; }
.flow .link { align-self: center; font-family: var(--mono); font-size: 12px; color: var(--subtext); text-align: center; }
.flow .link::before { content: "──▶"; display: block; color: var(--accent-ink); letter-spacing: -0.1em; }

.lesson {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), var(--card-2));
  padding: 20px 22px 8px;
  margin: 18px 0;
}
.lesson .tagline { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-ink); }
.doc-body .lesson h3 { margin: 6px 0 8px; }
.lesson dl { display: grid; grid-template-columns: 112px 1fr; gap: 6px 14px; margin: 12px 0 14px; font-size: 15px; }
.lesson dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--subtext); padding-top: 3px; }
.lesson dd { margin: 0; color: var(--ink-body); }

.v-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 8px; }

/* ======================= First-visit brand intro ===================== */
/* The overlay is in every page; the head script adds html.intro on the first
   page of a browser session (never under reduced motion, never without JS).
   It plays on CSS alone from first paint and fades itself out at
   --intro-total, so it never waits for app.js and can never leave the page
   covered. position:fixed, so nothing in the page moves. */
.intro-overlay { display: none; }
html.intro .intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--bg);
  cursor: pointer;
  transition: opacity 0.35s ease;
  animation: intro-exit 0.4s ease var(--intro-total) forwards;
}
@keyframes intro-exit { to { opacity: 0; visibility: hidden; pointer-events: none; } }
/* The navy tile on a dark page, the white one on a light page. */
.intro-mark-light { display: none; }
:root[data-theme="light"] .intro-mark-light { display: block; }
:root[data-theme="light"] .intro-mark-dark { display: none; }
.intro-overlay.leaving { opacity: 0; pointer-events: none; }
.intro-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: transform 0.35s ease;
}
.intro-overlay.leaving .intro-inner { transform: translateY(-18px) scale(0.97); }

/* Logo V6 "Pulse draw": the dots pop in, the pulse draws from dot to dot,
   the wordmark rises, the soft glow brightens and settles, the version line
   fades in. Every start and length is a --b-* custom property on the
   overlay, written from the app splash's splash-beats.json. */
.intro-mark { width: min(176px, 44vw); height: auto; overflow: visible; }
/* The tile fades in on the first dot's beat, as in the app's splash. */
.intro-mark .intro-tile { animation: intro-fade var(--b-dot_left-len) ease-out var(--b-dot_left-at) both; }
.intro-mark .intro-dot { transform-box: fill-box; transform-origin: center; }
.intro-mark .intro-dot-l { animation: intro-pop var(--b-dot_left-len) cubic-bezier(0.34, 1.56, 0.64, 1) var(--b-dot_left-at) both; }
.intro-mark .intro-dot-r { animation: intro-pop var(--b-dot_right-len) cubic-bezier(0.34, 1.56, 0.64, 1) var(--b-dot_right-at) both; }
.intro-mark .intro-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: intro-draw var(--b-pulse-len) cubic-bezier(0.65, 0, 0.35, 1) var(--b-pulse-at) forwards;
}
/* The mark's shadow lands as the pulse finishes drawing. */
.intro-mark .intro-shadow { animation: intro-shadow var(--b-pulse-len) ease-out var(--b-pulse-at) both; }
.intro-mark .intro-halo { animation: intro-glow var(--b-glow-len) ease-out var(--b-glow-at) both; }
.intro-word {
  margin: 0;
  font-size: clamp(30px, 6vw, 40px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  animation: intro-rise var(--b-wordmark-len) ease-out var(--b-wordmark-at) both;
}
.intro-word .word-ping { color: var(--text); }
.intro-word .word-pair { color: var(--accent-ink); }
.intro-ver {
  margin: 4px 0 0;
  animation: intro-fade var(--b-version-len) ease-out var(--b-version-at) both;
}
.intro-ver .ver-badge { font-size: 14px; padding: 4px 13px; }

@keyframes intro-pop { from { transform: scale(0); } to { transform: none; } }
@keyframes intro-draw { to { stroke-dashoffset: 0; } }
/* The tile's glow brightens past its resting level, then settles. */
@keyframes intro-glow {
  0%   { opacity: 0; filter: brightness(1); }
  40%  { opacity: 1; filter: brightness(1.6); }
  100% { opacity: 1; filter: brightness(1); }
}
@keyframes intro-shadow { 0%, 60% { opacity: 0; } 100% { opacity: 1; } }
@keyframes intro-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes intro-fade { from { opacity: 0; } to { opacity: 1; } }

/* ========================= Reduced motion =========================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  /* The head script never starts the intro here; this is the belt to that
     braces, should the preference change mid-session. */
  html.intro .intro-overlay, .intro-overlay { display: none; }
}

/* ========================= Hero — the proof ========================== */
/* The hero shows what you walk away with: a report's verdict card, laid
   over the app that produced it. The card is HTML (not a picture) so it is
   crisp, themed and readable by search engines. */
.hero-proof { display: grid; align-items: start; }
.hero-proof > * { grid-area: 1 / 1; }
.hero-proof .shot { width: 88%; justify-self: end; }
.hero-proof .shot img { aspect-ratio: 1920 / 1032; }
.report-card {
  position: relative;
  align-self: end;
  width: min(360px, 66%);
  margin-top: 200px;
  margin-left: -18px;
  padding: 18px 20px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
}
.rc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
}
.rc-head .brand { font-size: 13.5px; gap: 7px; }
.rc-head .mark-flat { width: 30px; height: 14px; }
.rc-kind { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.rc-verdict { display: flex; align-items: center; gap: 14px; margin: 14px 0 12px; }
.rc-verdict .vchip { font-size: 17px; padding: 6px 16px; }
.rc-verdict b { display: block; font-family: var(--mono); font-size: 14px; color: var(--text); }
.rc-verdict span:not(.vchip) { display: block; color: var(--subtext); font-size: 12.5px; }
.rc-crit { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rc-crit li { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: baseline; color: var(--ink-body); }
.rc-crit li::before { content: "\2713"; color: var(--ok-ink); font-weight: 700; }
.rc-crit em { font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--text); }
.rc-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin: 14px 0 12px; }
.rc-grid i { height: 9px; border-radius: 2px; background: #4ade80; opacity: 0.85; }
.rc-sign {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-strong);
  font-size: 12px;
  color: var(--muted);
}
.rc-sign b { color: var(--text); font-weight: 600; }
.hero-note { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); text-align: right; }

/* =================== Section heads, left-aligned ===================== */
.section-head.left { text-align: left; margin-left: 0; }

/* ===================== What a PASS means (home) ======================== */
.proof-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.proof-grid .crit p { margin: 0; color: var(--subtext); font-size: 14.5px; }
.proof-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 22px 0 0;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-left: 3px solid #facc15;
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink-body);
  font-size: 15px;
}
.proof-foot p { margin: 0; flex: 1 1 360px; }

/* ===================== Platform: one product, three doors =============== */
.plat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.plat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 24px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), var(--card-2));
}
.plat.is-live { border-color: var(--border-strong); }
.plat h3 { margin: 0; font-size: 18px; }
.plat p { margin: 0; color: var(--subtext); font-size: 15px; }
.plat ul { margin: 2px 0 0; padding-left: 18px; color: var(--subtext); font-size: 14.5px; }
.plat ul li { margin: 3px 0; }
.plat .plat-cta { margin-top: auto; padding-top: 10px; }
.status {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid;
}
.status.live { color: var(--ok-ink); background: rgba(87, 201, 112, 0.14); border-color: rgba(87, 201, 112, 0.45); }
.status.soon { color: var(--idle-ink); background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.45); }
.plat-note { margin: 22px auto 0; max-width: 70ch; text-align: center; color: var(--subtext); font-size: 14.5px; }

/* =========================== Closing CTA band ========================== */
.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 34px 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(520px 220px at 100% 0%, rgba(34, 211, 238, 0.14), transparent 65%),
    linear-gradient(180deg, var(--card), var(--card-2));
}
.cta-band h2 { margin: 0 0 6px; font-size: clamp(22px, 2.6vw, 28px); letter-spacing: -0.02em; }
.cta-band p { margin: 0; color: var(--subtext); }
.cta-band .hero-cta { flex: none; }

/* ============================ Download page ============================ */
.page-top { padding: 54px 0 10px; }
.page-top h1 { font-size: clamp(32px, 4.4vw, 46px); margin: 12px 0 10px; letter-spacing: -0.03em; line-height: 1.08; }
.page-top .lead { margin: 0; max-width: 62ch; color: var(--subtext); font-size: 18px; }
.release-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--subtext);
}
.release-line b { color: var(--text); font-weight: 600; }

.dl-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; margin-top: 30px; }
.dl-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 26px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--card), var(--card-2));
  min-width: 0;
}
.dl-option.is-primary { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.dl-option h2 { margin: 0; font-size: 21px; letter-spacing: -0.01em; padding-right: 120px; }
.dl-option p { margin: 0; color: var(--subtext); font-size: 15px; }
.dl-option .file { font-family: var(--mono); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.dl-option .btn { align-self: flex-start; }
.dl-option .status { position: absolute; top: 24px; right: 22px; }
.hash { margin-top: 4px; }
.hash-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.hash-row { display: flex; gap: 8px; align-items: stretch; }
.hash code {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-box-bg);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  overflow-wrap: anywhere;
}
.copy-btn {
  appearance: none;
  flex: none;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--ghost-bg);
  color: var(--subtext);
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent-line); }
.copy-btn.done { color: var(--ok-ink); border-color: rgba(87, 201, 112, 0.6); }

.dl-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel {
  padding: 24px 24px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  min-width: 0;
}
.panel h2 { margin: 0 0 12px; font-size: 18px; scroll-margin-top: 90px; }
.panel ul, .panel ol { margin: 0; padding-left: 20px; color: var(--ink-body); font-size: 15px; }
.panel li { margin: 6px 0; }
.panel p { color: var(--ink-body); font-size: 15px; margin: 0 0 10px; }
.panel pre {
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  overflow-x: auto;
}
.panel pre code { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.panel :not(pre) > code {
  font-family: var(--mono);
  font-size: 13px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--accent-ink);
}

.store-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.store-badge {
  display: inline-flex;
  flex-direction: column;
  min-width: 170px;
  padding: 10px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  color: var(--subtext);
  font-size: 12px;
  line-height: 1.3;
}
.store-badge b { font-size: 16px; color: var(--text); font-weight: 600; }
.store-badge-live { border-style: solid; text-decoration: none; }
.store-badge-live:hover { border-color: var(--accent); }

/* ============================ Legal pages ============================= */
.legal-meta { font-family: var(--mono); font-size: 13px; color: var(--muted); margin: 0 0 30px; }
.legal-card {
  margin: 22px 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
}
.doc-body .legal-card p { margin: 0; }
.doc-body .legal-card p + p { margin-top: 8px; }

/* =========================== Responsive ============================= */
@media (max-width: 1060px) {
  .nav { gap: 22px; }
  .nav-links { gap: 20px; }
  .nav-portal .soon { display: none; }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .doc-layout { grid-template-columns: 1fr; gap: 22px; }
  .doc-toc { position: static; border-left: 0; border-bottom: 1px solid var(--border); padding: 0 0 16px; }
  .doc-toc a { display: inline-block; margin-right: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 22px 18px; }
  .stat:nth-child(3)::before, .stat:nth-child(2)::before { display: none; }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
  .plat-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero { padding: 46px 0 18px; }
  .features, .tour, .trust-grid, .steps-flow, .dl-grid, .dl-columns { grid-template-columns: 1fr; }
  /* One column: the 3-column "centre a lone last shot" rule above would
     otherwise create an implicit 2nd column and squeeze every shot. */
  .tour figure:last-child:nth-child(3n + 1) { grid-column: auto; }
  .crit-grid { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow .link::before { content: "\25BC"; }
  .nav-portal { display: none; }
  /* Phone header: brand, theme, Download and the menu button on one row;
     the links open as a panel under it. Without JS they wrap below. */
  .nav { flex-wrap: wrap; height: auto; min-height: 62px; padding-top: 10px; padding-bottom: 10px; row-gap: 6px; }
  .nav-links { order: 3; width: 100%; gap: 6px 20px; flex-wrap: wrap; }
  .js .menu-btn { display: grid; }
  .js .nav-links { display: none; }
  .js .site-header.menu-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 0 4px;
    border-top: 1px solid var(--border);
  }
  .js .site-header.menu-open .nav-links a { padding: 12px 2px; font-size: 16px; }
  .js .site-header.menu-open .nav-links a::after { display: none; }
  .js .site-header.menu-open { background: var(--header-bg-scrolled); }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .brand { font-size: 17px; }
  .nav { gap: 10px; }
  .site-header .brand { gap: 8px; }
  .site-header .mark { width: 40px; height: 19px; }
  .nav-actions { gap: 6px; }
  .pill { font-size: 11px; letter-spacing: 0.06em; gap: 2px 6px; padding: 6px 12px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .proof-grid { grid-template-columns: 1fr; }
  .matrix-panel { padding: 16px 10px 14px; }
  .mx-table { border-spacing: 3px; }
  .mx-table thead th:first-child { width: 50px; }
  .mx-cell { font-size: 11px; min-height: 42px; padding: 5px 1px; }
  /* "REPEAT" + its retry mark is wider than a phone cell: the mark takes
     its own line rather than spilling over the cell's edge. */
  .mx-cell .mk { display: block; margin-left: 0; }
  .verdict-row { grid-template-columns: 1fr; gap: 8px; }
  .doc-body th, .doc-body td { padding: 9px 10px; }
  .lesson dl { grid-template-columns: 1fr; gap: 2px; }
  .lesson dd { margin-bottom: 8px; }
  .sample { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .report-card { width: 92%; margin-top: 120px; margin-left: 0; }
  .hero-proof .shot { width: 100%; }
  .cta-band { padding: 26px 22px; }
  .hash-row { flex-direction: column; }
  .copy-btn { padding: 9px 12px; align-self: flex-start; }
  .dl-option h2 { padding-right: 0; }
  .dl-option .status { position: static; }
}

/* =============== Run summary (/r — a report's QR code lands here) ======= */
.rsum { max-width: 760px; padding-top: 56px; padding-bottom: 80px; }
.rsum h1 { margin: 0 0 10px; font-size: clamp(30px, 5vw, 40px); letter-spacing: -0.02em; }
.rsum h2 { margin: 0 0 10px; font-size: 16px; letter-spacing: -0.01em; }
.rsum-lede { color: var(--subtext); margin: 0 0 28px; }
.rsum-note { color: var(--subtext); font-size: 14px; margin: 14px 0 0; padding: 8px 12px; border-left: 3px solid var(--border); }
.rsum-card, .rsum-check, .rsum-empty {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.rsum-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.rsum-head .vchip { font-size: 18px; padding: 6px 18px; }
.rsum-kind { color: var(--subtext); font-size: 14px; }
.rsum-facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0 0 18px; }
.rsum-facts dt { color: var(--muted); font-size: 14px; }
.rsum-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.rsum-points { margin-bottom: 18px; }
.rsum-points table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rsum-points th, .rsum-points td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); }
.rsum-points th { color: var(--muted); font-weight: 600; }
.rsum-more { color: var(--subtext); font-size: 14px; margin: 8px 0 0; }
.rsum-sha { font-family: var(--mono); font-size: 14px; margin: 0; overflow-wrap: anywhere; }
.rsum-check p, .rsum-empty p { color: var(--subtext); }
.rsum-drop {
  display: block;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.rsum-drop:hover, .rsum-drop.over { border-color: var(--accent-line); background: rgba(34, 211, 238, 0.06); }
.rsum-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rsum-drop:focus-within { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.rsum-result { margin: 14px 0 0; font-weight: 600; min-height: 1.4em; }
.rsum-result.ok { color: var(--ok-ink); }
.rsum-result.bad { color: var(--bad-ink); }
@media (max-width: 560px) {
  .rsum-facts { grid-template-columns: 1fr; gap: 2px; }
  .rsum-facts dd { margin-bottom: 8px; }
}

/* ===================== Light theme — rule overrides ===================== */
/* Last in the file on purpose: these must win over the base rules above
   (the token swap itself lives at the top, beside the dark tokens). */
[data-theme="light"] :is(.stats-grid, .card, .flow-step, .faq-item, .sample, .crit,
  .verdict-row, .lesson, .plat, .dl-option, .legal-card) {
  box-shadow: 0 1px 2px rgba(15, 30, 54, 0.05);
}
