/* ==========================================================================
   Travel Earned · home page, scroll-driven edition · preview, November 2026
   Loaded on the home page only, after styles.css. Everything here is scoped
   under .motion-on (set before first paint, and never for a reader who asked
   for less motion), so without it the page is the October layout unchanged.
   Scenes move transform, opacity and clip-path only.
   ========================================================================== */
:root { --pin-h: calc(100vh - var(--header-h) - env(safe-area-inset-top, 0px)); --bleed-h: var(--pin-h); }
@supports (height: 100svh) {
  /* The pin is sized to the small viewport so it never jumps when a phone's toolbar retracts.
     The photograph runs to the large one, so there is picture behind the toolbar when it does. */
  :root { --pin-h: calc(100svh - var(--header-h) - env(safe-area-inset-top, 0px)); --bleed-h: calc(100lvh - var(--header-h) - env(safe-area-inset-top, 0px)); }
}

/* The scene blocks exist only while the scenes run. */
.scene-window, .curtain-cap, .answers, .answers-section { display: none; }

@media screen {

  /* ---------- 1 · The opening: the coast opens from a window to the whole screen ---------- */
  .hero-live .scene-hero { position: relative; z-index: 1; padding: 0; height: calc(var(--pin-h) * 3); }
  .hero-live .scene-pin { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--header-h)); height: var(--pin-h); }
  .hero-live .scene-copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: stretch; gap: 0; height: 100%; padding-top: clamp(24px, 5vh, 72px); padding-bottom: clamp(20px, 4.4vh, 44px); pointer-events: none; }
  .hero-live .hero-top { flex: none; margin-bottom: clamp(24px, 4.4vh, 52px); pointer-events: auto; will-change: transform, opacity; }
  .hero-live .scene-window { display: block; flex: 1 1 auto; min-height: 0; }
  .hero-live .scene-media { position: absolute; inset: 0 0 auto 0; z-index: 0; height: var(--bleed-h); max-width: none; margin: 0; padding: 0; }
  .hero-live .scene-media .hero-photo { position: absolute; inset: 0; max-width: none; }
  .hero-live .scene-media .frame {
    position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; background: transparent;
    clip-path: inset(var(--ct, 46%) var(--cr, 16px) var(--cb, 40px) var(--cl, 16px) round var(--crad, 4px));
    will-change: clip-path;
  }
  .hero-live .scene-media .frame img, .hero-live .scene-media .frame video {
    object-position: 50% 58%;
    transform: translate3d(0, var(--my, 0px), 0) scale(var(--zoom, 1.12)); transform-origin: var(--zx, 50%) var(--zy, 70%);
    will-change: transform;
  }
  .hero-live .scene-media figcaption { display: none; }
  @media (max-width: 860px) {
    .hero-live .scene-copy { padding-top: 22px; padding-bottom: 0; }
    .hero-live .hero-top { margin-bottom: 24px; }
  }
  @media (max-width: 640px) and (max-height: 760px) {
    /* A phone screen has room for the headline, one line of what we do, one button, and the coast. */
    .hero-live .scene-hero .reassure, .hero-live .scene-hero .actions a:not(.btn) { display: none; }
    .hero-live .scene-hero .hero-side .lede { margin-bottom: 20px; }
  }

  /* ---------- 2 · The curtain: a light section rises over the coast, with the photograph's caption at its top edge ---------- */
  .motion-on .answers-section { display: block; position: relative; background: var(--bone); color: var(--navy); }
  .hero-live .answers-section { z-index: 2; margin-top: calc(var(--pin-h) * -1); }
  .hero-live .curtain-cap { display: block; padding-top: clamp(14px, 2vw, 20px); }
  .curtain-cap .pictured { margin: 0; color: var(--slate-bone); font-size: .9375rem; }
  .answers-section .label { color: var(--slate-bone); }

  /* ---------- 3 · The three answers: one balance, drawn three ways, as the reader scrolls ---------- */
  .motion-on .answers { display: block; height: calc(var(--pin-h) * 2); }
  .motion-on .answers-pin { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--header-h)); height: var(--pin-h); display: flex; align-items: center; }
  .answers-grid { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(44px, 7vw, 104px); align-items: center; }
  .answers-intro .label { margin-bottom: 18px; }
  .answers-intro h2 { font-size: clamp(2.125rem, 1.3rem + 3vw, 3.75rem); line-height: 1.05; letter-spacing: -0.02em; max-width: 9.5em; }
  .answers-intro h2 .num { letter-spacing: -0.03em; }
  .answers-sub { margin-top: 20px; font-weight: 300; font-size: clamp(1.1875rem, 1.08rem + .45vw, 1.375rem); color: var(--slate-bone); }
  .arow { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 16px; margin-bottom: clamp(22px, 4.4vh, 44px); opacity: var(--o, 0); transform: translate3d(0, calc((1 - var(--in, 0)) * 20px), 0); will-change: opacity, transform; }
  .arow:last-child { margin-bottom: 0; }
  .arow::before, .arow::after { content: ""; position: absolute; left: 0; bottom: 0; }
  .arow::before { right: 0; height: 1px; background: rgba(9, 17, 38, .16); }
  .arow::after { width: calc(var(--w) * 100%); height: 2px; bottom: -.5px; background: var(--slate-bone); transform: scaleX(var(--b, 0)); transform-origin: left; will-change: transform; }
  .arow-name { display: block; font-size: 1.0625rem; line-height: 1.3; color: var(--slate-bone); max-width: 24em; }
  .arow-value { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1; white-space: nowrap; color: var(--slate-bone); }
  .arow--ours { flex-direction: column; align-items: stretch; gap: 10px; padding-bottom: 20px; }
  .arow--ours .arow-name { font-size: 1.1875rem; font-weight: 500; color: var(--navy); max-width: none; }
  .arow--ours .arow-value { align-self: flex-end; font-size: clamp(3.5rem, 1.9rem + 6.4vw, 7.25rem); letter-spacing: -0.045em; line-height: .9; color: var(--navy); }
  .arow--ours::after { height: 3px; bottom: -1px; background: var(--navy); }
  /* The calculator is its own navy section. On the home page the exact-number field stays folded on every screen, so the section shows one figure. */
  @media (min-width: 861px) { .js .worth--scenes .exact > summary { display: flex; } .worth--scenes .exact { margin-top: 30px; } .worth--scenes .exact-body { padding-top: 22px; } }
  @media (max-width: 860px) {
    .answers-grid { grid-template-columns: 1fr; gap: clamp(28px, 5vh, 44px); }
    .answers-intro .label { margin-bottom: 12px; }
    .answers-sub { margin-top: 12px; }
    .arow { margin-bottom: clamp(18px, 3.4vh, 30px); padding-bottom: 14px; }
    .arow-name { font-size: 1rem; }
  }
  @media (max-width: 760px) { .motion-on .answers-pin { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); } }   /* clear of the phone bar */

  /* ---------- 4 · The trip cards: each photograph opens from a strip ---------- */
  @media (prefers-reduced-motion: no-preference) {
    .motion-on .card-photo .slot { clip-path: inset(41% 0 41% 0 round 4px); transition: clip-path 1.5s var(--ease-out) calc(var(--d, 0) * 1ms + 140ms); }
    .motion-on .card-photo.is-in .slot { clip-path: inset(0 0 0 0 round 0px); }
    .motion-on .card-photo .slot img { transform: scale(1.24); transition: transform 2.3s var(--ease-out) calc(var(--d, 0) * 1ms + 140ms); }
    .motion-on .card-photo.is-in .slot img { transform: none; }
  }

  /* ---------- 5 · The steps: a rail that fills as the reader moves down the list ---------- */
  .motion-on .steps { position: relative; }
  .motion-on .steps li { padding-left: 28px; }
  .motion-on .steps::before, .motion-on .steps::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; }
  .motion-on .steps::before { background: var(--hair); }
  .motion-on .steps::after { background: var(--navy); transform: scaleY(var(--rail, 0)); transform-origin: top; will-change: transform; }
  @media (max-width: 860px) { .motion-on .steps li { padding-left: 20px; } }
}
