/* SynapTree Animations */

/* Fade in from below */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Gentle float for hero SVG nodes */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

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

@keyframes floatReverse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Pulse glow for connections */
@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Scale in */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Connection draw-in */
@keyframes drawLine {
  from { stroke-dashoffset: 200; }
  to { stroke-dashoffset: 0; }
}

/* Scroll-triggered animation classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Staggered children */
.stagger-children .animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.stagger-children .animate-on-scroll:nth-child(2) { transition-delay: 80ms; }
.stagger-children .animate-on-scroll:nth-child(3) { transition-delay: 160ms; }
.stagger-children .animate-on-scroll:nth-child(4) { transition-delay: 240ms; }
.stagger-children .animate-on-scroll:nth-child(5) { transition-delay: 320ms; }
.stagger-children .animate-on-scroll:nth-child(6) { transition-delay: 400ms; }

/* Hero-specific animations */
.hero-title {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}

.hero-subtitle {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.25s both;
}

.hero-ctas {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

.hero-illustration {
  animation: fadeIn 1s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both;
}

/* SVG node animations */
.svg-node-float {
  animation: float 4s ease-in-out infinite;
}

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

.svg-node-float-reverse {
  animation: floatReverse 4.5s ease-in-out infinite;
}

.svg-connection-pulse {
  animation: pulseGlow 3s ease-in-out infinite;
}

/* Nav scroll transition */
.site-nav {
  transition: background-color var(--transition-base),
              box-shadow var(--transition-base),
              backdrop-filter var(--transition-base);
}

/* Button hover effects */
.btn {
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              background-color var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* Card hover effects */
.feature-card {
  transition: transform var(--transition-base),
              box-shadow var(--transition-base);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Theme card hover */
.theme-card {
  transition: transform var(--transition-base),
              box-shadow var(--transition-base);
}

.theme-card:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-xl);
}

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

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }

  .hero-title,
  .hero-subtitle,
  .hero-ctas,
  .hero-illustration {
    animation: none;
    opacity: 1;
  }
}
