/* ================================================================
   BEACONBOLD – ANIMATIONS
   style/animations.css
================================================================ */

/* ── Reveal on Scroll ──────────────────────────────────────── */
.reveal-up,
.reveal-left,
.reveal-right {
  opacity: 0;
  transition: opacity .65s cubic-bezier(.22,1,.36,1),
              transform .65s cubic-bezier(.22,1,.36,1);
  will-change: opacity, transform;
}

.reveal-up    { transform: translateY(40px); }
.reveal-left  { transform: translateX(-50px); }
.reveal-right { transform: translateX(50px); }

.reveal-up.revealed,
.reveal-left.revealed,
.reveal-right.revealed {
  opacity: 1;
  transform: none;
}

/* Staggered delay for service / why cards */
[data-delay="0"] { transition-delay: 0s;    }
[data-delay="1"] { transition-delay: .08s;  }
[data-delay="2"] { transition-delay: .16s;  }
[data-delay="3"] { transition-delay: .24s;  }
[data-delay="4"] { transition-delay: .32s;  }
[data-delay="5"] { transition-delay: .40s;  }
[data-delay="6"] { transition-delay: .48s;  }
[data-delay="7"] { transition-delay: .56s;  }

/* ── Floating particles (hero bg) ─────────────────────────── */
@keyframes particleFloat {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: .6; }
  33%  { transform: translateY(-20px) translateX(8px) scale(1.05); }
  66%  { transform: translateY(-8px) translateX(-6px) scale(.97); }
  100% { transform: translateY(0) translateX(0) scale(1); opacity: .6; }
}

/* ── Shimmer (card accents) ───────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ── Gradient shift (hero headline) ──────────────────────── */
@keyframes gradShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.headline-gradient {
  background-size: 200% 200%;
  animation: gradShift 6s ease infinite;
}

/* ── Pulsing ring (hero orb) ─────────────────────────────── */
@keyframes ringPulse {
  0%,100% { opacity: .3; transform: scale(1); }
  50%      { opacity: .7; transform: scale(1.04); }
}

