/* Earshot landing + docs site
   Design: dark "signal room" aesthetic. Privacy is the emotional core.
   Three typefaces: Fraunces (display), Spline Sans (body), JetBrains Mono (code/labels).
   60-30-10 color: deep ink dominant, cyan secondary, amber accent.
   Zero build step. Hand-styled syntax via highlight.js theme override below. */

:root {
  /* Signal palette: deep ink base, a single warm-amber "live signal" accent,
     a cool cyan for the on-device / secure register. All HSL custom properties. */
  --ink-900: hsl(222 38% 6%);
  --ink-850: hsl(222 32% 8%);
  --ink-800: hsl(221 28% 11%);
  --ink-750: hsl(221 24% 14%);
  --ink-700: hsl(220 20% 18%);
  --line: hsl(220 18% 24%);
  --line-soft: hsl(220 16% 19%);

  /* Foregrounds tuned for WCAG AA on the ink base.
     fg ~16:1, fg-dim ~7.4:1, fg-faint ~4.6:1 against ink-900. */
  --fg: hsl(210 32% 95%);
  --fg-dim: hsl(214 20% 76%);
  --fg-faint: hsl(216 17% 63%);

  --amber: hsl(36 96% 62%);
  --amber-deep: hsl(28 92% 54%);
  --cyan: hsl(176 62% 62%);
  --cyan-deep: hsl(184 58% 44%);
  --violet: hsl(258 78% 78%);

  --accent: var(--amber);
  --secure: var(--cyan);

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1180px;

  /* 8px spacing scale */
  --s-1: 8px;
  --s-2: 12px;
  --s-3: 16px;
  --s-4: 24px;
  --s-5: 32px;
  --s-6: 48px;
  --s-7: 64px;
  --s-8: 96px;

  --shadow-lg: 0 30px 60px -28px hsl(222 60% 2% / 0.85);
  --shadow-md: 0 14px 34px -20px hsl(222 60% 2% / 0.8);
  --shadow-glow: 0 0 0 1px hsl(36 96% 62% / 0.18), 0 18px 48px -20px hsl(36 96% 50% / 0.28);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Spline Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --z-sticky: 200;
}

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

html { scroll-behavior: smooth; overflow-x: hidden; }

@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;
  }
}

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  font-variant-numeric: tabular-nums;
}

/* Atmospheric background: a faint signal grid + two soft light wells. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(900px 520px at 84% -10%, hsl(36 90% 50% / 0.11), transparent 60%),
    radial-gradient(840px 640px at 6% -2%, hsl(184 70% 45% / 0.09), transparent 58%),
    radial-gradient(700px 700px at 50% 116%, hsl(184 70% 40% / 0.06), transparent 60%),
    var(--ink-900);
}

/* Signal grid: a faint coordinate lattice, masked so it fades into the dark. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(hsl(210 30% 94% / 0.024) 1px, transparent 1px),
    linear-gradient(90deg, hsl(210 30% 94% / 0.024) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(125% 95% at 50% 0%, #000 32%, transparent 82%);
  -webkit-mask-image: radial-gradient(125% 95% at 50% 0%, #000 32%, transparent 82%);
}

/* Tasteful film grain over the whole page, kept very low so it reads as texture. */
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }

::selection {
  background: hsl(36 96% 60% / 0.28);
  color: #fff;
}

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

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 999;
  background: var(--amber);
  color: var(--ink-900);
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: top 0.16s ease-out;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: hsl(222 38% 6% / 0.72);
  border-bottom: 1px solid var(--line-soft);
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  font-size: 17px;
  color: var(--fg);
}

.brand .mark {
  display: inline-flex;
  width: 26px;
  height: 26px;
}

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}

