/* =================================================================
   ReelDub — marketing site
   Design language: a dark creator/editor tool. Color carries meaning —
   grey = the ORIGINAL (source voice/language), violet = the DUBBED
   result, coral = the ACT of dubbing (playhead / energy). Monospace
   data (language codes, durations, stages) gives the editor texture.
   Tokens are defined once here; components reference them only.
   ================================================================= */

/* ---- Tokens ----------------------------------------------------- */
:root {
  /* Surfaces */
  --ink: #0A0A0C;            /* base void */
  --ink-2: #0E0E12;          /* app base */
  --panel: #16161C;
  --card: #1E1E26;
  --raised: #25252F;

  /* Text */
  --chalk: #F5F5F7;
  --ash: #9A9AA6;
  --slate: #62626E;

  /* Lines */
  --hairline: #2A2A33;
  --hairline-soft: #20202A;

  /* Brand accents */
  --violet: #7C5CFF;
  --violet-soft: #9B7CFF;
  --violet-deep: #5B43C4;
  --coral: #FF5C8A;
  --coral-soft: #FF7AA0;

  /* Semantic roles (the product's own logic) */
  --source: var(--ash);      /* original language / voice */
  --result: var(--violet);   /* dubbed output / primary action */
  --act: var(--coral);       /* the dub itself: playhead, energy */

  /* Status */
  --success: #34C759;
  --warning: #FFB020;
  --error: #FF453A;

  /* Spacing */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-6: 24px; --sp-8: 32px; --sp-12: 48px; --sp-16: 64px; --sp-24: 96px;

  /* Radii */
  --r-card: 12px; --r-sheet: 22px; --r-pill: 999px;

  /* Type — fluid display, fixed body */
  --t-display: clamp(40px, 7vw, 76px);
  --t-h2: clamp(30px, 4.4vw, 46px);
  --t-title: 22px;
  --t-headline: 17px;
  --t-body: 17px;
  --t-caption: 13px;
  --t-mono: 12px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, "Cascadia Mono",
               Consolas, monospace;

  --ease: cubic-bezier(.32, .72, 0, 1);
  --container: 1140px;
  --narrow: 760px;
}

/* ---- Base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink-2);
  color: var(--chalk);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--violet-soft); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--chalk); }
h1, h2, h3, h4 { margin: 0 0 var(--sp-4); line-height: 1.06; font-weight: 700; letter-spacing: -0.03em; }
p { margin: 0 0 var(--sp-4); }
:focus-visible { outline: 2px solid var(--violet-soft); outline-offset: 3px; border-radius: var(--sp-1); }
::selection { background: rgba(124, 92, 255, .35); color: #fff; }

/* ---- Mono utility / data type ---------------------------------- */
.mono {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: .02em;
  font-variant-ligatures: none;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: var(--sp-6);
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px; background: var(--act);
}

/* language code chip, e.g. en-GB → es-ES */
.lang-chip {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: .04em;
  color: var(--ash);
  border: 1px solid var(--hairline);
  border-radius: var(--sp-1);
  padding: 3px 7px;
  white-space: nowrap;
}
.lang-pair {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-mono); font-size: var(--t-mono); color: var(--slate);
}
.lang-pair b { color: var(--chalk); font-weight: 500; }
.lang-pair .to { color: var(--act); }

/* ---- Layout ----------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-6); }
.section { padding-block: var(--sp-24); }
.section--tight { padding-block: var(--sp-12); }
.lead { font-size: clamp(18px, 2.2vw, 22px); line-height: 1.5; color: var(--ash); font-weight: 400; letter-spacing: -0.01em; }
.section-head { max-width: var(--narrow); margin-bottom: var(--sp-16); }
.section-head h2 { font-size: var(--t-h2); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .eyebrow.center { justify-content: center; }

/* ---- Buttons ---------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 14px var(--sp-6);
  border-radius: var(--r-pill);
  font-size: var(--t-headline); font-weight: 600; letter-spacing: -0.01em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--result); color: #fff; box-shadow: 0 10px 34px -10px rgba(124,92,255,.65); }
.btn--primary:hover { background: var(--violet-soft); color: #fff; }
.btn--ghost { background: transparent; color: var(--chalk); border-color: var(--hairline); }
.btn--ghost:hover { border-color: var(--raised); background: var(--card); color: var(--chalk); }

/* ---- Header / nav ---------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,10,12,.72);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--hairline-soft);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: var(--t-headline); color: var(--chalk); letter-spacing: -0.02em; }
.brand:hover { color: var(--chalk); }
.brand svg { width: 30px; height: 30px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: var(--sp-8); list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ash); font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--chalk); }
.nav-cta { display: inline-flex; align-items: center; gap: var(--sp-3); }
.nav-toggle {
  display: none; background: transparent; border: 1px solid var(--hairline);
  border-radius: var(--sp-2); width: 42px; height: 42px; cursor: pointer; color: var(--chalk);
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }

/* ---- Hero ------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(56px, 9vw, 120px) var(--sp-16); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(100px); z-index: 0; pointer-events: none; }
.hero::before { width: 520px; height: 520px; background: rgba(124,92,255,.22); top: -160px; left: -120px; }
.hero::after { width: 440px; height: 440px; background: rgba(255,92,138,.16); top: 60px; right: -140px; }
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.04fr .96fr; gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero h1 { font-size: var(--t-display); letter-spacing: -0.04em; margin-bottom: var(--sp-6); }
.hero h1 .swap {
  /* the word that "gets dubbed" — colored as the result */
  color: var(--violet-soft);
  position: relative; white-space: nowrap;
}
.hero h1 .swap::after { content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: 3px; background: linear-gradient(90deg, var(--violet), var(--coral)); border-radius: 2px; opacity: .9; }
.hero .lead { margin-bottom: var(--sp-8); max-width: 30ch; }
.hero-actions { max-width: 480px; }
.hero-note { font-family: var(--font-mono); font-size: var(--t-mono); color: var(--slate); margin: var(--sp-4) 0 0; letter-spacing: .02em; }

