/* One-time entrances for the sections below the hero. */
@media screen and (prefers-reduced-motion: no-preference) {
  .home-page .top-motion-waiting:not(.story-index, .home-next-links > a) { opacity: 0; }
  .home-page .top-motion-enter { --top-motion-ease: cubic-bezier(.22, .82, .25, 1); }

  .home-page :is(.challenge-lead > h2, .story-heading h2, .news-heading h2, .home-next-intro > h2).top-motion-enter {
    animation: top-motion-heading 740ms var(--top-motion-ease) backwards;
  }
  .home-page :is(.scene-sort, .story-intro-art).top-motion-enter {
    animation: top-motion-illustration 820ms var(--top-motion-ease) backwards;
  }
  .home-page :is(.challenge-list > li, .story-values > article, .story-followup > li).top-motion-enter {
    animation: top-motion-rise 650ms var(--top-motion-ease) var(--top-motion-delay, 0ms) backwards;
  }
  .home-page .story-plan-sheet > article.top-motion-enter {
    transform-origin: 50% 20%;
    animation: top-motion-plan-note 410ms var(--top-motion-ease) backwards;
  }
  .home-page .story-plan-sheet > :nth-child(1) { --plan-note-from: -8px -22px; }
  .home-page .story-plan-sheet > :nth-child(2) {
    --plan-note-from: 9px -29px;
  }
  .home-page .story-plan-sheet > :nth-child(3) {
    --plan-note-from: 6px -16px;
  }
  .home-page .field-case-theme.top-motion-enter .field-case-theme-lead {
    animation: top-motion-case-lead 460ms var(--top-motion-ease) var(--top-motion-delay, 0ms) backwards;
  }
  .home-page .field-case-theme.top-motion-enter .field-case-theme-action {
    animation: top-motion-case-action 740ms cubic-bezier(.26, .78, .22, 1) calc(var(--top-motion-delay, 0ms) + 160ms) backwards;
  }

  .home-page .story-index.top-motion-enter::after {
    transform-origin: left;
    animation: top-motion-rule 860ms var(--top-motion-ease) backwards;
  }
  .home-page .story-index.top-motion-enter > span:first-child {
    transform-origin: bottom left;
    animation: top-motion-step 560ms var(--top-motion-ease) backwards;
  }
  .home-page .story-index.top-motion-enter > span:last-child {
    animation: top-motion-rise 560ms var(--top-motion-ease) 65ms backwards;
  }

  .home-page .story-act .field-photo-image.top-motion-enter {
    animation: top-motion-photo 850ms var(--top-motion-ease) var(--top-motion-delay, 0ms) backwards;
  }
  .home-page .story-act .field-photo-image.top-motion-enter::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 46%, #f8edb4 51%, transparent 56%);
    opacity: 0;
    animation: top-motion-photo-light 850ms var(--top-motion-ease) var(--top-motion-delay, 0ms) backwards;
  }

  .home-page .story-followup > li.top-motion-enter .story-followup-check path {
    stroke-dasharray: 1;
    animation: top-motion-check-draw 380ms cubic-bezier(.38, .14, .29, 1) 110ms backwards;
  }
  .home-page .story-followup > li.top-motion-enter .story-followup-check {
    animation: top-motion-check-stamp 230ms ease-out 410ms backwards;
  }
  .home-page .home-next-links > a.top-motion-enter::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: #efff39;
    opacity: 0;
    pointer-events: none;
    transform-origin: left;
    animation: top-motion-link-rule 780ms var(--top-motion-ease) backwards;
  }
  .home-page .home-next-links > a.top-motion-enter:focus-visible::before { visibility: hidden; }

  @media (min-width: 768px) {
    .home-page :is(.story-find, .story-connect) .story-intro-art {
      --top-motion-art-start: inset(0 0 0 100%);
    }
    .home-page :is(.story-values, .story-followup) > :nth-child(2) { --top-motion-delay: 85ms; }
    .home-page :is(.story-values, .story-followup) > :nth-child(3) { --top-motion-delay: 170ms; }
  }
  @media (min-width: 1200px) {
    .home-page .story-act .field-photo:nth-child(2) { --top-motion-delay: 105ms; }
    .home-page .story-act .field-photo:nth-child(3) { --top-motion-delay: 210ms; }
  }
}

@keyframes top-motion-heading {
  from { clip-path: inset(100% -8px -8px); translate: 0 24px; }
  to { clip-path: inset(-8px); translate: 0 0; }
}
@keyframes top-motion-illustration {
  from { clip-path: var(--top-motion-art-start, inset(0 100% 0 0)); translate: 0 12px; opacity: .4; }
  to { clip-path: inset(0); translate: 0 0; opacity: 1; }
}
@keyframes top-motion-rise {
  from { translate: 0 18px; opacity: .18; }
  to { translate: 0 0; opacity: 1; }
}
@keyframes top-motion-plan-note {
  from { translate: var(--plan-note-from, 0 -20px); scale: 1.08; opacity: 0; }
  60% { translate: 0 0; scale: 1.014 .967; opacity: 1; }
  80% { scale: .998 1.012; }
  to { translate: 0 0; scale: 1; opacity: 1; }
}
@keyframes top-motion-case-lead {
  from { clip-path: inset(0 100% 0 0) fill-box; }
  to { clip-path: inset(0) fill-box; }
}
@keyframes top-motion-case-action {
  from {
    clip-path: polygon(0 0, 0 0, -16% 100%, 0 100%) fill-box;
    translate: 0 25px;
  }
  80% {
    clip-path: polygon(0 0, 116% 0, 100% 100%, 0 100%) fill-box;
    translate: 0 -3px;
  }
  to {
    clip-path: polygon(0 0, 116% 0, 100% 100%, 0 100%) fill-box;
    translate: 0 0;
  }
}
@keyframes top-motion-rule {
  from { transform: scaleX(0); border-color: #efff39; }
  60% { border-color: #a4ae8d; }
  to { transform: scaleX(1); border-color: var(--story-rule); }
}
@keyframes top-motion-step {
  from { transform: translateY(9px) scale(.9); opacity: .36; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes top-motion-photo {
  from { clip-path: polygon(0 0, 12% 0, 0 100%, 0 100%); }
  to { clip-path: polygon(0 0, 112% 0, 100% 100%, 0 100%); }
}
@keyframes top-motion-photo-light {
  from { translate: -53% 0; opacity: .6; }
  70% { opacity: .42; }
  to { translate: 61% 0; opacity: 0; }
}
@keyframes top-motion-check-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes top-motion-check-stamp {
  36% { scale: 1.1; background-color: #30382f; }
}
@keyframes top-motion-link-rule {
  from { transform: scaleX(0); opacity: 1; }
  72% { transform: scaleX(1); opacity: 1; }
  to { transform: scaleX(1); opacity: 0; }
}
