/* Landing page. Cinematic "edit bay" direction: warm black, paper-white type,
   one vermilion record accent and a mint signal colour for audio. */
:root {
  --ink: #0d0c0a;
  --ink-2: #16140f;
  --line: #2a2620;
  --line-strong: #3d372e;
  --paper: #f2ede3;
  --muted: #a39c8f;
  --rec: #ff5a3c;
  --rec-ink: #1d0b05;
  --signal: #7fd4c1;

  --serif: "ScrollReel Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "ScrollReel Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --gutter: 32px;
  --max: 1180px;
  font-family: var(--sans);
}

* { box-sizing: border-box; min-width: 0; }

html { overflow-x: clip; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body.landing {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  min-height: 100vh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

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

/* ---- Nav ---- */
.l-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
}
.l-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rec);
  box-shadow: 0 0 0 4px rgba(255, 90, 60, 0.18);
}
.l-nav-cta {
  color: var(--paper);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.l-nav-cta:hover { border-color: var(--paper); }
.l-nav-links { display: flex; align-items: center; gap: 6px; }
.l-nav-link {
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease;
}
.l-nav-link:hover { color: var(--paper); }
.l-nav-link:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* ---- Shared type ---- */
.l-kicker, .l-section-kicker {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--rec);
  margin: 0 0 18px;
}

.l-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.l-btn-primary { background: var(--rec); color: var(--rec-ink); }
.l-btn-primary:hover { transform: translateY(-1px); background: #ff7255; }
.l-btn-ghost { color: var(--paper); border: 1px solid var(--line-strong); }
.l-btn-ghost:hover { border-color: var(--paper); }

/* ---- Scroll story ---- */
.reel {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  grid-template-areas:
    "intro    stage"
    "chapters stage";
  column-gap: 56px;
}

.reel-intro {
  grid-area: intro;
  min-height: calc(100svh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 48px;
}
.l-hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5.6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  max-width: 13ch;
  text-wrap: balance;
}
.l-hero-sub {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  max-width: 44ch;
  margin: 0 0 34px;
}
.l-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.reel-stage-cell { grid-area: stage; }
.reel-stage {
  --phone-h: min(64svh, 600px);
  --phone-w: calc(var(--phone-h) * 9 / 16);
  position: sticky;
  top: 0;
  height: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.phone {
  position: relative;
  width: var(--phone-w);
  height: var(--phone-h);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
  container-type: size;
}

/* Painted dusk-over-water scene: matches the demo script, no stock photo. */
.phone-scene {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #101828 0%, #2b2f4a 30%, #8a4b48 52%, #d88a5a 58%, #0f1d2b 58.4%, #0a141f 100%);
}
.scene-sun {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 46%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 140, 0.95) 0 30%, rgba(255, 140, 90, 0.35) 46%, transparent 70%);
  clip-path: inset(0 0 50% 0);
}
.scene-sea {
  position: absolute;
  left: 0;
  right: 0;
  top: 58.4%;
  bottom: 0;
  background:
    repeating-linear-gradient(180deg, rgba(255, 190, 140, 0.16) 0 1px, transparent 1px 9px),
    linear-gradient(180deg, rgba(216, 138, 90, 0.25), transparent 45%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
}
.phone-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.32); }

.phone-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 0 7%;
  text-align: center;
  text-wrap: balance;
  transform: translateY(22%); /* static fallback frame; landing.js drives it */
  will-change: transform;
}
.phone-track p {
  margin: 0;
  font-weight: 700;
  font-size: 15px;
  font-size: 5.6cqw;
  line-height: 1.5;
  color: var(--paper);
  opacity: 0.5;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  transition: opacity 0.25s ease;
}
.phone-track p.is-live { opacity: 1; }

/* Export card that lands once the last line has cleared the frame. */
.phone-done {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 8%;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(13, 12, 10, 0.78);
  border: 1px solid rgba(127, 212, 193, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.phone.is-done .phone-done { opacity: 1; transform: none; }
.phone-done-play {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--signal);
  position: relative;
}
.phone-done-play::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 10px;
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent var(--ink);
}
.phone-done-name { font-size: 14px; font-weight: 700; color: var(--paper); }
.phone-done-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); }

.timeline { width: max(var(--phone-w), 260px); }
.timeline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  white-space: nowrap;
}
.timecode { font-variant-numeric: tabular-nums; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}
.status[data-state="voice"]::before { background: var(--signal); }
.status[data-state="render"]::before { background: var(--rec); }
.status[data-state="done"] { color: var(--signal); }
.status[data-state="done"]::before { background: var(--signal); }

