/* ─── Fonts ─────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&display=swap');

/*
  Lexend: designed specifically to reduce visual stress and improve
  reading performance. Not on the reflex-reject list. Thematically
  appropriate for an accessibility product.
*/
@font-face {
  font-family: 'Lexend-Fallback';
  src: local('Arial');
  ascent-override: 96%;
  descent-override: 22%;
  line-gap-override: 0%;
  size-adjust: 103%;
}

/* ─── Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Colors in OKLCH — source: PRODUCT.md */
  --bg:          oklch(10.5% 0.012 258);
  --surface:     oklch(13.5% 0.025 254);
  --surface-hi:  oklch(17%   0.028 254);
  --border:      oklch(22%   0.022 254);
  --border-hi:   oklch(30%   0.030 254);

  --accent:      oklch(66%   0.155 250);
  --accent-hi:   oklch(71%   0.162 250);
  --accent-dim:  oklch(50%   0.110 250);

  --ink:         oklch(97%   0.005 255);
  --ink-2:       oklch(70%   0.082 248);   /* 5.6:1 against darkest composite bg */
  --ink-3:       oklch(62%   0.040 252);   /* 5.4:1 against darkest composite bg */

  --green:       oklch(65%   0.210 145);

  /* Typography */
  --font: 'Lexend', 'Lexend-Fallback', 'Helvetica Neue', Arial, sans-serif;

  --text-xs:      0.75rem;
  --text-sm:      0.875rem;
  --text-base:    1.125rem;
  --text-lg:      1.375rem;
  --text-xl:      clamp(1.5rem, 2.5vw + 0.75rem, 2.25rem);
  --text-2xl:     clamp(2rem,   4vw  + 0.5rem,  3.5rem);
  --text-display: clamp(2.75rem, 6vw + 1rem,    4.75rem);

  /* Spacing (4pt base) */
  --s1:  0.25rem;   --s2:  0.5rem;    --s3:  0.75rem;
  --s4:  1rem;      --s5:  1.25rem;   --s6:  1.5rem;
  --s8:  2rem;      --s10: 2.5rem;    --s12: 3rem;
  --s16: 4rem;      --s20: 5rem;      --s24: 6rem;

  /* Layout */
  --max-w:    1120px;
  --radius:   8px;
  --radius-lg: 14px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 150ms;
  --base: 250ms;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  hanging-punctuation: first last;
}

body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p { text-wrap: pretty; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ─── Utilities ──────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(var(--s4), 5vw, var(--s8));
}

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

/* ─── Focus ──────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
:focus:not(:focus-visible) { outline: none; }

/* ─── Navigation ─────────────────────────────────────────────────── */
.nav {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  background: oklch(10.5% 0.012 258 / 0.88);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.nav__logo span { color: var(--accent); }

.btn-nav {
  padding: var(--s2) var(--s5);
  background: var(--accent);
  color: oklch(10% 0.012 258);
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius);
  transition: background var(--fast) var(--ease-out);
}
.btn-nav:hover { background: var(--accent-hi); }

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s6);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all var(--fast) var(--ease-out);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: oklch(10% 0.012 258);
}
.btn--primary:hover { background: var(--accent-hi); }

.btn--ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--border-hi);
}
.btn--ghost:hover { color: var(--ink); border-color: var(--ink-3); }

/* ─── Hero ───────────────────────────────────────────────────────── */
.hero {
  padding-top: calc(60px + clamp(var(--s12), 8vw, var(--s24)));
  padding-bottom: clamp(var(--s16), 8vw, var(--s24));
  min-height: 100svh;
  display: flex;
  align-items: center;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--s10), 6vw, var(--s20));
  align-items: center;
}

.hero__headline {
  font-size: var(--text-display);
  line-height: 1.08;
  color: var(--ink);
  margin-bottom: var(--s6);
}

.hero__body {
  font-size: var(--text-lg);
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 44ch;
  margin-bottom: var(--s10);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
}

/* ─── Caption demo ───────────────────────────────────────────────── */
.caption-demo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  user-select: none;
}

.caption-demo__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s5);
  background: var(--surface-hi);
  border-bottom: 1px solid var(--border);
}

.caption-demo__live {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-2);
}

.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: live-pulse 2.2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.caption-demo__timer {
  font-size: var(--text-sm);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.caption-demo__body {
  padding: var(--s6) var(--s6) var(--s4);
}

.caption-demo__from {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--s3);
}

.caption-demo__text {
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--ink);
  min-height: 3.2em;
}

.caption-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.caption-demo__reply {
  margin: 0 var(--s4) var(--s4);
  background: var(--bg);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: var(--s3) var(--s3) var(--s3) var(--s4);
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.caption-demo__reply-text {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: 1.4;
  min-height: 1.4em;
}

.caption-demo__speak {
  flex-shrink: 0;
  padding: var(--s2) var(--s4);
  background: var(--accent);
  color: oklch(10% 0.012 258);
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--fast) var(--ease-out);
}
.caption-demo__speak:hover { background: var(--accent-hi); }

/* ─── Sections ───────────────────────────────────────────────────── */
.section {
  padding-top: var(--s20);
  padding-bottom: var(--s20);
}

