/* ============================================================
   VENTCORP — Animations & Keyframes
   ============================================================ */

/* ── Particle Canvas ─────────────────────────────────────── */
#particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Hero Entrance Animations ────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0);    }
}

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

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

@keyframes fadeRight {
  from { opacity: 0; transform: translateX(40px); }
  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);   }
}

@keyframes scaleInBounce {
  0%   { opacity: 0; transform: scale(0.8);  }
  60%  { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1);    }
}

/* ── Apply to hero elements ──────────────────────────────── */
.anim-fade-up   { animation: fadeUp   0.7s cubic-bezier(0.4,0,0.2,1) both; }
.anim-fade-down { animation: fadeDown 0.7s cubic-bezier(0.4,0,0.2,1) both; }
.anim-fade-in   { animation: fadeIn   0.7s cubic-bezier(0.4,0,0.2,1) both; }
.anim-scale-in  { animation: scaleIn  0.5s cubic-bezier(0.34,1.56,0.64,1) both; }

/* Staggered delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

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

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

/* ── Glow Pulse ──────────────────────────────────────────── */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(108,63,232,0.3), 0 0 40px rgba(108,63,232,0.1); }
  50%       { box-shadow: 0 0 40px rgba(108,63,232,0.6), 0 0 80px rgba(108,63,232,0.2); }
}

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

/* ── Float ───────────────────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0);    }
  50%       { transform: translateY(-12px); }
}

.float { animation: float 4s ease-in-out infinite; }

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

.spin { animation: spin 1s linear infinite; }

/* ── Shimmer text ────────────────────────────────────────── */
@keyframes shimmerText {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

.shimmer-text {
  background: linear-gradient(90deg, #fff 0%, #A78BFA 40%, #00D4FF 60%, #fff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerText 3s linear infinite;
}

/* ── Counter animate ─────────────────────────────────────── */
.counter { transition: all 1.5s cubic-bezier(0.4,0,0.2,1); }

/* ── Hero background blobs ───────────────────────────────── */
@keyframes blobMorph {
  0%   { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  25%  { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; }
  50%  { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
  75%  { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
  100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

.blob {
  position: absolute;
  filter: blur(60px);
  animation: blobMorph 8s ease-in-out infinite;
  pointer-events: none;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(108,63,232,0.18) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.blob-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0,212,255,0.12) 0%, transparent 70%);
  bottom: -80px;
  left: -80px;
  animation-delay: -3s;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,107,107,0.1) 0%, transparent 70%);
  top: 50%;
  left: 20%;
  animation-delay: -5s;
}

/* ── Typing cursor ───────────────────────────────────────── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--clr-primary-light);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

/* ── Line draw (SVG) ─────────────────────────────────────── */
@keyframes lineDraw {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0;    }
}

.line-draw {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: lineDraw 1.5s ease forwards;
}

/* ── Progress bar animate ────────────────────────────────── */
@keyframes progressFill {
  from { width: 0%; }
}

.progress-bar { animation: progressFill 1.2s cubic-bezier(0.4,0,0.2,1) both; }

/* ── Card hover shine ────────────────────────────────────── */
.card-shine {
  position: relative;
  overflow: hidden;
}

.card-shine::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.04),
    transparent
  );
  transform: skewX(-15deg);
  transition: left 0.6s ease;
  pointer-events: none;
  z-index: 1;
}

.card-shine:hover::before { left: 125%; }

/* ── Ripple ──────────────────────────────────────────────── */
@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.6; }
  100% { transform: scale(2); opacity: 0;   }
}

.ripple-container { position: relative; overflow: hidden; }

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  width: 100px;
  height: 100px;
  margin-top: -50px;
  margin-left: -50px;
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* ── Notification bounce ─────────────────────────────────── */
@keyframes notifBounce {
  0%, 100% { transform: scale(1);    }
  50%       { transform: scale(1.15); }
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clr-accent);
  animation: notifBounce 2s ease-in-out infinite;
}

/* ── Staggered grid items ────────────────────────────────── */
.stagger-child {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-child.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-child:nth-child(1)  { transition-delay: 0.05s; }
.stagger-child:nth-child(2)  { transition-delay: 0.1s;  }
.stagger-child:nth-child(3)  { transition-delay: 0.15s; }
.stagger-child:nth-child(4)  { transition-delay: 0.2s;  }
.stagger-child:nth-child(5)  { transition-delay: 0.25s; }
.stagger-child:nth-child(6)  { transition-delay: 0.3s;  }
.stagger-child:nth-child(7)  { transition-delay: 0.35s; }
.stagger-child:nth-child(8)  { transition-delay: 0.4s;  }
.stagger-child:nth-child(9)  { transition-delay: 0.45s; }
.stagger-child:nth-child(10) { transition-delay: 0.5s;  }
.stagger-child:nth-child(11) { transition-delay: 0.55s; }
.stagger-child:nth-child(12) { transition-delay: 0.6s;  }

/* ── Page transition ─────────────────────────────────────── */
.page-transition {
  animation: fadeIn 0.4s ease both;
}

/* ── Loader ──────────────────────────────────────────────── */
.loader {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.loader span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--clr-primary-light);
  animation: loaderBounce 0.8s ease-in-out infinite;
}

.loader span:nth-child(2) { animation-delay: 0.15s; }
.loader span:nth-child(3) { animation-delay: 0.3s; }

@keyframes loaderBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40%           { transform: scale(1);   opacity: 1;   }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