.nav-links a {
  position: relative;
  font-family: var(--font-mono);
  font-size: 13.5px;
  text-decoration: none;
  color: var(--fg-dim);
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 0.16s, background 0.16s;
}
.nav-links a:hover { color: var(--fg); background: hsl(210 30% 94% / 0.05); }
/* Active section indicator: color plus an underline tick (not color alone). */
.nav-links a.active { color: var(--fg); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--amber);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-900);
  background: var(--fg);
  padding: 9px 15px;
  border-radius: 9px;
  transition: transform 0.16s ease-out, background 0.16s;
}
.nav-cta:hover { background: #fff; transform: translateY(-1px); }
.nav-cta svg { width: 16px; height: 16px; }

@media (max-width: 760px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease-out, background 0.16s, border-color 0.16s;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: linear-gradient(180deg, var(--amber), var(--amber-deep));
  color: hsl(28 60% 10%);
  box-shadow: 0 1px 0 hsl(40 100% 80% / 0.4) inset, var(--shadow-md);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost {
  background: hsl(210 30% 94% / 0.04);
  color: var(--fg);
  border-color: var(--line);
}
.btn-ghost:hover { background: hsl(210 30% 94% / 0.08); transform: translateY(-2px); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100dvh - 64px);
  padding-top: clamp(48px, 7vw, 88px);
  padding-bottom: clamp(48px, 7vw, 88px);
}
.hero .hero-grid { width: 100%; }
@media (max-width: 940px) {
  .hero { min-height: 0; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secure);
  background: hsl(176 64% 56% / 0.08);
  border: 1px solid hsl(176 64% 56% / 0.24);
  padding: 7px 13px;
  border-radius: 999px;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--secure);
  box-shadow: 0 0 0 0 hsl(176 64% 56% / 0.6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 hsl(176 64% 56% / 0.55); }
  70% { box-shadow: 0 0 0 9px hsl(176 64% 56% / 0); }
  100% { box-shadow: 0 0 0 0 hsl(176 64% 56% / 0); }
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 460;
  font-optical-sizing: auto;
  font-size: clamp(2.5rem, 6.2vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 22px 0 0;
  max-width: 16ch;
  text-wrap: balance;
}
.hero h1 .accent {
  font-style: italic;
  color: var(--amber);
}

.hero-lede {
  margin: 24px 0 0;
  max-width: 56ch;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.55;
  color: var(--fg-dim);
  text-wrap: pretty;
}
.hero-lede strong { color: var(--fg); font-weight: 600; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* Device panel: the on-device privacy visualization. The screenshot moment.
   A stylized capture card: live waveform with a sweeping playhead, a transcript
   filling in, and a privacy ledger where the uplink reads a literal zero. */
.device {
  position: relative;
  background:
    linear-gradient(180deg, hsl(221 28% 13%), hsl(222 34% 8.5%));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}
/* A faint amber well behind the card, so the panel feels lit from within. */
.device-glow {
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: 22px;
  background: radial-gradient(120% 80% at 80% -10%, hsl(36 96% 56% / 0.16), transparent 62%);
  pointer-events: none;
}
.device-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
}
.device-id { display: inline-flex; align-items: center; gap: 9px; }
.rec-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px 1px hsl(36 96% 60% / 0.7);
  animation: recPulse 1.8s var(--ease-out) infinite;
}
@keyframes recPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.device-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--secure);
}
.device-chip svg { width: 14px; height: 14px; }

/* Waveform: bars are injected by JS to form a believable amplitude envelope.
   Each bar scales on its own phase; a playhead sweeps across to read as capture. */
.wave {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 76px;
  margin: 22px 2px 16px;
  overflow: hidden;
  border-radius: 8px;
}
.wave .bar {
  flex: 1;
  min-width: 2px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--amber), var(--amber-deep));
  opacity: 0.9;
  transform: scaleY(var(--amp, 0.4));
  transform-origin: center;
  animation: waveBeat var(--dur, 1.5s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes waveBeat {
  0%, 100% { transform: scaleY(calc(var(--amp, 0.4) * 0.42)); }
  50% { transform: scaleY(var(--amp, 0.4)); }
}
.wave-playhead {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  left: 0;
  background: linear-gradient(180deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 12px 1px hsl(176 64% 56% / 0.6);
  animation: sweep 4.2s linear infinite;
}
@keyframes sweep {
  0% { left: 0; opacity: 0; }
  6% { opacity: 1; }
  94% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
/* Pause animation when the panel is offscreen (toggled by IntersectionObserver). */
.device.paused .bar,
.device.paused .wave-playhead,
.device.paused .rec-dot { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .wave .bar { animation: none; }
  .wave-playhead { animation: none; opacity: 0.5; left: 50%; }
  .rec-dot { animation: none; }
  .eyebrow .dot { animation: none; }
}

.device-transcript {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg-dim);
  background: hsl(222 40% 5% / 0.62);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 14px 16px;
}
.device-transcript .line-done { color: var(--fg); }
.device-transcript .line-live { color: var(--fg-dim); }
.device-transcript .cursor {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  vertical-align: text-bottom;
  background: var(--amber);
  margin-left: 2px;
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.device-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-faint);
}
.device-meta .net {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--secure);
  font-variant-numeric: tabular-nums;
}
.device-meta .net svg { width: 13px; height: 13px; opacity: 0.85; }
.device-meta .net-num { font-weight: 600; color: var(--fg); }

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
}
.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-dim);
}
.trust-row svg { width: 16px; height: 16px; color: var(--secure); }