.section--ruled {
  border-top: 1px solid var(--border);
  padding-top: var(--s20);
  padding-bottom: var(--s20);
}

.section__hd {
  margin-bottom: clamp(var(--s10), 4vw, var(--s16));
}

.section__h2 {
  font-size: var(--text-2xl);
  color: var(--ink);
  margin-bottom: var(--s4);
}

.section__lead {
  font-size: var(--text-lg);
  color: var(--ink-2);
  max-width: 52ch;
  line-height: 1.55;
}

/* ─── Steps ──────────────────────────────────────────────────────── */
.steps { list-style: none; }

.step {
  display: grid;
  grid-template-columns: var(--s12) 1fr;
  gap: 0 clamp(var(--s6), 3vw, var(--s10));
  padding-top: clamp(var(--s8), 4vw, var(--s12));
  padding-bottom: clamp(var(--s8), 4vw, var(--s12));
  border-top: 1px solid var(--border);
}
.step:last-child { border-bottom: 1px solid var(--border); }

.step__num {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--ink-3);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  padding-top: var(--s1);
}

.step__title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: var(--s3);
}

.step__body {
  font-size: var(--text-base);
  color: var(--ink-2);
  line-height: 1.65;
  max-width: 56ch;
}

/* ─── Audience ───────────────────────────────────────────────────── */
.audience-items { list-style: none; }

.audience-item {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--s8) clamp(var(--s8), 5vw, var(--s16));
  padding-top: var(--s10);
  padding-bottom: var(--s10);
  border-top: 1px solid var(--border);
  align-items: start;
}
.audience-item:last-child { border-bottom: 1px solid var(--border); }

.audience-item__h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.audience-item__body {
  font-size: var(--text-base);
  color: var(--ink-2);
  line-height: 1.7;
  max-width: 52ch;
}

/* ─── Download ───────────────────────────────────────────────────── */
.download { text-align: center; }

.download__h2 {
  font-size: var(--text-2xl);
  color: var(--ink);
  margin-bottom: var(--s4);
}

.download__lead {
  font-size: var(--text-lg);
  color: var(--ink-2);
  margin-bottom: var(--s10);
  max-width: 44ch;
  margin-inline: auto;
}

.store-badges {
  display: flex;
  gap: var(--s4);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--s6);
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s5);
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  transition: border-color var(--fast) var(--ease-out),
              background var(--fast) var(--ease-out);
}
.store-badge:hover {
  background: oklch(20% 0.03 254);
  border-color: var(--accent-dim);
}

.store-badge__icon {
  width: 22px; height: 22px;
  flex-shrink: 0;
  color: var(--ink);
}

.store-badge__label {
  display: block;
  font-size: 0.6875rem;
  color: var(--ink-3);
  line-height: 1;
  margin-bottom: 3px;
}

.store-badge__name {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.download__note {
  font-size: var(--text-sm);
  color: var(--ink-3);
}
.download__note a {
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.download__note a:hover { color: var(--ink); }

/* ─── Footer ─────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding-top: var(--s8);
  padding-bottom: var(--s8);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s4);
}

.footer__copy {
  font-size: var(--text-sm);
  color: var(--ink-3);
}

.footer__nav {
  display: flex;
  gap: var(--s6);
  list-style: none;
}

.footer__nav a {
  font-size: var(--text-sm);
  color: var(--ink-3);
  transition: color var(--fast);
}
.footer__nav a:hover { color: var(--ink-2); }

/* ─── Privacy / prose pages ──────────────────────────────────────── */
.prose-page {
  padding-top: calc(60px + var(--s12));
  padding-bottom: var(--s24);
}

.prose-page__inner { max-width: 72ch; }

.prose-page h1 {
  font-size: var(--text-2xl);
  color: var(--ink);
  margin-bottom: var(--s3);
}

.prose-page .updated {
  font-size: var(--text-sm);
  color: var(--ink-3);
  margin-bottom: var(--s12);
  display: block;
}

.prose-page h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-top: var(--s10);
  margin-bottom: var(--s4);
}

.prose-page p {
  font-size: var(--text-base);
  color: var(--ink-2);
  line-height: 1.7;
  margin-bottom: var(--s4);
  max-width: 68ch;
}

.prose-page ul {
  margin-bottom: var(--s4);
  padding-left: var(--s6);
}

.prose-page li {
  font-size: var(--text-base);
  color: var(--ink-2);
  line-height: 1.7;
  margin-bottom: var(--s2);
}

.prose-page a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose-page a:hover { color: var(--accent-hi); }

.prose-page .back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--text-sm);
  color: var(--ink-3);
  margin-bottom: var(--s10);
  transition: color var(--fast);
}
.prose-page .back-link:hover { color: var(--ink-2); }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: var(--s10);
  }

  .hero__body { max-width: 100%; }

  .audience-item {
    grid-template-columns: 1fr;
    gap: var(--s4);
  }
}

@media (max-width: 600px) {
  :root {
    --s24: 4rem;
    --s16: 3rem;
  }

  .step {
    grid-template-columns: var(--s8) 1fr;
    gap: 0 var(--s4);
    padding-top: var(--s6);
    padding-bottom: var(--s6);
  }

  .step__num { font-size: 1.5rem; }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

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