/* ============================================================
   ANIMATIONS — vizasupport (modern edition)
   All keyframes, scroll-reveal, scroll-to-top, progress bar,
   ripple, skeleton, float, reduced-motion support.
   ============================================================ */

/* ══════════════════════════════════════════════════════════
   KEYFRAME DEFINITIONS
══════════════════════════════════════════════════════════ */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

@keyframes shimmerSkeleton {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

@keyframes floatVertical {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(29,122,74,0.45); }
  50%       { box-shadow: 0 0 0 12px rgba(29,122,74,0); }
}

@keyframes gradientShift {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

@keyframes spinnerRotate {
  to { transform: rotate(360deg); }
}

@keyframes drawUnderline {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@keyframes heroOrbDrift {
  0%   { transform: translate(0px, 0px) scale(1); }
  33%  { transform: translate(30px, -20px) scale(1.05); }
  66%  { transform: translate(-20px, 15px) scale(0.97); }
  100% { transform: translate(0px, 0px) scale(1); }
}

@keyframes badgePop {
  0%   { transform: scale(0.8); opacity: 0; }
  60%  { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); }
}

/* ══════════════════════════════════════════════════════════
   SCROLL REVEAL — elements animate when entering viewport
   Added dynamically by JS to elements below the fold.
══════════════════════════════════════════════════════════ */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity  0.65s var(--ease-out),
    transform 0.65s var(--ease-out);
  will-change: opacity, transform;
}

.reveal.reveal--active {
  opacity: 1;
  transform: translateY(0);
}

/* Direction variants */
.reveal--left  { transform: translateX(-28px); }
.reveal--right { transform: translateX(28px);  }
.reveal--scale { transform: scale(0.90);        }

.reveal--left.reveal--active,
.reveal--right.reveal--active { transform: translateX(0); }
.reveal--scale.reveal--active { transform: scale(1); }

/* Stagger delays (assigned by JS) */
.reveal--delay-1 { transition-delay: 0.05s; }
.reveal--delay-2 { transition-delay: 0.10s; }
.reveal--delay-3 { transition-delay: 0.15s; }
.reveal--delay-4 { transition-delay: 0.20s; }
.reveal--delay-5 { transition-delay: 0.25s; }
.reveal--delay-6 { transition-delay: 0.30s; }

/* ══════════════════════════════════════════════════════════
   READING PROGRESS BAR
══════════════════════════════════════════════════════════ */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  z-index: calc(var(--z-toast) + 1);
  transition: width 0.08s linear;
  pointer-events: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}


/* ══════════════════════════════════════════════════════════
   RIPPLE EFFECT
══════════════════════════════════════════════════════════ */

.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.28);
  transform: scale(0);
  animation: ripple 0.58s linear;
  pointer-events: none;
}

.btn--secondary .ripple {
  background: rgba(0,0,0,0.12);
}

/* ══════════════════════════════════════════════════════════
   SKELETON LOADING
══════════════════════════════════════════════════════════ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-100) 25%,
    var(--gray-200) 50%,
    var(--gray-100) 75%
  );
  background-size: 200% 100%;
  animation: shimmerSkeleton 1.6s infinite linear;
  border-radius: var(--radius-md);
}

.skeleton--text  { height: 1em;   margin-bottom: 0.5em; }
.skeleton--title { height: 1.5em; width: 60%; margin-bottom: 1em; }
.skeleton--card  { aspect-ratio: 5/2; border-radius: var(--radius-xl); }

/* ══════════════════════════════════════════════════════════
   FLOAT ANIMATION — decorative elements
══════════════════════════════════════════════════════════ */

.float-anim          { animation: floatVertical 6s ease-in-out infinite; }
.float-anim--slow    { animation-duration: 9s; }
.float-anim--fast    { animation-duration: 4s; }
.float-anim--delay-1 { animation-delay: 1.5s; }
.float-anim--delay-2 { animation-delay: 3s; }

/* ══════════════════════════════════════════════════════════
   GRADIENT TEXT UTILITY
══════════════════════════════════════════════════════════ */

.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ══════════════════════════════════════════════════════════
   SHINE SWEEP — cards & panels
══════════════════════════════════════════════════════════ */

.shine-on-hover {
  position: relative;
  overflow: hidden;
}

.shine-on-hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255,255,255,0.10) 50%,
    transparent 80%
  );
  transform: skewX(-18deg);
  transition: left 0.70s ease;
  pointer-events: none;
  z-index: 3;
}