/* ---------- Section scaffolding ---------- */
section { position: relative; }
.section {
  padding-block: clamp(64px, 9vw, 110px);
  border-top: 1px solid var(--line-soft);
}

.section-head { max-width: 60ch; margin-bottom: 44px; }
.kicker {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 14px;
}
.section h2 {
  font-family: var(--font-display);
  font-weight: 440;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
.section .sub {
  margin: 18px 0 0;
  color: var(--fg-dim);
  font-size: 1.08rem;
  max-width: 62ch;
  text-wrap: pretty;
}

/* ---------- How it works: pipeline + table ---------- */
.pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 40px;
}
@media (max-width: 880px) { .pipeline { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .pipeline { grid-template-columns: 1fr; } }

.stage {
  position: relative;
  background: var(--ink-800);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px;
}
.stage .num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-faint);
}
.stage .stage-icon {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: hsl(36 96% 60% / 0.1);
  color: var(--amber);
  margin: 10px 0 12px;
}
.stage .stage-icon svg { width: 18px; height: 18px; }
.stage h3 {
  font-size: 1rem;
  margin: 0 0 5px;
  font-weight: 600;
}
.stage p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--fg-dim);
  line-height: 1.5;
}

.platform-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-850);
  box-shadow: var(--shadow-md);
}
table.platforms {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  font-size: 0.95rem;
}
table.platforms caption { display: none; }
table.platforms th,
table.platforms td {
  text-align: left;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
table.platforms thead th {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-faint);
  font-weight: 600;
  background: hsl(222 30% 9%);
}
table.platforms thead th.col-ios { color: var(--violet); }
table.platforms thead th.col-android { color: var(--secure); }
table.platforms tbody th {
  font-weight: 600;
  color: var(--fg);
  font-size: 0.95rem;
  width: 30%;
}
table.platforms td { color: var(--fg-dim); }
table.platforms td code,
table.platforms th code { font-size: 0.85em; }
table.platforms tbody tr:last-child th,
table.platforms tbody tr:last-child td { border-bottom: none; }
table.platforms tbody tr:hover td,
table.platforms tbody tr:hover th { background: hsl(210 30% 94% / 0.018); }

code {
  font-family: var(--font-mono);
  background: hsl(210 30% 94% / 0.07);
  padding: 0.12em 0.4em;
  border-radius: 5px;
  font-size: 0.86em;
  color: var(--cyan);
}

.contract-note {
  margin-top: 26px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: hsl(258 70% 72% / 0.06);
  border: 1px solid hsl(258 70% 72% / 0.22);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--fg-dim);
  font-size: 0.96rem;
  line-height: 1.6;
}
.contract-note svg { width: 20px; height: 20px; color: var(--violet); flex: none; margin-top: 2px; }
.contract-note strong { color: var(--fg); }

/* ---------- Quickstart tabs ---------- */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  background: var(--ink-800);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  margin-bottom: 22px;
}
.tab {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg-dim);
  background: transparent;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.16s, background 0.16s;
}
.tab svg { width: 16px; height: 16px; }
.tab[aria-selected="true"] {
  color: var(--ink-900);
  background: var(--fg);
}
.tab:not([aria-selected="true"]):hover { color: var(--fg); }

.tabpanel[hidden] { display: none; }
.tabpanel .step-lead {
  color: var(--fg-dim);
  margin: 0 0 16px;
  font-size: 0.98rem;
}
.tabpanel .step-lead a { color: var(--cyan); }

