:is(#site-content, body) section.page-header[data-sk-static-hero][data-project-hero-scroll]::after {
  background: rgb(0 0 0 / 40%);
}

[data-project-hero-scroll] > [data-project-hero-photo] {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  [data-project-hero-scroll] .text > :is(.pilot-section-label, .sk-text-eyebrow, h1, p, .button-wrap) {
    animation: project-hero-reveal 1s ease var(--project-hero-reveal-delay, 0ms) backwards;
  }

  [data-project-hero-scroll] .text > h1 {
    --project-hero-reveal-delay: 100ms;
  }

  [data-project-hero-scroll] .text > p {
    --project-hero-reveal-delay: 200ms;
  }

  [data-project-hero-scroll] .text > .button-wrap {
    --project-hero-reveal-delay: 300ms;
  }
}

@keyframes project-hero-reveal {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
}

@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) and (animation-range: exit-crossing) {
    section.page-header[data-project-hero-scroll] {
      isolation: isolate;
      view-timeline: --project-hero block 0px;
    }

    [data-project-hero-scroll] > [data-project-hero-photo] {
      animation: project-hero-photo-exit auto linear both;
      animation-timeline: --project-hero;
      animation-range: exit-crossing;
    }

    section.page-header[data-project-hero-scroll] > .text-wrap {
      animation: project-hero-text-exit auto linear both;
      animation-timeline: --project-hero;
      animation-range: exit-crossing 0px exit-crossing 80svh;
    }
  }
}

/* Offset the photo inside the exiting hero to keep it moving slower than the page. */
@keyframes project-hero-photo-exit {
  from { transform: translateY(0) scale(1); }
  25% { transform: translateY(16.5625%) scale(1.125); }
  50% { transform: translateY(31.25%) scale(1.25); }
  75% { transform: translateY(44.0625%) scale(1.375); }
  to { transform: translateY(55%) scale(1.5); }
}

@keyframes project-hero-text-exit {
  from { transform: translateY(0); }
  to { transform: translateY(56svh); }
}
