@keyframes home-scroll-rise {
  from { translate: 0 var(--home-rise-distance, 22px); }
  to { translate: 0 0; }
}

@keyframes home-scroll-heading {
  from { translate: clamp(-30px, -3vw, -14px) 8px; }
  to { translate: 0 0; }
}

@keyframes home-admissions-rule {
  from { scale: .15 1; }
  to { scale: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .landing :is(.admissions, .stories-section).content-arrived {
    animation: none;
  }

  .landing .admissions {
    position: relative;
  }

  .landing .admissions::before {
    position: absolute;
    inset: 0 0 auto;
    block-size: 2px;
    background: linear-gradient(90deg, transparent 2%, #d1769d 37%, #eac5d6 78%, transparent);
    transform-origin: left;
    pointer-events: none;
    content: "";
  }

  .landing .admissions.content-arrived::before {
    animation: home-admissions-rule .9s cubic-bezier(.22, .75, .24, 1) both;
  }

  .landing .admissions.content-arrived:not(:focus-within) .admissions-copy {
    animation: home-scroll-rise .53s cubic-bezier(.2, .75, .16, 1) both;
  }

  .landing .admissions.content-arrived:not(:focus-within) .admissions-actions {
    --home-rise-distance: 16px;
    animation: home-scroll-rise .53s cubic-bezier(.2, .75, .16, 1) .12s both;
  }

  .landing .stories-section.content-arrived:not(:focus-within) .section-head > h2 {
    animation: home-scroll-heading .62s cubic-bezier(.2, .75, .16, 1) both;
  }

  .landing .stories-section.content-arrived:not(:focus-within) .section-head > a {
    --home-rise-distance: 12px;
    animation: home-scroll-rise .5s cubic-bezier(.2, .75, .16, 1) .13s both;
  }

  @supports ((animation-timeline: view()) and (animation-range: entry 0% entry 100%)) {
    .landing :is(.home-program, .program-life, .resources-section).content-arrived {
      animation: none;
    }

    .landing[data-home-scroll-started] .hero {
      view-timeline: --home-hero block;
      view-timeline-inset: 0;
    }

    .landing[data-home-scroll-started] .hero > :is(.hero-image, .hero-video) {
      animation: home-hero-drift auto linear forwards;
      animation-timeline: --home-hero;
      animation-range: exit 4% exit 64%;
    }

    .landing .home-program {
      position: relative;
      isolation: isolate;
      view-timeline: --home-program block;
    }

    .landing .home-program::before {
      position: absolute;
      z-index: -1;
      inset: 0 0 auto;
      block-size: clamp(8rem, 19vw, 17rem);
      background:
        radial-gradient(ellipse 72% 84% at 16% -18%, #e39dbd96, transparent 78%),
        radial-gradient(ellipse 67% 90% at 92% -18%, #e8a1c16e, transparent 83%);
      pointer-events: none;
      content: "";
      animation: home-program-wash auto linear both;
      animation-timeline: --home-program;
      animation-range: entry 0% entry 42%;
    }

    .landing .home-program-heading { view-timeline: --home-program-heading block; }
    .landing .home-program-heading h2 {
      animation: home-scroll-rise auto cubic-bezier(.2, .75, .16, 1) both;
      animation-timeline: --home-program-heading;
      animation-range: entry 0% entry 76%;
    }

    .landing .home-program-heading p {
      --home-rise-distance: 30px;
      animation: home-scroll-rise auto cubic-bezier(.2, .75, .16, 1) both;
      animation-timeline: --home-program-heading;
      animation-range: entry 14% entry 100%;
    }

    .landing .home-program-photo { view-timeline: --home-program-photo block; }
    .landing .home-program-photo:not(:focus-visible) img {
      animation: home-program-photo-reveal auto cubic-bezier(.23, .58, .2, 1) both;
      animation-timeline: --home-program-photo;
      animation-range: entry 0% entry 77%;
    }

    .landing .home-program-details { view-timeline: --home-program-details block; }
    .landing .home-program-details:not(:focus-within) .home-program-facts > div {
      animation: home-scroll-rise auto cubic-bezier(.2, .75, .16, 1) both;
      animation-timeline: --home-program-details;
      animation-range: entry var(--home-fact-start, 0%) entry 65%;
    }

    .landing .home-program-facts > div:nth-child(2) { --home-fact-start: 11%; }
    .landing .home-program-facts > div:nth-child(3) { --home-fact-start: 21%; }

    .landing .program-life h2 {
      animation: home-scroll-rise auto ease-out both;
      animation-timeline: view();
      animation-range: entry 0% entry 100%;
    }

    .landing .life-grid .picture-link {
      view-timeline: --home-life-photo block;
      --home-life-travel: -18px;
      --home-life-reveal-end: 64%;
    }

    .landing .life-grid .picture-link:nth-child(2) {
      --home-life-travel: 0px;
      --home-life-reveal-end: 77%;
    }

    .landing .life-grid .picture-link:nth-child(3) {
      --home-life-travel: 18px;
      --home-life-reveal-end: 90%;
    }

    .landing .life-grid .picture-link:not(:focus-visible) img {
      animation: home-life-photo-reveal auto ease-out both;
      animation-timeline: --home-life-photo;
      animation-range: entry 0% entry var(--home-life-reveal-end);
    }

    .landing .life-grid .picture-link:not(:focus-visible) .picture-caption {
      --home-rise-distance: 25px;
      animation: home-scroll-rise auto ease-out both;
      animation-timeline: --home-life-photo;
      animation-range: entry 10% entry 92%;
    }

    .landing .resource-banner { view-timeline: --home-resource-banner block; }
    .landing .resource-banner img {
      animation: home-resource-pan auto ease-out both;
      animation-timeline: --home-resource-banner;
      animation-range: entry 0% entry 88%;
    }

    .landing .resource-banner h2 {
      animation: home-scroll-rise auto ease-out both;
      animation-timeline: --home-resource-banner;
      animation-range: entry 19% entry 96%;
    }

    .landing .resources-grid > a:not(:focus-visible) {
      --home-rise-distance: 12px;
      animation: home-scroll-rise auto ease-out both;
      animation-timeline: view();
      animation-range: entry 8% entry 98%;
    }
  }
}

@keyframes home-hero-drift {
  from { translate: 0 0; }
  to { translate: 0 clamp(18px, 4.6dvh, 46px); }
}

@keyframes home-program-wash {
  from { opacity: .54; scale: 1 .72; transform-origin: top; }
  to { opacity: 1; scale: 1; transform-origin: top; }
}

@keyframes home-program-photo-reveal {
  from { clip-path: inset(0 23% 0 0 round 1rem); translate: 0 15px; }
  to { clip-path: inset(0 round 1rem); translate: 0 0; }
}

@keyframes home-life-photo-reveal {
  from { scale: 1.095; translate: var(--home-life-travel) 9px; clip-path: inset(11% 0 0); }
  to { scale: 1; translate: 0 0; clip-path: inset(0); }
}

@keyframes home-resource-pan {
  from { scale: 1.11; translate: clamp(-28px, -3vw, -12px) 0; }
  to { scale: 1; translate: 0 0; }
}
