/* Backspace landing page. Colors and type follow Adi Design (sage on clean
   off-white, Newsreader + Inter); values are copied here so the page ships
   with no build step. */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin-opsz-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin-opsz-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: oklch(0.977 0.004 150);
  --surface: oklch(0.993 0.003 150);
  --surface-soft: oklch(0.958 0.006 150);
  --text: oklch(0.27 0.014 152);
  --muted: oklch(0.47 0.013 152);
  --faint: oklch(0.6 0.011 152);
  --line: oklch(0.9 0.006 152);
  --accent: oklch(0.57 0.068 150);
  --accent-ink: oklch(0.44 0.066 150);
  --accent-soft: oklch(0.935 0.026 150);
  --accent-line: oklch(0.79 0.05 150);
  --amber: oklch(0.74 0.12 80);
  --cut: oklch(0.6 0.13 25);
  --frame-bg: oklch(0.2 0.018 152);
  --frame-glow: oklch(0.36 0.035 150);
  --frame-figure: oklch(0.5 0.045 150);
  --shadow: 0 1px 2px oklch(0.27 0.014 152 / 0.05), 0 18px 50px -18px oklch(0.27 0.014 152 / 0.22);
  --serif: "Newsreader", ui-serif, Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.185 0.008 152);
    --surface: oklch(0.225 0.009 152);
    --surface-soft: oklch(0.26 0.01 152);
    --text: oklch(0.94 0.006 152);
    --muted: oklch(0.74 0.01 152);
    --faint: oklch(0.58 0.01 152);
    --line: oklch(0.32 0.01 152);
    --accent: oklch(0.72 0.075 150);
    --accent-ink: oklch(0.8 0.07 150);
    --accent-soft: oklch(0.31 0.035 150);
    --accent-line: oklch(0.45 0.05 150);
    --frame-bg: oklch(0.13 0.01 152);
    --frame-glow: oklch(0.3 0.03 150);
    --frame-figure: oklch(0.45 0.04 150);
    --shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 18px 50px -18px oklch(0 0 0 / 0.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
main, .top, footer { width: min(1080px, 100% - 48px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; padding: 28px 0 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand svg { width: 22px; height: 22px; fill: currentColor; }
.tag { font-size: 13px; color: var(--muted); }

/* hero: one screen */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; display: flex; align-items: center; }
.hero { width: 100%; padding: clamp(32px, 6vw, 72px) 0; text-align: center; }
h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 9.2vw, 104px);
  line-height: 1;
  letter-spacing: -0.035em;
}
h1 em { font-style: italic; color: var(--accent-ink); }
.sub { margin: 26px 0 30px; font-size: clamp(18px, 2.2vw, 23px); color: var(--muted); }
.demo { position: relative; }

