/* Lead gen + qualifier. Same order as the series: heading, stats, statement
   (the entry has no client quote), the problem, before, now, what changed.
   Every section reads with no scroll effects; page.js adds the tab pile and
   the dossier turn on top. Loaded after the engine and the site stylesheet. */

:root {
  --sc-canvas: var(--bg);
  --sc-ink: var(--text);
  --sc-accent: var(--accent);
  --sc-font-display: var(--h-font);
  --sc-font-text: var(--b-font);
  --sc-font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;

  /* This page's ground: a navy ink instead of the site's near black, so the
     Before reads like a late-night browser session. */
  --ground: #0e1320;
  --ground-2: #161d2e;
  --ground-3: #1e2740;
  --before-ink: #f2f2f2;
  --before-soft: #a3a9b8;                   /* 7.6:1 on --ground */
  --before-line: #283149;
  --accent-on-dark: var(--accent);          /* 5.0:1 on --ground */
  --accent-on-light: #c8200f;               /* 5.3:1 on --bg */

  --side-pad: clamp(24px, 5vw, 88px);
  --gap: clamp(56px, 8vh, 96px);
}

/* Owner's decision on the series: an ordinary header at the top. */
.tf-header { position: absolute; }

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

/* ------------------------------------------------------------- layout -- */
.lg { background: var(--bg); color: var(--text); }
.wrap { max-width: 76rem; margin-inline: auto; padding-inline: var(--side-pad); }
.lg > .wrap + .wrap, .lg > .wrap + section, .lg > section + .wrap { margin-top: var(--gap); }
.prose > * { max-width: 46rem; }
.prose > * + * { margin-top: 18px; }
.prose p, .prose li { font-size: 1.1rem; line-height: 1.7; color: var(--muted); }
.prose p strong, .prose li strong { color: var(--text); }
.lg h2 { font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.8rem); letter-spacing: -.02em; }
.lg h3 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.8rem); letter-spacing: -.01em; }

/* ---------------------------------------------------------------- hero -- */
.lg-hero {
  position: relative; overflow: clip;
  padding-top: clamp(150px, 22vh, 220px); padding-bottom: 24px;
}
.hero-copy { position: relative; z-index: 2; }
.hero-copy > * + * { margin-top: 20px; }
.eyebrow { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-on-light); }
.hero-line {
  font-family: var(--h-font); font-weight: 700;
  font-size: clamp(2rem, 1.1rem + 2.6vw, 3.4rem);
  line-height: 1.08; letter-spacing: -.03em;
  max-width: 24ch; margin: 0;
}
.lead { font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); line-height: 1.6; max-width: 40ch; color: var(--muted); }

