/**
 * EB Solutions Design System - Animations & Motion
 */

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

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

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

@keyframes ebsPulseGlow {
  0%, 100% {
    opacity: 0.15;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.05);
  }
}

@keyframes ebsBadgePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.2);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(34, 211, 238, 0);
  }
}

@keyframes ebsLineDraw {
  from {
    stroke-dashoffset: 100;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* Base Motion Classes */
.ebs-animate-fade {
  animation: ebsFadeIn var(--eb-transition-normal) forwards;
}

.ebs-animate-fade-up {
  animation: ebsFadeInUp var(--eb-transition-slow) forwards;
}

/* Luminous Ambient Background Blobs */
.ebs-glow-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  opacity: 0.18;
  z-index: 0;
  animation: ebsPulseGlow 8s ease-in-out infinite;
  will-change: transform, opacity;
}

.ebs-glow-blob--primary {
  background: var(--eb-brand-primary);
  width: 400px;
  height: 400px;
}

.ebs-glow-blob--accent {
  background: var(--eb-brand-accent);
  width: 350px;
  height: 350px;
  animation-delay: -3s;
}

/* Hero Badge Glow Pulse */
.ebs-hero__market-note {
  animation: ebsBadgePulse 3s infinite;
}

/* Scroll Progress Timeline Native Support */
@supports (animation-timeline: scroll()) {
  .ebs-scroll-progress {
    animation: ebsProgressWidth linear;
    animation-timeline: scroll(root);
  }
  
  @keyframes ebsProgressWidth {
    from { width: 0%; }
    to { width: 100%; }
  }
}

/* Prefers Reduced Motion Safety */
@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;
  }
  
  .ebs-glow-blob {
    animation: none !important;
    opacity: 0.08 !important;
  }
  
  .ebs-hero__market-note {
    animation: none !important;
  }
}
