/* =========================================================
   Sanus Pharma — animations.css
   Scroll reveal, microinteracciones, keyframes
   ========================================================= */

/* ---- Scroll reveal (IntersectionObserver añade .is-visible) ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity var(--t-slow) var(--ease-out),
    transform var(--t-slow) var(--ease-out);
  will-change: opacity, transform;
}

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

/* Escalonado de hijos dentro de una rejilla revelada */
.grid .reveal.is-visible,
.about-grid .reveal.is-visible {
  transition-delay: calc(var(--reveal-i, 0) * 80ms);
}

/* ---- Hero scroll indicator ---- */
.hero__scroll span {
  animation: scroll-dot 1.8s var(--ease) infinite;
}

@keyframes scroll-dot {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ---- Fondo: brillo flotante de respaldo ---- */
.bg-fallback {
  animation: bg-drift 22s ease-in-out infinite alternate;
}

@keyframes bg-drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(0, -2%, 0) scale(1.04); }
}

/* ---- Entrada del hero ---- */
.hero__title {
  animation: fade-up .9s var(--ease-out) both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}

/* ---- Toast ---- */
.toast {
  transform: translateY(20px);
  opacity: 0;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Acordeón FAQ (apertura suave del contenido) ---- */
.faq__answer {
  overflow: hidden;
}

.faq__item[open] .faq__answer {
  animation: faq-open var(--t) var(--ease-out);
}

@keyframes faq-open {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* ---- Brillo pulsante de la marca en el icono del toast ---- */
.toast__icon {
  animation: pulse-soft 2.4s var(--ease) infinite;
}

@keyframes pulse-soft {
  0%, 100% { box-shadow: 0 0 0 0 rgba(20, 151, 212, .35); }
  50% { box-shadow: 0 0 0 7px rgba(20, 151, 212, 0); }
}

/* ---- Ticker de marcas (desplazamiento horizontal infinito) ----
   El track contiene dos grupos idénticos, por eso el bucle termina en -50%. */
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---- Accesibilidad: reducir movimiento si el usuario lo pide ----
   Se desactivan animaciones intrusivas; el contenido nunca queda oculto. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Sin animación: el ticker se vuelve una fila desplazable manualmente */
  .marquee {
    overflow-x: auto;
    -webkit-mask-image: none;
            mask-image: none;
  }

  .marquee__track {
    animation: none !important;
  }
}
