/* ============================================
   Animations & Keyframes
   ============================================ */

/* ---- KEYFRAMES ---- */

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes breatheGlow {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(181, 34, 58, 0.15));
  }
  50% {
    filter: drop-shadow(0 0 24px rgba(181, 34, 58, 0.35));
  }
}

@keyframes breatheGlowWhite {
  0%, 100% {
    filter: brightness(0) invert(1) drop-shadow(0 0 12px rgba(255, 255, 255, 0.3));
  }
  50% {
    filter: brightness(0) invert(1) drop-shadow(0 0 28px rgba(255, 255, 255, 0.5));
  }
}

@keyframes bounceDown {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) translateX(-50%);
  }
  40% {
    transform: translateY(12px) translateX(-50%);
  }
  60% {
    transform: translateY(6px) translateX(-50%);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes widthGrow {
  from {
    width: 0;
  }
  to {
    width: 60px;
  }
}

/* ---- SCROLL-TRIGGERED ANIMATION CLASSES ---- */

/* Elements waiting to be animated */
[data-animate] {
  opacity: 0;
  transition: none;
}

/* Animated state */
[data-animate].animated {
  animation-duration: 700ms;
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-animate="fadeInUp"].animated {
  animation-name: fadeInUp;
}

[data-animate="fadeInDown"].animated {
  animation-name: fadeInDown;
}

[data-animate="fadeInLeft"].animated {
  animation-name: fadeInLeft;
}

[data-animate="fadeInRight"].animated {
  animation-name: fadeInRight;
}

[data-animate="fadeIn"].animated {
  animation-name: fadeIn;
}

[data-animate="scaleIn"].animated {
  animation-name: scaleIn;
}

/* Delay modifiers */
[data-delay="100"].animated { animation-delay: 100ms; }
[data-delay="200"].animated { animation-delay: 200ms; }
[data-delay="300"].animated { animation-delay: 300ms; }
[data-delay="400"].animated { animation-delay: 400ms; }
[data-delay="500"].animated { animation-delay: 500ms; }
[data-delay="600"].animated { animation-delay: 600ms; }
[data-delay="800"].animated { animation-delay: 800ms; }
[data-delay="1000"].animated { animation-delay: 1000ms; }

/* ---- LANDING PAGE ENTRY SEQUENCE ---- */

.landing-animate {
  opacity: 0;
}

.landing-animate.visible {
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.landing-animate.visible[data-landing="logo"] {
  animation: scaleIn 800ms both;
}

.landing-animate.visible[data-landing="title"] {
  animation: fadeInUp 600ms both;
  animation-delay: 400ms;
}

.landing-animate.visible[data-landing="subtitle"] {
  animation: fadeInUp 600ms both;
  animation-delay: 700ms;
}

.landing-animate.visible[data-landing="tagline"] {
  animation: fadeIn 800ms both;
  animation-delay: 1000ms;
}

.landing-animate.visible[data-landing="buttons"] {
  animation: fadeInUp 600ms both;
  animation-delay: 1300ms;
}

.landing-animate.visible[data-landing="footer"] {
  animation: fadeIn 600ms both;
  animation-delay: 1600ms;
}

/* ---- NAV LINK UNDERLINE EFFECT ---- */

.nav-link {
  position: relative;
  display: inline-block;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-tart-cherry);
  transition: width var(--transition-base), left var(--transition-base);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
  left: 0;
}

/* ---- WHATSAPP BREATHE ---- */

@keyframes whatsappBreathe {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(34, 197, 94, 0.5);
  }
}

/* ---- TITLE LINE GROW ---- */

@keyframes lineGrowFromCenter {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* ---- PREFERS REDUCED MOTION ---- */

@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    opacity: 1;
    animation: none !important;
  }

  .landing-animate {
    opacity: 1;
    animation: none !important;
  }

  .nav-link::after {
    transition: none;
  }

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

  .section__line {
    animation: none !important;
    transform: scaleX(1) !important;
  }
}
