/*
 * Tier 1 — app palette. Mirrors lightTheme/darkTheme in
 * code/captions/src/ui/theme.ts; keep the two in sync. Pressed variants
 * follow the app rule (HSL lightness −10% light, +10% dark).
 */
:root {
  --app-background: #FFFFFF;
  --app-surface: #F1F5F9;
  --app-surface-alt: #E2E8F0;
  --app-surface-border: #76839B;
  --app-text-primary: #090D16;
  --app-text-secondary: #334155;
  --app-primary: #024A97;
  --app-primary-pressed: #013165;
  --app-primary-text: #FFFFFF;
  --app-info-container: #DBEAFE;
  --app-on-info-container: #024A97;
  --app-error: #951A1A;
  --app-speaker2-ring: #A85A06;
}

@media (prefers-color-scheme: dark) {
  :root {
    --app-background: #0B0F17;
    --app-surface: #1E293B;
    --app-surface-alt: #26334A;
    --app-surface-border: #7B8FAE;
    --app-text-primary: #F8FAFC;
    --app-text-secondary: #CBD5E1;
    --app-primary: #67CCFA;
    --app-primary-pressed: #98DDFC;
    --app-primary-text: #0B0F17;
    --app-info-container: #12304A;
    --app-on-info-container: #67CCFA;
    --app-error: #FCA5A5;
    --app-speaker2-ring: #FCD34D;
  }
}

/* Tier 2 — site tokens. Components use only these. */
:root {
  color-scheme: light dark;

  --color-bg: var(--app-background);
  --color-band: var(--app-surface);
  --color-card: var(--app-background);
  --color-field: var(--app-background);
  --color-text: var(--app-text-primary);
  --color-text-soft: var(--app-text-secondary);
  --color-text-on-tint: var(--app-text-secondary);
  --color-border: var(--app-surface-border);
  --color-rule: var(--app-surface-alt);
  --color-link: var(--app-primary);
  --color-link-hover: var(--app-primary-pressed);
  --color-focus: var(--app-primary);
  --color-error: var(--app-error);
  --color-highlight: var(--app-speaker2-ring);

  --color-action: var(--app-primary);
  --color-action-hover: var(--app-primary-pressed);
  --color-on-action: var(--app-primary-text);
  --color-action-soft: var(--app-info-container);
  --color-on-action-soft: var(--app-on-info-container);
  --tint-info: var(--app-info-container);

  /* The dark stage: the Play feature graphic's near-black, in both themes. */
  --stage: #0B0F17;
  --stage-glow-1: rgb(3 105 161 / 0.35);
  --stage-glow-2: rgb(126 34 206 / 0.35);
  --on-stage: #E8EEF7;
  --on-stage-soft: #A9B6C9;
  --on-stage-rule: #334155;
  --on-stage-link: #67CCFA;
  --device: #1F2937;
  --device-edge: #334155;

  --brand-mark-bg: var(--stage);
  --brand-mark-line: #E8EEF7;
  --brand-mark-caption: #5BF08A;

  --font-body: 'Figtree', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Bricolage Grotesque', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lead: 1.25rem;
  --text-card: 1.1875rem;
  --text-brand: 1.375rem;
  --text-feature: clamp(1.625rem, 2.6vw, 2.125rem);
  --text-h2: clamp(1.875rem, 3.2vw, 2.625rem);
  --text-h1: clamp(2.75rem, 6.4vw, 4.75rem);

  --page-width: 1120px;
  --prose-width: 42rem;
  --gutter: 24px;
  --section-space: 88px;

  --radius-pill: 999px;
  --radius-card: 24px;
  --radius-feature: 28px;
  --radius-panel: 32px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Secondary text drops under 7:1 on the dark tints. */
    --color-text-on-tint: var(--app-text-primary);
    --color-card: var(--app-surface-alt);
    --color-rule: var(--app-surface);
    --stage: #05080D;
  }
}

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
}

a { color: var(--color-link); }
a:hover { color: var(--color-link-hover); }

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

h1, h2, h3, p, ol, figure { margin: 0; }

