/* ===================================================================
   STARTEK HQ — ANIMATIONS & KEYFRAMES
   =================================================================== */

/* ===================================================================
   KEYFRAMES
   =================================================================== */

/* Floating orbs */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) scale(1); }
  50%       { transform: translateY(-32px) scale(1.04); }
}

@keyframes floatMedium {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-18px) rotate(5deg); }
  66%       { transform: translateY(-8px) rotate(-3deg); }
}

/* Pulsing dot (announcement bar, hero badge) */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(1.4); }
}

/* Timeline dot pulse ring */
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233,41,132,0.45); }
  50%       { box-shadow: 0 0 0 10px rgba(233,41,132,0); }
}

/* Infinite trust-bar marquee */
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Shake (form validation error) */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-8px); }
  30%       { transform: translateX(8px); }
  45%       { transform: translateX(-6px); }
  60%       { transform: translateX(6px); }
  75%       { transform: translateX(-3px); }
  90%       { transform: translateX(3px); }
}

/* Gradient background shift (CTA buttons) */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Entrance animations (fired via IntersectionObserver) */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeLeft {
  from { opacity: 0; transform: translateX(-36px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeRight {
  from { opacity: 0; transform: translateX(36px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Counter pop when value changes */
@keyframes countPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* Glow pulse for CTA hero button */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(233,41,132,0.3); }
  50%       { box-shadow: 0 8px 40px rgba(233,41,132,0.55); }
}

/* Hero badge shimmer */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

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

/* Underline reveal */
@keyframes underlineReveal {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ===================================================================
   SCROLL-TRIGGER CLASSES
   Base state: invisible. JS adds `.is-visible` via IntersectionObserver.
   =================================================================== */

.animate {
  opacity: 0;
  will-change: opacity, transform;
  transition:
    opacity  0.65s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate.fade-up    { transform: translateY(36px); }
.animate.fade-left  { transform: translateX(-36px); }
.animate.fade-right { transform: translateX(36px); }
.animate.scale-in   { transform: scale(0.88); }
.animate.fade-in    { transform: none; }

.animate.is-visible {
  opacity: 1;
  transform: none !important;
}

/* ===================================================================
   STAGGERED CHILDREN
   Apply .stagger to parent; children get automatic delay increments.
   =================================================================== */

.stagger > .animate:nth-child(1)  { transition-delay: 0ms; }
.stagger > .animate:nth-child(2)  { transition-delay: 90ms; }
.stagger > .animate:nth-child(3)  { transition-delay: 180ms; }
.stagger > .animate:nth-child(4)  { transition-delay: 270ms; }
.stagger > .animate:nth-child(5)  { transition-delay: 360ms; }
.stagger > .animate:nth-child(6)  { transition-delay: 450ms; }
.stagger > .animate:nth-child(7)  { transition-delay: 540ms; }
.stagger > .animate:nth-child(8)  { transition-delay: 630ms; }

/* ===================================================================
   BUTTON GLOW PULSE
   =================================================================== */
.btn--primary {
  animation: glowPulse 3s ease-in-out infinite;
}

.btn--primary:hover {
  animation: none;
}

/* ===================================================================
   COUNTER ELEMENTS
   JS replaces the text content; this class marks the element.
   =================================================================== */
[data-counter].is-counting {
  animation: countPop 0.3s ease forwards;
}

/* ===================================================================
   PAGE TRANSITION OVERLAY (fast fade-out on load)
   =================================================================== */
.page-enter {
  animation: fadeIn 0.45s ease forwards;
}

/* ===================================================================
   REDUCED MOTION — Respect user preference
   =================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:   0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration:  0.001ms !important;
    scroll-behavior: auto !important;
  }

  .animate {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero__orb { animation: none !important; }
  .trust-bar__track { animation: none !important; }
  .btn--primary { animation: none !important; }
  .hero__badge-dot { animation: none !important; }
  .timeline-item__dot { animation: none !important; }
}
