/* ============================================================
   AfterFire Solutions — image-led scroll story
   Each stage of the first ninety days is a full-viewport
   photograph pinned in place while its marker and headline
   rise through it; the chapter's text follows on paper.
   Scroll linkage: CSS scroll-driven animations (view timeline),
   with a rAF fallback in main.js where unsupported.
   Ported: 21st.dev "Text Parallax Content" (uniquesonu, id 2768).
   Copy is COPY.md. Colours are the flier's.
   ============================================================ */

:root {
  --navy-deep: #0B1728;
  --navy:      #14263F;
  --azure:     #2B6CB0;
  --cornflower:#8FC1EA;
  --ice:       #EDF2F7;
  --slate:     #4A5A6A;
  --white:     #FFFFFF;
  --ink:       #101B2B;

  --serif: "Playfair Display", "Georgia", "Times New Roman", serif;
  --sans:  "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --measure: 34rem;                  /* ~68ch at 16px Inter */
  --spread: 68rem;                   /* the page's reading spine, shared by
                                        every block set on paper so they all
                                        start on the same left edge */
  --pad: clamp(1.25rem, 4vw, 3rem);
  --frame: clamp(8px, 1vw, 14px);    /* the paper margin around each still */
  --bar-h: 3.5rem;

  /* One muted tone for secondary text on dark, not three. empathy.com uses a
     single alpha for 27 of its 33 dark-ground text nodes: every additional
     grey is a decision the reader has to decode, and an alpha stays correct
     when the ground underneath it changes. 9.7:1 on --navy-deep. */
  --on-dark: rgba(255, 255, 255, .72);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ice);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }
/* Playfair's f has a long overhanging terminal and this cut ships no fi
   ligature (forcing 'liga' changes nothing), so f and i collide in "fire" and
   "first". Negative tracking made it worse; a touch of positive tracking opens
   the pair cleanly. Measured against 0 / .01 / .02 / .03 at the live 40px
   size — .02em is the least that separates them. */
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: .02em; line-height: 1.08; }
h1 em, h2 em { font-style: italic; color: var(--cornflower); }

:focus-visible { outline: 3px solid var(--azure); outline-offset: 3px; }
.bar :focus-visible, .hero :focus-visible, .closing :focus-visible { outline-color: var(--cornflower); }
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--navy-deep); color: var(--white); padding: .6rem 1rem; text-decoration: none;
}
.skip:focus { top: 1rem; }

.eyebrow {
  font-size: .8125rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
  color: var(--azure); margin-bottom: 1.25rem;
}
.eyebrow--light { color: var(--cornflower); }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 50;
  height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad);
  background: rgba(11, 23, 40, .86);
  color: var(--white);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.bar__mark { text-decoration: none; font-family: var(--serif); font-size: 1.25rem; letter-spacing: -.01em; }
.bar__mark-b { color: var(--cornflower); font-style: italic; }
.bar__call { text-decoration: none; display: flex; gap: .6rem; align-items: baseline; }
.bar__call-label { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--cornflower); }
.bar__call-num { font-weight: 500; text-decoration: underline; text-underline-offset: .2em; text-decoration-color: var(--cornflower); }
.bar__call:hover .bar__call-num { text-decoration-color: var(--white); }
@media (max-width: 480px) { .bar__call-label { display: none; } }