h1, h2, h3 {
  font-family: var(--font-display);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--text-h2);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h3 {
  font-size: var(--text-card);
  font-weight: 700;
  line-height: 1.25;
}

svg, img, video { display: block; }
img, video { max-width: 100%; height: auto; }

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--color-action);
  color: var(--color-on-action);
}
.skip-link:focus { top: 8px; }

/* Layout */
.container {
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-space); }
.section--band { background: var(--color-band); }

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap, 24px);
}

.section-intro {
  max-width: 640px;
  margin-top: 14px;
  color: var(--color-text-soft);
  font-size: 1.125rem;
}

/* Buttons */
.button {
  display: inline-block;
  padding: 14px 26px;
  border: none;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button--primary {
  background: var(--color-action);
  color: var(--color-on-action);
}
.button--primary:hover {
  background: var(--color-action-hover);
  color: var(--color-on-action);
}

.button--secondary {
  background: transparent;
  color: var(--color-text);
  box-shadow: inset 0 0 0 1.5px var(--color-border);
}
.button--secondary:hover { color: var(--color-text); background: var(--color-band); }

.button--small {
  padding: 10px 18px;
  font-size: var(--text-sm);
}

/* Site header */
.site-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding-block: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-brand);
}
.brand:hover { color: var(--color-text); }

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-mark-bg);
}
.brand__mark svg { width: 24px; height: 24px; }

.site-nav ul {
  display: flex;
  gap: 8px 26px;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a:not(.button) {
  color: var(--color-text-soft);
  text-decoration: none;
}
.site-nav a:not(.button):hover { color: var(--color-text); }

@media (max-width: 720px) {
  .site-nav__link { display: none; }
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 48px;
  align-items: center;
  padding-block: 32px var(--section-space);
}

.kicker {
  display: block;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--color-link);
}

.hero h1 .who { color: var(--color-highlight); }

.hero__lead {
  max-width: 30ch;
  margin-top: 20px;
  color: var(--color-text-soft);
  font-size: var(--text-lead);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  color: var(--color-text-soft);
  font-size: var(--text-sm);
}
.trust li { display: inline-flex; align-items: center; gap: 7px; }
.trust svg { flex: none; }
.trust a { color: inherit; text-underline-offset: 3px; }

/* The dark stage behind the hero recording */
.stage {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 36px 22px;
  border-radius: var(--radius-panel);
  background:
    radial-gradient(120% 80% at 80% 110%, var(--stage-glow-2), transparent 60%),
    radial-gradient(90% 70% at 10% 0%, var(--stage-glow-1), transparent 60%),
    var(--stage);
  color: var(--on-stage);
}

.stage__label {
  position: absolute;
  top: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-stage-soft);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #F43F5E;
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgb(244 63 94 / 0.6); }
  70%, 100% { box-shadow: 0 0 0 8px rgb(244 63 94 / 0); }
}

/* A phone frame around a real screen recording or screenshot */
.device {
  width: min(300px, 100%);
  overflow: hidden;
  border: 10px solid var(--device);
  border-radius: 36px;
  background: var(--color-bg);
  box-shadow: 0 0 0 1.5px var(--device-edge), 0 30px 60px -20px rgb(0 0 0 / 0.6);
}
.device video,
.device img { width: 100%; }
.device--small { width: min(260px, 100%); border-width: 8px; border-radius: 30px; }

/* Problem: three places, each with a real caption card */
.scenes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.scene {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border-radius: var(--radius-card);
  background: var(--color-card);
}
.scene p { color: var(--color-text-soft); }
.scene picture { margin-top: auto; padding-top: 6px; }
.scene img { width: 100%; border-radius: 14px; }

/* Features: copy beside a real recording */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}
.feature + .feature { margin-top: 80px; }
.feature--flip .feature__art { order: 2; }

.feature__art {
  display: grid;
  place-items: center;
  padding: 32px;
  border-radius: var(--radius-feature);
  background: var(--color-band);
}
.feature__art--video {
  padding: 0;
  overflow: hidden;
  background: var(--stage);
}
.feature__art--video video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.feature__copy { display: flex; flex-direction: column; gap: 14px; }
.feature__copy h2 { font-size: var(--text-feature); }
.feature__copy p { color: var(--color-text-soft); }
.feature__note { font-size: var(--text-sm); }

