:root {
  /* Palette — matched to db.synthehol.ai light theme */
  --bg: #f7f8fb;
  --bg-panel: #ffffff;
  --bg-deeper: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text-main: #111827;
  --text-muted: #6b7280;
  --text-bright: #0a0e1a;
  --accent: #ff3b30;
  --accent-dim: rgba(255, 59, 48, 0.08);
  --accent-hover: rgba(255, 59, 48, 0.18);
  --accent-secondary: #a85a57;
  --accent-secondary-dim: rgba(168, 90, 87, 0.08);
  /* Brand-lockup red — tracks the app's --brand token so the logo + wordmark
     match the React app in both themes (the app brightens this in dark). */
  --logo-red: #ff3b30;
  --brand-red: #c41e3a;
  --brand-navy: #1a1a2e;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --container: 1120px;
  --font-sans: 'Manrope', 'Avenir Next', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', 'Fira Code', Consolas, monospace;
  /* Themed colors for the inline SVGs (topic map, waveform) and nav glass. */
  --nav-bg: rgba(255, 255, 255, 0.82);
  --map-faint: rgba(17, 24, 39, 0.10);
  --map-line: rgba(17, 24, 39, 0.30);
  --map-text: rgba(17, 24, 39, 0.55);
  --map-ink: #111827;
  --wave-bar: #c2c7cf;
  font-synthesis: none;
}

/* Dark theme — toggled from the header, persisted in localStorage, defaults
   to the visitor's prefers-color-scheme. Accent red carries both themes. */
:root[data-theme="dark"] {
  --bg: #0b0d12;
  --bg-panel: #11141b;
  --bg-deeper: #0e1118;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.20);
  --text-main: #e7e9ee;
  --text-muted: #9ea3b0;
  --text-bright: #ffffff;
  --accent-dim: rgba(255, 59, 48, 0.14);
  --accent-hover: rgba(255, 59, 48, 0.24);
  --accent-secondary-dim: rgba(168, 90, 87, 0.18);
  --brand-red: #f2546b; /* the light theme's cardinal is too dark on #0b0d12 */
  --logo-red: #ff5a50; /* matches the app's dark-mode --brand */
  --nav-bg: rgba(11, 13, 18, 0.80);
  --map-faint: rgba(231, 233, 238, 0.10);
  --map-line: rgba(231, 233, 238, 0.35);
  --map-text: rgba(231, 233, 238, 0.60);
  --map-ink: #e7e9ee;
  --wave-bar: #3d4452;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  /* Nothing may force sideways scroll on phones — wider elements clip. */
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--text-bright); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.015em;
  font-size: 23px;
  color: var(--text-bright);
}
.wm-speak { color: var(--logo-red); }
/* Logo mark #4 "two threads" — draws itself once on load, then stays */
.logo-svg { flex: none; overflow: visible; }
.logo-svg path {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: logo-draw 1.1s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.logo-svg .lt1 { stroke: var(--text-bright); }
.logo-svg .lt2 { stroke: var(--logo-red); animation-delay: 0.15s; }
.logo-svg .ldot {
  fill: var(--logo-red);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  animation: logo-dot 0.4s ease-out 1.2s forwards;
}
@keyframes logo-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes logo-dot {
  0%   { opacity: 0; transform: scale(0); }
  70%  { opacity: 1; transform: scale(1.35); }
  100% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-svg path { animation: none; stroke-dashoffset: 0; }
  .logo-svg .ldot { animation: none; opacity: 1; transform: scale(1); }
}
/* Replay the draw-on whenever the logo is hovered: identical keyframes under
   a second name force a fresh animation; leaving hover snaps back to the
   finished state (the base animation already ended with `forwards`). */
@keyframes logo-draw-replay {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}
@keyframes logo-dot-replay {
  0%   { opacity: 0; transform: scale(0); }
  70%  { opacity: 1; transform: scale(1.35); }
  100% { opacity: 1; transform: scale(1); }
}
.logo:hover .logo-svg path,
.footer-brand:hover .logo-svg path {
  animation: logo-draw-replay 1.1s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.logo:hover .logo-svg .lt2,
.footer-brand:hover .logo-svg .lt2 { animation-delay: 0.15s; }
.logo:hover .logo-svg .ldot,
.footer-brand:hover .logo-svg .ldot {
  animation: logo-dot-replay 0.4s ease-out 1.2s forwards;
}
@media (prefers-reduced-motion: reduce) {
  .logo:hover .logo-svg path, .footer-brand:hover .logo-svg path,
  .logo:hover .logo-svg .ldot, .footer-brand:hover .logo-svg .ldot { animation: none; }
}

/* Theme switcher */
.theme-toggle {
  flex: none;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-panel);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg { width: 17px; height: 17px; display: block; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
.nav nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}
.nav nav a { transition: color 0.15s ease; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-sans);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff; /* white on red in BOTH themes — never the panel color */
  box-shadow: 0 4px 14px -6px rgba(255, 59, 48, 0.5);
}
.btn-primary:hover { background: #e6352b; color: #fff; box-shadow: 0 6px 18px -6px rgba(255, 59, 48, 0.55); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text-main);
  background: var(--bg-panel);
  height: 36px;
  padding: 0 14px;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-link {
  background: transparent;
  color: var(--text-muted);
  padding: 0;
  height: auto;
}
.btn-link:hover { color: var(--accent); }

/* Hero */
.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(900px 420px at 85% -10%, var(--accent-dim), transparent 65%),
    var(--bg);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: center;
}
/* Grid items default to min-width:auto, so one wide intrinsic child (the
   topic-map SVG / recorder chip) can blow the column past the viewport on
   phones. Let them shrink. */
.hero-inner > * { min-width: 0; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--brand-red);
  text-transform: uppercase;
  margin-bottom: 18px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-panel);
}
h1 {
  font-size: clamp(40px, 5.4vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 800;
  margin: 0 0 20px;
  color: var(--text-bright);
}
h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent), var(--brand-red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 0 28px;
}
.cta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}
.dot {
  width: 3px;
  height: 3px;
  background: var(--border-strong);
  border-radius: 50%;
}
.hero-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
}
.hero-visual > svg {
  width: 100%;
  max-width: 460px;
  height: auto;
  filter: drop-shadow(0 24px 48px rgba(255, 59, 48, 0.12));
}
/* Topic-map + waveform SVG theming (markup carries classes, colors live here
   so the dark theme can restyle the inline graphics). */