/* ---- Dub demo (the signature) ---------------------------------- */
.dub-demo {
  position: relative;
  background: linear-gradient(160deg, var(--panel), var(--ink));
  border: 1px solid var(--hairline);
  border-radius: var(--r-sheet);
  padding: var(--sp-6);
  box-shadow: 0 50px 100px -40px rgba(0,0,0,.85);
  max-width: 460px; width: 100%; justify-self: center;
}
.dub-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-6); }
.dub-rec { display: inline-flex; align-items: center; gap: var(--sp-2); font-family: var(--font-mono); font-size: var(--t-mono); color: var(--ash); letter-spacing: .04em; }
.dub-rec .rec-dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--act); box-shadow: 0 0 0 0 rgba(255,92,138,.6); animation: pulse 2s var(--ease) infinite; }
.dub-keep { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: var(--t-mono); color: var(--success); }
.dub-keep svg { width: 13px; height: 13px; }

.dub-speaker { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.dub-avatar {
  width: 40px; height: 40px; border-radius: var(--r-pill); flex: none;
  background: conic-gradient(from 200deg, var(--violet), var(--coral), var(--violet));
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px;
  border: 1px solid rgba(255,255,255,.12);
}
.dub-speaker .who { font-weight: 600; font-size: 15px; }
.dub-speaker .sub { font-family: var(--font-mono); font-size: var(--t-mono); color: var(--slate); }

/* waveform — constant; the timing that never changes */
.waveform { position: relative; display: flex; align-items: center; gap: 3px; height: 64px; margin-bottom: var(--sp-6); }
.waveform .bar { flex: 1; min-width: 2px; border-radius: var(--r-pill); background: linear-gradient(var(--violet-soft), var(--violet)); opacity: .9; }
.waveform .playhead {
  position: absolute; top: -6px; bottom: -6px; width: 2px; left: 0;
  background: var(--act); box-shadow: 0 0 12px 1px rgba(255,92,138,.8);
  animation: sweep 4.2s linear infinite;
}
.waveform .playhead::before { content: ""; position: absolute; top: -4px; left: -3px; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--act); }

/* the two captions: original (grey, fixed) and dubbed (cycles) */
.dub-track { border-top: 1px solid var(--hairline-soft); padding-top: var(--sp-4); }
.dub-line { display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; }
.dub-line + .dub-line { margin-top: var(--sp-3); }
.dub-tag { font-family: var(--font-mono); font-size: var(--t-mono); letter-spacing: .06em; text-transform: uppercase; flex: none; width: 84px; }
.dub-cap { min-width: 0; overflow-wrap: anywhere; }
.dub-line.original .dub-tag { color: var(--source); }
.dub-line.dubbed .dub-tag { color: var(--violet-soft); }
.dub-cap { font-size: 15px; line-height: 1.4; }
.dub-line.original .dub-cap { color: var(--ash); }
.dub-line.dubbed .dub-cap { color: var(--chalk); font-weight: 600; font-size: 16px; min-height: 1.4em; transition: opacity .35s var(--ease), transform .35s var(--ease); }
.dub-line.dubbed .dub-cap.is-swapping { opacity: 0; transform: translateY(6px); }
.dub-flag { font-size: 15px; }

