/* ============================================================
   ANIMATIONS.CSS – Keyframes and entrance animations
   ============================================================ */

/* ── Fade variants ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

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

/* ── Staggered children ── */
.stagger-children > *:nth-child(1) { animation-delay: 0s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.5s; }

/* ── Entrance animation classes ── */
.anim-fade-up {
  animation: fadeInUp 0.65s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.anim-fade-left {
  animation: fadeInLeft 0.65s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.anim-fade-right {
  animation: fadeInRight 0.65s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.anim-scale {
  animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ── Shimmer loader ── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(90deg, var(--pf-ice) 25%, var(--pf-mist) 50%, var(--pf-ice) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s linear infinite;
}

/* ── Gradient text animation ── */
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.gradient-text-anim {
  background: linear-gradient(135deg, var(--pf-blue), var(--pf-teal), var(--pf-blue));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease-in-out infinite;
}

/* ── Glow pulse ── */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(22, 199, 210, 0.2); }
  50% { box-shadow: 0 0 40px rgba(22, 199, 210, 0.4); }
}

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

/* ── Count-up numbers (CSS marker, JS handles the logic) ── */
.count-up { display: inline-block; }

/* ── Page transition overlay ── */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--pf-gradient-cta);
  z-index: 9999;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.page-transition.in { transform: translateX(0); }
.page-transition.out { transform: translateX(100%); }

/* ── Loading spinner ── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--pf-mist);
  border-top-color: var(--pf-teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Hover lift (utility) ── */
.hover-lift {
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--pf-shadow-hover);
}

/* ── Line draw animation ── */
@keyframes lineGrow {
  from { width: 0; }
  to { width: 100%; }
}

.line-draw {
  display: block;
  height: 2px;
  background: var(--pf-gradient-cta);
  animation: lineGrow 1s cubic-bezier(0.4, 0, 0.2, 1) both;
}
