/* ============================================================
   Animations — protótipo Rosceli 2026
   Camadas:
   1. Fade-up ao rolar (IntersectionObserver disparada em animations.js)
   2. Stagger interno (cada filho aparece com delay incremental)
   3. Hover lift em cards (Plans / Services / FAQ rows)
   4. Parallax leve em fotos (animations.js)

   Todas as animações respeitam prefers-reduced-motion.
   ============================================================ */

/* --------- 1. Fade-up ao rolar --------- */

/* Estado inicial: invisível e levemente abaixo */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Fallback: se JS falhar, conteúdo aparece após 1s (não fica oculto pra sempre) */
.no-js .reveal,
html:not(.has-animations) .reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

/* --------- 2. Stagger interno --------- */
/* Filhos diretos de qualquer elemento .reveal-group ganham delay incremental */
.reveal-group > .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-group > .reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal-group > .reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal-group > .reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal-group > .reveal:nth-child(5) { transition-delay: 0.32s; }
.reveal-group > .reveal:nth-child(6) { transition-delay: 0.40s; }

/* --------- 3. Hover lift em cards interativos --------- */

/* Plans cards (3 verticais) */
section[data-screen-label="06 Planos"] > div > div > div > div[style*="display: flex"][style*="flex-direction: column"][style*="padding: 32px"] {
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
section[data-screen-label="06 Planos"] > div > div > div > div[style*="display: flex"][style*="flex-direction: column"][style*="padding: 32px"]:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(26, 36, 24, 0.15);
}
/* O featured já tem translateY(-16px); incrementamos ao hover */
section[data-screen-label="06 Planos"] [style*="transform: translateY(-16px)"]:hover,
section[data-screen-label="06 Planos"] [style*="transform: none"][data-featured]:hover {
  transform: translateY(-22px) !important;
}

/* Services grid cells: leve highlight no hover */
section[data-screen-label="04 Serviços"] [style*="border-bottom: 1px solid"] {
  transition: background 0.3s ease;
}
section[data-screen-label="04 Serviços"] [style*="border-bottom: 1px solid"]:hover {
  background: rgba(204, 34, 41, 0.04);
}

/* Benefits items: barra cereja entra da esquerda no hover */
section[data-screen-label="02 Como posso te ajudar"] [style*="grid-template-columns: auto 1fr auto"] {
  position: relative;
  transition: padding-left 0.3s ease;
}
section[data-screen-label="02 Como posso te ajudar"] [style*="grid-template-columns: auto 1fr auto"]::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 50%;
  width: 0;
  height: 2px;
  background: #CC2229;
  transform: translateY(-50%);
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
section[data-screen-label="02 Como posso te ajudar"] [style*="grid-template-columns: auto 1fr auto"]:hover::before {
  width: 16px;
}

/* FAQ rows: já têm hover via index.html .faq-question:hover */

/* --------- 4. Reduced motion --------- */

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.is-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  /* Parallax fica desligado no JS quando matchMedia detecta prefers-reduced-motion */
}

/* --------- 5. Acessibilidade: foco sempre visível mesmo com transições --------- */
.reveal:focus-visible,
.reveal:focus-within {
  opacity: 1;
  transform: none;
}