.tm-rings { stroke: var(--map-faint); }
.tm-branches { stroke: var(--map-line); }
.tm-labels { fill: var(--map-text); }
.tm-root { fill: var(--map-ink); }
.tm-ripple { stroke: var(--map-line); }
.wbar { fill: var(--wave-bar); }
.wbar.hot { fill: var(--accent); }

/* Recorder chip — live waveform synced to the topic map */
.recorder {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 380px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 18px;
  box-shadow: 0 10px 30px -18px rgba(17, 24, 39, 0.25);
}
.rec-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  animation: rec-blink 1.6s ease-in-out infinite;
}
@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
.rec-label {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.rec-wave {
  flex: 1;
  min-width: 0;
  height: 36px;
}
.rec-time {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
@media (prefers-reduced-motion: reduce) {
  .rec-dot { animation: none; }
}

/* Strip */
.strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}
.strip-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 28px 0;
}
.metric { text-align: left; }
.metric-num {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}
.metric-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Sections */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-deeper); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head h2 {
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  font-weight: 800;
  color: var(--text-bright);
}
.section-head p {
  color: var(--text-muted);
  font-size: 17px;
  margin: 0;
}

/* Steps */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.steps li {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.steps li:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -12px rgba(17, 24, 39, 0.12);
}
.step-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 14px;
}
.steps h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-bright);
}
.steps p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-muted);
}

