/* =========================================================
   animations.css — keyframes + motion-driven styles
   ========================================================= */

/* ---- Keyframes ---- */

@keyframes floatIcon {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-14px) rotate(4deg); }
  66%       { transform: translateY(-6px) rotate(-3deg); }
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px currentColor; }
  50%       { opacity: 0.5; box-shadow: 0 0 18px currentColor; }
}

@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes scrollDot {
  0%   { transform: translateX(-50%) translateY(0); opacity: 1; }
  100% { transform: translateX(-50%) translateY(16px); opacity: 0; }
}

@keyframes shimmerSweep {
  0%   { background-position: -150% -150%; }
  100% { background-position: 250% 250%; }
}

@keyframes loaderFill {
  0%   { width: 0%; }
  100% { width: 100%; }
}

@keyframes blobDrift {
  0%, 100% { transform: scale(1) translate(0, 0); }
  50%       { transform: scale(1.12) translate(24px, -18px); }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(4); opacity: 0; }
}

@keyframes pipelineGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(56, 189, 248, 0); }
  50%       { box-shadow: 0 0 24px rgba(56, 189, 248, 0.35); }
}

@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 fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes rotateIn {
  from { opacity: 0; transform: rotate(-10deg) scale(0.9); }
  to   { opacity: 1; transform: rotate(0deg) scale(1); }
}

@keyframes borderGlow {
  0%, 100% { border-color: rgba(56, 189, 248, 0.15); }
  50%       { border-color: rgba(56, 189, 248, 0.55); }
}

@keyframes textGradientFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shootingStar {
  0%   { transform: translateX(0) translateY(0) rotate(215deg); opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translateX(-800px) translateY(800px) rotate(215deg); opacity: 0; }
}

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

/* ---- Animated gradient text ---- */
.gradient-text {
  background: linear-gradient(90deg, #38bdf8, #22d3ee, #0ea5e9, #38bdf8);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: textGradientFlow 5s ease infinite;
}

/* ---- Blob animations ---- */
.blob-1 { animation: blobDrift 10s ease-in-out infinite; }
.blob-2 { animation: blobDrift 13s ease-in-out infinite reverse; }

/* ---- Loader fill ---- */
.loader-bar-fill { animation: loaderFill 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

/* ---- Pipeline sequential glow ---- */
.pipeline-node { animation: pipelineGlow 4s ease-in-out infinite; }
.pipeline-node[data-step="1"]  { animation-delay: 0s; }
.pipeline-node[data-step="2"]  { animation-delay: 0.3s; }
.pipeline-node[data-step="3"]  { animation-delay: 0.6s; }
.pipeline-node[data-step="4"]  { animation-delay: 0.9s; }
.pipeline-node[data-step="5"]  { animation-delay: 1.2s; }
.pipeline-node[data-step="6"]  { animation-delay: 1.5s; }
.pipeline-node[data-step="7"]  { animation-delay: 1.8s; }
.pipeline-node[data-step="8"]  { animation-delay: 2.1s; }
.pipeline-node[data-step="9"]  { animation-delay: 2.4s; }
.pipeline-node[data-step="10"] { animation-delay: 2.7s; }
.pipeline-node[data-step="11"] { animation-delay: 3.0s; }
.pipeline-node[data-step="12"] { animation-delay: 3.3s; }

/* ---- Skill cards floating glow border ---- */
.skill-card { animation: borderGlow 3.5s ease-in-out infinite; }
.skill-card:nth-child(1)  { animation-delay: 0.0s; }
.skill-card:nth-child(2)  { animation-delay: 0.2s; }
.skill-card:nth-child(3)  { animation-delay: 0.4s; }
.skill-card:nth-child(4)  { animation-delay: 0.6s; }
.skill-card:nth-child(5)  { animation-delay: 0.8s; }
.skill-card:nth-child(6)  { animation-delay: 1.0s; }
.skill-card:nth-child(7)  { animation-delay: 1.2s; }
.skill-card:nth-child(8)  { animation-delay: 1.4s; }
.skill-card:nth-child(9)  { animation-delay: 1.6s; }
.skill-card:nth-child(10) { animation-delay: 1.8s; }
.skill-card:nth-child(11) { animation-delay: 2.0s; }
.skill-card:nth-child(12) { animation-delay: 2.2s; }
.skill-card:nth-child(13) { animation-delay: 2.4s; }
.skill-card:nth-child(14) { animation-delay: 2.6s; }
.skill-card:nth-child(15) { animation-delay: 2.8s; }
.skill-card:nth-child(16) { animation-delay: 3.0s; }

/* ---- Button ripple effect (added via JS) ---- */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  animation: ripple 0.6s linear;
  transform-origin: center;
}

/* ---- Hero entrance sequence ---- */
.hero-content > * {
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}
.hero-content > *:nth-child(1) { animation-delay: 0.2s; }
.hero-content > *:nth-child(2) { animation-delay: 0.4s; }
.hero-content > *:nth-child(3) { animation-delay: 0.55s; }
.hero-content > *:nth-child(4) { animation-delay: 0.7s; }
.hero-content > *:nth-child(5) { animation-delay: 0.85s; }
.hero-content > *:nth-child(6) { animation-delay: 1.0s; }

/* ---- Shooting stars (inserted via JS) ---- */
.shooting-star {
  position: absolute;
  width: 2px;
  height: 80px;
  background: linear-gradient(to bottom, rgba(56,189,248,0), #38bdf8);
  border-radius: 2px;
  animation: shootingStar 2.4s linear infinite;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

/* ---- Magnetic button hover (JS-driven, CSS base) ---- */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s ease;
}

/* ---- Hover: project card tilt shadow ---- */
.project-card[data-tilt]:hover {
  box-shadow: 0 24px 60px -14px rgba(0, 0, 0, 0.7), var(--shadow-glow);
}

/* ---- Cert card flip-reveal ---- */
.cert-card {
  transform-style: preserve-3d;
  perspective: 600px;
}
.cert-card:hover {
  transform: translateY(-6px) rotateX(4deg);
}

/* ---- Timeline dot pulse ---- */
.vtimeline-dot {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.vtimeline-item:hover .vtimeline-dot {
  box-shadow: 0 0 18px var(--accent-1);
  transform: scale(1.3);
}

/* ---- Section entrance (AOS overrides) ---- */
[data-aos] { pointer-events: none; }
[data-aos].aos-animate { pointer-events: all; }

/* ---- Scroll progress bar ---- */
#scrollProgress {
  position: fixed; top: 0; left: 0; z-index: 1100;
  height: 3px; width: 0%;
  background: var(--accent-gradient);
  transition: width 0.1s linear;
}

/* ---- Page transition overlay ---- */
#pageTransition {
  position: fixed; inset: 0; z-index: 9998;
  background: var(--bg-0);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
  pointer-events: none;
}
#pageTransition.active { transform: scaleY(1); }

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