/* ---------- Code blocks ---------- */
.codeblock {
  position: relative;
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.code-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: hsl(222 30% 9%);
}
.code-dots { display: flex; gap: 6px; }
.code-dots i {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--ink-700);
}
.code-file {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-faint);
  letter-spacing: 0.02em;
}
.copy-btn {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-dim);
  background: hsl(210 30% 94% / 0.05);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 6px 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 0.16s, background 0.16s, border-color 0.16s;
}
.copy-btn:hover { color: var(--fg); background: hsl(210 30% 94% / 0.09); }
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn.copied { color: var(--secure); border-color: hsl(176 64% 56% / 0.4); }

.codeblock pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  tab-size: 2;
}
.codeblock pre code {
  background: none;
  padding: 0;
  color: var(--fg);
  font-size: inherit;
}

/* highlight.js theme override -> tuned to the signal palette */
.hljs { color: var(--fg); background: transparent; }
.hljs-comment, .hljs-quote { color: var(--fg-faint); font-style: italic; }
.hljs-keyword, .hljs-built_in, .hljs-type { color: var(--violet); }
.hljs-string, .hljs-meta-string { color: hsl(36 90% 70%); }
.hljs-number, .hljs-literal { color: var(--cyan); }
.hljs-title, .hljs-title.function_, .hljs-function .hljs-title { color: var(--amber); }
.hljs-params { color: var(--fg-dim); }
.hljs-attr, .hljs-attribute, .hljs-property { color: var(--secure); }
.hljs-meta { color: var(--fg-faint); }
.hljs-class .hljs-title, .hljs-title.class_ { color: hsl(36 90% 72%); }

.code-stack { display: grid; gap: 20px; }

/* ---------- API surface ---------- */
.api-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) { .api-grid { grid-template-columns: 1fr; } }

.api-list { display: grid; gap: 2px; }
.api-method {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 15px 4px;
  border-bottom: 1px solid var(--line-soft);
}
.api-method:last-child { border-bottom: none; }
.api-method .sig {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--amber);
  white-space: nowrap;
}
.api-method .sig .kw { color: var(--violet); }
.api-method .desc { color: var(--fg-dim); font-size: 0.95rem; line-height: 1.5; }
@media (max-width: 560px) {
  .api-method { grid-template-columns: 1fr; gap: 5px; }
}

.result-card {
  background: var(--ink-800);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px;
}
.result-card h3 {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  margin: 0 0 16px;
  font-weight: 600;
}
.result-variant {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  padding: 12px 0;
}
.result-variant + .result-variant { border-top: 1px solid var(--line-soft); }
.result-variant .tag {
  display: inline-block;
  font-weight: 600;
  margin-bottom: 4px;
}
.result-variant .tag.ok { color: var(--secure); }
.result-variant .tag.err { color: hsl(8 80% 66%); }
.result-variant .fields { color: var(--fg-dim); }

/* ---------- Measurement ---------- */
.measure-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}
@media (max-width: 900px) { .measure-grid { grid-template-columns: 1fr; } }

.wer-chart {
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 26px 22px;
  box-shadow: var(--shadow-md);
}
.wer-chart h3 {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 0 0 4px;
  font-weight: 600;
}
.wer-chart .axis-note {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-faint);
  margin: 0 0 22px;
}
.bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.bar-row .label {
  font-size: 0.92rem;
  color: var(--fg-dim);
}
.bar-row .label b { color: var(--fg); font-weight: 600; }
.bar-track {
  grid-column: 1 / -1;
  height: 12px;
  border-radius: 999px;
  background: hsl(222 40% 5% / 0.7);
  overflow: hidden;
  margin-top: 6px;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  transform-origin: left;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-fill.small { background: linear-gradient(90deg, var(--amber-deep), var(--amber)); }
.bar-fill.bigger { background: linear-gradient(90deg, var(--cyan-deep), var(--cyan)); }
.bar-fill.apple { background: linear-gradient(90deg, hsl(220 10% 38%), hsl(220 10% 52%)); }
.bar-row .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--fg);
}
.chart-foot {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--fg-faint);
  line-height: 1.5;
}

