/* =====================================================================
   SpeakoFlow  ·  styles.css   (rebuilt as one cohesive system)
  Signal Workshop light theme. Teal trust, coral voice energy, cobalt vision.
  Newsreader (display) + Manrope (body) + JetBrains Mono (keys only).

  Each chapter uses a composition matched to its behavior: dictation split,
  assistant workspace, immersive screen vision, personalization tabs, and a
  visible local-data boundary.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg:        #f7f8f5;
  --bg-2:      #eef0ec;
  --surface:   #ffffff;

  --ink:       #151a18;   /* headings */
  --ink-2:     #46504c;   /* body */
  --muted:     #68736e;   /* meta */

  --line:      rgba(21, 26, 24, 0.09);
  --line-2:    rgba(21, 26, 24, 0.16);

  --teal:      #20c9b7;   /* local / trusted state */
  --teal-ink:  #087c72;   /* brand and primary action */
  --teal-deep: #075f58;   /* hover */
  --teal-wash: #dff2ed;   /* active surface */
  --teal-wash-2: #edf6f3;
  --local-surface: #e6efec;
  /* Secondary accent — indigo "intelligence". Colorblind-safe against teal
     (they separate on the blue–yellow axis, which red–green CVD preserves).
     Replaces the old coral, which muddied to mustard under CVD and fought the
     teal brand. */
  --iris:        #6366f1;  /* bright — small glyphs, dots, listening cue */
  --iris-ink:    #4338ca;  /* text / kickers on light (~7.9:1 on white) */
  --iris-deep:   #3730a3;  /* hover / deep surfaces */
  --iris-wash:   #eceefb;  /* section tint */
  --iris-wash-2: #f4f5fd;  /* faint tint */

  /* Soft, brand-tinted shadows (deep teal, not neutral grey) so elevation reads
     as designed rather than default. */
  --shadow-sm: 0 1px 2px rgba(9, 51, 47, 0.05), 0 2px 8px rgba(9, 51, 47, 0.06);
  --shadow-md: 0 8px 24px rgba(9, 51, 47, 0.09), 0 2px 8px rgba(9, 51, 47, 0.06);
  --shadow-lg: 0 30px 70px -24px rgba(9, 51, 47, 0.24), 0 12px 28px -18px rgba(9, 51, 47, 0.16);

  --ring: 0 0 0 3px rgba(15, 118, 110, 0.35);

  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans:  "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --maxw: 1140px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;

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

  /* One vertical rhythm for every band, so spacing never feels random. */
  --section-y: clamp(4.5rem, 9vw, 8rem);
  --flow-gap:  clamp(2.5rem, 5vw, 4rem);   /* header -> its content */
}

/* Dark theme is opt-in via <html data-theme="dark">. */
:root[data-theme="dark"] {
  --bg:        #16120f;
  --bg-2:      #1d1815;
  --surface:   #221c18;
  --ink:       #f6f2ec;
  --ink-2:     #d3ccc1;
  --muted:     #9b938a;
  --line:      rgba(255, 255, 255, 0.10);
  --line-2:    rgba(255, 255, 255, 0.16);
  --teal:      #2dd4bf;
  --teal-ink:  #5eead4;
  --teal-deep: #99f6e4;
  --teal-wash: rgba(45, 212, 191, 0.12);
  --teal-wash-2: rgba(45, 212, 191, 0.07);
  --iris:        #a5b4fc;
  --iris-ink:    #c7d2fe;
  --iris-deep:   #e0e7ff;
  --iris-wash:   rgba(99, 102, 241, 0.14);
  --iris-wash-2: rgba(99, 102, 241, 0.07);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, 0.7);
  --ring: 0 0 0 3px rgba(94, 234, 212, 0.4);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink-2);
  line-height: 1.65;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; }
a { color: var(--teal-ink); text-decoration: none; }
button { font: inherit; cursor: pointer; }

