/* ============================================
   Cape Global — Animations
   animations.css
   ============================================ */

/* ============================================
   Scroll Reveal Base States
   ============================================ */
.reveal {
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.reveal--up {
  transform: translateY(40px);
}

.reveal.reveal--left {
  transform: translateX(-40px);
}

.reveal.reveal--right {
  transform: translateX(40px);
}

.reveal.reveal--scale {
  transform: scale(0.92);
}

.reveal.reveal--fade {
  transform: none;
}

/* Visible state — added by IntersectionObserver */
.reveal.visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* Staggered children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0ms; }
.stagger-children .reveal:nth-child(2) { transition-delay: 100ms; }
.stagger-children .reveal:nth-child(3) { transition-delay: 200ms; }
.stagger-children .reveal:nth-child(4) { transition-delay: 300ms; }
.stagger-children .reveal:nth-child(5) { transition-delay: 400ms; }
.stagger-children .reveal:nth-child(6) { transition-delay: 500ms; }

/* ============================================
   Counter Number Animation
   ============================================ */
.counter-value {
  display: inline-block;
  transition: var(--transition);
}

/* ============================================
   Particle Canvas Animation (Hero)
   ============================================ */
@keyframes particleDrift {
  0%, 100% { transform: translateY(0) translateX(0); }
  33% { transform: translateY(-20px) translateX(10px); }
  66% { transform: translateY(10px) translateX(-15px); }
}

/* ============================================
   Mobile Trust Ticker
   ============================================ */
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.trust-bar__ticker-inner {
  display: flex;
  animation: ticker 20s linear infinite;
  width: max-content;
}

/* ============================================
   Page Load Animations
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

/* Hero entrance */
.hero__badge {
  animation: fadeInUp 0.6s ease both;
  animation-delay: 0.2s;
}

.hero__title {
  animation: fadeInUp 0.7s ease both;
  animation-delay: 0.35s;
}

.hero__sub {
  animation: fadeInUp 0.7s ease both;
  animation-delay: 0.5s;
}

.hero__ctas {
  animation: fadeInUp 0.7s ease both;
  animation-delay: 0.65s;
}

.hero__scroll {
  animation: fadeInUp 0.7s ease both;
  animation-delay: 0.8s;
}

/* ============================================
   Card Hover Animations
   ============================================ */
.service-card,
.pricing-card,
.hr-service-card,
.value-card,
.team-card,
.trust-pillar {
  will-change: transform;
}

/* ============================================
   Green Line Draw Animation
   ============================================ */
@keyframes drawLine {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* ============================================
   Gradient Shift (for accents)
   ============================================ */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animated-gradient {
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

/* ============================================
   Floating Animation (tech visual items)
   ============================================ */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.tech-item:nth-child(1) { animation: float 3.5s ease-in-out infinite; }
.tech-item:nth-child(2) { animation: float 4s ease-in-out infinite 0.3s; }
.tech-item:nth-child(3) { animation: float 3.8s ease-in-out infinite 0.6s; }
.tech-item:nth-child(4) { animation: float 4.2s ease-in-out infinite 0.2s; }
.tech-item:nth-child(5) { animation: float 3.6s ease-in-out infinite 0.8s; }
.tech-item:nth-child(6) { animation: float 4.1s ease-in-out infinite 0.4s; }

/* ============================================
   Number Tick (counter)
   ============================================ */
@keyframes numberPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.stat-item__number.counting {
  animation: numberPop 0.1s ease;
}

/* ============================================
   Nav Link Underline Hover
   ============================================ */
.nav__links a {
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--accent-green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
  border-radius: 1px;
}

.nav__links a:hover::after,
.nav__links a.active::after {
  transform: scaleX(1);
}

/* ============================================
   Input Focus Glow
   ============================================ */
@keyframes inputGlow {
  0% { box-shadow: 0 0 0 0 rgba(0,200,150,0.25); }
  100% { box-shadow: 0 0 0 4px rgba(0,200,150,0); }
}

.form-group input:focus,
.form-group textarea:focus {
  animation: inputGlow 0.4s ease;
}

/* ============================================
   Testimonial Card Entrance
   ============================================ */
.testimonial-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* ============================================
   Button Ripple Effect
   ============================================ */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.12);
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: inherit;
}

.btn:active::after {
  opacity: 1;
}

/* ============================================
   Scroll Progress Indicator
   ============================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--grad-green);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
}

/* ============================================
   Fix: Pricing card visibility fallback
   Prevent white-space gap if IntersectionObserver
   hasn't fired yet (scroll position or slow JS)
   ============================================ */
.pricing-card {
  opacity: 1 !important;
  transform: none !important;
}

.pricing-card.reveal {
  opacity: 0 !important;
  transform: translateY(32px) !important;
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.pricing-card.reveal.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ============================================
   Skip-to-content link
   ============================================ */
.skip-link {
  position: absolute;
  top: -48px;
  left: 0;
  background: var(--accent-green, #00C896);
  color: #fff;
  padding: 10px 20px;
  z-index: 99999;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 0 0 8px 0;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #fff;
  outline-offset: 2px;
}
