/* ═══════════════════════════════════════════════════════
   Scroll Reveal System
   Progressive: hidden only when JS is confirmed ready
   ═══════════════════════════════════════════════════════ */

html.reveal-active .section,
html.reveal-active .stat-item,
html.reveal-active .project-card,
html.reveal-active .category-card,
html.reveal-active .contact-card,
html.reveal-active .changelog-entry,
html.reveal-active .about-header,
html.reveal-active .focus-item {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s var(--ease-out-expo),
    transform 0.7s var(--ease-out-expo),
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

html.reveal-active .section.revealed,
html.reveal-active .stat-item.revealed,
html.reveal-active .project-card.revealed,
html.reveal-active .category-card.revealed,
html.reveal-active .contact-card.revealed,
html.reveal-active .changelog-entry.revealed,
html.reveal-active .about-header.revealed,
html.reveal-active .focus-item.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for grid items */
html.reveal-active .project-card:nth-child(2),
html.reveal-active .stat-item:nth-child(2),
html.reveal-active .category-card:nth-child(2),
html.reveal-active .focus-item:nth-child(2) {
  transition-delay: 0.06s;
}

html.reveal-active .project-card:nth-child(3),
html.reveal-active .stat-item:nth-child(3),
html.reveal-active .category-card:nth-child(3),
html.reveal-active .focus-item:nth-child(3) {
  transition-delay: 0.12s;
}

html.reveal-active .project-card:nth-child(4),
html.reveal-active .stat-item:nth-child(4),
html.reveal-active .category-card:nth-child(4),
html.reveal-active .focus-item:nth-child(4) {
  transition-delay: 0.18s;
}

html.reveal-active .project-card:nth-child(5),
html.reveal-active .stat-item:nth-child(5),
html.reveal-active .category-card:nth-child(5),
html.reveal-active .focus-item:nth-child(5) {
  transition-delay: 0.24s;
}

html.reveal-active .project-card:nth-child(6),
html.reveal-active .category-card:nth-child(6) {
  transition-delay: 0.3s;
}

html.reveal-active .project-card:nth-child(7),
html.reveal-active .category-card:nth-child(7) {
  transition-delay: 0.36s;
}

html.reveal-active .project-card:nth-child(8),
html.reveal-active .category-card:nth-child(8) {
  transition-delay: 0.42s;
}

/* Changelog stagger */
html.reveal-active .changelog-entry:nth-child(2) {
  transition-delay: 0.08s;
}
html.reveal-active .changelog-entry:nth-child(3) {
  transition-delay: 0.16s;
}
html.reveal-active .changelog-entry:nth-child(4) {
  transition-delay: 0.24s;
}
html.reveal-active .changelog-entry:nth-child(5) {
  transition-delay: 0.32s;
}

/* ═══════════════════════════════════════════════════════
   Keyframe Animations
   ═══════════════════════════════════════════════════════ */

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

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

.fade-in {
  animation: fadeIn 0.4s var(--ease-out-expo) forwards;
}

@keyframes selectMenuIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes meshFloat1 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(40px, -30px) scale(1.08);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
}

@keyframes meshFloat2 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(-30px, 25px) scale(1.05);
  }
  66% {
    transform: translate(25px, -15px) scale(0.92);
  }
}

@keyframes glowDot {
  0%,
  100% {
    box-shadow: 0 0 6px currentColor;
  }
  50% {
    box-shadow:
      0 0 12px currentColor,
      0 0 20px currentColor;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

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

@keyframes avatarPulse {
  0%,
  100% {
    box-shadow: 0 0 30px oklch(74% 0.2 45 / 10%);
  }
  50% {
    box-shadow:
      0 0 40px oklch(74% 0.2 45 / 20%),
      0 0 60px oklch(70% 0.24 20 / 10%);
  }
}

/* ── Loading Spinner ──────────────────────────────────── */
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