.shine-on-hover:hover::after {
  left: 160%;
}

/* ══════════════════════════════════════════════════════════
   HERO DECORATIVE ORBS (CSS-only, no images)
══════════════════════════════════════════════════════════ */

/* Applied to .hero via JS-added class or existing element */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.hero-orb--1 {
  width: 320px;
  height: 320px;
  right: 8%;
  top: -80px;
  background: radial-gradient(circle, rgba(29,122,74,0.18) 0%, transparent 70%);
  animation: heroOrbDrift 18s ease-in-out infinite;
}

.hero-orb--2 {
  width: 200px;
  height: 200px;
  right: 30%;
  bottom: -40px;
  background: radial-gradient(circle, rgba(232,168,0,0.10) 0%, transparent 70%);
  animation: heroOrbDrift 24s ease-in-out infinite reverse;
}

.hero-orb--3 {
  width: 120px;
  height: 120px;
  left: 15%;
  top: 20%;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  animation: heroOrbDrift 14s ease-in-out infinite;
  animation-delay: 3s;
}

/* ══════════════════════════════════════════════════════════
   SECTION HEADER ANIMATED ACCENT LINE
══════════════════════════════════════════════════════════ */

.section-header--animated .section-header__title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  border-radius: var(--radius-full);
  margin-top: var(--space-sm);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.55s var(--ease-out) 0.25s;
}

.section-header--animated.reveal--active .section-header__title::after,
.section-header--animated:not(.reveal) .section-header__title::after {
  transform: scaleX(1);
}

.section-header--center.section-header--animated .section-header__title::after {
  margin-inline: auto;
  transform-origin: center;
}

/* ══════════════════════════════════════════════════════════
   LABEL ENTRANCE
══════════════════════════════════════════════════════════ */

.label--animate {
  animation: badgePop 0.45s var(--ease-spring) both;
}

/* ══════════════════════════════════════════════════════════
   WHY-CARD ICON GLOW ON HOVER
══════════════════════════════════════════════════════════ */

.why-card:hover .why-card__icon {
  animation: glowPulse 1.5s ease-in-out 1;
}

/* ══════════════════════════════════════════════════════════
   HERO STATS — count-up display polish
══════════════════════════════════════════════════════════ */

.hero__stat-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.about-stat__number {
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════
   ANIMATED GRADIENT BACKGROUND (utility)
══════════════════════════════════════════════════════════ */

.bg-animated-gradient {
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

/* ══════════════════════════════════════════════════════════
   STEP NUMBER — animated entrance
══════════════════════════════════════════════════════════ */

.step.reveal--active .step__number {
  animation: badgePop 0.45s var(--ease-spring) 0.2s both;
}

/* ══════════════════════════════════════════════════════════
   PAGE HERO — animated polygon shape
══════════════════════════════════════════════════════════ */

.page-hero::before {
  transition: transform 0.8s var(--ease-out);
}

/* ══════════════════════════════════════════════════════════
   CARD FOOTER LINK — animated arrow
══════════════════════════════════════════════════════════ */

.card__link svg {
  transition: transform var(--transition-fast);
}

.card__link:hover svg {
  transform: translateX(4px);
}

/* ══════════════════════════════════════════════════════════
   FILTER BUTTON — active state transition
══════════════════════════════════════════════════════════ */

.filter-btn {
  transition:
    background     var(--transition-fast),
    border-color   var(--transition-fast),
    color          var(--transition-fast),
    box-shadow     var(--transition-fast),
    transform      var(--transition-fast);
}

.filter-btn:active { transform: scale(0.96); }

/* ══════════════════════════════════════════════════════════
   ACCORDION — smoother icon transition
══════════════════════════════════════════════════════════ */

.accordion__icon {
  transition: transform var(--transition), background var(--transition-fast);
}

/* ══════════════════════════════════════════════════════════
   SMOOTH FOCUS RINGS (global)
══════════════════════════════════════════════════════════ */

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ══════════════════════════════════════════════════════════
   REDUCE MOTION — honour user preference
══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.reveal--active {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .float-anim,
  .hero-orb,
  .skeleton,
  .reading-progress,
  .shine-on-hover::after {
    animation: none !important;
    transition: none !important;
  }

.step.reveal--active .step__number,
  .why-card:hover .why-card__icon,
  .label--animate {
    animation: none !important;
  }
}