/* How it works */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 36px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  border-radius: var(--radius-card);
  background: var(--color-card);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-link);
}
.steps p { color: var(--color-text-soft); }

/* Private by design: a dark panel in both themes */
.privacy {
  padding: clamp(28px, 6vw, 56px);
  border-radius: var(--radius-panel);
  background: var(--stage);
  color: var(--on-stage);
}
.privacy h2,
.privacy h3 { color: #FFFFFF; }
.privacy .section-intro,
.privacy p { color: var(--on-stage-soft); }
.privacy a { color: var(--on-stage-link); }

.privacy__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin-top: 36px;
}
.privacy__facts > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--on-stage-rule);
}
.privacy__more { margin-top: 28px; font-size: var(--text-sm); }

/* FAQ */
.faq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 48px;
  margin-top: 28px;
}
.faq details {
  padding-block: 16px;
  border-bottom: 1px solid var(--color-border);
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
}
.faq details p {
  margin-top: 8px;
  color: var(--color-text-soft);
}

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 12px; }
  .feature { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .feature--flip .feature__art { order: 0; }
  .scenes,
  .steps,
  .privacy__facts,
  .faq { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

/* Early access */
.access { padding-bottom: var(--section-space); }

.access__panel {
  align-items: center;
  padding: 64px 32px;
  border-radius: var(--radius-panel);
  background: var(--tint-info);
  text-align: center;
}
.access__panel .section-intro { margin-top: 0; color: var(--color-text-on-tint); }

.signup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 520px;
}
.signup[hidden] { display: none; }

/* Phone choice: a segmented pair of radio buttons */
.signup__platform {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
  border: none;
}
.signup__platform legend {
  margin: 0 auto 8px;
  padding: 0;
  font-weight: 600;
}
.signup__platform label { position: relative; }
.signup__platform input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
/* Smaller and outlined, so a chosen phone never reads as a second "Join" button */
.signup__platform span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 112px;
  min-height: 44px;
  padding: 6px 18px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-field);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 600;
}
.signup__check { display: none; }
.signup__platform input:checked + span {
  border-color: var(--color-action);
  box-shadow: inset 0 0 0 1.5px var(--color-action);
  color: var(--color-action);
}
.signup__platform input:checked + span .signup__check { display: block; }
.signup__platform input:focus-visible + span {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.signup__field {
  position: relative;
  width: 100%;
  text-align: start;
}

.signup__email {
  width: 100%;
  height: 52px;
  padding: 0 22px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-field);
  color: var(--color-text);
  font: inherit;
}

.signup .button {
  height: 52px;
  padding-block: 0;
  padding-inline: 28px;
}
.signup .button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.signup[aria-busy="true"] .button:disabled {
  cursor: progress;
  opacity: 0.7;
}

/* After a signup, focus moves to the heading (tabindex=-1) so the result is read next; it is not a control. */
#access-title:focus { outline: none; }

.signup__status { max-width: 520px; font-weight: 600; }
.signup__status:empty { display: none; }
.signup__status[data-kind="error"] { color: var(--color-error); }
.signup__status[data-kind="error"] a { color: inherit; }

.signup__note {
  color: var(--color-text-on-tint);
  font-size: var(--text-sm);
}

/* Logo */
.art-line { stroke: var(--brand-mark-line); }
.art-caption { fill: var(--brand-mark-caption); }

/* Legal / prose pages */
.prose {
  max-width: var(--prose-width);
  padding-block: 48px var(--section-space);
}
.prose h1 {
  margin-bottom: 24px;
  font-size: var(--text-h2);
}
.prose h2 {
  margin-top: 2em;
  margin-bottom: 0.5em;
  font-size: 1.5rem;
}
.prose p,
.prose ul,
.prose ol { margin-block: 0 1em; }

/* Site footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding-block: 28px 40px;
  border-top: 1px solid var(--color-rule);
  color: var(--color-text-soft);
  font-size: var(--text-sm);
}

.site-footer a { color: var(--color-text-soft); }

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
