/* ============================================
   ANIMATIONS — Interactive Effects & Reveals
   ============================================ */

/* ---- SCROLL REVEAL SYSTEM ---- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays for children */
.stagger-children > *:nth-child(1) { transition-delay: 0s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.08s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.16s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.24s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.32s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.4s; }
.stagger-children > *:nth-child(7) { transition-delay: 0.48s; }
.stagger-children > *:nth-child(8) { transition-delay: 0.56s; }

/* ---- FLOATING DECORATIVE ELEMENTS ---- */
.float-element {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.float-orb {
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  animation: floatOrb 12s ease-in-out infinite;
}

.float-orb--blue {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
  animation-duration: 15s;
  animation-direction: reverse;
}

.float-orb--sm { width: 200px; height: 200px; }
.float-orb--md { width: 350px; height: 350px; }
.float-orb--lg { width: 500px; height: 500px; }

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(20px, -30px) rotate(5deg); }
  50% { transform: translate(-10px, -50px) rotate(-3deg); }
  75% { transform: translate(-30px, -20px) rotate(2deg); }
}

/* Grid decoration */
.grid-decoration {
  position: absolute;
  width: 300px;
  height: 300px;
  background-image:
    linear-gradient(var(--glass-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.3;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 50% 50% at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at center, black 30%, transparent 70%);
}

/* ---- PARTICLE DOTS ---- */
.particle-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: particleFade 4s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.particle:nth-child(2) { left: 25%; top: 60%; animation-delay: 0.8s; }
.particle:nth-child(3) { left: 45%; top: 30%; animation-delay: 1.6s; }
.particle:nth-child(4) { left: 65%; top: 70%; animation-delay: 2.4s; }
.particle:nth-child(5) { left: 80%; top: 15%; animation-delay: 3.2s; }
.particle:nth-child(6) { left: 90%; top: 55%; animation-delay: 0.4s; }
.particle:nth-child(7) { left: 15%; top: 80%; animation-delay: 1.2s; }
.particle:nth-child(8) { left: 55%; top: 90%; animation-delay: 2.0s; }

@keyframes particleFade {
  0%, 100% { opacity: 0; transform: translateY(0) scale(1); }
  50% { opacity: 0.6; transform: translateY(-20px) scale(1.5); }
}

/* ---- HERO ENTRANCE ANIMATIONS ---- */
.hero-animate-badge {
  opacity: 0;
  transform: translateY(20px);
  animation: heroEnter 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
}

.hero-animate-title {
  opacity: 0;
  transform: translateY(30px);
  animation: heroEnter 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.25s forwards;
}

.hero-animate-sub {
  opacity: 0;
  transform: translateY(25px);
  animation: heroEnter 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.45s forwards;
}

.hero-animate-ctas {
  opacity: 0;
  transform: translateY(20px);
  animation: heroEnter 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.6s forwards;
}

.hero-animate-price {
  opacity: 0;
  animation: fadeIn 0.6s ease 0.8s forwards;
}

.hero-animate-pills {
  opacity: 0;
  animation: fadeIn 0.6s ease 0.9s forwards;
}

.hero-animate-photo {
  opacity: 0;
  transform: translateX(40px) scale(0.96);
  animation: heroPhotoEnter 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
}

@keyframes heroEnter {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heroPhotoEnter {
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* ---- MAGNETIC HOVER (applied via JS) ---- */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- TILT CARD EFFECT ---- */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
}

.tilt-card-inner {
  transition: transform 0.4s ease;
}

/* ---- COUNTER ANIMATION ---- */
.stat-number {
  will-change: contents;
}

/* ---- WHATSAPP PULSE ---- */
@keyframes waPulse {
  0%, 100% {
    box-shadow: 0 6px 24px var(--whatsapp-glow), 0 0 0 0 rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow: 0 6px 24px var(--whatsapp-glow), 0 0 0 14px rgba(37, 211, 102, 0);
  }
}

.wa-float {
  animation: waPulse 2.5s ease infinite;
}

.wa-float:hover {
  animation: none;
}

/* ---- GRADIENT TEXT SHIMMER ---- */
.shimmer-text {
  background: linear-gradient(
    90deg,
    var(--accent-light) 0%,
    #fff 25%,
    var(--accent-light) 50%,
    var(--accent) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textShimmer 4s ease-in-out infinite;
}

@keyframes textShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ---- HOVER GLOW CARDS ---- */
.glow-card {
  position: relative;
}

.glow-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.15),
    transparent 40%,
    transparent 60%,
    rgba(59, 130, 246, 0.1)
  );
  opacity: 0;
  transition: opacity var(--transition);
  z-index: -1;
  filter: blur(8px);
}

.glow-card:hover::after {
  opacity: 1;
}

/* ---- BORDER GRADIENT ON HOVER ---- */
.gradient-border {
  position: relative;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent), rgba(59, 130, 246, 0.5), var(--accent));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.gradient-border:hover::before {
  opacity: 1;
}

/* ---- LINE DECORATION ---- */
.line-accent {
  position: relative;
}

.line-accent::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}

/* ---- PARALLAX LAYERS ---- */
.parallax-layer {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* ---- SMOOTH COUNTERS ---- */
@keyframes countPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.stat-number.counting {
  animation: countPulse 0.15s ease;
}

/* ---- NOISE TEXTURE OVERLAY ---- */
.noise-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero-animate-badge,
  .hero-animate-title,
  .hero-animate-sub,
  .hero-animate-ctas,
  .hero-animate-price,
  .hero-animate-pills,
  .hero-animate-photo {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .float-orb,
  .particle,
  .wa-float {
    animation: none !important;
  }

  .shimmer-text {
    animation: none !important;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}
