/* ============================
   Animations — Keyframes & Scroll Effects
   ============================ */

/* Float */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}

/* Pulse Glow */
@keyframes pulseGlow {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.05); }
}

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

/* Gradient Shift */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */

/* Base class for animated elements */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Directional variants */
.animate-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale Up */
.animate-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays for children */
.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; }
.stagger-children > *:nth-child(7) { transition-delay: 0.6s; }
.stagger-children > *:nth-child(8) { transition-delay: 0.7s; }
.stagger-children > *:nth-child(9) { transition-delay: 0.8s; }

/* ===== HERO SPECIFIC ===== */
.hero-content {
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

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

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

/* Background glow animation */
.hero-bg-glow {
  animation: pulseGlow 8s ease-in-out infinite;
}

.hero-bg-glow-2 {
  animation-delay: 4s;
}

/* ===== HOVER MICROANIMATIONS ===== */

/* Card subtle lift */
.card {
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base),
              background var(--transition-base);
}

/* Icon rotation on hover */
.card:hover .card-icon svg {
  transform: scale(1.1);
  transition: transform var(--transition-spring);
}

/* Process step pulse */
.process-step-number {
  transition: box-shadow var(--transition-base);
}

.process-step:hover .process-step-number {
  box-shadow: 0 4px 30px var(--accent-primary-glow), 0 0 40px var(--accent-primary-glow);
}

/* Button shine effect */
@keyframes shine {
  from {
    transform: translateX(-100%) skewX(-15deg);
  }
  to {
    transform: translateX(200%) skewX(-15deg);
  }
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: skewX(-15deg);
  transition: none;
}

.btn-primary:hover::before {
  animation: shine 0.8s ease-in-out;
}

/* ===== PREFERS 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,
  .animate-left,
  .animate-right,
  .animate-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ===== THEME TRANSITION ===== */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
  transition: background-color 0.5s ease,
              color 0.5s ease,
              border-color 0.5s ease,
              box-shadow 0.5s ease !important;
}

/* ===== CUSTOM CURSOR ===== */

/* Hide default cursor when custom cursor is active */
.custom-cursor-active,
.custom-cursor-active * {
  cursor: none !important;
}

.cursor-inner {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 100000;
  mix-blend-mode: difference;
  transition: width 0.2s ease, height 0.2s ease, background 0.2s ease;
}

.cursor-outer {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--accent-primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  opacity: 0.6;
  transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 0 10px var(--accent-primary-glow);
}

.cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 50px;
  height: 50px;
  border: 1px solid var(--accent-secondary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  opacity: 0.15;
  transition: width 0.3s ease, height 0.3s ease;
}

/* Hover state */
.cursor-outer.cursor-hover {
  width: 56px;
  height: 56px;
  border-color: var(--accent-secondary);
  opacity: 0.8;
  box-shadow: 0 0 20px var(--accent-secondary-glow);
}

.cursor-inner.cursor-hover {
  width: 10px;
  height: 10px;
  background: var(--accent-secondary);
}

/* Click state */
.cursor-outer.cursor-click {
  width: 28px;
  height: 28px;
  opacity: 1;
}

.cursor-inner.cursor-click {
  width: 4px;
  height: 4px;
}

/* ===== SECTION PARTICLES CANVAS ===== */
.section-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Ensure section content is above particles */
.section > .container,
section > .container {
  position: relative;
  z-index: 1;
}

/* Hide cursor elements on mobile */
@media (max-width: 768px) {
  .cursor-inner,
  .cursor-outer,
  .cursor-trail {
    display: none !important;
  }
}