/* ── Scale in (CTA stats) ────────────────────────────────── */
@keyframes scaleIn {
  from { transform: scale(.88); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ── Hero badge entrance ──────────────────────────────────── */
@keyframes slideDown {
  from { transform: translateY(-16px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.hero-badge  { animation: slideDown .6s cubic-bezier(.22,1,.36,1) .1s both; }

/* ── Stat counter flash ──────────────────────────────────── */
@keyframes statFade {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.stat-item:nth-child(1) { animation: statFade .5s ease .8s both; }
.stat-item:nth-child(3) { animation: statFade .5s ease .9s both; }
.stat-item:nth-child(5) { animation: statFade .5s ease 1s  both; }

/* ── Hover underline for footer links ────────────────────── */
.footer-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1px;
  background: var(--cyan-light, #22D3EE);
  transition: width .25s ease;
}
.footer-links a:hover::after { width: 100%; }

/* ── Service card border glow on hover ───────────────────── */
.service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(29,78,216,.06), rgba(6,182,212,.04));
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.service-card:hover::after { opacity: 1; }

/* ── Smooth CTA button pulsing ring ──────────────────────── */
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(29,78,216,.5);
  animation: btnRipple 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes btnRipple {
  0%   { box-shadow: 0 0 0 0 rgba(29,78,216,.4); }
  70%  { box-shadow: 0 0 0 10px rgba(29,78,216,0); }
  100% { box-shadow: 0 0 0 0 rgba(29,78,216,0); }
}

/* ── Why card number float on hover ─────────────────────── */
.why-card:hover .wc-number {
  transform: translateY(-4px);
  transition: transform .3s ease, color .3s ease;
}

/* ── Tech card micro-shadow pulse ───────────────────────── */
.tech-card {
  transition: box-shadow .3s ease, transform .3s ease;
}
.tech-card:hover {
  box-shadow: 0 16px 40px rgba(15,28,63,.16);
}

/* ── Loading animation for page entrance ────────────────── */
@keyframes fadeInPage {
  from { opacity: 0; }
  to   { opacity: 1; }
}
body { animation: fadeInPage .4s ease; }

/* ── Dotted line animate ─────────────────────────────────── */
@keyframes dashDraw {
  from { stroke-dashoffset: 200; }
  to   { stroke-dashoffset: 0; }
}

/* ── Orb center breathe ──────────────────────────────────── */
.orb-center {
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe {
  0%,100% { box-shadow: 0 8px 32px rgba(29,78,216,.2); transform: scale(1); }
  50%      { box-shadow: 0 12px 48px rgba(29,78,216,.35); transform: scale(1.04); }
}

/* ── About core breathe ──────────────────────────────────── */
.avc-core {
  animation: breathe 5s ease-in-out infinite .5s;
}


/* ================================================================
   ECOSYSTEM ANIMATION ENHANCEMENTS
================================================================ */

/* Ensure transform-origin works on SVG <g> in all browsers */
.ecosystem-svg g[style*="transform-origin"],
.about-ecosystem-svg g[style*="transform-origin"] {
  transform-box: fill-box;
}

/* Hero ecosystem hover lift */
.hero-ecosystem:hover .eco-card {
  box-shadow: 0 14px 40px rgba(15,28,63,0.16), 0 2px 8px rgba(15,28,63,0.08);
}

/* About panel bar animate on reveal */
.reveal-left.revealed .ap-bar-fill {
  animation: apBarGrow 1.6s cubic-bezier(.22,1,.36,1) 0.4s both;
}

/* Continuous glow pulse on central hex */
@keyframes hexGlow {
  0%,100% { filter: drop-shadow(0 0 8px rgba(29,78,216,0.3)) drop-shadow(0 0 24px rgba(6,182,212,0.2)); }
  50%      { filter: drop-shadow(0 0 16px rgba(29,78,216,0.5)) drop-shadow(0 0 40px rgba(6,182,212,0.35)); }
}
.ecosystem-svg polygon:first-of-type,
.about-ecosystem-svg polygon:first-of-type {
  animation: hexGlow 4s ease-in-out infinite;
}

/* Eco card entry animation */
.reveal-right.revealed .eco-card-1 { animation: ecoCardIn 0.6s cubic-bezier(.34,1.56,.64,1) 0.3s both, ecoFloat1 5.5s ease-in-out 0.9s infinite; }
.reveal-right.revealed .eco-card-2 { animation: ecoCardIn 0.6s cubic-bezier(.34,1.56,.64,1) 0.45s both, ecoFloat2 6.2s ease-in-out 1.05s infinite; }
.reveal-right.revealed .eco-card-3 { animation: ecoCardIn 0.6s cubic-bezier(.34,1.56,.64,1) 0.6s both, ecoFloat2 5.8s ease-in-out 1.2s infinite; }
.reveal-right.revealed .eco-card-4 { animation: ecoCardIn 0.6s cubic-bezier(.34,1.56,.64,1) 0.75s both, ecoFloat1 7s ease-in-out 1.35s infinite; }

@keyframes ecoCardIn {
  from { opacity: 0; transform: scale(0.8) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* About panel entry */
.reveal-left.revealed .ap-1 { animation: ecoCardIn 0.6s cubic-bezier(.34,1.56,.64,1) 0.35s both, ecoFloat1 5.8s ease-in-out 0.95s infinite; }
.reveal-left.revealed .ap-2 { animation: ecoCardIn 0.6s cubic-bezier(.34,1.56,.64,1) 0.5s both, ecoFloat2 6.5s ease-in-out 1.1s infinite; }
.reveal-left.revealed .ap-3 { animation: ecoCardIn 0.6s cubic-bezier(.34,1.56,.64,1) 0.65s both, ecoFloat1 7.2s ease-in-out 1.25s infinite; }

/* SVG orbit marker glow pulse */
@keyframes markerGlow {
  0%,100% { opacity: 0.8; }
  50%      { opacity: 1; filter: drop-shadow(0 0 6px currentColor); }
}


/* ================================================================
   TESTIMONIALS ANIMATIONS
================================================================ */

/* Staggered card entrance */
.testi-card.reveal-up[data-delay="0"] { transition-delay: 0s;   }
.testi-card.reveal-up[data-delay="1"] { transition-delay: .14s; }
.testi-card.reveal-up[data-delay="2"] { transition-delay: .28s; }

/* Featured card subtle inner glow pulse */
@keyframes featuredPulse {
  0%,100% { box-shadow: 0 8px 40px rgba(15,28,63,.22), 0 0 0 0 rgba(59,130,246,.0); }
  50%      { box-shadow: 0 12px 56px rgba(15,28,63,.28), 0 0 32px rgba(59,130,246,.12); }
}
.testi-card-featured {
  animation: featuredPulse 6s ease-in-out infinite;
}

/* Star shimmer on the featured card */
.testi-stars-light svg {
  animation: starShimmer 3s ease-in-out infinite;
}
.testi-stars-light svg:nth-child(1) { animation-delay: 0s; }
.testi-stars-light svg:nth-child(2) { animation-delay: .1s; }
.testi-stars-light svg:nth-child(3) { animation-delay: .2s; }
.testi-stars-light svg:nth-child(4) { animation-delay: .3s; }
.testi-stars-light svg:nth-child(5) { animation-delay: .4s; }

@keyframes starShimmer {
  0%,80%,100% { opacity: 1; transform: scale(1); }
  90%          { opacity: .7; transform: scale(.85); }
}

/* Accent bar slide in */
.testi-card.revealed .testi-accent {
  animation: accentSlide .5s cubic-bezier(.22,1,.36,1) .4s both;
}
@keyframes accentSlide {
  from { opacity: 0; transform: scaleY(0); }
  to   { opacity: .5; transform: scaleY(1); }
}
