/* ============================================
   SINGHAL ENTERPRISES — Animations
   animations.css — Keyframes, Scroll Animations
   ============================================ */

/* --- Keyframes --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeLeft {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeRight {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-10px); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes glassSweep {
  0% {
    background-position: -100% 0;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    background-position: 200% 0;
    opacity: 0;
  }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scrollHint {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%      { transform: translateY(8px); opacity: 1; }
}

@keyframes expandWidth {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes borderGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(34, 114, 163, 0.2); }
  50%      { box-shadow: 0 0 20px rgba(34, 114, 163, 0.4); }
}

@keyframes logoSlide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}


/* --- Scroll-Triggered Animation Classes --- */
.anim {
  opacity: 0;
  transition: all 0.8s var(--ease-out);
}

.anim.visible {
  opacity: 1;
}

.anim-up {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s var(--ease-out);
}

.anim-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.anim-down {
  opacity: 0;
  transform: translateY(-30px);
  transition: all 0.8s var(--ease-out);
}

.anim-down.visible {
  opacity: 1;
  transform: translateY(0);
}

.anim-left {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s var(--ease-out);
}

.anim-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.anim-right {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s var(--ease-out);
}

.anim-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.anim-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.8s var(--ease-out);
}

.anim-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays for children */
.stagger > *:nth-child(1)  { transition-delay: 0ms; }
.stagger > *:nth-child(2)  { transition-delay: 80ms; }
.stagger > *:nth-child(3)  { transition-delay: 160ms; }
.stagger > *:nth-child(4)  { transition-delay: 240ms; }
.stagger > *:nth-child(5)  { transition-delay: 320ms; }
.stagger > *:nth-child(6)  { transition-delay: 400ms; }
.stagger > *:nth-child(7)  { transition-delay: 480ms; }
.stagger > *:nth-child(8)  { transition-delay: 560ms; }
.stagger > *:nth-child(9)  { transition-delay: 640ms; }
.stagger > *:nth-child(10) { transition-delay: 720ms; }
.stagger > *:nth-child(11) { transition-delay: 800ms; }
.stagger > *:nth-child(12) { transition-delay: 880ms; }

/* Delay utilities */
.delay-100 { transition-delay: 100ms !important; }
.delay-200 { transition-delay: 200ms !important; }
.delay-300 { transition-delay: 300ms !important; }
.delay-400 { transition-delay: 400ms !important; }
.delay-500 { transition-delay: 500ms !important; }
.delay-600 { transition-delay: 600ms !important; }
.delay-700 { transition-delay: 700ms !important; }
.delay-800 { transition-delay: 800ms !important; }


/* --- Hero Specific Animations --- */
.hero-glass-sweep {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.04) 40%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 60%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: glassSweep 4s ease-in-out infinite;
  pointer-events: none;
}

.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(34, 114, 163, 0.3);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.hero-particle:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.hero-particle:nth-child(2) { top: 40%; left: 80%; animation-delay: 1s; animation-duration: 7s; }
.hero-particle:nth-child(3) { top: 60%; left: 30%; animation-delay: 2s; animation-duration: 5s; }
.hero-particle:nth-child(4) { top: 30%; left: 60%; animation-delay: 0.5s; animation-duration: 8s; }
.hero-particle:nth-child(5) { top: 70%; left: 70%; animation-delay: 1.5s; animation-duration: 6s; }
.hero-particle:nth-child(6) { top: 15%; left: 50%; animation-delay: 3s; animation-duration: 9s; }


/* --- Logo Scroll Animation --- */
.logo-scroll {
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.logo-scroll-track {
  display: flex;
  gap: var(--space-12);
  animation: logoSlide 25s linear infinite;
  width: max-content;
}

.logo-scroll-track:hover {
  animation-play-state: paused;
}


/* --- Counter Animation --- */
.counter {
  display: inline-block;
}

.counter.counting {
  animation: countUp 0.6s var(--ease-out) forwards;
}


/* --- Scroll Progress Bar --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--grad-orange);
  z-index: calc(var(--z-nav) + 1);
  width: 0%;
  transition: width 50ms linear;
}


/* --- 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;
  }
  
  .anim, .anim-up, .anim-down, .anim-left, .anim-right, .anim-scale {
    opacity: 1;
    transform: none;
  }
}
