/* heygro.app homepage, v3.
 * A Paper page with one Ink film band. Palette and type come from
 * launch/social/design-system.md (the "quiet proof" system); nothing else.
 * Never red. Leaf appears only on Ink, where it passes contrast. */

/* ── Fonts (bundled, subset to Latin) ───────────────────────────────── */
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/inter-400.woff) format("woff"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/inter-600.woff) format("woff"); }
@font-face { font-family: "Inter"; font-weight: 800; font-style: normal; font-display: swap; src: url(fonts/inter-800.woff) format("woff"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/mono-700.woff) format("woff"); }
/* Arial, reshaped to Inter's metrics, so the swap doesn't move the layout. */
@font-face { font-family: "Inter Fallback"; src: local("Arial"); size-adjust: 107.12%; ascent-override: 90.44%; descent-override: 22.52%; line-gap-override: 0%; }

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  --paper: #F3EFE5;
  --ink: #14251F;
  --ink-hover: #1F3A30;
  --quiet: #56635C;          /* 5.5:1 on Paper */
  --line: #D7D1C4;
  --leaf: #B7D85A;           /* Ink only: 9.9:1 there, 1.4:1 on Paper */
  --on-ink: #F3EFE5;
  --on-ink-2: #A9B6AE;       /* 7.6:1 on Ink */
  --on-ink-3: #8F9C95;       /* 5.6:1 on Ink */

  --sans: "Inter", "Inter Fallback", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --gutter: 20px;
  --measure: 1180px;
  --pad-x: max(var(--gutter), calc((100% - var(--measure)) / 2));

  --nav-h: 56px;
  --band-gap: 14px;          /* the Paper strip under the band */
  --stage-h: calc(100vh - var(--nav-h) - var(--band-gap));
  --travel: 360vh;           /* scroll distance the film is scrubbed across */
  --copy-h: 17rem;           /* phones: the act words sit under the phone in this row */

  /* Crop of the footage that frames the phone. Shared by the canvas, the
     poster and the static stills; film.js reads these too.
     ar = (w * 800) / (h * 1422). The v4 film (9450f8c) keeps the phone
     inside x 0.17-0.83, y 0.10-0.90 in every frame, flips included. */
  --crop-x: 0.15;
  --crop-y: 0.075;
  --crop-w: 0.70;
  --crop-h: 0.85;
  --crop-ar: 0.4633;
}
@supports (height: 100svh) {
  :root { --stage-h: calc(100svh - var(--nav-h) - var(--band-gap)); --travel: 360svh; }
}
@media (min-width: 900px) {
  :root { --gutter: 40px; --nav-h: 64px; --band-gap: 24px; --travel: 420vh; }
  @supports (height: 100svh) { :root { --travel: 420svh; } }
}

/* ── Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body { margin: 0; font: 400 1.0625rem/1.55 var(--sans); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
h1, h2, p, figure, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.film :focus-visible { outline-color: var(--leaf); }

.skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 10px 14px; background: var(--ink); color: var(--paper); border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 10px; }

kbd { font: 700 0.9em/1 var(--mono); letter-spacing: -0.01em; padding: 0.16em 0.4em 0.12em; border-radius: 6px; background: rgba(20, 37, 31, 0.08); white-space: nowrap; }

/* ── Controls ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 600 1rem/1 var(--sans); letter-spacing: -0.005em; text-decoration: none; white-space: nowrap;
  transition: transform 100ms ease-out, background-color 160ms ease-out;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--ink-hover); }
.btn--paper { background: var(--paper); color: var(--ink); }
.btn--paper:hover { background: #FFFDF8; }

.link { font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; text-decoration-color: rgba(20, 37, 31, 0.35); }
.link:hover { text-decoration-color: currentColor; }
.link--on-ink { color: var(--on-ink); text-decoration-color: rgba(243, 239, 229, 0.4); }
.act__cta .link, .close__cta .link { display: inline-flex; align-items: center; min-height: 44px; }

/* ── Nav ────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 20;
  height: var(--nav-h); padding-inline: var(--pad-x);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--paper);
}
.nav__mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.1875rem; letter-spacing: -0.025em; }
.nav__mark img { width: 30px; height: 30px; border-radius: 8px; }
.nav__cta { min-height: 40px; padding: 0 16px; font-size: 0.9375rem; }

/* ── The film band ──────────────────────────────────────────────────── */
.film { position: relative; height: calc(var(--stage-h) + var(--travel)); }
.film__stage {
  position: sticky; top: var(--nav-h);
  height: var(--stage-h); overflow: hidden; isolation: isolate;
  background: var(--ink); color: var(--on-ink);
  display: grid; grid-template-rows: minmax(0, 1fr) var(--copy-h) auto; row-gap: 10px;
  will-change: transform;   /* its own compositor layer while it's pinned */
  padding: 14px var(--gutter) 6px;
}