/* ---------- text links as actions ---------- */
.link-call, .link-more {
  display: inline-block; text-decoration: underline; text-underline-offset: .3em; text-decoration-thickness: 1px;
  font-weight: 500;
}
.link-call { font-size: 1.125rem; }
.link-call--big { font-size: clamp(1.25rem, 2.4vw, 1.75rem); font-family: var(--serif); font-weight: 400; }
.link-more { color: var(--cornflower); text-decoration-color: rgba(143, 193, 234, .6); }
.link-more:hover, .link-call:hover { text-decoration-thickness: 2px; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: grid; align-items: end;
  color: var(--white); background: var(--navy-deep);
  margin-top: calc(-1 * var(--bar-h));     /* the photo runs under the bar */
}
.hero__pic, .hero__pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__pic::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(11,23,40,.94) 0%, rgba(11,23,40,.6) 40%, rgba(11,23,40,.12) 75%);
}
.hero__copy {
  position: relative; padding: 8rem var(--pad) clamp(3rem, 8vh, 6rem); max-width: 46rem;
}
.hero__eyebrow {
  font-size: .8125rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--cornflower); margin-bottom: 1.25rem;
}
.hero h1 { font-size: clamp(2.25rem, 6.2vw, 4.75rem); }
.hero__sub { margin-top: 1.5rem; max-width: var(--measure); font-size: 1.0625rem; color: #E2ECF6; }
.hero__actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; align-items: baseline; }

/* Phones: the copy sits in the middle of the frame rather than on the floor.
   That moves it off the near-solid base of the scrim and onto open sky, so the
   scrim is rebuilt to hold an even veil the whole way up — measured worst case
   is 5.5:1 for the 12px cornflower eyebrow and 8.7:1 for the body — both
   past the 4.5 floor, with the veil kept as light as those numbers allow so
   the house still reads through it. */
@media (max-width: 700px) {
  .hero { align-items: center; }
  .hero__pic::after {
    background: linear-gradient(to top,
      rgba(11,23,40,.92) 0%, rgba(11,23,40,.82) 38%, rgba(11,23,40,.72) 62%, rgba(11,23,40,.58) 100%);
  }
  .hero__copy { padding-top: calc(var(--bar-h) + 2rem); padding-bottom: 3rem; }
  .hero h1 { font-size: clamp(2.5rem, 9vw, 3.25rem); }
  .hero__sub { font-size: 1.125rem; margin-top: 1.25rem; }
  .hero .link-call { font-size: 1.1875rem; }
  .hero .link-more { font-size: 1.0625rem; }
  .hero__actions { gap: 1.25rem 2rem; }
}

/* ---------- the gap ----------
   This sits between two photographic moments and was reading as a stall: a
   544px column floating in a 1278px field, immediately followed by another
   eyebrow + serif headline that looked like the same component again.
   Rebuilt as a composed spread — the headline holds the left column, the
   reader's situation and our answer hold the right — so it uses the page
   width and no longer rhymes with the timeline intro below it. The answer is
   an inset panel on white rather than a floating rule: the division is
   structural instead of drawn. */
.gap { padding: clamp(4.5rem, 11vh, 7.5rem) var(--pad); }
.gap__inner { max-width: var(--spread); margin-inline: auto; }
.gap h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); text-wrap: balance; }
.gap p:not(.eyebrow) { color: var(--slate); font-size: 1.0625rem; }

.gap p.gap__close {
  margin-top: 1.75rem;
  background: var(--white);
  border-left: 3px solid var(--azure);
  padding: 1.375rem 1.5rem;
  color: var(--ink); font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.1875rem, 1.6vw, 1.375rem); line-height: 1.4;
}

@media (min-width: 861px) {
  .gap__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 0 clamp(3rem, 6vw, 5.5rem);
    align-items: start;
  }
  .gap__head h2 { margin-bottom: 0; }
  .gap__body { padding-top: .5rem; }   /* drop the small text off the cap line */
}

@media (max-width: 860px) {
  .gap h2 { margin-bottom: 1.5rem; }
}

@media (max-width: 700px) {
  .gap { padding: clamp(3.5rem, 9vh, 5rem) var(--pad); }
  .gap p:not(.eyebrow) { font-size: 1.125rem; }
  .gap p.gap__close { font-size: 1.3125rem; margin-top: 1.75rem; padding: 1.25rem 1.375rem; }
}

/* ---------- the first ninety days ---------- */
/* Same spine as .gap__inner: the element carries the page padding itself, so
   its max-width includes that padding. .ninety cannot take padding of its own
   without insetting the full-bleed chapter stills. */