/* Modes */
.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.mode {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
}
.mode-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  margin-bottom: 16px;
}
.mode-tag-clin {
  background: var(--accent-secondary-dim);
  color: var(--accent-secondary);
}
.mode h3 {
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  font-weight: 700;
  color: var(--text-bright);
}
.mode p {
  color: var(--text-muted);
  margin: 0 0 16px;
}
.mode ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.mode li {
  position: relative;
  padding-left: 22px;
  font-size: 14.5px;
  color: var(--text-main);
}
.mode li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 12px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* Grid cards */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -12px rgba(17, 24, 39, 0.12);
}
.card h4 {
  margin: 0 0 8px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-bright);
}
.card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}
.grid-note {
  margin: 22px 0 0;
  max-width: 760px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* CTA */
.cta {
  background:
    radial-gradient(700px 300px at 50% 0%, var(--accent-hover), transparent 70%),
    var(--bg-panel);
  border-top: 1px solid var(--border);
}
.cta-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.cta-inner h2 {
  font-size: clamp(28px, 3.4vw, 38px);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  font-weight: 800;
  color: var(--text-bright);
}
.cta-inner > p {
  color: var(--text-muted);
  margin: 0 0 28px;
  font-size: 17px;
}
.cta-form {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 10px;
  align-items: stretch;
}
.cta-form[hidden] { display: none; }
.cta-form input,
.cta-form select {
  height: 44px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cta-form input::placeholder { color: var(--text-muted); }
.cta-form input:focus,
.cta-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.cta-form button { height: 44px; }
.cta-done {
  margin-top: 14px;
  color: var(--brand-red);
  font-family: var(--font-mono);
  font-size: 14px;
}
.cta-terms {
  margin: 18px auto 0;
  max-width: 460px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}
.cta-terms a { color: var(--accent); }
.cta-terms a:hover { text-decoration: underline; }

/* Legal pages (terms.html, privacy.html) — long-form document layout on the
   shared palette tokens. */
.legal { padding: 64px 0 96px; }
.legal-wrap { max-width: 760px; }
.legal .eyebrow { margin-bottom: 14px; }
.legal h1 {
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  margin: 0 0 12px;
}
.legal .meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 28px;
}
.legal .callout {
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 36px;
}
.legal h2 {
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--text-bright);
  margin: 40px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.legal h2:first-of-type { border-top: none; padding-top: 0; }
.legal h2 .num {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  margin-right: 10px;
}
.legal p, .legal li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-main);
}
.legal ul { margin: 12px 0; padding-left: 22px; }
.legal li { margin: 8px 0; }
.legal li strong { color: var(--text-bright); }
.legal a { color: var(--accent); }
.legal a:hover { text-decoration: underline; }
.legal .fineprint { font-size: 13px; color: var(--text-muted); margin-top: 36px; }
.legal-nav { display: inline-flex; gap: 16px; margin-top: 28px; font-size: 14px; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  background: var(--bg-deeper);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-bright);
  font-weight: 700;
}
.footer-meta { display: inline-flex; gap: 10px; align-items: center; }
.footer-meta a:hover { color: var(--accent); }

/* Responsive */
@media (max-width: 900px) {
  .hero { padding: 56px 0 40px; }
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  /* Copy first on phones: the headline sells; the animation rewards. */
  .strip-inner { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .modes { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 72px 0; }
  .cta-form { grid-template-columns: 1fr; }
  .nav nav a:not(.btn) { display: none; }
}
@media (max-width: 560px) {
  /* The nav was the page's horizontal-overflow culprit on phones: logo +
     two buttons exceed a 390px viewport. Tighten everything and drop the
     secondary button — "Get early access" repeats in the hero and CTA. */
  .nav nav { gap: 10px; }
  .nav nav .btn-ghost { display: none; }
  .logo { font-size: 19px; gap: 9px; }
  .logo-svg { width: 38px; height: 28px; }
  .container { padding: 0 18px; }
  .hero { padding: 40px 0 32px; }
  .lede { font-size: 16px; }
  .cta-row { flex-wrap: wrap; gap: 12px; }
  .section { padding: 56px 0; }
  .section-head { margin-bottom: 32px; }
  .strip-inner { grid-template-columns: 1fr; row-gap: 18px; padding: 24px 0; }
  /* One readable row per metric: number in a fixed slot, label beside it. */
  .metric { display: flex; align-items: baseline; gap: 14px; }
  .metric-num { font-size: 19px; flex: none; min-width: 52px; text-align: right; }
  .metric-label { margin-top: 0; }
  .steps { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .mode { padding: 22px; }
  .footer-inner { flex-direction: column; gap: 10px; }
}
