/* ============================================================
   ANIMATIONS.CSS — Keyframes & Motion
   ============================================================ */

/* ── Hero WebGL canvas ── */
#aurora-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
  z-index: 0;
  max-width: 100%;
  display: block;
}

/* ── Hero mesh background ── */
@keyframes meshShift {
  0%   {
    background:
      radial-gradient(ellipse 80% 60% at 20% 40%, rgba(88, 166, 255, 0.15) 0%, transparent 60%),
      radial-gradient(ellipse 60% 80% at 80% 60%, rgba(56, 139, 253, 0.10) 0%, transparent 60%),
      #0D1117;
  }
  33%  {
    background:
      radial-gradient(ellipse 70% 70% at 30% 30%, rgba(88, 166, 255, 0.12) 0%, transparent 60%),
      radial-gradient(ellipse 80% 60% at 70% 70%, rgba(56, 139, 253, 0.13) 0%, transparent 60%),
      #0D1117;
  }
  66%  {
    background:
      radial-gradient(ellipse 90% 50% at 15% 60%, rgba(88, 166, 255, 0.10) 0%, transparent 60%),
      radial-gradient(ellipse 60% 70% at 75% 45%, rgba(56, 139, 253, 0.14) 0%, transparent 60%),
      #0D1117;
  }
  100% {
    background:
      radial-gradient(ellipse 75% 65% at 40% 50%, rgba(88, 166, 255, 0.18) 0%, transparent 60%),
      radial-gradient(ellipse 55% 75% at 85% 55%, rgba(56, 139, 253, 0.08) 0%, transparent 60%),
      #0D1117;
  }
}

/* ── Scroll indicator pulse ── */
@keyframes scrollPulse {
  0%   { opacity: 0; transform: scaleY(0); transform-origin: top; }
  40%  { opacity: 1; }
  100% { opacity: 0; transform: scaleY(1); transform-origin: top; }
}

/* ── Gate pulse ring ── */
@keyframes pulsRing {
  0%   { transform: scale(0.6); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 0; }
}

/* ── Gate glow ── */
@keyframes glowPulse {
  0%   { opacity: 0.5; transform: scale(0.95); }
  100% { opacity: 1;   transform: scale(1.05); }
}

/* ── Floating subtle animation ── */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* ── Fade slide in (general) ── */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ── Nav link underline fill ── */
.nav__link::after {
  transition: width 0.35s var(--ease-out-expo);
}

/* ── Hero clip-path text reveal ── */
.hero__headline .word {
  display: inline-block;
  overflow: hidden;
}

.hero__headline .word-inner {
  display: inline-block;
}

/* ── Stats number glow ── */
.stat-item__value {
  text-shadow: 0 0 30px rgba(88, 166, 255, 0.3);
}

/* ── Timeline dot pulse ── */
.timeline-dot {
  animation: dotGlow 2.5s ease-in-out infinite alternate;
}

@keyframes dotGlow {
  0%   { box-shadow: 0 0 6px rgba(88, 166, 255, 0.3); }
  100% { box-shadow: 0 0 16px rgba(88, 166, 255, 0.7); }
}

/* ── Project card image overlay ── */
.project-card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(8, 11, 16, 0.7) 100%);
  pointer-events: none;
}

/* ── Accent line draw animation ── */
.accent-line {
  display: inline-block;
  position: relative;
}

.accent-line::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.6s var(--ease-out-expo);
}

.accent-line.revealed::after {
  width: 100%;
}

/* ── Contact headline glow ── */
.contact__headline {
  text-shadow: 0 0 80px rgba(88, 166, 255, 0.08);
}

/* ── Skill card icon hover ── */
.skill-card:hover .skill-card__icon {
  animation: floatY 2s ease-in-out infinite;
}

/* ── Page fade in ── */
@keyframes pageFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   TASK 3 — Scroll-Reveal Enhancements
   ═══════════════════════════════════════════════════════════ */

/* ── Timeline slide-in init state ── */
.timeline-item.reveal-pending {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.timeline-item.reveal-visible {
  opacity: 1;
  transform: translateX(0);
}

/* ── Timeline dot hover glow ── */
.timeline-dot {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.timeline-item:hover .timeline-dot {
  box-shadow: 0 0 20px rgba(88, 166, 255, 0.8), 0 0 40px rgba(88, 166, 255, 0.4);
  transform: translateX(-50%) scale(1.2);
}

/* ── Skill card reveal init state ── */
.skill-card.reveal-pending {
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.skill-card.reveal-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── Skill card enhanced hover glow ── */
.skill-card:hover {
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.3), 0 8px 32px rgba(88, 166, 255, 0.1) !important;
}

/* ── Project card reveal init state ── */
.project-card.reveal-pending {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.project-card.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Project card top border animation ── */
.project-card__top-border {
  transform-origin: left;
  transform: scaleX(1);
  transition: transform 0.4s var(--ease-out-expo, cubic-bezier(0.16,1,0.3,1));
}

.project-card:not(:hover) .project-card__top-border {
  transform: scaleX(0.3);
  opacity: 0.6;
}

.project-card:hover .project-card__top-border {
  transform: scaleX(1);
  opacity: 1;
}

/* ── Contact HELLO watermark ── */
.contact__watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  font-family: var(--font-heading, 'Space Grotesk', sans-serif);
  font-weight: 800;
  font-size: clamp(6rem, 20vw, 18rem);
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: rgba(88, 166, 255, 0.04);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
  line-height: 1;
}

.contact {
  position: relative;
}

.contact > .container {
  position: relative;
  z-index: 1;
}

/* ── Section heading underline draw ── */
.section-h2 {
  position: relative;
  display: inline-block;
}

.section-h2::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent) 0%, transparent 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-h2.h2-revealed::after {
  transform: scaleX(1);
}

/* ── Skill card reveal ── */
.skill-card {
  opacity: 0;
  transform: translateY(30px) scale(0.96);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.skill-card.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── Project card reveal ── */
.project-card {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22,1,0.36,1);
}
.project-card.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ── Timeline card reveal ── */
.timeline-item__card {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.timeline-item__card.in-view {
  opacity: 1;
  transform: translateX(0);
}

/* ── Stat item reveal ── */
.stat-item {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.stat-item.in-view {
  opacity: 1;
}