.film__phone { position: relative; height: 100%; aspect-ratio: var(--crop-ar); justify-self: center; max-width: 100%; }
.film__floor {
  position: absolute; left: 50%; bottom: calc(var(--copy-h) + 30px); z-index: -1;
  width: min(90vw, 520px); height: 110px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(243, 239, 229, 0.09), rgba(243, 239, 229, 0) 100%);
}
.film__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Hidden until it has painted, so the poster shows first. */
.film__canvas { visibility: hidden; }
.film.is-painted .film__canvas { visibility: visible; }
.film__phone > .crop { position: absolute; inset: 0; }
.film.is-painted .film__phone > .crop { visibility: hidden; }

/* The crop: show the part of a 1080 × 1920 frame that holds the phone. */
.crop { position: relative; overflow: hidden; aspect-ratio: var(--crop-ar); }
.crop img {
  position: absolute; top: 0; left: 0; max-width: none;
  width: calc(100% / var(--crop-w)); height: auto;
  transform: translate(calc(-100% * var(--crop-x)), calc(-100% * var(--crop-y)));
}

.film__copy { position: relative; }
.act {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  /* Leaving is quick, arriving waits a beat, so two acts never overlap. */
  transition: opacity 120ms ease-out, transform 120ms ease-out, visibility 0s linear 120ms;
}
.act.is-live {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 220ms ease-out 100ms, transform 220ms ease-out 100ms, visibility 0s;
}
.act.is-turning { opacity: 0.4; }
.act__still { display: none; }
.act__h { font-weight: 800; font-size: clamp(1.875rem, 1.2rem + 2.6vw, 3.75rem); line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance; }
h2.act__h { font-size: clamp(1.625rem, 1.1rem + 2vw, 3rem); }
.act__p { margin-top: 12px; max-width: 30em; color: var(--on-ink-2); font-size: 1rem; line-height: 1.5; }
.act__cta { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.act__cta .btn { min-height: 46px; padding: 0 18px; font-size: 0.9375rem; }
.act__cta .link { font-size: 0.9375rem; }

/* Chapters double as the scrubber: where you are, and a way to jump. */
.scrub { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.scrub__item {
  min-height: 44px; padding: 6px 0 0; border: 0; background: none; cursor: pointer; text-align: left;
  font: 600 0.8125rem/1.2 var(--sans); color: var(--on-ink-3); letter-spacing: 0.005em;
  -webkit-tap-highlight-color: transparent;
}
.scrub__item[aria-current="step"] { color: var(--on-ink); }
.scrub__label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scrub__track { display: block; margin-top: 8px; height: 2px; border-radius: 2px; background: rgba(243, 239, 229, 0.16); overflow: hidden; }
.scrub__fill { display: block; height: 100%; background: var(--leaf); transform-origin: left center; transform: scaleX(0); }
.scrub__item.is-done .scrub__fill { transform: scaleX(1); }

@media (min-width: 900px) {
  .film__stage {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto;
    column-gap: clamp(40px, 6vw, 96px); row-gap: 18px;
    padding: 28px var(--pad-x) 14px;
  }
  .film__phone { grid-column: 2; grid-row: 1; }
  .film__copy { grid-column: 1; grid-row: 1; }
  .film__floor { left: auto; right: var(--pad-x); bottom: 64px; width: 560px; height: 140px; transform: translateX(14%); }
  .act { inset: 0; display: flex; flex-direction: column; justify-content: center; padding-bottom: 6vh; }
  .act__p { margin-top: 18px; font-size: 1.125rem; }
  .act__cta { margin-top: 28px; }
  .act__cta .btn { min-height: 50px; padding: 0 24px; font-size: 1rem; }
  .act__cta .link { font-size: 1rem; }
  .scrub { grid-column: 1 / -1; grid-row: 2; gap: 20px; max-width: 760px; }
  .scrub__item { font-size: 0.875rem; }
}

/* Static: no motion, no film. Each act is a still and its words, in order. */
.is-static .film { height: auto; }
.is-static .film__stage { position: static; height: auto; display: block; padding: 48px var(--pad-x) 56px; }
.is-static .film__phone, .is-static .film__floor, .is-static .scrub { display: none; }
.is-static .film__copy { display: grid; gap: 56px; }
.is-static .act { position: static; opacity: 1; visibility: visible; transform: none; display: grid; gap: 20px; padding: 0; }
.is-static .act__still { display: block; width: min(56vw, 240px); }
/* The JS-only copy of each still has no src until film.js gives it one; never
   let a no-JS browser draw its alt text behind the <noscript> image. */
.act__still img:not([src]) { visibility: hidden; }
@media (min-width: 900px) {
  .is-static .film__copy { gap: 72px; }
  .is-static .act { grid-template-columns: 260px minmax(0, 1fr); align-items: center; column-gap: 64px; }
  .is-static .act__still { width: 260px; }
}

/* ── Field notes ────────────────────────────────────────────────────── */
.notes { padding-top: clamp(24px, 5vw, 56px); }
.note {
  padding: clamp(56px, 9vw, 120px) var(--pad-x) 0;
  display: grid; gap: 28px;
}
.note__h { font-weight: 800; font-size: clamp(2rem, 1.25rem + 3vw, 3.5rem); line-height: 1.04; letter-spacing: -0.032em; max-width: 13ch; text-wrap: balance; }
.note__p { margin-top: 16px; max-width: 32em; color: var(--quiet); font-size: 1.0625rem; line-height: 1.55; }
.note__p kbd { color: var(--ink); }

.proof img { border-radius: 26px; background: #000; box-shadow: 0 1px 2px rgba(20, 37, 31, 0.10), 0 26px 44px -30px rgba(20, 37, 31, 0.55); }
.proof figcaption { margin-top: 14px; font: 700 0.75rem/1.45 var(--mono); color: var(--quiet); letter-spacing: 0; }
.proof--today, .proof--money, .proof--gro { max-width: 460px; }
.widgets { display: grid; grid-template-columns: minmax(0, 220px); gap: 16px; }
.widgets img { border-radius: 13%; box-shadow: 0 1px 2px rgba(20, 37, 31, 0.10), 0 20px 36px -24px rgba(20, 37, 31, 0.55); }

@media (min-width: 900px) {
  .note { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(40px, 6vw, 96px); align-items: start; }
  .note__text { padding-top: 6px; }
  .note__p { margin-top: 22px; font-size: 1.125rem; }
  .proof--capture { max-width: 560px; }
  .proof--today { max-width: 500px; }
  .proof--money { max-width: 420px; }
  .proof--gro { max-width: 380px; }
}

/* ── Privacy ────────────────────────────────────────────────────────── */
.privacy { margin-top: clamp(72px, 11vw, 144px); padding: 0 var(--pad-x); }
.privacy__h { font-weight: 800; font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.25rem); letter-spacing: -0.025em; line-height: 1.1; }
.spec { margin-top: 24px; display: grid; border-bottom: 1px solid var(--line); }
.spec > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); align-items: baseline; }
.spec dt { font: 700 0.8125rem/1.4 var(--mono); color: var(--quiet); }
.spec dd { font-weight: 600; font-size: 1rem; line-height: 1.4; }
@media (min-width: 900px) {
  .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 64px; border-bottom: 0; }
  .spec > div { grid-template-columns: 8.5rem minmax(0, 1fr); padding: 16px 0; }
  .spec > div:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* ── Cartoon ────────────────────────────────────────────────────────── */