/* A and B: the headline edits itself */
.ch { visibility: hidden; position: relative; }
.ch.shown { visibility: visible; }
.ch.caret::after {
  content: ""; position: absolute; right: -0.04em; top: 0.12em; bottom: 0.1em; width: 0.035em; min-width: 2px;
  background: var(--accent); border-radius: 2px; animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.fill {
  display: inline-flex; white-space: pre; overflow-x: clip;
  border-radius: 0.08em;
  transition: width 0.5s cubic-bezier(0.3, 0.7, 0.2, 1), background-color 0.2s, opacity 0.35s;
}
.fill.sel { background: var(--accent-soft); }
.fill.gone { opacity: 0; }
.v-b h1 { font-size: clamp(26px, 4.3vw, 54px); line-height: 1.15; }
@media (min-width: 821px) { .v-b h1 { white-space: nowrap; } }

.strip { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; margin: clamp(22px, 3vw, 34px) auto 0; width: fit-content; --u: min(54px, 8.6vw); }
.strip .track { height: 44px; flex: none; overflow: visible; }
.strip .blk { flex: none; width: calc(var(--s) * var(--u)); transition: width 0.55s cubic-bezier(0.3, 0.7, 0.2, 1), opacity 0.35s, background-color 0.2s; }
.strip .blk.cut { width: 0; }
.strip .replay { position: absolute; left: 100%; margin-left: 8px; top: 50%; margin-top: -15px; }
.strip .length { min-width: 0; }
.replay {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0;
  background: transparent; color: var(--faint); cursor: pointer; display: grid; place-items: center;
  opacity: 0; transition: opacity 0.3s, color 0.15s, background-color 0.15s;
}
.replay.show { opacity: 1; }
.replay:hover { color: var(--text); background: var(--surface-soft); }
.replay svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.blk.hide { opacity: 0; }

/* C: before and after */
.ba { width: min(760px, 100%); margin: clamp(30px, 4.5vw, 52px) auto 0; display: grid; gap: 14px; }
.row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) 44px; align-items: center; gap: 14px;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  transition: opacity 0.5s, transform 0.5s;
}
.row.wait { opacity: 0; transform: translateY(-10px); }
.row .lab { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); text-align: left; }
.row .len { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.row.after { border-color: var(--accent-line); box-shadow: var(--shadow); }
.row.after .lab { color: var(--accent-ink); }
.cols { display: flex; min-width: 0; }
.col {
  flex-basis: 0; min-width: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 6px;
  border-radius: 6px; padding: 4px 0 2px;
  transition: flex-grow 0.6s cubic-bezier(0.3, 0.7, 0.2, 1), opacity 0.35s, background-color 0.2s;
}
.col .bars { height: 34px; width: 100%; display: flex; align-items: center; justify-content: space-evenly; }
.col .bars i { flex: none; width: 2px; border-radius: 1px; background: var(--faint); }
.col span { font-family: var(--serif); font-size: clamp(13px, 1.6vw, 18px); white-space: nowrap; }
.col.filler span { color: var(--cut); }
.col.filler .bars i { background: var(--cut); opacity: 0.55; }
.col.sel { background: var(--accent-soft); }
.col.cut { opacity: 0; }

/* preview switch (local only) */
.pick {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; padding: 5px 6px 5px 14px;
  background: var(--text); color: var(--bg); border-radius: 999px; font-size: 13px; z-index: 5;
  box-shadow: 0 10px 30px -10px oklch(0 0 0 / 0.5);
}
.pick span { opacity: 0.7; margin-right: 6px; }
.pick a { color: inherit; text-decoration: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; }
.pick a.cur { background: var(--bg); color: var(--text); }

/* the stage: frame + transcript + timeline */
.stage {
  position: relative;
  margin-top: clamp(28px, 4vw, 44px);
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1.050fr) minmax(0, 1fr);
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.frame {
  position: relative;
  margin: 16px 0 16px 16px;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: var(--frame-bg);
  align-self: start;
}
.person { position: absolute; inset: 0; width: 100%; height: 100%; }
.clock {
  position: absolute; top: 12px; right: 14px;
  font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  color: oklch(1 0 0 / 0.72);
}
.voice { position: absolute; top: 14px; left: 14px; display: flex; gap: 3px; align-items: center; height: 14px; }
.voice i { width: 3px; height: 4px; border-radius: 2px; background: oklch(1 0 0 / 0.7); }
.playing .voice i { animation: voice 0.7s ease-in-out infinite alternate; }
.playing .voice i:nth-child(2) { animation-delay: -0.5s; }
.playing .voice i:nth-child(3) { animation-delay: -0.2s; }
.playing .voice i:nth-child(4) { animation-delay: -0.6s; }
.playing .voice i:nth-child(5) { animation-delay: -0.35s; }
@keyframes voice { to { height: 14px; } }
.caption {
  position: absolute; left: 0; right: 0; bottom: 8%;
  margin: 0; padding: 0 16px; text-align: center;
  font-weight: 650; font-size: clamp(15px, 2.100vw, 23px); line-height: 1.25; letter-spacing: -0.01em;
  color: oklch(1 0 0 / 0.55);
  text-shadow: 0 1px 10px oklch(0 0 0 / 0.5);
  min-height: 1.25em;
}
.caption b { font-weight: inherit; color: #fff; }

.doc { padding: 26px 30px 18px 30px; display: flex; flex-direction: column; min-width: 0; }
.transcript {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(19px, 1.9vw, 23px);
  line-height: 1.62;
  flex: 1;
}
.w {
  padding: 2px 1px;
  border-radius: 4px;
  transition: background-color 0.18s, color 0.25s;
  -webkit-tap-highlight-color: transparent;
}
.w.filler { text-decoration: underline dotted var(--amber); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.w.sel { background: var(--accent-soft); }
.w.on { background: var(--accent-soft); color: var(--accent-ink); }
.w.cut { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--cut); text-decoration-thickness: 1.500px; opacity: 0.75; }
.w.cut:hover { opacity: 1; }
.w:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint { margin: 14px 0 0; font-size: 13px; color: var(--faint); }

.timeline {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}
.play {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: var(--text); color: var(--bg);
  display: grid; place-items: center; cursor: pointer;
  transition: transform 0.12s;
}
.play:active { transform: scale(0.94); }
.play svg { width: 18px; height: 18px; fill: currentColor; }
.play:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.track { position: relative; flex: 1; height: 40px; display: flex; align-items: center; min-width: 0; overflow: hidden; }
.blk {
  height: 100%; min-width: 0; flex-basis: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: space-evenly; gap: 1px;
  transition: flex-grow 0.55s cubic-bezier(0.3, 0.7, 0.2, 1), opacity 0.35s, background-color 0.2s;
  border-radius: 3px;
}
.blk i { flex: none; width: 2px; border-radius: 1px; background: var(--faint); transition: background-color 0.2s; }
.blk.sel { background: var(--accent-soft); }
.blk.sel i, .blk.on i { background: var(--accent); }
.blk.cut { opacity: 0; }
.playhead {
  position: absolute; top: -3px; bottom: -3px; left: 0; width: 2px; border-radius: 1px;
  background: var(--accent-ink); pointer-events: none; opacity: 0;
  transition: opacity 0.2s;
}
.playing .playhead, .paused .playhead { opacity: 1; }
.length { flex: none; display: flex; gap: 8px; align-items: baseline; font-variant-numeric: tabular-nums; font-size: 14px; min-width: 76px; justify-content: flex-end; }
.length s { color: var(--faint); text-decoration-color: var(--cut); }
.length b { font-weight: 600; }

.keycap {
  position: absolute; z-index: 2;
  left: 0; top: 0;
  width: 58px; height: 46px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 22px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 3px 0 var(--line), 0 12px 28px -8px oklch(0.27 0.014 152 / 0.35);
  opacity: 0; pointer-events: none;
  transform: translateY(6px) scale(0.9);
  transition: opacity 0.2s, transform 0.2s;
}
.keycap.show { opacity: 1; transform: none; }
.keycap.press { transform: translateY(3px); box-shadow: 0 0 0 var(--line), 0 6px 14px -8px oklch(0.27 0.014 152 / 0.35); }

/* three points */
.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); padding: clamp(56px, 8vw, 96px) 0 0; }
.point svg { width: 40px; height: 40px; fill: none; stroke: var(--accent-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.point svg .strike { stroke: var(--cut); }
.point h2 { margin: 14px 0 6px; font-family: var(--serif); font-weight: 500; font-size: 24px; letter-spacing: -0.015em; line-height: 1.2; }
.point p { margin: 0; color: var(--muted); max-width: 30ch; }

/* sign-up */
.join { text-align: center; padding: clamp(64px, 9vw, 112px) 0 clamp(48px, 6vw, 72px); }
.join h2 { margin: 0 0 22px; font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.03em; line-height: 1.05; }
form { display: flex; gap: 8px; justify-content: center; max-width: 440px; margin: 0 auto; }
input[type="email"] {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px;
  font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="email"]::placeholder { color: var(--faint); }
input[type="email"]:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
form button {
  flex: none; height: 48px; padding: 0 20px;
  font: inherit; font-weight: 600; color: var(--bg);
  background: var(--text); border: 0; border-radius: 12px; cursor: pointer;
  transition: transform 0.12s, opacity 0.15s;
}
form button:active { transform: scale(0.97); }
form button:disabled { opacity: 0.6; cursor: default; }
form button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.note { margin: 14px 0 0; font-size: 14px; color: var(--muted); min-height: 1.5em; }
.note.ok { color: var(--accent-ink); font-weight: 500; }
.note.err { color: var(--cut); }

footer { padding: 18px 0 64px; font-size: 13px; color: var(--faint); text-align: center; }
footer a { color: inherit; }

@media (max-width: 820px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .blk { gap: 0; }
  .blk i { width: 1.5px; }
  .blk i:nth-child(even) { display: none; }
  .frame { margin: 12px 12px 0; }
  .doc { padding: 20px 20px 14px; }
  .points { grid-template-columns: 1fr; gap: 32px; }
  .point p { max-width: none; }
  .timeline { padding: 10px 12px 12px; gap: 10px; }
  .length { min-width: 0; }
  .length s { display: none; }
}
@media (max-width: 460px) {
  main, .top, footer { width: calc(100% - 32px); }
  form { flex-direction: column; }
  input[type="email"] { flex: none; width: 100%; }
  form button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* D: keep headline, card and sign-up on one screen */
.v-d .hero { padding: 20px 0; }
.v-d h1 { font-size: clamp(36px, 5.6vw, 68px); }
.v-d .stage { width: min(900px, 100%); margin-inline: auto; margin-top: 26px; }
.v-d .frame { aspect-ratio: 16 / 9; margin: 12px 0 12px 12px; }
.v-d .doc { padding: 18px 24px 12px; }
.v-d .transcript { font-size: clamp(16px, 1.5vw, 19px); line-height: 1.55; }
.v-d .timeline { padding: 8px 14px 8px 12px; }
.v-d .track { height: 30px; }
.v-d .sub { margin: 22px 0 20px; }
.v-c .sub, .v-d .sub { font-size: clamp(17px, 1.9vw, 20px); }
@media (max-width: 820px) {
  .v-d .frame { margin: 12px 12px 0; }
  .row { grid-template-columns: minmax(0, 1fr) 40px; }
  .row .lab { grid-column: 1 / -1; }
}
.v-c .hero { padding: 16px 0; }
.v-c h1 { font-size: clamp(40px, 7vw, 84px); }
.v-c .ba { margin-top: clamp(22px, 3vw, 36px); }
.v-c .sub { margin: 14px 0 20px; }

/* E: real clip, two lines, a strip of frames */
.v-e .hero { padding: 20px 0; }
.v-e h1 { font-size: clamp(42px, 7.6vw, 92px); }
.v-e .sub { margin: 26px 0 22px; }
.reel {
  position: relative; width: min(820px, 100%); margin: clamp(26px, 3.6vw, 40px) auto 0;
  display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: center; column-gap: 28px; row-gap: 16px;
  text-align: left;
}
.shot { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: var(--frame-bg); display: block; box-shadow: var(--shadow); }
.lines { margin: 0; font-family: var(--serif); font-size: clamp(20px, 2.1vw, 26px); line-height: 1.45; }
.fumble { border-radius: 5px; padding: 2px 0; box-decoration-break: clone; -webkit-box-decoration-break: clone; transition: background-color 0.2s, color 0.2s, opacity 0.3s; }
.fumble.sel { background: var(--accent-soft); color: var(--accent-ink); }
.fumble.gone { display: none; }
.film { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 46px; }
.frames { position: relative; display: flex; width: calc(100% - 52px); max-width: 720px; justify-content: center; }
.frames { width: auto; max-width: none; }
.thumb {
  flex: none; width: clamp(18px, 4.6vw, 44px); aspect-ratio: 16 / 10; background-size: cover; background-position: center;
  transition: width 0.6s cubic-bezier(0.3, 0.7, 0.2, 1), opacity 0.35s, filter 0.2s;
}
.thumb:first-of-type { border-radius: 6px 0 0 6px; }
.thumb:last-of-type { border-radius: 0 6px 6px 0; }
.thumb.sel { filter: sepia(1) hue-rotate(70deg) saturate(1.6) brightness(0.9); }
.thumb.cut { width: 0; opacity: 0; }
.film .playhead { opacity: 1; top: -4px; bottom: -4px; background: #fff; box-shadow: 0 0 0 1px oklch(0 0 0 / 0.35); }
.film .len { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 34px; }
.reel .replay { position: absolute; right: -40px; bottom: 8px; }
@media (max-width: 820px) {
  .reel { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
  .shot { width: min(300px, 100%); margin-inline: auto; }
  .lines { text-align: center; min-height: 4.35em; }
  .reel .replay { position: static; margin: 0 auto; grid-column: 1 / -1; }
}

/* F: fillers go, then the headline grows */
.v-f h1 {
  height: clamp(34px, 9.2vw, 104px); display: flex; align-items: center; justify-content: center; white-space: nowrap;
  font-size: clamp(17px, 5.2vw, 62px); transition: font-size 0.7s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.v-f h1.big { font-size: clamp(34px, 9.2vw, 104px); }
.v-f .hero { padding-top: clamp(70px, 9vw, 110px); }

/* G: headline + real clip + frame strip */
.v-g .hero { padding: 16px 0; }
.v-g h1 {
  height: clamp(44px, 8.4vw, 96px); display: flex; align-items: center; justify-content: center;
  font-size: clamp(22px, 5.4vw, 64px); transition: font-size 0.7s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.v-g h1.big { font-size: clamp(44px, 8.4vw, 96px); }
@media (min-width: 821px) { .v-g h1 { white-space: nowrap; } }
@media (max-width: 820px) { .v-g h1 { height: 2.4em; } .v-g h1.big { height: auto; min-height: 2.4em; } }
.reel.g { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: clamp(20px, 2.8vw, 30px); }
.reel.g .shot { width: min(320px, 78%); }
.reel.g .film { width: 100%; }
.v-g .sub { margin: 22px 0 20px; }

/* H: one cut, full-size headline, real clip */
.v-h .hero { padding: 16px 0; }
.v-h h1 { font-size: clamp(40px, 8.4vw, 96px); min-height: 1em; }
@media (min-width: 821px) { .v-h h1 { white-space: nowrap; } }
.v-h .sub { margin: 22px 0 20px; }
.pick[hidden] { display: none; }