::selection { background: rgba(32, 201, 183, 0.26); color: var(--ink); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

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

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus-visible { top: 16px; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}
section { position: relative; }
section[id] { scroll-margin-top: 6rem; }

/* ---------- Typography (ONE scale) ----------
   Every section heading is .section-title at ONE fluid size. Card titles are
   the only smaller heading tier. Nothing else competes at section level. */
.section-title {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--ink);
  font-size: clamp(2rem, 1.45rem + 1.9vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.section-body {
  color: var(--ink-2);
  font-size: 1.075rem;
  line-height: 1.7;
  max-width: 46rem;
  margin-top: 1.25rem;
  text-wrap: pretty;
}
.section-body-center { margin-inline: auto; text-align: center; max-width: 56ch; }

/* Left-aligned section header (compare, faq) — matches the feature sections'
   left-to-right reading rhythm instead of pulling to center. */
.section-head { max-width: 56rem; margin: 0 0 var(--flow-gap); }
.section-head .section-body { max-width: none; }

/* One consistent kicker for every feature section. */
.feature-kicker {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--teal-ink);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.005em;
  margin-bottom: 0.9rem;
}
.feature-kicker i { font-size: 1.15rem; }

@media (max-width: 640px) { br.br-desktop { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  font-family: var(--font-sans);
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background 0.25s var(--ease),
              box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
  will-change: transform;
}
.btn i { font-size: 1.2em; }
.btn-sm { padding: 0.6rem 1.1rem; font-size: 0.9rem; }
.btn-lg { padding: 0.95rem 1.7rem; font-size: 1.05rem; }

.btn-primary {
  background: var(--teal-ink);
  color: #fff;
  box-shadow: 0 10px 26px -12px rgba(15, 118, 110, 0.75),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover { background: var(--teal-deep); transform: translateY(-2px);
  box-shadow: 0 16px 34px -12px rgba(15, 118, 110, 0.8), inset 0 1px 0 rgba(255,255,255,0.2); }
.btn-primary:active { transform: translateY(0) scale(0.985); }
[data-theme="dark"] .btn-primary { background: #0f766e; color: #fff; }
[data-theme="dark"] .btn-primary:hover { background: #0d9488; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--teal-ink); color: var(--teal-ink); transform: translateY(-2px); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding-top: clamp(0.6rem, 1.5vw, 1rem);
  padding-bottom: 0.4rem;
  pointer-events: none;
}
.nav-shell {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(0.75rem, 2.5vw, 1.25rem);
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  box-shadow: var(--shadow-sm);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
  pointer-events: auto;
}
.site-header.scrolled .nav-shell {
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-color: var(--line-2);
  box-shadow: var(--shadow-md);
}
/* Auto-hide the header on scroll-down (revealed on scroll-up or near the top).
   Scoped to phone/tablet widths where screen space is tight; JS toggles
   .nav-hidden. Desktop keeps the nav always visible. */
@media (max-width: 820px) {
  .site-header {
    transition: transform 0.35s var(--ease);
    will-change: transform;
  }
  .site-header.nav-hidden {
    transform: translateY(-115%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: 60px; }
.nav-brand { display: inline-flex; align-items: center; }
.nav-logo { height: 30px; width: auto; }

.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  color: var(--ink-2); font-weight: 600; font-size: 0.96rem;
  position: relative; padding: 0.35rem 0; transition: color 0.2s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--teal); border-radius: 2px; transition: width 0.25s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 0.9rem; }
.nav-github {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--ink-2); font-weight: 600; font-size: 0.95rem; transition: color 0.2s var(--ease);
}
.nav-github i { font-size: 1.25rem; }
.nav-github:hover { color: var(--ink); }

.nav-toggle {
  display: none; width: 44px; height: 44px; border-radius: 12px;
  background: transparent; border: 1px solid var(--line-2);
  align-items: center; justify-content: center;
}
.nav-toggle-bars { position: relative; width: 20px; height: 14px; }
.nav-toggle-bars span {
  position: absolute; left: 0; width: 100%; height: 2px; background: var(--ink);
  border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle-bars span:nth-child(1) { top: 3px; }
.nav-toggle-bars span:nth-child(2) { bottom: 3px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { bottom: 6px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  overflow: hidden;
  background: var(--bg);
  border-bottom: 1px solid rgba(21, 26, 24, 0.08);
}
/* A calm "clearing" behind the hero copy: fades the animated voice-field lines
   out through the centre so the headline + subhead read as the clear focus,
   while the field stays lively at the edges. Painted above the canvas (z0),
   below the copy (z1), and in the same --bg colour so there is no visible edge. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(92% 70% at 50% 44%,
    color-mix(in srgb, var(--bg) 52%, transparent) 0%,
    color-mix(in srgb, var(--bg) 34%, transparent) 38%,
    color-mix(in srgb, var(--bg) 14%, transparent) 64%,
    transparent 88%);
}
.hero-voice-field {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.hero-inner {
  position: relative; z-index: 1;
  min-height: 100svh;
  padding-top: clamp(7rem, 14vh, 9rem);
  padding-bottom: clamp(7rem, 15vh, 9rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.hero-main {
  width: min(100%, 42rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-title {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--ink);
  font-size: clamp(3rem, 2rem + 3vw, 4.65rem);
  line-height: 1.04;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.hero-title span { white-space: nowrap; }
.hero-sub {
  margin: 1.5rem auto 0;
  max-width: 42ch;
  font-size: clamp(1.075rem, 1rem + 0.35vw, 1.2rem);
  color: var(--ink-2);
  line-height: 1.6;
}
.hero-cta { margin-top: 2rem; display: flex; justify-content: center; }
.hero-pill {
  position: absolute;
  left: 50%;
  bottom: clamp(1.25rem, 3vh, 2rem);
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
  color: var(--ink);
  filter: drop-shadow(0 16px 24px rgba(21, 26, 24, 0.18));
}
.hero-pill-mount { display: flex; justify-content: center; }
/* A confident, clearly-visible listening pill (not a lonely dot). */
.hero-pill-mount .sf-rec-pill { height: 46px; padding: 0 18px; }
.hero-pill-mount .sf-wave-box { width: 124px; }
.hero-pill-caption {
  color: var(--ink-2); font-size: 0.9rem; font-weight: 600;
  padding: 0.25rem 0.65rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

/* ---------- Trust strip ---------- */
.trust {
  padding: clamp(1.75rem, 4vw, 2.5rem) 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.trust-row { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); }
.trust-row li {
  display: flex; flex-direction: column; gap: 0.15rem; padding-inline: 1.5rem;
  text-align: center; align-items: center;
}
.trust-row li:not(:last-child) { border-right: 1px solid var(--line); }
.trust-key { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 500; color: var(--ink); letter-spacing: -0.01em; }
.trust-note { font-size: 0.85rem; color: var(--muted); }

/* ---------- Core feature moments ---------- */
.feature { padding: clamp(5rem, 8vw, 7.5rem) 0; }
#features {
  background:
    radial-gradient(120% 85% at 14% 0%, var(--teal-wash-2), transparent 56%),
    var(--surface);
}
.feature--assistant {
  background:
    radial-gradient(115% 90% at 86% 4%, color-mix(in srgb, var(--iris) 10%, transparent), transparent 54%),
    linear-gradient(180deg, color-mix(in srgb, var(--iris-wash) 72%, var(--bg)) 0%, var(--bg) 80%);
  border-top: 1px solid color-mix(in srgb, var(--iris) 16%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--iris) 12%, transparent);
}
.feature--assistant .feature-kicker { color: var(--iris-ink); }
.feature--assistant kbd { background: #f5f6fe; border-color: color-mix(in srgb, var(--iris) 28%, transparent); }
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.feature--assistant .feature-media { order: -1; }

.feature-copy { max-width: 34rem; }
.feature-copy .section-body { margin-bottom: 0; }

.kbd-line { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.6rem; }
kbd {
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 500;
  color: var(--ink); background: var(--bg-2);
  border: 1px solid var(--line-2); border-bottom-width: 2px;
  border-radius: 7px; padding: 0.35rem 0.6rem; line-height: 1;
}
.kbd-plus { color: var(--muted); font-weight: 700; }
.kbd-caption { color: var(--muted); font-size: 0.9rem; margin-left: 0.4rem; }

/* Compact speed proof (replaces the old separate comparison band). */
.stat-row { display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 4vw, 2.75rem); margin-top: 2rem; }
.stat { display: flex; flex-direction: column; gap: 0.1rem; }
.stat-num { font-family: var(--font-serif); font-weight: 500; font-size: 2rem; line-height: 1; color: var(--teal-deep); letter-spacing: -0.01em; }
.stat-cap { font-size: 0.85rem; color: var(--muted); font-weight: 600; }

/* Media column: every visual is centered and shares one max width so no
   section dominates another. */
.feature-media { display: flex; justify-content: center; }
.feature-media > * { width: 100%; max-width: 560px; }

/* Shared demo surface (dictation + spoken pill). */
.demo-card,
.pill-showcase {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.demo-card {
  display: flex; align-items: center;
  min-height: 340px;
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}
.demo-card .dictation-demo-mount { width: 100%; }
.demo-card .sf-dictation { width: 100%; max-width: none; }
.demo-card .sf-doc { min-height: 0; height: 208px; overflow: hidden; }

/* Spoken-answers pill, shown in its own calm stage (the "beautiful pill"). */
.pill-showcase {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 260px;
  padding: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  background: radial-gradient(130% 120% at 50% 12%, var(--teal-wash) 0%, var(--surface) 66%);
  text-align: center;
}
.pill-showcase-mount { display: flex; flex-direction: column; align-items: center; }
.pill-showcase .sf-pill-stage { min-height: 56px; }
/* The state caption sits BELOW the pill, centered, with real breathing room —
   never crammed against its right edge. */
.pill-showcase .sf-state-label { margin-top: 1rem; }

/* Screen-vision demo renders its own framed display, so it just fills the
   column (no double frame, and NOT the old oversized 1000px band). */
.screen-frame { width: 100%; }

/* Assistant demo — same white card + real app pill as the other sections, so
   this section finally reads as the same product (was a bespoke dark bar). The
   piece paints its own header, thread and pill; the card just frames it and
   matches the dictation card's height so the two split cards rhyme. */
.demo-card--assistant { align-items: stretch; }
.demo-card--assistant .assistant-demo-mount { width: 100%; display: flex; align-items: center; }
.demo-card--assistant .sf-assistant { width: 100%; }

/* Spoken output is the final state of the assistant story, not another demo. */
.assistant-spoken {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 0.85rem;
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid color-mix(in srgb, var(--iris) 24%, transparent);
}
.assistant-spoken > i { margin-top: 0.15rem; color: var(--iris-ink); font-size: 1.35rem; }
.assistant-spoken h3 { color: var(--ink); font-size: 1.05rem; line-height: 1.3; }
.assistant-spoken p { margin-top: 0.45rem; color: var(--ink-2); font-size: 0.94rem; line-height: 1.65; }

/* The assistant demo keeps the REAL app colours: the app's red live cue
   (--sf-live #e5484d) and teal accent, so the panel matches the product the
   user actually ships — we do not re-tint it to the section's indigo. */

/* The captured screen is the only cloud image on the page. */
.vision {
  overflow: hidden;
  padding: clamp(4.5rem, 8vw, 7rem) 0;
  background:
    radial-gradient(95% 85% at 88% 100%, color-mix(in srgb, var(--teal) 16%, transparent), transparent 58%),
    radial-gradient(85% 75% at 6% 0%, color-mix(in srgb, var(--iris) 9%, transparent), transparent 55%),
    #f4f7f6;
  border-bottom: 1px solid var(--line);
}
.vision .feature-kicker { color: var(--teal-ink); }
.vision .sf-scope { --sf-accent: var(--teal-ink); }
.vision-inner { position: relative; z-index: 1; }
.vision-copy { max-width: 46rem; }
.vision-copy .section-title { font-size: clamp(2.4rem, 1.9rem + 2vw, 3.35rem); }
.vision-copy .section-body { max-width: 60ch; }
.vision-media {
  width: min(100%, 760px);
  margin: clamp(2.5rem, 5vw, 4rem) auto 0;
}
.vision-media .sf-screen { border-radius: var(--radius-md); }

/* Memory and profiles share one workspace and switch in place when JS is on. */
.personalize {
  padding: clamp(5rem, 9vw, 8rem) 0;
  background:
    radial-gradient(85% 72% at 92% 6%, color-mix(in srgb, var(--iris) 12%, transparent), transparent 55%),
    radial-gradient(85% 75% at 4% 98%, color-mix(in srgb, var(--teal) 12%, transparent), transparent 58%),
    var(--bg);
}
.personalize-head { max-width: 50rem; }
.personalize-head .section-body { max-width: 60ch; }
.personalize-workspace {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-2);
  background: var(--surface);
  box-shadow: 0 10px 28px -20px rgba(18, 39, 34, 0.32);
}
.personalize-tabs {
  display: none;
  align-items: center;
  gap: 0.25rem;
  padding: 0.55rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.personalize-workspace.is-enhanced .personalize-tabs { display: flex; }
.personalize-tab {
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 9px;
  color: var(--ink-2);
  background: transparent;
  font-weight: 700;
  transition: color 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease);
}
.personalize-tab:hover { color: var(--ink); }
.personalize-tab.is-active {
  color: var(--teal-deep);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(18, 39, 34, 0.08);
}
.personalize-workspace.is-enhanced .personalize-panel:not(.is-active) { display: none; }
.personalize-panel {
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(16rem, 0.78fr) minmax(20rem, 1.22fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding: clamp(2rem, 5vw, 4rem);
}
.personalize-panel + .personalize-panel { border-top: 1px solid var(--line); }
.personalize-copy { max-width: 33rem; }
.personalize-panel .card-title { font-size: clamp(1.75rem, 1.4rem + 1vw, 2.3rem); }
.personalize-panel .card-body { max-width: 48ch; line-height: 1.7; }
.personalize-panel .card-demo {
  margin-top: 0;
  min-height: 210px;
  justify-content: center;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: 12px;
  background: var(--teal-wash-2);
}

/* Animated chat scenes used by the personalization workspace. */
.card-demo {
  margin-top: auto;
  width: 100%;
  /* Breathing room above the chat, plus a constant reserved height so streaming
     text / persona swaps never resize the card (which would push the whole
     section). Reserve = top padding + the tallest state (2-line replies); wide
     desktop stays 1-line so it reserves less. */
  padding-top: 1.5rem;
  min-height: 178px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
@media (min-width: 1100px) { .card-demo { min-height: 154px; } }
.mini-demo { font-family: var(--font-sans); }
.mini-thread { display: flex; flex-direction: column; gap: 0.7rem; }

.mini-msg {
  max-width: 93%;
  padding: 0.58rem 0.9rem;
  font-size: 0.92rem; line-height: 1.55; font-weight: 500;
  border-radius: 15px;
  opacity: 0; transform: translateY(7px);
  transition: opacity 0.32s var(--ease), transform 0.36s var(--ease);
}
.mini-msg.is-on { opacity: 1; transform: none; }
.mini-msg--user {
  align-self: flex-end;
  border-radius: 15px 15px 5px 15px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink-2);
}
.mini-msg--bot {
  align-self: flex-start;
  border-radius: 15px 15px 15px 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}

/* streaming caret while a reply is being produced */
.mini-msg.is-live .mini-txt::after {
  content: ""; display: inline-block;
  width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -3px;
  border-radius: 1px; background: var(--teal-ink);
  animation: mini-caret 1.06s steps(1) infinite;
}
@keyframes mini-caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* Memory: recalled spans light up; a small tag names the source */
.mini-hi {
  background: color-mix(in srgb, var(--teal) 22%, transparent);
  color: var(--teal-deep);
  border-radius: 4px; padding: 0 0.15em;
  font-weight: 700;
}
.mini-memtag {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin-top: 0.7rem;
  font-size: 0.76rem; font-weight: 600; color: var(--muted);
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.mini-memtag.is-on { opacity: 1; transform: none; }
.mini-memtag svg { width: 12px; height: 12px; color: var(--teal-ink); }

/* Personas: a named badge per voice, each with its own accent dot */
.mini-badge {
  display: flex; align-items: center; gap: 0.4rem;
  margin-bottom: 0.5rem;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink);
}
.mini-badge-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--teal-ink); }
.mini-msg.p0 .mini-badge-dot { background: #0f766e; }
.mini-msg.p1 .mini-badge-dot { background: #6366f1; }
.mini-msg.p2 .mini-badge-dot { background: #8b5cf6; }

@media (prefers-reduced-motion: reduce) {
  .mini-msg { opacity: 1 !important; transform: none !important; transition: none !important; }
  .mini-memtag { opacity: 1 !important; transform: none !important; }
  .mini-msg.is-live .mini-txt::after { animation: none !important; }
}
.card-title { font-family: var(--font-serif); font-weight: 500; font-size: 1.5rem; color: var(--ink); letter-spacing: -0.01em; line-height: 1.2; }
.card-body { margin-top: 0.75rem; color: var(--ink-2); font-size: 1.02rem; }

/* ---------- Comparison ---------- */
.compare {
  padding: clamp(5.5rem, 10vw, 8.5rem) 0;
  background:
    radial-gradient(110% 80% at 50% 0%, color-mix(in srgb, var(--teal) 13%, transparent), transparent 60%),
    radial-gradient(70% 60% at 100% 100%, color-mix(in srgb, var(--iris) 10%, transparent), transparent 55%),
    var(--bg-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.compare-head { max-width: 54rem; margin-bottom: clamp(2.75rem, 6vw, 4.75rem); }
.compare-head .section-body { max-width: 62ch; }
.compare-board {
  display: grid;
  grid-template-columns: minmax(21rem, 1.05fr) minmax(24rem, 0.95fr);
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.compare-home {
  position: relative;
  overflow: hidden;
  padding: clamp(2.25rem, 4vw, 3.25rem);
  background: linear-gradient(160deg, #10897c 0%, var(--teal-deep) 52%, #064e48 100%);
  color: #ffffff;
}
.compare-home::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%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");
  background-size: 140px 140px;
  opacity: 0.06;
  mix-blend-mode: overlay;
}
.compare-home > * { position: relative; z-index: 1; }
.compare-brand { display: flex; align-items: center; gap: 0.65rem; font-weight: 800; }
.compare-brand img { flex: 0 0 auto; }
.compare-price {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  font-family: var(--font-serif);
  font-size: clamp(4rem, 7vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: -0.025em;
}
.compare-price-note { margin-top: 0.7rem; color: #cfe9e5; font-weight: 700; }
.compare-advantages { display: grid; gap: 1.15rem; margin-top: 2.5rem; padding: 0; list-style: none; }
.compare-advantages li { display: flex; align-items: flex-start; gap: 0.7rem; color: #d7ece9; line-height: 1.55; }
.compare-advantages i { margin-top: 0.28rem; color: var(--teal); }
.compare-advantages strong { color: #ffffff; }
.competitor-list { display: flex; flex-direction: column; }
.competitor-row {
  flex: 1 1 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 44px;
  gap: 1.5rem;
  align-items: center;
  padding: clamp(1.5rem, 3vw, 2.25rem);
}
.competitor-row:not(:last-child) { border-bottom: 1px solid var(--line); }
.competitor-row h3 { color: var(--ink); font-size: 1.1rem; line-height: 1.2; }
.competitor-row p { margin-top: 0.4rem; color: var(--muted); font-size: 0.9rem; }
.competitor-price { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.competitor-price strong { color: var(--ink-2); font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.competitor-price span { color: var(--muted); font-size: 0.78rem; }
.competitor-row > a {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--teal-ink);
  border: 1px solid var(--line-2);
  transition: color 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease);
}
.competitor-row > a:hover { color: var(--teal-deep); border-color: var(--teal-ink); transform: translateY(-2px); }
.compare-foot { color: var(--muted); font-size: 0.82rem; margin-top: 1.2rem; }

/* ---------- Privacy ---------- */
.privacy {
  padding: clamp(5.5rem, 10vw, 8.5rem) 0;
  overflow: hidden;
  background:
    radial-gradient(92% 80% at 90% 6%, color-mix(in srgb, var(--teal) 15%, transparent), transparent 55%),
    radial-gradient(70% 62% at 5% 100%, color-mix(in srgb, var(--iris) 9%, transparent), transparent 55%),
    var(--surface);
  border-top: 1px solid rgba(8, 124, 114, 0.1);
  border-bottom: 1px solid rgba(8, 124, 114, 0.12);
}
.privacy-head { max-width: 58rem; }
.privacy-head .section-title { font-size: clamp(2.7rem, 2rem + 2.5vw, 4.15rem); }
.privacy-head .section-body { max-width: 60ch; }
.privacy-principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
}
.privacy-principles article { padding-top: 1.4rem; border-top: 1px solid var(--line-2); }
.privacy-principles i { color: var(--teal-ink); font-size: 1.35rem; }
.privacy-principles h3 {
  margin-top: 1.25rem;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 1.1rem + 0.65vw, 1.75rem);
  font-weight: 500;
  line-height: 1.2;
}
.privacy-principles p { margin-top: 0.85rem; color: var(--ink-2); line-height: 1.7; }
.privacy-quiet-proof {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 3rem);
  margin-top: clamp(3.5rem, 7vw, 5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}
.privacy-quiet-proof a {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin-left: auto;
  color: var(--teal-ink);
}

/* ---------- FAQ ---------- */
.faq { padding: var(--section-y) 0; }
.faq-head { max-width: 48rem; margin-bottom: clamp(2.5rem, 5vw, 3.75rem); }
.faq-head .section-body a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:first-child { border-top: 1px solid var(--line); }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding: 1.5rem 0.25rem; background: none; border: none; text-align: left;
  font-family: var(--font-serif); font-size: clamp(1.2rem, 1rem + 0.6vw, 1.45rem);
  font-weight: 500; color: var(--ink); letter-spacing: -0.01em; transition: color 0.2s var(--ease);
}
.faq-q:hover { color: var(--teal-ink); }
.faq-toggle { position: relative; width: 20px; height: 20px; flex-shrink: 0; }
.faq-toggle::before, .faq-toggle::after {
  content: ""; position: absolute; background: var(--teal-ink); border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.faq-toggle::before { top: 9px; left: 0; width: 20px; height: 2px; }
.faq-toggle::after { top: 0; left: 9px; width: 2px; height: 20px; }
.faq-q[aria-expanded="true"] .faq-toggle::after { transform: rotate(90deg); opacity: 0; }
.faq-a { overflow: hidden; max-height: 0; transition: max-height 0.4s var(--ease); }
.faq-a p { padding: 0 0.25rem 1.6rem; color: var(--ink-2); font-size: 1.05rem; max-width: 62ch; }

/* ---------- Final CTA ---------- */
.final-cta {
  padding: clamp(6rem, 11vw, 9rem) 0;
  text-align: center; overflow: hidden;
  background: linear-gradient(158deg, #0a6f66 0%, var(--teal-deep) 52%, #054a45 100%);
}
.final-wash {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 100% at 12% 0%, color-mix(in srgb, var(--teal) 30%, transparent), transparent 55%),
    radial-gradient(80% 120% at 100% 100%, color-mix(in srgb, var(--iris) 44%, transparent), transparent 52%);
}
.final-wash::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%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");
  background-size: 150px 150px;
  opacity: 0.08;
  mix-blend-mode: overlay;
}
.final-inner { position: relative; z-index: 1; }
.final-title {
  font-family: var(--font-serif); font-weight: 500; color: #ffffff;
  font-size: clamp(2.3rem, 1.5rem + 2.8vw, 3.4rem); line-height: 1.06; letter-spacing: -0.018em; text-wrap: balance;
}
.final-sub { margin: 1.25rem auto 0; max-width: 42ch; color: #d7ece9; font-size: 1.15rem; }
.final-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1rem; margin-top: 2.25rem; }
.final-cta .btn-primary { background: #ffffff; color: var(--teal-deep); box-shadow: 0 12px 24px -14px rgba(0, 0, 0, 0.45); }
.final-cta .btn-primary:hover { background: #e9f5f2; color: var(--teal-deep); }
.final-cta .btn-ghost { color: #ffffff; border-color: rgba(255, 255, 255, 0.42); }
.final-cta .btn-ghost:hover { color: #ffffff; border-color: #ffffff; }
.final-note { margin-top: 1.5rem; color: #c3dfda; font-size: 0.92rem; }
.final-note a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.final-note a { color: #ffffff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); padding: clamp(3rem, 6vw, 4.5rem) 0 2.5rem; }
.footer-inner {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap; padding-bottom: 2.5rem; border-bottom: 1px solid var(--line);
}
.footer-brand img { height: 30px; width: auto; }
.footer-tagline { margin-top: 0.9rem; color: var(--muted); font-family: var(--font-serif); font-style: italic; font-size: 1.05rem; }
.footer-links { display: flex; gap: 1.75rem; flex-wrap: wrap; }
.footer-links a { color: var(--ink-2); font-weight: 600; font-size: 0.95rem; transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--teal-ink); }
.footer-bottom { margin-top: 2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-credit { color: var(--ink-2); font-size: 0.92rem; }
.footer-credit a { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.footer-fine { color: var(--muted); font-size: 0.85rem; }

/* Content is visible by default. JS opts into reveal motion only after the
  observer is ready, so blocked or delayed scripts never blank the page. */
.reveal { opacity: 1; transform: none; transition: opacity 0.75s var(--ease-out-expo), transform 0.75s var(--ease-out-expo); }
.reveal-group > * { opacity: 1; transform: none; transition: opacity 0.65s var(--ease-out-expo), transform 0.65s var(--ease-out-expo); }
.motion-ready .reveal:not(.is-visible) { opacity: 0; transform: translateY(24px); }
.motion-ready .reveal.is-visible { opacity: 1; transform: none; }
.motion-ready .reveal-group:not(.is-visible) > * { opacity: 0; transform: translateY(22px); }
.motion-ready .reveal-group.is-visible > * { opacity: 1; transform: none; }
.reveal-group.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-group.is-visible > *:nth-child(2) { transition-delay: 80ms; }
.reveal-group.is-visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal-group.is-visible > *:nth-child(4) { transition-delay: 240ms; }

/* =====================================================================
   Embedded SpeakoFlow UI demo (pill + waveform) · site integration
   Make the extracted demo's surface tokens follow the site theme, and
   hide the app-only "cancel" affordance.
   ===================================================================== */
.sf-scope.sf-on-light,
.sf-scope.sf-on-dark {
  --sf-wave-bar: linear-gradient(to top, #0d9488, #5eead4 78%);
  --sf-doc-ink: var(--ink);
}
:root[data-theme="dark"] .sf-scope.sf-on-light,
:root[data-theme="dark"] .sf-scope.sf-on-dark {
  --sf-wave-bar: linear-gradient(to top, #14b8a6, #99f6e4 80%);
}
.sf-pill-cancel { display: none !important; }
.sf-scope .sf-state-label { color: var(--muted); }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr; gap: clamp(2rem, 6vw, 3rem); }
  .feature--assistant .feature-media { order: 0; }
  .feature-copy { max-width: none; }
  .feature-media > * { max-width: 560px; }
  .personalize-panel { grid-template-columns: 1fr; min-height: 0; }
  .personalize-copy { max-width: 42rem; }
  .compare-board { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .nav-links, .nav-github span { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 0.5rem;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 0.85rem 1rem; font-size: 1.05rem; }
  .nav-links a::after { display: none; }

  .trust-row { grid-template-columns: 1fr 1fr; gap: 1.5rem 0; }
  .trust-row li:last-child { border-right: none; }
  .trust-row li:nth-child(2) { border-right: none; }
  .trust-row li { padding-block: 0.5rem; }
}

@media (max-width: 760px) {
  .hero { min-height: max(680px, 100svh); }
  .hero-inner {
    min-height: max(680px, 100svh);
    display: flex;
    padding-top: clamp(6.5rem, 18vw, 8rem);
    padding-bottom: 9rem;
  }
  .hero-main { width: 100%; max-width: 36rem; }
  .hero-title { font-size: clamp(2.75rem, 11vw, 4rem); }
  .hero-sub { max-width: 42ch; }
  .hero-pill { left: 50%; right: auto; bottom: 1.25rem; }
  .hero-pill-caption { display: none; }

  .vision-copy .section-title { font-size: clamp(2.5rem, 10vw, 3.4rem); }
  .vision-media { width: 100%; }
  .personalize-tabs { overflow-x: auto; }
  .personalize-tab { flex: 1 0 auto; }
}

@media (max-width: 600px) {
  .privacy-principles { grid-template-columns: 1fr; gap: 2rem; }
  .privacy-quiet-proof { flex-wrap: wrap; }
  .privacy-quiet-proof a { width: 100%; margin-left: 0; }
}

@media (max-width: 520px) {
  body { font-size: 1rem; }
  .site-header { padding-top: max(0.45rem, env(safe-area-inset-top)); }
  .nav { gap: 0.5rem; height: 56px; }
  .nav-shell { padding-inline: 0.7rem; }
  .nav-logo { height: 25px; }
  .nav-actions { gap: 0.5rem; }
  .nav-github { display: none; }
  .nav .btn-sm { padding: 0.58rem 0.85rem; }
  .nav-toggle { width: 42px; height: 42px; }

  .hero { min-height: max(680px, 100svh); }
  .hero-inner { min-height: max(680px, 100svh); padding-inline: 1.25rem; padding-top: 6rem; }
  .hero-title { font-size: clamp(2.6rem, 13vw, 3.45rem); }
  .hero-title span { white-space: normal; }
  .hero-sub { margin-top: 1.15rem; font-size: 1rem; }
  .hero-cta { margin-top: 1.5rem; }
  .hero-cta .btn { width: 100%; }
  .hero-pill { left: 50%; right: auto; bottom: 1rem; }

  .trust { padding-block: 1.5rem; }
  .trust-row { grid-template-columns: 1fr 1fr; gap: 0; }
  .trust-row li { padding: 0.85rem 0.6rem; }
  .trust-row li:nth-child(odd) { border-right: 1px solid var(--line); }
  .trust-row li:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .trust-key { font-size: 1.1rem; }
  .trust-note { font-size: 0.75rem; }

  .feature, .vision, .personalize, .compare, .privacy, .faq { padding-block: 4.5rem; }
  .demo-card { min-height: 290px; padding: 1.1rem; border-radius: var(--radius-md); }
  .personalize-panel { padding: 1.5rem; gap: 1.5rem; }
  .personalize-panel .card-demo { padding: 0.75rem; }
  .compare-home { padding: 1.5rem; }
  .competitor-row { grid-template-columns: minmax(0, 1fr) auto 44px; gap: 0.75rem; padding: 1.15rem; }
  .competitor-row p { font-size: 0.82rem; }
  .competitor-price strong { font-size: 1rem; }
  .competitor-price span { font-size: 0.7rem; }

  .final-actions { flex-direction: column; }
  .final-actions .btn { width: 100%; }
  .footer-inner { flex-direction: column; }
  .stat-row { gap: 1.5rem; }
}

@media (max-height: 650px) and (min-width: 761px) {
  .hero, .hero-inner { min-height: 560px; }
  .hero-inner { align-items: center; padding-top: 5.5rem; padding-bottom: 6rem; }
  .hero-title { font-size: clamp(2.6rem, 5vw, 3.15rem); }
  .hero-sub { margin-top: 1rem; font-size: 1rem; line-height: 1.5; }
  .hero-cta { margin-top: 1.25rem; }
  .hero-pill { left: 50%; right: auto; bottom: 0.8rem; }
  .hero-pill-caption { display: none; }
}

@media (hover: none) {
  .btn-primary:hover, .btn-ghost:hover { transform: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-group > * { opacity: 1 !important; transform: none !important; transition: none !important; }
  .reveal-group.is-visible > * { transition-delay: 0ms !important; }
  .btn, .nav-links a::after, .personalize-tab { transition: none !important; }
  .faq-a { transition: none !important; }
}