/* Hero depth: the sheet grid lags most, the dossier card less. */
.plane { position: absolute; margin: 0; pointer-events: none; }
.plane--grid {
  inset: -340px 0 0 0; z-index: 0;
  --grid-line: color-mix(in oklab, var(--text) 6%, transparent);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 120px 32px;
  -webkit-mask-image: radial-gradient(80% 70% at 70% 60%, #000 30%, transparent 85%);
          mask-image: radial-gradient(80% 70% at 70% 60%, #000 30%, transparent 85%);
}
.plane--mid { z-index: 1; right: max(var(--side-pad), calc((100% - 76rem) / 2 + var(--side-pad))); bottom: 40px; width: 15rem; }
.mini-dossier {
  display: flex; flex-direction: column; gap: 10px; padding: 18px 20px;
  background: var(--card-bg); border-radius: var(--card-radius); box-shadow: var(--card-shadow);
  transform: rotate(-3deg);
}
.mini-title { font-size: 13px; font-weight: 600; color: var(--muted); }
.mini-line { height: 6px; border-radius: 3px; background: var(--line); }
.mini-line:nth-of-type(3) { width: 70%; }
.mini-stamp, .stamp {
  display: grid; place-items: center; border-radius: 10px;
  border: 3px solid var(--accent-on-light); color: var(--accent-on-light);
  font-family: var(--h-font); font-weight: 800; line-height: 1;
  transform: rotate(-12deg);
}
.mini-stamp { position: absolute; right: -16px; bottom: -18px; width: 52px; height: 52px; font-size: 30px; background: var(--card-bg); }

/* --------------------------------------------------------------- stats -- */
.lg > .stats { margin-top: 56px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.stat {
  display: flex; flex-direction: column; padding: 26px 26px 28px;
  background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--card-radius);
}
.stat-viz { height: 64px; margin-bottom: 22px; }

/* 4 calls: 4 call rings, each fills in turn. */
.viz-calls { display: flex; gap: 12px; align-items: center; }
.viz-calls i { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-on-light); box-shadow: inset 0 0 0 12px #fbe3df; }

/* ~100 a day: 100 small ticks, the day's actions. */
.viz-actions { display: grid; grid-template-columns: repeat(25, 1fr); gap: 3px; align-content: center; }
.viz-actions i { height: 11px; border-radius: 2px; background: var(--accent-on-light); }

/* $0.004 a lead: a lens finds one lead. */
.viz-find { width: 64px; overflow: visible; }
.find-lens { fill: none; stroke: var(--text); stroke-width: 4; }
.find-handle { stroke: var(--text); stroke-width: 6; stroke-linecap: round; }
.find-lead { fill: var(--accent-on-light); transform-origin: 27px 27px; }

.lg-motion .stat { transition: opacity .7s var(--sc-ease-out, ease-out), transform .7s var(--sc-ease-out, ease-out); transition-delay: calc(var(--n) * 120ms); }
.lg-motion .stats:not(.is-in) .stat { opacity: 0; transform: translateY(28px); }
.lg-motion .viz-calls i { transition: transform .45s var(--sc-ease-out, ease-out), opacity .45s; transition-delay: calc(.5s + var(--i) * 180ms); }
.lg-motion .stats:not(.is-in) .viz-calls i { transform: scale(.4); opacity: .15; }
.lg-motion .viz-actions i { transition: opacity .3s; transition-delay: calc(.5s + var(--i) * 9ms); }
.lg-motion .stats:not(.is-in) .viz-actions i { opacity: .12; }
.lg-motion .viz-find .find-lead { transition: transform .5s var(--sc-ease-out, ease-out) 1.1s; }
.lg-motion .viz-find .find-lens, .lg-motion .viz-find .find-handle { transition: transform 1s var(--sc-ease-out, ease-out) .4s; }
.lg-motion .stats:not(.is-in) .find-lead { transform: scale(0); }
.lg-motion .stats:not(.is-in) .find-lens, .lg-motion .stats:not(.is-in) .find-handle { transform: translate(14px, 10px); }

.stat-n {
  margin: 0; font-family: var(--h-font); font-weight: 700; color: var(--text);
  font-size: clamp(2.2rem, 1.6rem + 2vw, 3.4rem); line-height: 1.05; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.stat-l { margin: 8px 0 0; font-size: 1rem; color: var(--muted); }

/* ----------------------------------------------------------- statement -- */
.statement-line {
  margin: 0; font-family: var(--h-font); font-weight: 600; color: var(--text);
  font-size: clamp(1.7rem, 1.2rem + 2.2vw, 3rem); line-height: 1.2; letter-spacing: -.025em;
  max-width: 24ch; text-wrap: balance;
}
.statement-note { margin: 16px 0 0; color: var(--muted); }

/* -------------------------------------------------------------- before -- */
.before {
  background: var(--ground); color: var(--before-ink);
  padding-top: var(--gap); padding-bottom: var(--gap);
}
.before h2, .before h3 { color: #fff; }
.before .prose p { color: var(--before-soft); }
.before .prose p strong { color: #fff; }
.before .cost { margin-top: var(--gap); }
.before .cost .cost-line { font-size: clamp(1.2rem, 1rem + .6vw, 1.45rem); line-height: 1.5; color: var(--before-ink); }
.pull {
  margin: 36px 0 0; padding-left: 22px; border-left: 4px solid var(--accent-on-dark);
  font-family: var(--h-font); font-weight: 600; color: #fff;
  font-size: clamp(1.6rem, 1.1rem + 2vw, 2.6rem); line-height: 1.2; letter-spacing: -.02em;
  max-width: 22ch; text-wrap: balance;
}

.grind { margin-top: 48px; }
.grind-stage { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.steps { margin: 20px 0 0; padding-left: 1.4em; color: var(--before-soft); font-size: 1.1rem; line-height: 1.5; }
.steps li + li { margin-top: 8px; }

.timer { margin-top: 28px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.timer-n {
  font-family: var(--sc-font-mono); font-weight: 600; font-variant-numeric: tabular-nums;
  font-size: clamp(3rem, 2rem + 4vw, 5.5rem); line-height: 1; color: var(--accent-on-dark);
}
.timer-l { color: var(--before-soft); }

.scene-note, .lead-count { font-size: 14px; color: var(--before-soft); margin: 0 0 12px; }
.lead-count { margin: 14px 0 0; font-weight: 600; }

/* The desk: 5 browser tabs for 1 lead, piled with an offset. The same pile
   reads with no motion; page.js only brings each one in on its step. */
.desk { position: relative; height: 22rem; --tab-dx: 22px; --tab-dy: 38px; }   /* dy clears each tab's title bar, so every title stays readable in the pile */
.tab {
  position: absolute; left: 0; top: 0;
  width: calc(100% - 4 * var(--tab-dx)); height: calc(100% - 4 * var(--tab-dy));
  transform: translate(calc(var(--k) * var(--tab-dx)), calc(var(--k) * var(--tab-dy)));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--ground-2); border: 1px solid var(--before-line); border-radius: 12px;
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .85);
}
.tab-bar {
  margin: 0; flex: none; display: flex; align-items: center; gap: 7px; padding: 10px 14px;
  background: var(--ground-3); border-bottom: 1px solid var(--before-line);
  font-size: 13px; color: var(--before-ink);
}
.tab-bar i { width: 9px; height: 9px; border-radius: 50%; background: #3a4560; }
.tab-bar span { margin-left: 8px; font-weight: 600; }
.tab-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.ln { height: 9px; border-radius: 5px; background: #2b3550; }
.ln--s { width: 55%; }
.pin { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent-on-dark); }
.block { height: 54px; border-radius: 8px; background: #263050; }
.field { height: 26px; border-radius: 6px; border: 1px solid #36415f; }
.avatars { display: flex; gap: 8px; }
.avatars b { width: 30px; height: 30px; border-radius: 50%; background: #2f3a58; }
.msg { margin: 0; font-family: var(--sc-font-mono); font-size: 15px; line-height: 1.5; color: #fff; }
.caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -3px; background: var(--accent-on-dark); animation: lg-blink 1s steps(1) infinite; }
@keyframes lg-blink { 50% { opacity: 0; } }

/* The pinned grind. Only with motion: page.js sets .lg-motion. */
.lg-motion .grind { margin-top: 0; }
.lg-motion .grind-stage {
  align-items: stretch; padding-block: clamp(56px, 10vh, 112px);
  background: var(--ground);
}
.lg-motion .grind-copy { display: flex; flex-direction: column; justify-content: center; }
.lg-motion .scene { display: flex; flex-direction: column; min-height: 0; }
.lg-motion .desk { flex: 1; height: auto; min-height: 14rem; max-height: 30rem; }
.lg-motion .tab { will-change: transform, opacity; }

/* One step at a time, as in the series. */
.lg-motion .steps { display: grid; list-style: none; padding-left: 0; margin-top: 28px; }
.lg-motion .steps li {
  grid-area: 1 / 1; margin: 0; color: #fff;
  font-family: var(--h-font); font-weight: 600; letter-spacing: -.01em;
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2.1rem); line-height: 1.25;
  will-change: transform, opacity, filter;
}
.lg-motion .steps li::before {
  content: "Step " counter(list-item) " of 4"; display: block; margin-bottom: 10px;
  font-family: var(--b-font); font-size: 14px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent-on-dark);
}
.lg-motion .steps::after {
  content: ""; grid-area: 2 / 1; margin-top: 24px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-on-dark) calc(var(--sp, 0) * 100%), var(--before-line) 0);
}

/* ----------------------------------------------------------------- now --
   The peak. With motion the stage starts on the navy ground, the tab pile
   folds into its 8:00, the ground lifts to light (--lit, 0 to 1), and the
   dossier card builds stage by stage until the stamp lands. */
.now { padding-bottom: 0; }
.turn-stage {
  --lit: 1;
  background: color-mix(in oklab, var(--bg) calc(var(--lit) * 100%), var(--ground));
  display: flex; align-items: center;
  padding-block: var(--gap);
}
.turn-grid { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: center; }
.turn-now > * + * { margin-top: 16px; }
.turn-now h2 { font-size: clamp(3rem, 2rem + 4vw, 5.5rem); line-height: 1; letter-spacing: -.04em; }
.turn-before { display: none; }
.lg-motion .turn-copy { display: grid; }
.lg-motion .turn-copy > * { grid-area: 1 / 1; align-self: center; }
.lg-motion .turn-before {
  display: block; margin: 0; max-width: 15ch; color: #fff;
  font-family: var(--h-font); font-weight: 600; letter-spacing: -.02em;
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.4rem); line-height: 1.12;
}
.time { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-on-light); }
.turn-line { font-size: clamp(1.2rem, 1rem + .6vw, 1.5rem); line-height: 1.5; color: var(--text); max-width: 26ch; }
.now > .prose { margin-top: 8px; }

.turn-objects { display: grid; }
.turn-objects > * { grid-area: 1 / 1; align-self: center; }

.dossier {
  position: relative;
  background: var(--card-bg); border-radius: var(--card-radius);
  box-shadow: var(--card-shadow); padding: 24px 28px; max-width: 34rem;
}
.dossier-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.dossier-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text); }
.dossier-note { margin: 0; font-size: 13px; color: var(--muted); }
.rail { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rail li {
  padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: #fbe3df; color: #9e1a0c;
}
.rail li.is-off { background: #ececec; color: #4d4d4d; }
.fields { margin: 14px 0 0; }
.f { position: relative; display: grid; grid-template-columns: 5.5rem 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.f dt { font-size: 14px; color: var(--muted); }
.f dd { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.stamp { position: absolute; right: 4px; top: 50%; margin-top: -30px; width: 60px; height: 60px; font-size: 36px; background: var(--card-bg); }
.sendrow { margin: 16px 0 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 15px; font-weight: 600; color: var(--text); }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--dark); color: #fff; font-size: 13px; }

.pile { display: none; }
.lg-motion .turn-stage { height: 100svh; padding-block: 0; }
.lg-motion .pile {
  display: flex; flex-direction: column; overflow: hidden;
  max-width: 26rem; padding: 18px 22px;
  background: var(--ground-2); border: 1px solid var(--before-line); border-radius: var(--inner-radius);
  will-change: transform, height, opacity;
}
.pile-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: flex-end; flex: 1; min-height: 0; overflow: hidden; }
.pile-rows li { flex: none; padding: 9px 0; border-bottom: 1px solid var(--before-line); color: var(--before-ink); font-size: 15px; }
.folded { margin: 14px 0 0; flex: none; display: flex; align-items: baseline; gap: 12px; color: var(--before-soft); }
.folded .timer-n { font-size: clamp(2.4rem, 1.8rem + 2vw, 3.6rem); }
.lg-motion .turn-stage .dossier { opacity: 0; }

/* Trust guards: 4 small cards. */
.guards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 46rem; }
.guard { padding: 20px 22px; background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--card-radius); }
.guard h4 { margin: 0; font-size: 1.05rem; color: var(--text); }
.guard p { margin: 8px 0 0; font-size: 1rem; line-height: 1.55; }
.cs-steps { padding-left: 1.4em; }
.cs-steps li + li { margin-top: 10px; }

/* What changed: the 80 caterers, by fit. */
.split { margin: 28px 0 0; }
.split-bar { display: flex; gap: 4px; height: 18px; }
.split-bar span { flex: var(--n) 1 0; border-radius: 4px; background: #d6d6d6; }
.split-bar .is-primary { background: var(--accent-on-light); }
.split-key { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.split-key li { font-size: 15px; color: var(--muted); }
.split-key li strong { color: var(--text); }
.split-key .is-primary strong { color: var(--accent-on-light); }
.split figcaption { margin-top: 10px; font-size: 15px; color: var(--muted); }

/* --------------------------------------------------------------- close -- */
.close { display: flex; flex-direction: column; align-items: flex-start; padding-bottom: calc(var(--gap) * 1.5); }
.close > * + * { margin-top: 18px; }
.close p { font-size: 1.1rem; color: var(--muted); max-width: 46rem; }
.close .tf-btn { margin-top: 28px; }
.lg .tf-btn:active { transform: translateY(0) scale(.98); filter: brightness(1.05); }

/* --------------------------------------------------------------- tablet -- */
@media (max-width: 1000px) {
  .plane--mid { display: none; }
}

/* ---------------------------------------------------------------- phone -- */
@media (max-width: 760px) {
  .logo-site { display: inline-block; padding-block: 7px; }
  .menu-toggle { padding: 14px 10px; }
  .lg-hero { padding-top: 130px; }
  .hero-line { font-size: clamp(1.7rem, 1.1rem + 3vw, 2.2rem); }
  .stats { grid-template-columns: 1fr; gap: 16px; }
  .guards { grid-template-columns: 1fr; }
  .grind-stage, .turn-grid { grid-template-columns: 1fr; }
  .desk { height: 18rem; }
  .desk { --tab-dx: 12px; --tab-dy: 12px; }
  /* The pinned grind is one screen tall: step and timer on top, the tabs fill the rest. */
  .lg-motion .grind-stage { grid-template-rows: auto 1fr; gap: 16px; padding-block: 72px 92px; }
  .lg-motion .grind-copy h3 { font-size: 1.15rem; }
  .lg-motion .steps { margin-top: 14px; }
  .lg-motion .steps li { font-size: 1.25rem; }
  .lg-motion .steps::after { margin-top: 14px; }
  .lg-motion .timer { margin-top: 12px; }
  .lg-motion .timer-n { font-size: 2.6rem; }
  .lg-motion .desk { min-height: 10rem; }
  .lg-motion .turn-grid { gap: 18px; }
  /* The finished turn has to fit one phone screen. */
  .turn-now h2 { font-size: 2.6rem; }
  .turn-now > * + * { margin-top: 8px; }
  .turn-line { font-size: 1.05rem; max-width: none; }
  .dossier { padding: 16px 18px; }
  .rail { margin-top: 10px; }
  .rail li { padding: 3px 8px; font-size: 12px; }
  .f { grid-template-columns: 4.5rem 1fr; padding: 6px 0; }
  .f dd { font-size: 14px; padding-right: 50px; }
  .stamp { width: 46px; height: 46px; margin-top: -23px; font-size: 28px; }
  .sendrow { margin-top: 10px; font-size: 14px; }
}
@media (max-width: 760px) and (max-height: 720px) {
  .lg-motion .turn-before { font-size: 1.8rem; }
  .time { display: none; }   /* never the illustration note: it must stay with the sample card */
}
