/* ============================================================
   SOFTROUTE INFO TECHNOLOGIES — ANIMATIONS CSS
   Scroll Reveals, Float, Counters, Hover, Transitions
   ============================================================ */

/* ── 1. SCROLL REVEAL — BASE STATES ─────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

.reveal-fade {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.reveal-fade.revealed {
  opacity: 1;
}

/* ── 2. STAGGER DELAYS (for grid children) ───────────────── */
.stagger > *:nth-child(1) { transition-delay: 0.05s; }
.stagger > *:nth-child(2) { transition-delay: 0.12s; }
.stagger > *:nth-child(3) { transition-delay: 0.19s; }
.stagger > *:nth-child(4) { transition-delay: 0.26s; }
.stagger > *:nth-child(5) { transition-delay: 0.33s; }
.stagger > *:nth-child(6) { transition-delay: 0.40s; }
.stagger > *:nth-child(7) { transition-delay: 0.47s; }
.stagger > *:nth-child(8) { transition-delay: 0.54s; }
.stagger > *:nth-child(9) { transition-delay: 0.61s; }
.stagger > *:nth-child(10){ transition-delay: 0.68s; }

/* ── 3. FLOAT ANIMATION (Hero SVG elements) ─────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-14px); }
}

@keyframes float-slow {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

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

.float        { animation: float 4.5s ease-in-out infinite; }
.float-slow   { animation: float-slow 6s ease-in-out infinite; }
.float-xs     { animation: float-xs 3.5s ease-in-out infinite; }
.float-delay1 { animation-delay: 0.8s; }
.float-delay2 { animation-delay: 1.6s; }
.float-delay3 { animation-delay: 2.4s; }
.float-delay4 { animation-delay: 0.4s; }

/* ── 4. PULSE ANIMATION ──────────────────────────────────── */
@keyframes pulse-ring {
  0%   { transform: scale(0.95); opacity: 0.8; }
  70%  { transform: scale(1.1); opacity: 0; }
  100% { transform: scale(1.1); opacity: 0; }
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}

.pulse-dot   { animation: pulse-dot 2.5s ease-in-out infinite; }
.pulse-ring  { animation: pulse-ring 2.5s ease-out infinite; }

/* ── 5. SHIMMER / SCAN LINE ──────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.shimmer-line {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.4) 50%,
    transparent 100%
  );
  background-size: 400px 100%;
  animation: shimmer 2.5s ease-in-out infinite;
}

/* ── 6. GRADIENT SHIFT ───────────────────────────────────── */
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-animate {
  background-size: 200% 200%;
  animation: gradient-shift 6s ease infinite;
}

/* ── 7. SVG PATH DRAW ────────────────────────────────────── */
@keyframes draw-path {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0; }
}

.draw-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

.draw-path.revealed {
  animation: draw-path 1.5s ease-out forwards;
}

/* ── 8. COUNTER ANIMATION ────────────────────────────────── */
.counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ── 9. SPIN ANIMATION ───────────────────────────────────── */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes spin-reverse {
  from { transform: rotate(360deg); }
  to   { transform: rotate(0deg); }
}

.spin-slow    { animation: spin-slow 20s linear infinite; }
.spin-reverse { animation: spin-reverse 15s linear infinite; }

/* ── 10. TYPEWRITER CURSOR ───────────────────────────────── */
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: currentColor;
  margin-left: 2px;
  vertical-align: middle;
  animation: cursor-blink 1s step-end infinite;
}

/* ── 11. SLIDE IN ANIMATIONS ─────────────────────────────── */
@keyframes slide-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes zoom-in {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.animate-slide-up    { animation: slide-in-up 0.6s ease-out forwards; }
.animate-slide-left  { animation: slide-in-left 0.6s ease-out forwards; }
.animate-slide-right { animation: slide-in-right 0.6s ease-out forwards; }
.animate-zoom-in     { animation: zoom-in 0.5s ease-out forwards; }

/* ── 12. HERO ENTRANCE ANIMATIONS ───────────────────────── */
@keyframes hero-fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title    { animation: hero-fade-up 0.7s ease-out 0.1s both; }
.hero-subtitle { animation: hero-fade-up 0.7s ease-out 0.25s both; }
.hero-cta-group{ animation: hero-fade-up 0.7s ease-out 0.4s both; }
.hero-eyebrow  { animation: hero-fade-up 0.7s ease-out 0s both; }
.hero-visual   { animation: hero-fade-up 0.8s ease-out 0.3s both; }

/* ── 13. NAVBAR TRANSITIONS ──────────────────────────────── */
.navbar .nav-links > li > a {
  position: relative;
}

.navbar .nav-links > li > a::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  right: 50%;
  height: 2px;
  background: var(--color-primary);
  transition: left var(--transition-base), right var(--transition-base);
  border-radius: var(--radius-full);
}