.ninety__head {
  max-width: calc(var(--spread) + 2 * var(--pad));
  margin-inline: auto; padding: 0 var(--pad) clamp(2rem, 6vh, 4rem);
}
.ninety__head h2 { max-width: 22ch; }
.ninety__head h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
.ninety__head h2 em { color: var(--azure); }

.chapters { list-style: none; margin: 0; padding: 0 var(--frame); }
.chapter { position: relative; }

/* The stage is 150vh tall and names a view timeline; the still is sticky
   for the whole of it, and the overlay copy lives inside the still. */
.chapter__stage { position: relative; height: 150svh; view-timeline: --stage block; }
.chapter__still {
  position: sticky; top: var(--frame);
  height: calc(100svh - var(--frame) * 2);
  overflow: hidden; border-radius: 4px; background: var(--navy-deep);
  transform-origin: center;
}
.chapter__still img { width: 100%; height: 100%; object-fit: cover; }
.chapter__still::after {
  content: ""; position: absolute; inset: 0; background: rgba(11,23,40,.5);
}
.chapter__overlay {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; color: var(--white); padding: 0 var(--pad); pointer-events: none;
}
.chapter__marker {
  font-size: .8125rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--cornflower); margin-bottom: 1rem;
}
.chapter__title { font-size: clamp(2.25rem, 6vw, 4.5rem); max-width: 14ch; text-wrap: balance; text-shadow: 0 2px 24px rgba(11,23,40,.5); }

/* The scroll linkage, all against the stage's timeline.
   Copy: rises through the held photo between the stage half-entering and
   half-leaving, fully visible while the photo is pinned.
   Still: shrinks and darkens as the stage leaves. */
@supports (animation-timeline: view()) {
  .js .chapter__still {
    animation: still-out linear both; animation-timeline: --stage; animation-range: exit 0% exit 100%;
  }
  .js .chapter__still::after {
    animation: dim-in linear both; animation-timeline: --stage; animation-range: exit 0% exit 100%;
  }
  .js .chapter__overlay {
    animation: copy-through linear both; animation-timeline: --stage; animation-range: entry 50% exit 50%;
  }
}
@keyframes still-out { to { transform: scale(.88); } }
@keyframes dim-in    { from { background: rgba(11,23,40,.5); } to { background: rgba(11,23,40,.9); } }
@keyframes copy-through {
  0%   { transform: translateY(30vh); opacity: 0; }
  28%  { opacity: 0; }
  42%  { opacity: 1; }
  64%  { opacity: 1; }
  80%  { opacity: 0; }
  100% { transform: translateY(-30vh); opacity: 0; }
}
/* rAF fallback (main.js) drives these where view() is unsupported */
.js.no-sda .chapter__still { transform: scale(var(--s, 1)); }
.js.no-sda .chapter__still::after { background: rgba(11,23,40, var(--d, .5)); }
.js.no-sda .chapter__overlay { transform: translateY(var(--y, 0)); opacity: var(--o, 1); }

@media (prefers-reduced-motion: reduce) {
  .chapter__still, .chapter__still::after, .chapter__overlay { animation: none !important; }
  .js.no-sda .chapter__still { transform: none; }
  .js.no-sda .chapter__overlay { transform: none; opacity: 1; }
}

.chapter__body {
  max-width: calc(var(--spread) + 2 * var(--pad)); margin-inline: auto;
  padding: clamp(3rem, 8vh, 5rem) var(--pad) clamp(4rem, 12vh, 8rem);
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 4rem; align-items: start;
}
.chapter__you { font-family: var(--serif); font-size: clamp(1.25rem, 2.2vw, 1.625rem); line-height: 1.35; color: var(--ink); }
.chapter__us { border-left: 2px solid var(--azure); padding-left: 1.25rem; color: var(--slate); font-size: 1.0625rem; }
.chapter__us-label { font-size: .8125rem; letter-spacing: .18em; text-transform: uppercase; color: var(--azure); font-weight: 500; margin-bottom: .6rem; }

