/* ==========================================================================
   animations.css — entradas, revelação no scroll e microinterações
   Só transform/opacity/clip-path (compositor) — sem animar layout.
   Tudo é desligado em prefers-reduced-motion.
   O estado inicial "escondido" só vale com JS ativo (classe .js no <html>),
   então sem JavaScript o conteúdo aparece normalmente.
   ========================================================================== */

/* ---------- Hero: entrada em cascata ---------- */
@keyframes hero-in {
  from { opacity: 0; transform: translate3d(0, 28px, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes hero-photo-in {
  from { opacity: 0; transform: scale(1.06); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes rule-draw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes badge-pop {
  0%   { opacity: 0; transform: translate3d(0, 18px, 0) scale(.92); }
  70%  { opacity: 1; transform: translate3d(0, -2px, 0) scale(1.02); }
  100% { opacity: 1; transform: none; }
}

.js .hero-in {
  opacity: 0;
  animation: hero-in .9s var(--ease-out) forwards;
  animation-delay: calc(.12s + var(--d, 0) * .11s);
}
.js .hero__badge.hero-in { animation-name: badge-pop; }
.js .hero__media img { animation: hero-photo-in 1.6s var(--ease-out) both; }
.js .brand__line { transform-origin: right; animation: rule-draw 1.1s .2s var(--ease-out) both; }

/* Respiro discreto do CTA principal (uma vez, depois para) */
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
.js .hero__cta.hero-in { animation: hero-in .9s var(--ease-out) forwards, nudge 1.4s 1.9s var(--ease) 2; animation-delay: calc(.12s + 5 * .11s), 1.9s; }

/* ---------- Revelação no scroll (Intersection Observer em animations.js) ---------- */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 80ms);
}
.js .reveal--scale { transform: translate3d(0, 30px, 0) scale(.96); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Depois de revelado, animations.js remove as classes .reveal* e o componente
   volta a usar suas próprias transições de hover. */

/* Moldura das fotos: as "asas" amarelas abrem depois da foto */
.js .media-frame.reveal::before { transform: scaleX(.6); opacity: 0; transition: transform 1s .2s var(--ease-out), opacity .6s .2s var(--ease); }
.js .media-frame.reveal.is-visible::before { transform: none; opacity: 1; }

/* Mapa: flutuação lenta e curta (só enquanto visível; animations.js controla a classe) */
@keyframes float-pin {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.locator__art.is-floating img { animation: float-pin 4.5s var(--ease) 3; }

/* Toast */
.toast:not([hidden]) { animation: hero-in .35s var(--ease-out); }

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .js .hero-in, .js .reveal, .js .media-frame.reveal::before { opacity: 1 !important; transform: none !important; }
  .btn:hover, .qa-card:hover, .doc-card:hover, .eligibility:hover, .chip:hover, .media-frame:hover img { transform: none !important; }
}