.measure-copy h2 { margin-bottom: 0; }
.relcut {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin: 26px 0 0;
}
.relcut .big {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  font-weight: 460;
  font-style: italic;
  color: var(--cyan);
  line-height: 1;
}
.relcut .cap { color: var(--fg-dim); font-size: 0.98rem; max-width: 22ch; }
.caveat {
  margin-top: 26px;
  padding: 18px 20px;
  border-left: 3px solid var(--amber);
  background: hsl(36 96% 60% / 0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--fg-dim);
  font-size: 0.98rem;
  line-height: 1.6;
}
.caveat strong { color: var(--fg); }

/* ---------- Models / credits ---------- */
.credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}
.credit {
  display: block;
  text-decoration: none;
  background: var(--ink-800);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.16s, transform 0.16s, background 0.16s;
}
.credit:hover {
  border-color: var(--line);
  transform: translateY(-3px);
  background: var(--ink-750);
}
.credit .role {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.credit h3 {
  margin: 8px 0 6px;
  font-size: 1.08rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.credit h3 .lic {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--secure);
  background: hsl(176 64% 56% / 0.1);
  padding: 2px 7px;
  border-radius: 6px;
}
.credit p { margin: 0; color: var(--fg-dim); font-size: 0.92rem; line-height: 1.5; }
.credit .src {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-faint);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.credit:hover .src { color: var(--amber); }
.credit .src svg { width: 13px; height: 13px; }

.license-note {
  margin-top: 26px;
  font-size: 0.96rem;
  color: var(--fg-dim);
  line-height: 1.6;
}
.license-note strong { color: var(--fg); }
.license-note a { color: var(--cyan); }

/* ---------- Honesty callout ---------- */
.honesty {
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(26px, 4vw, 40px);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: start;
  box-shadow: var(--shadow-md);
}
@media (max-width: 620px) { .honesty { grid-template-columns: 1fr; } }
.honesty .badge {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: hsl(176 64% 56% / 0.1);
  color: var(--secure);
}
.honesty .badge svg { width: 26px; height: 26px; }
.honesty h2 {
  font-family: var(--font-display);
  font-weight: 440;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.honesty p { margin: 0 0 12px; color: var(--fg-dim); line-height: 1.65; }
.honesty p:last-child { margin-bottom: 0; }
.honesty strong { color: var(--fg); }
.honesty a { color: var(--cyan); }

/* ---------- CTA ---------- */
.final-cta {
  text-align: center;
  padding-block: clamp(72px, 11vw, 130px);
  border-top: 1px solid var(--line-soft);
}
.final-cta h2 {
  font-family: var(--font-display);
  font-weight: 440;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 auto;
  max-width: 18ch;
  text-wrap: balance;
}
.final-cta h2 em { color: var(--amber); }
.final-cta p {
  margin: 20px auto 0;
  color: var(--fg-dim);
  max-width: 50ch;
  font-size: 1.08rem;
}
.final-cta .hero-actions { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding-block: 40px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  align-items: center;
  justify-content: space-between;
}
.footer-inner .brand { font-size: 15px; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}
.footer-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-dim);
  text-decoration: none;
}
.footer-links a:hover { color: var(--fg); }
.footer-note {
  margin-top: 22px;
  font-size: 13px;
  color: var(--fg-faint);
  line-height: 1.6;
  max-width: 70ch;
}
.footer-note a { color: var(--fg-dim); }

/* ---------- Page-load reveal (orchestrated, staggered) ---------- */
/* Items lift in on first paint. The .preload class on <body> holds them hidden
   until JS removes it on the next frame, so there is no flash of unstyled motion. */
.load-item {
  opacity: 1;
  transform: none;
}
.preload .load-item {
  opacity: 0;
  transform: translateY(14px);
}
body:not(.preload) .load-item {
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.load-item:nth-child(1) { transition-delay: 0.04s; }
.load-item:nth-child(2) { transition-delay: 0.10s; }
.load-item:nth-child(3) { transition-delay: 0.16s; }
.load-item:nth-child(4) { transition-delay: 0.22s; }
.load-item:nth-child(5) { transition-delay: 0.28s; }
/* The device panel sits in the second grid column; give it its own beat. */
.hero-grid > .device.load-item { transition-delay: 0.20s; }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .preload .load-item,
  .load-item { opacity: 1; transform: none; transition: none; }
}
