/* ═══════════════════════════════════════════════════════════════════════
   ENERMAC · effects.css
   Sistema de animação: reveals de entrada, keyframes compartilhados e
   política de movimento reduzido.

   Regra do projeto: scroll 100% nativo. Efeitos ligados ao scroll usam
   apenas transform/opacity, dirigidos por variáveis CSS escritas em
   js/main.js (1 listener + 1 requestAnimationFrame por frame).

   ÍNDICE
   1. Reveal on-scroll (.reveal / .is-visible)
   2. Stagger (cascata para grids)
   3. Keyframes compartilhados
   4. prefers-reduced-motion
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 1. REVEAL ──
   Escondido apenas quando html.js existe: sem JavaScript o conteúdo
   permanece 100% visível (nunca refém da animação). */
html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ── 2. STAGGER ──
   Grids marcados com .stagger revelam os filhos em cascata.
   Substitui os style="transition-delay" inline do HTML antigo. */
html.js .stagger > .reveal:nth-child(2) { transition-delay: .08s; }
html.js .stagger > .reveal:nth-child(3) { transition-delay: .16s; }
html.js .stagger > .reveal:nth-child(4) { transition-delay: .24s; }
html.js .stagger > .reveal:nth-child(5) { transition-delay: .32s; }
html.js .stagger > .reveal:nth-child(6) { transition-delay: .40s; }

/* ── 3. KEYFRAMES COMPARTILHADOS ── */

/* Entrada do hero (título → subtítulo → CTA) */
@keyframes hero-in {
  to {
    opacity: 1;
    transform: none;
  }
}

/* Bolhas de biogás subindo (hero) */
@keyframes bubble-rise {
  0% {
    transform: translateY(110vh) translateX(0);
    opacity: 0;
  }
  6% {
    opacity: 1;
  }
  88% {
    opacity: .4;
  }
  100% {
    transform: translateY(-10vh) translateX(35px);
    opacity: 0;
  }
}

/* Pulso do botão de WhatsApp */
@keyframes wa-pulse {
  0% {
    transform: scale(1);
    opacity: .8;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* ── 4. MOVIMENTO REDUZIDO ──
   js/main.js também lê esta preferência e desativa os efeitos de scroll;
   aqui garantimos os fallbacks visuais estáticos. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html.js .hero__title,
  html.js .hero__sub,
  html.js .hero__bullets,
  html.js .hero__cta {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .bubble,
  .wa-float__fab::before {
    animation: none;
  }

  /* Painel 3D fica reto e visível */
  .cases-panel {
    transform: none !important;
    opacity: 1 !important;
  }

  .hero__bg {
    transform: none !important;
  }
}