/* ---- Language rail (marquee of real pairs) --------------------- */
.rail { border-block: 1px solid var(--hairline-soft); overflow: hidden; background: var(--ink); }
.rail-track { display: flex; gap: var(--sp-8); padding-block: var(--sp-4); width: max-content; animation: marquee 42s linear infinite; }
.rail:hover .rail-track { animation-play-state: paused; }
.rail-item { display: inline-flex; align-items: center; gap: var(--sp-2); }

/* ---- How it works — editor timeline ---------------------------- */
.track { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 27px; height: 2px;
  background: linear-gradient(90deg, var(--hairline), var(--violet) 50%, var(--coral));
  opacity: .4;
}
.track-step { position: relative; padding-top: var(--sp-12); }
.track-node {
  position: absolute; top: 16px; left: 0;
  width: 24px; height: 24px; border-radius: var(--r-pill);
  background: var(--ink-2); border: 2px solid var(--violet);
  display: grid; place-items: center;
}
.track-node::after { content: ""; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--violet); }
.track-step:last-child .track-node { border-color: var(--act); }
.track-step:last-child .track-node::after { background: var(--act); }
.track-idx { font-family: var(--font-mono); font-size: var(--t-mono); color: var(--slate); letter-spacing: .1em; display: block; margin-bottom: var(--sp-2); }
.track-step h3 { font-size: var(--t-title); }
.track-step p { color: var(--ash); margin: 0; }
.pipeline-mini {
  margin-top: var(--sp-12); padding-top: var(--sp-6); border-top: 1px solid var(--hairline-soft);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3);
  font-family: var(--font-mono); font-size: var(--t-mono); color: var(--slate);
}
.pipeline-mini .pl { color: var(--ash); }
.pipeline-mini .sep { color: var(--act); }

/* ---- Audience panels ------------------------------------------- */
.audience { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
.panel {
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--r-sheet);
  padding: clamp(28px, 4vw, 48px); position: relative; overflow: hidden;
}
.panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--violet); opacity: .9; }
.panel.coral::before { background: var(--act); }
.panel .eyebrow { color: var(--violet-soft); }
.panel.coral .eyebrow { color: var(--coral-soft); }
.panel.coral .eyebrow::before { background: var(--violet); }
.panel h3 { font-size: clamp(22px, 2.6vw, 30px); }
.panel > p { color: var(--ash); }
.panel ul { list-style: none; margin: var(--sp-6) 0 0; padding: 0; display: grid; gap: var(--sp-3); }
.panel li { position: relative; padding-left: 26px; color: var(--ash); }
.panel li::before {
  content: ""; position: absolute; left: 0; top: 9px; width: 11px; height: 11px;
  border-radius: 3px; background: var(--violet);
}
.panel.coral li::before { background: var(--act); }

/* ---- Feature row ------------------------------------------------ */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.feature { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--r-sheet); padding: var(--sp-8); }
.feature .fviz { height: 56px; margin-bottom: var(--sp-6); display: flex; align-items: center; }
.feature h3 { font-size: var(--t-title); }
.feature p { color: var(--ash); margin: 0; }

