/* ==========================================================================
   CodeVerse — Animations
   Deliberate, restrained motion. One orchestrated hero moment,
   quiet scroll reveals, small hover feedback. Nothing scattered.
   ========================================================================== */

/* ---- Scroll reveal (JS toggles .is-visible via IntersectionObserver) ---- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children of a revealed group */
.reveal-group.is-visible .reveal-child {
  transition-delay: calc(var(--stagger-index, 0) * 70ms);
}

/* ---- Hero typewriter caret ---- */
.typewriter-caret {
  display: inline-block;
  width: 2px;
  background: var(--color-code-accent);
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ---- Fade-in page load ---- */
.page-enter {
  animation: pageEnter var(--duration-slow) var(--ease-out);
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Quiz feedback pulse ---- */
@keyframes correctPulse {
  0% { box-shadow: 0 0 0 0 rgba(30, 158, 107, 0.35); }
  100% { box-shadow: 0 0 0 8px rgba(30, 158, 107, 0); }
}
.quiz-option.is-correct { animation: correctPulse 600ms var(--ease-out); }

/* ---- Confetti-free score reveal ---- */
.quiz-score {
  transform: scale(0.85);
  opacity: 0;
  animation: scoreIn var(--duration-slow) var(--ease-out) forwards;
}
@keyframes scoreIn {
  to { transform: scale(1); opacity: 1; }
}
