/* ==========================================================================
   ANIMATIONS & MICRO-INTERACTIONS - MADE IN TAHA
   ========================================================================== */

/* Keyframe Animations */
@keyframes pulse-dot-anim {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

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

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

@keyframes pulseBorder {
  0%, 100% {
    border-color: rgba(255, 67, 56, 0.2);
  }
  50% {
    border-color: rgba(255, 67, 56, 0.6);
  }
}

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

/* Sound Wave Bars Animation */
.sound-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.sound-bar {
  width: 2px;
  background-color: var(--accent-emerald);
  border-radius: 1px;
}

.audio-toggle-btn.active .sound-bar:nth-child(1) {
  animation: soundBarAnim 0.8s ease-in-out infinite alternate;
}
.audio-toggle-btn.active .sound-bar:nth-child(2) {
  animation: soundBarAnim 0.6s ease-in-out 0.2s infinite alternate;
}
.audio-toggle-btn.active .sound-bar:nth-child(3) {
  animation: soundBarAnim 1.1s ease-in-out 0.4s infinite alternate;
}

@keyframes soundBarAnim {
  0% {
    height: 3px;
  }
  100% {
    height: 12px;
  }
}

/* Custom Interactive Cursor */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, background-color 0.2s ease;
  mix-blend-mode: difference;
}

.custom-cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 67, 56, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: calc(var(--z-cursor) - 1);
  transform: translate(-50%, -50%);
  transition: transform 0.08s ease-out, width 0.25s ease, height 0.25s ease, border-color 0.25s ease;
}

body.cursor-hover .custom-cursor {
  width: 14px;
  height: 14px;
  background: var(--accent-cyan);
}

body.cursor-hover .custom-cursor-follower {
  width: 50px;
  height: 50px;
  border-color: rgba(0, 229, 255, 0.5);
  background: rgba(0, 229, 255, 0.05);
}

/* Scroll reveal utility */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Reduced Motion Support (Rule 12 Accessibility - Cannot Be Skipped) */
@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;
  }
  
  .custom-cursor, .custom-cursor-follower {
    display: none !important;
  }
  
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
  
  #galaxy-canvas {
    opacity: 0.2 !important;
  }
}
