/* Homepage hero entrance. Active only when hero-motion.js adds .hero-motion (motion allowed). */
@media (prefers-reduced-motion: no-preference) {
  .hero-motion .branded-home .home-opening-scene img,
  .hero-motion.branded-home .home-opening-scene img,
  .hero-motion .home-opening-scene img {
    animation: hero-lights-up 2.2s cubic-bezier(.2, .7, .2, 1) both, brand-camera 18s ease-in-out 2.2s infinite alternate;
  }

  /* Light layers sit above the art but below the copy (the scene is z-index -1). */
  .hero-motion .home-opening-scene .hero-sweep,
  .hero-motion .home-opening-scene .hero-spot,
  .hero-motion .home-opening-scene .hero-dust { position: absolute; inset: 0; pointer-events: none; }
  .hero-motion .hero-sweep {
    z-index: 1; mix-blend-mode: screen; opacity: 0;
    background: linear-gradient(105deg, transparent 36%, #f6dca44d 45%, #fff2d68c 50%, #f6dca44d 55%, transparent 64%) no-repeat;
    background-size: 260% 100%; background-position: 130% 0;
    animation: hero-sweep 1.9s cubic-bezier(.4, .1, .2, 1) .55s both;
  }
  .hero-motion .hero-spot {
    z-index: 1; mix-blend-mode: soft-light; opacity: 0; transition: opacity .6s ease;
    background: radial-gradient(420px circle at var(--x, 70%) var(--y, 40%), #ffe9bf99, transparent 70%);
  }
  .hero-motion .hero-spot.is-on { opacity: 1; }
  .hero-motion .hero-dust { z-index: 1; width: 100%; height: 100%; opacity: 0; transition: opacity 1.6s ease; }
  .hero-motion .hero-dust.is-on { opacity: 1; }
  /* The scene's dark copy-side gradient must stay above the light layers. */
  .hero-motion .home-opening-scene::after { z-index: 2; }

  /* Copy: a choreographed arrival, readable within about a second. */
  .hero-motion .home-brand-prefix { display: inline-block; animation: hero-track-in 1.1s cubic-bezier(.2, .7, .2, 1) .15s both; }
  .hero-motion .home-opening-name > span:last-child { display: inline-block; animation: hero-wipe 1s cubic-bezier(.65, 0, .25, 1) .3s both; }
  .hero-motion .home-opening-brand .eyebrow { animation: hero-rise .8s cubic-bezier(.2, .7, .2, 1) .8s both; }
  .hero-motion #home-title { animation: hero-rise 1s cubic-bezier(.2, .7, .2, 1) .95s both; }
  .hero-motion #home-title em {
    background: linear-gradient(100deg, currentColor 0 40%, #fff3d6 50%, currentColor 60% 100%);
    background-size: 300% 100%; background-position: 100% 0;
    -webkit-background-clip: text; background-clip: text;
    animation: hero-shimmer 1.6s cubic-bezier(.4, .1, .2, 1) 1.9s both;
  }
  @supports (-webkit-background-clip: text) or (background-clip: text) {
    .hero-motion #home-title em { -webkit-text-fill-color: transparent; }
  }
  .hero-motion .home-opening-description { animation: hero-rise .9s cubic-bezier(.2, .7, .2, 1) 1.15s both; }
  .hero-motion .home-opening-actions { animation: hero-rise .9s cubic-bezier(.2, .7, .2, 1) 1.3s both; }
  .hero-motion .home-opening-topics > * { animation: hero-rise .8s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-motion .home-opening-topics > :nth-child(1) { animation-delay: 1.5s; }
  .hero-motion .home-opening-topics > :nth-child(2) { animation-delay: 1.6s; }
  .hero-motion .home-opening-topics > :nth-child(3) { animation-delay: 1.7s; }

  /* Returning in the same session: same character, about half the time. */
  .hero-motion--return .home-opening-scene img { animation-duration: 1.1s, 18s; animation-delay: 0s, 1.1s; }
  .hero-motion--return :is(.home-brand-prefix, .home-opening-name > span:last-child, .home-opening-brand .eyebrow, #home-title, .home-opening-description, .home-opening-actions, .home-opening-topics > *) { animation-duration: .6s; animation-delay: .05s; }
  .hero-motion--return .hero-sweep { animation-delay: .15s; animation-duration: 1.2s; }
  .hero-motion--return #home-title em { animation-delay: .6s; animation-duration: 1.2s; }
}

@keyframes hero-lights-up {
  from { transform: scale(1.09); filter: brightness(.35) saturate(.8); }
  55%  { filter: brightness(.9) saturate(1); }
  to   { transform: scale(1.02); filter: none; }
}
@keyframes hero-sweep {
  0%   { opacity: 0; background-position: 130% 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; background-position: -30% 0; }
}
@keyframes hero-track-in { from { opacity: 0; letter-spacing: .9em; } }
@keyframes hero-wipe     { from { clip-path: inset(0 100% 0 0); opacity: .3; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes hero-rise     { from { opacity: 0; transform: translate3d(0, 16px, 0); } }
@keyframes hero-shimmer  { from { background-position: 100% 0; } to { background-position: 0 0; } }
