/* ==========================================================================
   Motion system
   Everything decorative stays quiet: no parallax on every element, no endless
   transforms on content. Scroll entrances are one-shot and run via
   IntersectionObserver.
   ========================================================================== */

@keyframes heroRise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes noteFloat {
  0%,
  100% {
    transform: rotate(-4deg) translateY(0);
  }
  50% {
    transform: rotate(-2.5deg) translateY(-7px);
  }
}

@keyframes scrollDot {
  0% {
    opacity: 0;
    transform: translateY(-7px);
  }
  28% {
    opacity: 1;
  }
  72% {
    opacity: 1;
    transform: translateY(7px);
  }
  100% {
    opacity: 0;
    transform: translateY(9px);
  }
}

@keyframes coverEnter {
  from {
    opacity: 0;
    transform: translateY(28px) rotate(5deg) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(2deg) scale(1);
  }
}

@keyframes artFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-7px) rotate(0.35deg);
  }
}

@keyframes softSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Scroll reveals: hidden only when JS is active, so content never disappears
   for crawlers, no-JS visitors, or if the script fails to load. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
  will-change: opacity, transform;
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

.js .reveal-delay-1 {
  transition-delay: 0.08s;
}

.js .reveal-delay-2 {
  transition-delay: 0.16s;
}

.js .reveal-delay-3 {
  transition-delay: 0.24s;
}

.page-hero__copy > * {
  animation: heroRise 0.8s var(--ease-out) both;
}

.page-hero__copy > *:nth-child(2) {
  animation-delay: 0.08s;
}

.page-hero__copy > *:nth-child(3) {
  animation-delay: 0.15s;
}

.page-hero__copy > *:nth-child(4) {
  animation-delay: 0.22s;
}

.page-hero__copy > *:nth-child(5) {
  animation-delay: 0.29s;
}

.page-hero__copy > *:nth-child(6) {
  animation-delay: 0.36s;
}

.cover-frame {
  animation: coverEnter 0.9s 0.16s var(--ease-out) both;
}

.about-figure__image {
  animation: artFloat 8s ease-in-out infinite;
}

.hero__aside {
  animation-delay: 0.7s;
}

/* Small quality-of-life motion for touch/desktop controls. */
@media (hover: hover) and (pointer: fine) {
  .game-card {
    will-change: transform;
  }

  .button:focus-visible,
  .site-nav__link:focus-visible,
  .menu-toggle:focus-visible {
    transition: outline-offset 0.16s ease;
    outline-offset: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__aside,
  .about-figure__image,
  .cover-frame {
    animation: none !important;
  }

  .game-card:hover,
  .approach-card:hover,
  .learn-card:hover,
  .button:hover {
    transform: none;
  }
}