.cartoon { margin-top: clamp(72px, 11vw, 144px); padding: 0 var(--pad-x); display: grid; gap: 24px; justify-items: start; }
.cartoon__film { width: min(68vw, 300px); }
.cartoon__film video { width: 100%; height: auto; aspect-ratio: 9 / 16; border-radius: 22px; border: 1px solid var(--line); background: #F2EEE4; }
.cartoon__line { font-weight: 800; font-size: clamp(1.875rem, 1.2rem + 2.6vw, 3rem); line-height: 1.05; letter-spacing: -0.03em; }
.cartoon__meta { margin-top: 10px; font: 700 0.75rem/1.45 var(--mono); color: var(--quiet); }
@media (min-width: 900px) {
  .cartoon { grid-template-columns: 300px minmax(0, 1fr); align-items: center; column-gap: 72px; }
}

/* ── Close ──────────────────────────────────────────────────────────── */
.close { padding: clamp(96px, 14vw, 176px) var(--pad-x) clamp(80px, 11vw, 136px); }
.close__h { font-weight: 800; font-size: clamp(2.125rem, 1.2rem + 4vw, 4.5rem); line-height: 1.02; letter-spacing: -0.038em; max-width: 17ch; text-wrap: balance; }
.close__cta { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); padding: 14px var(--pad-x) 32px; align-items: center; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; font-size: 0.875rem; color: var(--quiet); }
.foot__links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot__links a { display: inline-block; padding: 10px 0; color: var(--ink); text-decoration: none; }
.foot__links a:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .btn, .act { transition: none; }
}