.wave {
  position: relative;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--line);
}
.wave i {
  flex: 1;
  height: var(--h, 30%);
  border-radius: 2px;
  background: var(--line-strong);
}
.wave i.on { background: var(--signal); }
.wave-playhead {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--paper);
  will-change: transform;
}

/* Chapters scroll past the pinned stage. */
.chapters {
  grid-area: chapters;
  list-style: none;
  margin: 0;
  padding: 0 0 18vh;
  counter-reset: none;
}
.chapter {
  min-height: 72svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--line);
  padding-left: 28px;
  opacity: 0.38;
  transition: opacity 0.3s ease, border-color 0.3s ease;
}
.chapter.is-active { opacity: 1; border-left-color: var(--rec); }
.chapter-num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--rec);
  margin-bottom: 12px;
}
.chapter h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 42px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 14px;
}
.chapter p {
  margin: 0;
  max-width: 42ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

/* No JS / reduced motion: nothing is pinned or dimmed. */
.landing:not(.js-scrub) .chapter { opacity: 1; min-height: 0; padding-block: 28px; }
.landing:not(.js-scrub) .chapters { padding-bottom: 72px; }
.landing:not(.js-scrub) .phone-track p { opacity: 1; }
.landing:not(.js-scrub) .timeline { display: none; }

/* ---- Spec sheet ---- */
.spec {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px var(--gutter) 40px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 56px;
  border-top: 1px solid var(--line);
}
.spec-head { position: sticky; top: 40px; align-self: start; }
.spec-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 14ch;
}
.spec-list { margin: 0; }
.spec-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.spec-row:first-child { padding-top: 4px; }
.spec-row dt {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding-top: 4px;
}
.spec-row dd {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--paper);
}
.spec-row dd strong { font-weight: 600; }
.hl { color: var(--rec); }

.ratios {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.ratios li { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ratio {
  display: block;
  height: 34px;
  aspect-ratio: var(--r);
  border: 1.5px solid var(--paper);
  border-radius: 4px;
}
.ratios li:nth-child(4) .ratio { height: auto; width: 46px; }
.ratio--custom { border-style: dashed; border-color: var(--muted); }

.type-samples { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; }
.ts { font-size: 24px; line-height: 1.5; }
.ts-sans { font-family: var(--sans); font-weight: 700; }
.ts-serif { font-family: var(--serif); }
.ts-urdu { font-family: "ScrollReel Urdu", "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif; font-size: 22px; line-height: 2; }
.ts-note { flex-basis: 100%; color: var(--muted); font-size: 14.5px; }

/* ---- CTA ---- */
.l-cta {
  max-width: 820px;
  margin: 0 auto;
  padding: 96px var(--gutter) 112px;
  text-align: center;
}
.l-cta h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
}

/* ---- Footer ---- */
.l-footer {
  border-top: 1px solid var(--line);
  padding: 22px var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  font-size: 13px;
  color: var(--muted);
}
.l-footer-brand { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.l-footer-brand > span:first-child { color: var(--paper); font-weight: 600; }
.l-footer-muted strong { color: var(--paper); font-weight: 600; }
.l-footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.l-footer-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  cursor: pointer;
}
.l-footer-link:hover { color: var(--paper); text-decoration-color: currentColor; }
.l-footer-link:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

/* ---- Tablet / phone: stage pins to the top, chapters scroll beneath it ---- */
@media (max-width: 880px) {
  :root { --gutter: 20px; }
  .reel {
    grid-template-columns: 1fr;
    grid-template-areas: "intro" "stage" "chapters";
  }
  .reel-intro { min-height: 0; padding: 28px 0 40px; }
  .reel-stage-cell {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--ink);
    margin: 0 calc(-1 * var(--gutter));
    padding: 14px var(--gutter) 12px;
    border-bottom: 1px solid var(--line);
  }
  .reel-stage {
    --phone-h: min(48svh, 440px);
    position: static;
    height: auto;
    gap: 12px;
  }
  .phone { border-radius: 16px; }
  .chapter { min-height: 46svh; padding-left: 20px; }
  .chapters { padding-bottom: 24svh; }

  .spec { grid-template-columns: 1fr; gap: 28px; padding-top: 56px; }
  .spec-head { position: static; }
  .spec-row { grid-template-columns: 1fr; gap: 8px; }
}

/* Without the scroll story the stage shouldn't hog the screen. */
@media (max-width: 880px) {
  .landing:not(.js-scrub) .reel-stage-cell { position: static; border-bottom: 0; }
}

@media (max-width: 420px) {
  .l-hero-actions .l-btn { flex: 1 1 auto; justify-content: center; }
}