/* Phones: the chapter text is the substance of the page — size it to be read
   comfortably at arm's length rather than scaled down from the desktop grid. */
@media (max-width: 700px) {
  .chapter__body { grid-template-columns: 1fr; gap: 2rem; padding-top: clamp(2.5rem, 6vh, 3.5rem); }
  .chapter__you { font-size: 1.5rem; line-height: 1.4; }
  .chapter__us { font-size: 1.125rem; line-height: 1.6; padding-left: 1.125rem; }
  .chapter__marker { font-size: .875rem; }
}

/* ---------- the closing run ----------
   Ported from 21st.dev "Scroll 01" (felipemenezes098, id 18041). The component
   is a two-column grid: sticky media in one, and in the other a beats column
   with a 35vh lead-in and 30vh between beats, each beat translating 20px→-20px
   and fading up through 0.7 to 1 and back out as it passes the held media.
   That rhythm is the substance of it and is what is ported here; the framework
   is not — this runs on the same view-timeline the chapters use.

   Why the page needed it: cost, founder and the closing panel were three
   sections with identical architecture, so no ground colour could separate
   them, and the pinned-photograph idea that carries the first half of the page
   simply stopped after chapter 3. One photograph now holds the whole run. */
.closing { background: var(--navy-deep); color: var(--white); padding: var(--frame); }
.closing__media { border-radius: 4px; overflow: hidden; background: var(--navy); }
.closing__media img { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 701px) {
  .closing {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 5rem); align-items: start;
    padding-inline: var(--frame);
  }
  /* align-items:start keeps the media item its own height, which is what lets
     it stick inside its grid row for the length of the beats column */
  .closing__media {
    position: sticky; top: calc(var(--bar-h) + var(--frame));
    height: calc(100svh - var(--bar-h) - var(--frame) * 2);
  }
  .closing__beats { padding-block: 22vh; display: grid; gap: 24vh; }
}

@media (max-width: 700px) {
  .closing__media { height: 46svh; margin-bottom: clamp(2.5rem, 7vh, 4rem); }
  /* .closing carries --frame so the photo insets like a chapter still; the
     beats need the page's --pad, so make up the difference here */
  .closing__beats {
    display: grid; gap: clamp(3.5rem, 10vh, 6rem);
    padding: 0 calc(var(--pad) - var(--frame)) clamp(2rem, 6vh, 4rem);
  }
}

.beat { max-width: 34rem; margin-inline: auto; }
.beat h2 { font-size: clamp(2rem, 3.4vw, 3rem); }
.beat__body { margin-top: clamp(1.25rem, 3vh, 1.75rem); display: grid; gap: 1.15rem; }
.beat__body p, .beat__sub { font-size: 1.0625rem; line-height: 1.65; color: var(--on-dark); text-wrap: pretty; }
/* The one beat that is a statement rather than a passage. Centred in its own
   column — it has no rule, list or field to hang off a left edge. */
.beat--statement { text-align: center; }
.beat--statement h2 { max-width: 20ch; margin-inline: auto; }

.quote blockquote {
  margin: 0; padding-left: 1.25rem; border-left: 2px solid var(--cornflower);
  font-family: var(--serif); font-size: clamp(1.375rem, 2.2vw, 1.75rem); line-height: 1.4;
}
.quote figcaption {
  margin-top: 1.75rem; padding-left: 1.375rem;
  color: var(--cornflower); font-size: .9375rem; letter-spacing: .02em;
}
.quote figcaption strong { color: var(--white); font-weight: 500; }

.beat__sub { margin-top: 1.5rem; }
.beat__list { list-style: none; margin: 1.75rem 0 2.25rem; padding: 0; display: grid; gap: .5rem; color: var(--on-dark); }
.beat__list li { padding-left: 1.25rem; position: relative; }
.beat__list li::before { content: ""; position: absolute; left: 0; top: .75em; width: .5rem; height: 1px; background: var(--cornflower); }

