/**
 * Purewell — Sistema de Animaciones
 *
 * Sistema centralizado y optimizado para animaciones al scroll.
 * Todas las animaciones usan GPU mediante transform3d.
 *
 * @version 1.0
 * @updated 2025-11-16
 */

/* ============================================
   🎬 ANIMACIÓN BASE
   ============================================ */

.animate-on-scroll {
  opacity: 0;
  /* Usar translate3d para activar aceleración GPU */
  transform: translate3d(0, 20px, 0);
  
  /* will-change le avisa al navegador para optimizar */
  will-change: opacity, transform;
  
  /* Transición suave con curva de aceleración natural */
  transition: 
    opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estado animado (aplicado por IntersectionObserver) */
.animate-on-scroll.animated {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ============================================
   📱 OPTIMIZACIONES MÓVIL
   ============================================ */

@media (max-width: 768px) {
  .animate-on-scroll {
    /* Animaciones más sutiles y rápidas en móvil */
    transform: translate3d(0, 10px, 0);
    transition-duration: 0.4s;
  }
}

/* ============================================
   🎯 VARIANTES DE ANIMACIÓN
   ============================================ */

/* Desde la izquierda */
.animate-on-scroll.from-left {
  transform: translate3d(-30px, 0, 0);
}

.animate-on-scroll.from-left.animated {
  transform: translate3d(0, 0, 0);
}

/* Desde la derecha */
.animate-on-scroll.from-right {
  transform: translate3d(30px, 0, 0);
}

.animate-on-scroll.from-right.animated {
  transform: translate3d(0, 0, 0);
}

/* Zoom in */
.animate-on-scroll.scale-in {
  transform: translate3d(0, 0, 0) scale(0.9);
}

.animate-on-scroll.scale-in.animated {
  transform: translate3d(0, 0, 0) scale(1);
}

/* ============================================
   ⏱️ DELAYS
   ============================================ */

.animate-on-scroll.delay-100 {
  transition-delay: 0.1s;
}

.animate-on-scroll.delay-200 {
  transition-delay: 0.2s;
}

.animate-on-scroll.delay-300 {
  transition-delay: 0.3s;
}

.animate-on-scroll.delay-400 {
  transition-delay: 0.4s;
}

/* ============================================
   ♿ ACCESIBILIDAD
   ============================================ */

/* Respetar preferencias de usuario que desactivan animaciones */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll,
  .animate-on-scroll.from-left,
  .animate-on-scroll.from-right,
  .animate-on-scroll.scale-in {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }
}
