@media (min-width: 1025px) {
  .ews-carousel .feature-card .feature-caption { background: linear-gradient(transparent, #070d22c2); }
}

@media (min-width: 1025px) and (prefers-reduced-motion: no-preference) {
  .hero-character > img {
    /* Keep the large raster cached while JS parallax and CSS floating change its transforms. */
    will-change: transform, translate;
    transform: translate3d(var(--hero-parallax-x, 0px), var(--hero-parallax-y, 0px), 0);
  }
  .hero-character[data-hero-character="1"] { --hero-flight-overshoot-x: calc(12 * var(--u)); --hero-float-x: calc(2 * var(--u)); --hero-float-y: calc(-6 * var(--u)); --hero-float-duration: 8.2s; }
  .hero-character[data-hero-character="2"] { --hero-flight-overshoot-x: calc(16 * var(--u)); --hero-float-x: calc(-5 * var(--u)); --hero-float-y: calc(16 * var(--u)); --hero-float-duration: 6.8s; }
  .hero-character[data-hero-character="3"] { --hero-flight-overshoot-x: calc(-14 * var(--u)); --hero-float-x: calc(3 * var(--u)); --hero-float-y: calc(9 * var(--u)); --hero-float-duration: 9.1s; }
  /* The nearest figure touches both native vertical edges; drift sideways to keep those cuts outside the viewport. */
  .hero-character[data-hero-character="4"] { --hero-flight-overshoot-x: calc(-20 * var(--u)); --hero-float-x: calc(-22 * var(--u)); --hero-float-y: 0px; --hero-float-duration: 7.6s; }
  .hero-character[data-hero-floating] > img {
    animation: hero-character-float var(--hero-float-duration) cubic-bezier(.37, 0, .63, 1) infinite;
    animation-play-state: var(--hero-float-play-state, paused);
  }
  @keyframes hero-character-float {
    0%, 100% { translate: 0 0; }
    50% { translate: var(--hero-float-x) var(--hero-float-y); }
  }
  .hero-kv {
    will-change: transform;
    transform: scale(var(--hero-background-scale, 1.02));
    transform-origin: center;
  }
}

/* The head bootstrap opts into hiding. Without JavaScript the existing page stays visible. */
@media (prefers-reduced-motion: no-preference) {
  /* These carousels reveal their content independently; keep frames and pagination steady. */
  :is(.reward-carousel, .shell-picker, .character-picker, .ews-carousel) > [data-slide]:not([hidden]) { animation: none; }
  /* The PC backdrop is a pseudo layer; release it alongside the decoded slide's real artwork. */
  .character-picker[data-content-motion] > .character-slide:not([hidden])::before {
    opacity: 0;
    animation: none;
  }
  .character-picker[data-content-motion="playing"] > .character-slide:not([hidden])::before {
    --section-entrance-offset: 16px 0;
    opacity: 1;
    animation: section-entrance-enter 420ms ease-out 0ms backwards;
  }
  .character-shadow-cast.section-entrance-enter {
    animation: character-shadow-settle var(--section-entrance-duration, 700ms) ease-out var(--section-entrance-delay, 0ms) backwards;
  }
  @keyframes character-shadow-settle {
    from { transform: skewX(-9deg) scaleY(.96); }
    to { transform: none; }
  }
  :root[data-campaign-entrance="booting"] :is(.hero-kv, .hero-character, .brand > picture, .hero-slogan-entrance, .hero-download,
    .hero-actions button, .store-promo, .content-section > *) { opacity: 0; }
  .hero-character.section-entrance-enter { animation-timing-function: cubic-bezier(.16, .7, .25, 1); }

  @media (min-width: 1025px) {
    .hero-character.section-entrance-enter {
      animation: hero-character-flight var(--section-entrance-duration, 780ms) cubic-bezier(.32, 0, .36, 1) var(--section-entrance-delay, 0ms) backwards,
        hero-character-fade 600ms ease-in-out var(--section-entrance-delay, 0ms) backwards;
    }
  }

  @keyframes hero-character-flight {
    0% { translate: var(--section-entrance-offset, none); }
    80% {
      translate: var(--hero-flight-overshoot-x, 0px) 0;
      animation-timing-function: cubic-bezier(.37, 0, .63, 1);
    }
    100% { translate: none; }
  }

  @keyframes hero-character-fade {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  :root[data-campaign-entrance] [data-entrance-pending] { opacity: 0; }
  :root[data-campaign-entrance] [data-entrance-pending][data-glitch-entrance-playing] { opacity: 1; }

  /* Adjacent mobile previews keep their geometry, but cannot precede the selected page's entrance. */
  .content-section:is([data-entrance-state="pending"], [data-entrance-state="running"])
    .mobile-carousel__page[inert] > * { opacity: 0; }

  [data-entrance-dom-glitch] {
    animation: glitch-entrance-reveal 360ms ease-out var(--section-entrance-delay, 0ms) backwards,
      campaign-calendar-slice 360ms steps(1) var(--section-entrance-delay, 0ms) 2,
      campaign-calendar-chroma 360ms steps(1) calc(var(--section-entrance-delay, 0ms) + 8ms) 2;
  }

  /* Distort the real scroll viewport briefly; no snapshot, cloned table, or event replacement. */
  @keyframes campaign-calendar-slice {
    0%, 16%, 31%, 51%, 66%, 84%, 100% { clip-path: none; translate: none; }
    12% { clip-path: inset(20% 0 75%); translate: 1.7% 0; }
    27% { clip-path: inset(55% 0 40%); translate: -2.15% 0; }
    47% { clip-path: inset(75% 0 20%); translate: 1.3% 0; }
    62% { clip-path: inset(35% 0 60%); translate: -1.5% 0; }
    80% { clip-path: inset(10% 0 86%); translate: 1.1% 0; }
  }
  @keyframes campaign-calendar-chroma {
    0%, 18%, 32%, 52%, 85%, 100% { filter: none; }
    14%, 28%, 48%, 81% { filter: drop-shadow(3px 0 #ff0040) drop-shadow(-3px 0 #00b4d8); }
  }

  /* The library's picture reveal and two color slices keep the reservation-page rhythm. */
  [data-glitch-entrance="image"][data-glitch-entrance-playing]::before,
  [data-glitch-entrance="image"][data-glitch-entrance-playing]::after { animation-iteration-count: 2; }

  .brand[data-glitch-entrance] {
    position: absolute;
    --glitch-entrance-image-position: calc(-101 * var(--u)) calc(-94 * var(--u));
    --glitch-entrance-image-size: calc(840 * var(--u)) auto;
  }
  .brand[data-glitch-entrance] > .glitch-entrance__content { position: static; }

  .hero-slogan-entrance { display: block; }
  .hero-slogan-entrance .hero-slogan { width: 100%; }

  @media (width > 1024px) {
    :root[data-campaign-entrance="booting"] .section-nav { opacity: 0; }
  }
  @media (max-width: 1024px) {
    .brand[data-glitch-entrance] {
      --glitch-entrance-image-position: center;
      --glitch-entrance-image-size: 100% 100%;
    }
  }

  /* Only the existing visual pseudo layers animate; their layout hosts never move. */
  .season-calendar::before,
  .shells::before,
  .shell-feature::before,
  .shell-feature::after,
  .shell-picker::before,
  .shell-detail::before,
  .character-slide::before,
  .character-slide::after,
  .awakening-panel::before {
    opacity: var(--entrance-pseudo-opacity, 1);
    translate: var(--entrance-pseudo-translate, none);
    animation: var(--entrance-pseudo-animation, none);
  }
}
