/* ==========================================================================
   ARRUDA CHUDZY ADVOGADAS - ANIMATIONS & MOTION
   ========================================================================== */

/* Keyframe Definitions */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-32px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(32px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.65;
  }
}

@keyframes waPulseRing {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.25);
    opacity: 0;
  }
  100% {
    transform: scale(0.95);
    opacity: 0;
  }
}

@keyframes floatGentle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Scroll Reveal Classes (Driven by IntersectionObserver) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.9, 0.3, 1),
              transform 0.8s cubic-bezier(0.2, 0.9, 0.3, 1);
  will-change: opacity, transform;
}

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

.reveal-delay-1 {
  transition-delay: 0.15s;
}

.reveal-delay-2 {
  transition-delay: 0.3s;
}

.reveal-delay-3 {
  transition-delay: 0.45s;
}

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

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

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

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

/* Float card animation */
.hero-floating-card {
  animation: floatGentle 5s ease-in-out infinite;
}

/* Scroll-Driven Animations: Shrinking Header (Chrome 115+, Safari 26+) */
@supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
  @keyframes shrinkHeaderAnim {
    from {
      height: var(--header-height);
      background-color: rgba(37, 7, 27, 0.72);
    }
    to {
      height: var(--header-height-shrunk);
      background-color: rgba(37, 7, 27, 0.96);
      box-shadow: 0 10px 30px rgba(20, 3, 14, 0.45);
    }
  }

  .site-header {
    animation: shrinkHeaderAnim auto linear both;
    animation-timeline: scroll(root);
    animation-range: 0px 140px;
  }
}

/* Accessibility: Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .reveal-left,
  .reveal-right {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero-floating-card {
    animation: none !important;
  }

  .floating-whatsapp-btn::before {
    animation: none !important;
  }
}
