/* ==========================================================================
   ANIMATIONS & MICRO-INTERACTIONS
   Karam Chand Portfolio Website
   ========================================================================== */

/* Keyframe: Spin slow for Ashoka Chakra motifs */
@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Keyframe: Fade In */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Keyframe: Scale Up */
@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Keyframe: Scroll Indicator Wheel */
@keyframes scrollWheel {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  50% {
    opacity: 0.4;
    transform: translateY(8px);
  }
  100% {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* Keyframe: Bounce Down */
@keyframes bounceDown {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(6px);
  }
  60% {
    transform: translateY(3px);
  }
}

/* Keyframe: Gentle Float for Badges */
@keyframes gentleFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Keyframe: Subtle Pulse */
@keyframes pulseSubtle {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 130, 32, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(245, 130, 32, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 130, 32, 0);
  }
}

/* Applied Animation Classes */
.floating-trust-badge {
  animation: gentleFloat 5s ease-in-out infinite;
}

.hero-badge .badge-tricolor-dot {
  animation: pulseSubtle 2.5s infinite;
}

/* Hero Entrance Animations (CSS-native, guaranteed visibility without JS dependency) */
@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-content > * {
  animation: heroFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero-content > *:nth-child(1) { animation-delay: 0.05s; }
.hero-content > *:nth-child(2) { animation-delay: 0.15s; }
.hero-content > *:nth-child(3) { animation-delay: 0.25s; }
.hero-content > *:nth-child(4) { animation-delay: 0.35s; }
.hero-content > *:nth-child(5) { animation-delay: 0.45s; }
.hero-content > *:nth-child(6) { animation-delay: 0.55s; }

.hero-visual {
  animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

/* Reveal Elements: Visible by default, enhanced when JS triggers */
.reveal-elem {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Button Shimmer / Ripple hover feel */
.btn-saffron {
  position: relative;
  overflow: hidden;
}
.btn-saffron::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: rotate(25deg);
  transition: none;
}
.btn-saffron:hover::after {
  left: 120%;
  transition: left 0.75s ease-in-out;
}

/* Smooth Focus Rings for Accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--color-saffron);
  outline-offset: 3px;
}

/* Reduced Motion Mode */
@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-elem {
    opacity: 1 !important;
    transform: none !important;
  }
}
