/* ========================================
   MACOWA — Animation System
   Keyframes, scroll reveals, hero kinetics,
   hover effects, & reduced-motion support
   ======================================== */


/* ─────────────────────────────────────────
   KEYFRAMES
   ───────────────────────────────────────── */

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

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

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

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

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

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.4);
  }
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes draw {
  from {
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes typewriter {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

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

@keyframes rotate-gradient {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}


/* ─────────────────────────────────────────
   SCROLL REVEAL CLASSES
   ───────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
  will-change: opacity, transform;
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
  will-change: opacity, transform;
}

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

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
  will-change: opacity, transform;
}

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

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
  will-change: opacity, transform;
}

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


/* ─────────────────────────────────────────
   STAGGER DELAYS (for child elements)
   ───────────────────────────────────────── */

.stagger-children > *:nth-child(1) { transition-delay: 0s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.4s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.5s; }


/* ─────────────────────────────────────────
   HERO KINETIC TYPOGRAPHY
   ───────────────────────────────────────── */

.hero-title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s ease forwards;
}

.hero-title .word:nth-child(1) { animation-delay: 0.1s; }
.hero-title .word:nth-child(2) { animation-delay: 0.2s; }
.hero-title .word:nth-child(3) { animation-delay: 0.3s; }
.hero-title .word:nth-child(4) { animation-delay: 0.4s; }
.hero-title .word:nth-child(5) { animation-delay: 0.5s; }
.hero-title .word:nth-child(6) { animation-delay: 0.6s; }
.hero-title .word:nth-child(7) { animation-delay: 0.7s; }
.hero-title .word:nth-child(8) { animation-delay: 0.8s; }

/* Typewriter cursor effect */
.typewriter {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--accent-primary);
  animation:
    typewriter 3s steps(40) 1s forwards,
    blink 0.75s step-end infinite;
}


/* ─────────────────────────────────────────
   HOVER EFFECTS
   ───────────────────────────────────────── */

.hover-lift {
  transition: transform var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

.hover-scale {
  transition: transform var(--transition-base);
}

.hover-scale:hover {
  transform: scale(1.03);
}


/* ─────────────────────────────────────────
   FLOATING ANIMATION UTILITY
   ───────────────────────────────────────── */

.float {
  animation: float 3s ease-in-out infinite;
}

.float-slow {
  animation: float 5s ease-in-out infinite;
}

.float-delayed {
  animation: float 3s ease-in-out 1s infinite;
}


/* ─────────────────────────────────────────
   GRADIENT ANIMATION UTILITY
   ───────────────────────────────────────── */

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
}


/* ─────────────────────────────────────────
   SHIMMER / SKELETON LOADING
   ───────────────────────────────────────── */

.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-surface) 25%,
    var(--bg-elevated) 50%,
    var(--bg-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}


/* ─────────────────────────────────────────
   PULSE DOT (e.g., hero badge "live" dot)
   ───────────────────────────────────────── */

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-secondary);
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--accent-secondary);
  animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}


/* ─────────────────────────────────────────
   ROTATING GRADIENT BORDER
   ───────────────────────────────────────── */

.gradient-border {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: conic-gradient(
    from 0deg,
    var(--gradient-start),
    var(--gradient-end),
    var(--gradient-start)
  );
  border-radius: inherit;
  animation: rotate-gradient 3s linear infinite;
  z-index: -1;
}

.gradient-border::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--bg-surface);
  border-radius: calc(var(--radius-lg) - 2px);
  z-index: -1;
}


/* ─────────────────────────────────────────
   REDUCED MOTION — ACCESSIBILITY
   ───────────────────────────────────────── */

@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,
  .reveal-scale {
    opacity: 1;
    transform: none;
  }

  .hero-title .word {
    opacity: 1;
    transform: none;
  }

  .typewriter {
    overflow: visible;
    border-right: none;
  }

  .float,
  .float-slow,
  .float-delayed {
    animation: none;
  }
}