/* mini viz: equal-length bars (sync) */
.viz-bars { display: flex; align-items: center; gap: 4px; width: 100%; height: 40px; }
.viz-bars i { flex: 1; border-radius: var(--r-pill); background: linear-gradient(var(--violet-soft), var(--violet)); }
.viz-bars i:nth-child(even) { background: linear-gradient(var(--coral-soft), var(--coral)); }
/* mini viz: lock-step pair (timing) */
.viz-lock { display: grid; gap: 6px; width: 100%; }
.viz-lock .row { height: 8px; border-radius: var(--r-pill); background: repeating-linear-gradient(90deg, var(--source) 0 10px, transparent 10px 18px); opacity: .5; }
.viz-lock .row.r2 { background: repeating-linear-gradient(90deg, var(--violet) 0 10px, transparent 10px 18px); opacity: 1; }
/* mini viz: language chips (coverage) */
.viz-langs { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- FAQ -------------------------------------------------------- */
.faq { max-width: var(--narrow); margin-inline: auto; }
.faq details { border-top: 1px solid var(--hairline); padding: var(--sp-6) 0; }
.faq details:last-child { border-bottom: 1px solid var(--hairline); }
.faq summary { cursor: pointer; font-size: var(--t-headline); font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .q-idx { font-family: var(--font-mono); font-size: var(--t-mono); color: var(--slate); margin-right: var(--sp-3); }
.faq summary .chevron { color: var(--act); transition: transform .2s var(--ease); flex: none; }
.faq details[open] summary .chevron { transform: rotate(90deg); }
.faq details p { color: var(--ash); margin: var(--sp-3) 0 0; padding-left: calc(var(--t-mono) + var(--sp-3) + 1ch); }

/* ---- CTA band --------------------------------------------------- */
.cta-band {
  position: relative; overflow: hidden;
  background: radial-gradient(100% 160% at 50% -20%, #1c1530 0%, #110f18 55%, #0b0b0e 100%);
  border: 1px solid var(--hairline); border-radius: var(--r-sheet);
  padding: clamp(40px, 6vw, 80px); text-align: center;
}
.cta-band h2 { font-size: var(--t-h2); }
.cta-band .lead { margin-inline: auto; margin-bottom: var(--sp-8); max-width: 44ch; }
.cta-band .waitlist { max-width: 520px; margin-inline: auto; text-align: left; }
.cta-band .form-msg { text-align: center; }

/* ---- Waitlist form --------------------------------------------- */
.waitlist { display: flex; gap: var(--sp-2); background: var(--card); border: 1px solid var(--hairline); border-radius: var(--r-pill); padding: 6px 6px 6px var(--sp-2); }
.waitlist input[type="email"] {
  flex: 1; min-width: 0; background: transparent; border: none; color: var(--chalk);
  font-size: var(--t-body); font-family: var(--font); padding: 12px var(--sp-4);
}
.waitlist input::placeholder { color: var(--slate); }
.waitlist input:focus { outline: none; }
.waitlist:focus-within { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124,92,255,.2); }
.form-msg { font-family: var(--font-mono); font-size: var(--t-mono); margin: var(--sp-3) 0 0; min-height: 1.3em; color: var(--ash); }
.form-msg.is-success { color: var(--success); }
.form-msg.is-error { color: var(--error); }

/* ---- Footer ----------------------------------------------------- */
.site-footer { border-top: 1px solid var(--hairline-soft); background: var(--ink); padding-block: var(--sp-16) var(--sp-8); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: var(--sp-12); margin-bottom: var(--sp-12); }
.footer-brand p { color: var(--ash); max-width: 34ch; margin-top: var(--sp-4); }
.footer-col h4 { font-family: var(--font-mono); font-size: var(--t-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--slate); margin: 0 0 var(--sp-4); font-weight: 500; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.footer-col a { color: var(--ash); font-weight: 500; }
.footer-col a:hover { color: var(--chalk); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); padding-top: var(--sp-6); border-top: 1px solid var(--hairline-soft); color: var(--slate); font-family: var(--font-mono); font-size: var(--t-mono); }

/* ---- Legal / article pages ------------------------------------- */
.page-hero { padding-block: var(--sp-16) var(--sp-8); background: radial-gradient(120% 90% at 30% 0%, #18141F 0%, #0E0E12 70%, #0A0A0C 100%); border-bottom: 1px solid var(--hairline-soft); }
.page-hero h1 { font-size: var(--t-h2); }
.page-hero p { color: var(--ash); margin: 0; font-family: var(--font-mono); font-size: var(--t-mono); }
.prose { max-width: var(--narrow); margin-inline: auto; }
.prose h2 { font-size: var(--t-title); margin-top: var(--sp-12); }
.prose h3 { font-size: var(--t-headline); margin-top: var(--sp-8); }
.prose p, .prose li { color: var(--ash); }
.prose ul { padding-left: var(--sp-6); display: grid; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.prose a { color: var(--violet-soft); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--chalk); }
.contact-card { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--r-sheet); padding: var(--sp-8); margin-top: var(--sp-8); }
.contact-card a { font-size: var(--t-title); font-weight: 700; }

/* ---- Scroll reveal --------------------------------------------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---- Keyframes -------------------------------------------------- */
@keyframes sweep { 0% { left: 2%; } 100% { left: 98%; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,92,138,.55); } 70% { box-shadow: 0 0 0 7px rgba(255,92,138,0); } 100% { box-shadow: 0 0 0 0 rgba(255,92,138,0); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- Responsive ------------------------------------------------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .dub-demo { order: -1; }
  .hero .lead { max-width: none; }
  .track { grid-template-columns: 1fr; gap: var(--sp-8); }
  .track::before { display: none; }
  .track-step { padding-top: 0; padding-left: var(--sp-12); }
  .track-node { top: 2px; }
  .audience, .features { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-8); }

  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: var(--sp-2);
    background: var(--panel); border-bottom: 1px solid var(--hairline);
    padding: var(--sp-4) var(--sp-6); display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: var(--sp-2) 0; width: 100%; }
  .nav .nav-cta .btn--primary { display: none; }
}
@media (max-width: 560px) {
  .section { padding-block: var(--sp-16); }
  .container { padding-inline: var(--sp-4); }
  .waitlist { flex-direction: column; border-radius: var(--r-sheet); padding: var(--sp-3); }
  .waitlist .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .dub-tag { width: 70px; }
}

/* ---- Reduced motion -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .rail-track { animation: none; }
  .waveform .playhead { animation: none; left: 38%; }
}