/* The beat's pass across the held photograph. Only above the breakpoint, where
   the media is actually sticky and there is something to pass. */
@media (min-width: 701px) {
  .beat { view-timeline: --beat block; }
  @supports (animation-timeline: view()) {
    .js .beat {
      animation: beat-through linear both;
      animation-timeline: --beat; animation-range: entry 30% exit 70%;
    }
    /* the last beat arrives and stays — you cannot fade a form out from under
       someone who is filling it in */
    .js .beat--hold { animation-name: beat-in; animation-range: entry 25% entry 95%; }
  }
}
@keyframes beat-through {
  0%   { opacity: 0; transform: translateY(20px); }
  30%  { opacity: .7; }
  50%  { opacity: 1; transform: translateY(0); }
  70%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-20px); }
}
@keyframes beat-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .beat { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ---------- reach form ----------
   Fields are ruled lines, not boxes: the page already uses the underline as
   its affordance (.link-call, .bar__call-num), so an input reads as the same
   gesture. Light-on-navy, sitting under the phone CTA in the closing panel. */
.reach { margin-top: 2.75rem; }
.reach__h {
  font-family: var(--sans); font-weight: 400; font-size: 1.0625rem;
  letter-spacing: 0; line-height: 1.5; color: var(--on-dark);
}
.reach__row { display: grid; gap: 1.5rem; margin-top: 1.75rem; }
@media (min-width: 32rem) { .reach__row { grid-template-columns: 1fr 1fr; } }

/* the row's grid gap already spaces stacked fields, so only the block
   following the row needs a margin */
.reach__row + .field { margin-top: 1.5rem; }
.field__label {
  display: block; font-size: .8125rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--cornflower);
  margin-bottom: .5rem;
}
.field__input {
  width: 100%; display: block;
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.4; color: var(--white);
  background: transparent; border: 0; border-bottom: 1px solid rgba(143, 193, 234, .5);
  border-radius: 0; padding: .5rem 0 .625rem;
  transition: border-color .15s;
}
.field__input:hover { border-bottom-color: var(--cornflower); }
.field__input:focus { border-bottom-color: var(--cornflower); }
.field__input--select {
  /* native arrow is invisible against the photograph on some platforms, so
     draw our own and keep room for it */
  appearance: none; padding-right: 1.75rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--cornflower) 50%),
                    linear-gradient(135deg, var(--cornflower) 50%, transparent 50%);
  background-position: right 8px center, right 3px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field__input--select option { color: var(--ink); background: var(--white); }
.field__input[aria-invalid="true"] { border-bottom-color: #F3A0A0; border-bottom-width: 2px; }
.field__error { margin-top: .5rem; font-size: .875rem; color: #F3A0A0; }

.reach__send {
  margin-top: 2rem; display: inline-block; cursor: pointer;
  font-family: var(--sans); font-size: 1rem; font-weight: 500; color: var(--white);
  background: var(--azure); border: 1px solid var(--azure); border-radius: 2px;
  padding: .875rem 1.75rem;
  transition: background-color .15s, border-color .15s;
}
.reach__send:hover { background: #3B7CC0; border-color: #3B7CC0; }

.reach__note { margin-top: 1.5rem; font-size: .875rem; line-height: 1.55; color: var(--on-dark); }
.reach__status:not(:empty) {
  margin-top: 1.25rem; font-size: .9375rem; line-height: 1.55; color: var(--white);
  border-left: 2px solid var(--cornflower); padding-left: .875rem;
}

/* ---------- footer ---------- */
.foot { padding: 2.5rem var(--pad) 3rem; color: var(--slate); font-size: .9375rem; }
.foot p + p { margin-top: .5rem; }
.foot strong { color: var(--ink); font-weight: 500; }
.foot .foot__small { font-size: .8125rem; max-width: var(--measure); margin-top: 1.25rem; }

/* ---------- no-JS ---------- */
.no-js .chapter__stage { height: auto; }
.no-js .chapter__still { position: relative; height: 70svh; top: 0; }
