/* ==========================================================================
   animations.css - scroll reveal, hero entrance, floating visuals,
   and the reduced-motion fallback.
   Reveal styles only apply when JavaScript is running (html.js), so the
   content is always visible if scripts fail to load.
   ========================================================================== */

@keyframes dropIn { from { opacity: 0; transform: translateY(-10px); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(28px); } }
@keyframes float  { 50% { transform: translateY(-10px); } }
@keyframes swap   { from { opacity: 0; transform: translateY(14px) scale(0.98); } }

/* ---------- scroll reveal ---------- */
.js .reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.7s ease var(--delay, 0ms), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--delay, 0ms);
}
.js .reveal[data-reveal="zoom"]  { transform: scale(0.92); }
@media (min-width: 900px) {
  .js .reveal[data-reveal="left"]  { transform: translateX(-40px); }
  .js .reveal[data-reveal="right"] { transform: translateX(40px); }
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- hero entrance ---------- */
/* held until the intro loader has lifted (html.is-ready, set by loader.js) so it is not played behind the overlay */
.js:not(.is-ready) .hero__text > *, .js:not(.is-ready) .hero h1 .line, .js:not(.is-ready) .deck, .js:not(.is-ready) .hero__img { animation-play-state: paused; }
.js .hexfig .hexfig__item { transition: opacity 0.6s ease; }
.js:not(.is-ready) .hexfig .hexfig__item { opacity: 0 !important; }
.hero__text > * { animation: riseIn 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero__text > :nth-child(2) { animation-delay: 0.1s; }
.hero__text > :nth-child(3) { animation-delay: 0.2s; }
.hero__text > :nth-child(4) { animation-delay: 0.3s; }
.hero__text > :nth-child(5) { animation-delay: 0.4s; }
.deck { animation: riseIn 1s 0.25s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero__img { animation: riseIn 1s 0.25s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero__img img { animation: float 6s ease-in-out infinite; }
.hero h1 .line:nth-child(2) { animation: riseIn 0.8s 0.12s both; }
.hero h1 .line:nth-child(3) { animation: riseIn 0.8s 0.24s both; }

/* ---------- misc ---------- */
.finder-result.is-swapping { animation: swap 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
.cap-card[data-tilt] { transition: transform 0.15s ease-out, border-color 0.25s, box-shadow 0.25s; will-change: transform; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .hero__img img { animation: none; }
}