.navbar.scrolled .nav-links > li > a:hover::before,
.navbar.scrolled .nav-links > li > a.active::before {
  left: var(--space-3);
  right: var(--space-3);
}

/* ── 14. CARD HOVER EFFECTS ──────────────────────────────── */
.card-hover-lift {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.card-hover-lift:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 20px 40px rgba(35,103,154,0.15);
}

/* ── 15. BUTTON RIPPLE ───────────────────────────────────── */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: scale(0);
  animation: none;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ── 16. IMAGE ZOOM ON HOVER ─────────────────────────────── */
.img-zoom-wrap {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.img-zoom-wrap img {
  transition: transform 0.6s ease;
}

.img-zoom-wrap:hover img {
  transform: scale(1.05);
}

/* ── 17. ICON BOUNCE ─────────────────────────────────────── */
@keyframes icon-bounce {
  0%, 100% { transform: translateY(0); }
  40%       { transform: translateY(-6px); }
  60%       { transform: translateY(-3px); }
}

.icon-bounce:hover {
  animation: icon-bounce 0.6s ease;
}

/* ── 18. GLOW EFFECT ─────────────────────────────────────── */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(35,103,154,0.3); }
  50%       { box-shadow: 0 0 20px 8px rgba(35,103,154,0.15); }
}

.glow-pulse {
  animation: glow-pulse 3s ease-in-out infinite;
}

/* ── 19. PARTICLE DOTS (SVG background) ──────────────────── */
@keyframes particle-drift {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.6; }
  33%  { transform: translate(8px, -12px) scale(1.1); opacity: 0.9; }
  66%  { transform: translate(-6px, -6px) scale(0.9); opacity: 0.7; }
  100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
}

.particle { animation: particle-drift 6s ease-in-out infinite; }
.particle:nth-child(2) { animation-delay: 1s; }
.particle:nth-child(3) { animation-delay: 2s; }
.particle:nth-child(4) { animation-delay: 3s; }
.particle:nth-child(5) { animation-delay: 4s; }

/* ── 20. LOADING SKELETON ────────────────────────────────── */
@keyframes skeleton-loading {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg,
    var(--color-border) 25%,
    var(--color-bg-light) 50%,
    var(--color-border) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* ── 21. MEGA MENU ANIMATION ─────────────────────────────── */
.mega-menu {
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

/* ── 22. MOBILE MENU ANIMATION ───────────────────────────── */
.mobile-menu {
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── 23. FAQ ANSWER TRANSITION ───────────────────────────── */
.faq-answer {
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease;
  opacity: 0;
}

.faq-item.open .faq-answer {
  opacity: 1;
}

/* ── 24. BACKGROUND PARALLAX HINT ────────────────────────── */
.parallax-bg {
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
}

/* ── 25. SCROLL PROGRESS INDICATOR ──────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-mid));
  z-index: calc(var(--z-sticky) + 1);
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ── 26. ORBIT ANIMATION (for tech section) ──────────────── */
@keyframes orbit {
  from { transform: rotate(0deg) translateX(70px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(70px) rotate(-360deg); }
}

.orbit-item { animation: orbit 8s linear infinite; }
.orbit-item:nth-child(2) { animation-delay: -2.67s; }
.orbit-item:nth-child(3) { animation-delay: -5.33s; }

/* ── 27. 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;
    scroll-behavior: auto !important;
  }

  .float,
  .float-slow,
  .float-xs,
  .spin-slow,
  .spin-reverse,
  .pulse-dot,
  .pulse-ring,
  .glow-pulse,
  .particle,
  .orbit-item,
  .shimmer-line,
  .gradient-animate {
    animation: none !important;
  }

  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-fade {
    opacity: 1 !important;
    transform: none !important;
  }
}
