:root {
    --palette-ink: #101820;
    --palette-cool: #9BB6C8;
    --palette-warm: #D89A3A;
    --ink: #101820;
    --cool: #9BB6C8;
    --warm: #D89A3A;
    --paper: #f6f4f1;
    --motion: 1;
    --measure: 34rem;
  }

  *, *::before, *::after { box-sizing: border-box; }

  html { scroll-behavior: smooth; }

  body {
    margin: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  img, video { max-width: 100%; display: block; }

  .scene {
    position: relative;
    isolation: isolate;
    min-height: var(--scene-extent, 100vh);
  }

  /* The media layer is pinned for the scene's scroll extent; copy scrolls over it. */
  .scene__stage {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
  }

  .scene__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: var(--media-opacity, 1);
    transform: scale(calc(1 + 0.06 * var(--motion) * var(--progress, 0)));
    transition: opacity 120ms linear;
    will-change: opacity, transform;
  }

  .scene__media--poster { z-index: 1; }

  /*
   * A video a scene references is meant to be seen. The default is opaque, because the failure
   * the other way round is silent: the clip downloads, decodes and plays at opacity 0 above its
   * own poster, and the page looks like a still that simply never moves. Only the crossfade
   * interaction drives this from the scroll position, and only that one starts hidden — which
   * is also why the variable is scoped to it rather than defaulted globally.
   */
  .scene__media--motion { z-index: 2; }
  .scene[data-interaction='scroll_crossfade'] .scene__media--motion {
    opacity: var(--motion-opacity, 0);
  }

  .scene__scrim {
    position: absolute;
    inset: 0;
    z-index: 3;
    background:
      linear-gradient(180deg, rgb(0 0 0 / 0.55) 0%, rgb(0 0 0 / 0.15) 38%, rgb(0 0 0 / 0.7) 100%);
  }

  /*
   * Copy lives inside the pinned stage, not after it. Placing it after the sticky element puts
   * the headline below the fold for the whole first viewport — the hero would load with no
   * words on screen, which is both a bad first impression and a bad largest-contentful-paint.
   */
  .scene__copy {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: min(100%, calc(var(--measure) + 3rem));
    margin: 0 auto;
    padding: 0 1.5rem 14vh;
  }

  .scene--narrative .scene__copy,
  .scene--proof .scene__copy { justify-content: center; padding-bottom: 0; }

  /*
   * Progressive enhancement: copy is visible by default and only becomes animatable once the
   * runtime has marked the document. If the script fails to load, the page still reads.
   */
  .js .scene__copy {
    opacity: 0;
    transform: translateY(calc(1.75rem * var(--motion)));
    transition: opacity 700ms ease, transform 700ms cubic-bezier(0.22, 0.61, 0.36, 1);
  }

  .js .scene[data-inview='true'] .scene__copy { opacity: 1; transform: none; }

  .scene__eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cool);
    margin: 0 0 0.75rem;
  }

  .scene__headline {
    font-size: clamp(2.1rem, 1.4rem + 3.4vw, 4.25rem);
    line-height: 1.04;
    letter-spacing: -0.02em;
    font-weight: 600;
    margin: 0 0 1rem;
    text-wrap: balance;
  }

  .scene__body { margin: 0; color: rgb(246 244 241 / 0.86); text-wrap: pretty; }

  .scene__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
    margin-top: 2rem;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    background: var(--warm);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease;
  }

  .scene__cta:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgb(0 0 0 / 0.35); }
  .scene__cta:focus-visible { outline: 3px solid var(--cool); outline-offset: 3px; }

  .site-footer {
    padding: 4rem 1.5rem;
    text-align: center;
    color: rgb(246 244 241 / 0.55);
    font-size: 0.85rem;
    background: color-mix(in srgb, var(--ink) 88%, black);
  }

  .skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 99;
    padding: 0.75rem 1.25rem;
    background: var(--paper);
    color: var(--ink);
  }
  .skip-link:focus { left: 0; }

  @media (max-width: 48rem) {
    .scene__copy { padding-bottom: 10vh; }
    .scene { min-height: var(--scene-extent-mobile, 100vh); }
  }

  /*
   * The reduced-motion path is a complete narrative, not the full experience with animation
   * switched off. Scenes stop pinning and become a legible vertical sequence; posters replace
   * video entirely; nothing depends on scroll position to become readable.
   */
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    .scene { min-height: 0; }
    .scene__stage { position: static; height: auto; aspect-ratio: 16 / 9; }
    .scene__media { transform: none; transition: none; opacity: 1; }
    .scene__media--motion { display: none; }
    .scene__copy,
    .js .scene__copy {
      position: absolute;
      inset: auto 0 0 0;
      padding-block: 2rem;
      opacity: 1;
      transform: none;
      transition: none;
    }
    .scene--narrative .scene__copy,
    .scene--proof .scene__copy { justify-content: flex-end; }
    .scene__cta { transition: none; }
    .scene__cta:hover { transform: none; }
  }
