/* ============================================================
   RESTYLING 2026 — Scroll-Triggered Animations
   ============================================================ */

/* ===== Base: Hidden state for all animated elements ===== */
[data-animate] {
  opacity: 0;
  transition-property: opacity, transform, filter;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

/* When element becomes visible */
[data-animate].is-visible {
  opacity: 1;
  transform: none !important;
  filter: none !important;
}

/* ===== Animation Variants ===== */

/* Fade up (default) */
[data-animate="fade-up"] {
  transform: translateY(40px);
  transition-duration: 0.8s;
}

/* Fade down */
[data-animate="fade-down"] {
  transform: translateY(-40px);
  transition-duration: 0.8s;
}

/* Fade left (slides in from left) */
[data-animate="fade-left"] {
  transform: translateX(-50px);
  transition-duration: 0.8s;
}

/* Fade right (slides in from right) */
[data-animate="fade-right"] {
  transform: translateX(50px);
  transition-duration: 0.8s;
}

/* Scale up (zoom in from smaller) */
[data-animate="scale-up"] {
  transform: scale(0.85);
  transition-duration: 0.7s;
}

/* Blur in (focus effect) */
[data-animate="blur-in"] {
  filter: blur(12px);
  transform: translateY(20px);
  transition-duration: 0.9s;
}

/* Fade up + slight rotation */
[data-animate="fade-rotate"] {
  transform: translateY(30px) rotate(2deg);
  transition-duration: 0.8s;
}

/* Zoom blur (dramatic entrance for hero elements) */
[data-animate="zoom-blur"] {
  transform: scale(0.9);
  filter: blur(8px);
  transition-duration: 1s;
}

/* Slide up with spring-like overshoot */
[data-animate="spring-up"] {
  transform: translateY(60px);
  transition-duration: 1s;
  transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Clip reveal (from bottom) */
[data-animate="clip-up"] {
  clip-path: inset(100% 0 0 0);
  transform: none;
  transition: clip-path 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease;
}

[data-animate="clip-up"].is-visible {
  clip-path: inset(0 0 0 0);
}

/* ===== Stagger Delays for Grid Children ===== */
/* Applied via data-animate-delay or auto-stagger class */

[data-animate-delay="100"] { transition-delay: 0.1s; }
[data-animate-delay="200"] { transition-delay: 0.2s; }
[data-animate-delay="300"] { transition-delay: 0.3s; }
[data-animate-delay="400"] { transition-delay: 0.4s; }
[data-animate-delay="500"] { transition-delay: 0.5s; }
[data-animate-delay="600"] { transition-delay: 0.6s; }
[data-animate-delay="700"] { transition-delay: 0.7s; }
[data-animate-delay="800"] { transition-delay: 0.8s; }

/* ===== Auto-Stagger: Children in a grid/flex container get
        sequential delays automatically via JS ===== */

/* ===== Section Title Underline Animation ===== */
h2.section-title::after {
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}

[data-animate] h2.section-title::after,
h2.section-title[data-animate]::after {
  width: 0;
}

[data-animate].is-visible h2.section-title::after,
h2.section-title[data-animate].is-visible::after {
  width: 56px;
}

/* ===== Floating / Pulse subtle effect on visible elements ===== */
@keyframes subtleFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

@keyframes subtlePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
  50%      { box-shadow: 0 0 20px 4px rgba(249, 115, 22, 0.08); }
}

/* ===== Counter / Number animation ===== */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Smooth parallax-like scroll depth layers ===== */
.parallax-slow  { transition-duration: 1.1s !important; }
.parallax-fast  { transition-duration: 0.5s !important; }

/* ===== Section Divider Line Animations ===== */
.animated-divider {
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent-primary), transparent);
  margin: 0 auto;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.animated-divider.is-visible {
  width: 80%;
}

/* ===== Glow Pulse for CTA buttons on scroll ===== */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
  50%      { box-shadow: 0 0 24px 8px rgba(249, 115, 22, 0.15); }
}

.preventivo-btn.is-visible {
  animation: glowPulse 3s ease-in-out infinite;
  animation-delay: 1.5s;
}

/* ===== Partner Logo Stagger with scale ===== */
.logo-item[data-animate] {
  transform: translateY(20px) scale(0.9);
  transition-duration: 0.6s;
}

.logo-item[data-animate].is-visible {
  transform: translateY(0) scale(1) !important;
}

/* ===== Accessibility: Reduce motion ===== */
@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
    animation: none !important;
  }

  [data-animate].is-visible {
    animation: none !important;
  }

  .animated-divider {
    width: 80% !important;
    transition: none !important;
  }
}
