/* ============================================
   MONTAGE — Animations & Keyframes
   ============================================ */

/* --- Page Fade In --- */
@keyframes fadeInPage {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.page-enter {
  animation: fadeInPage 0.5s ease forwards;
}

/* --- Fade In Up (cards, elements) --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  animation: fadeInUp 0.4s ease forwards;
}

/* Staggered children */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }

/* --- Typewriter Effect --- */
@keyframes typewriter {
  from { width: 0; }
  to   { width: 100%; }
}
@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--gold); }
}

.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--gold);
  width: 0;
  animation:
    typewriter 2.5s steps(40) 0.5s forwards,
    blink-caret 0.8s step-end infinite;
}

/* --- Film Reel Spinner --- */
@keyframes spinReel {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.spinner-reel {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gold-dim);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spinReel 0.8s linear infinite;
}

.spinner-reel--lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* --- Pulsing (for processing badges) --- */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* --- Glow Pulse (for active elements) --- */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(201, 168, 76, 0.1); }
  50% { box-shadow: 0 0 20px rgba(201, 168, 76, 0.25); }
}

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

/* --- Star Bounce (for favourites) --- */
@keyframes starBounce {
  0% { transform: scale(1); }
  25% { transform: scale(1.4); }
  50% { transform: scale(0.9); }
  75% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.star-bounce {
  animation: starBounce 0.5s ease;
}

/* --- Slide In Right (modals, panels) --- */
@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.slide-in-right {
  animation: slideInRight 0.3s ease forwards;
}

/* --- Scale In (modals) --- */
@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.scale-in {
  animation: scaleIn 0.2s ease forwards;
}

/* --- Progress Bar Fill --- */
@keyframes fillProgress {
  from { width: 0; }
}

.progress-animate {
  animation: fillProgress 1s ease forwards;
}

/* --- Shimmer (loading placeholders) --- */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface-raised) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* --- Hover Glow (cards) --- */
.hover-glow {
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}
.hover-glow:hover {
  box-shadow: 0 0 24px rgba(201, 168, 76, 0.12);
  border-color: var(--gold-dim);
}

/* --- Toast Slide --- */
@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes toastSlideOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}

.toast-enter { animation: toastSlideIn 0.3s ease forwards; }
.toast-exit  { animation: toastSlideOut 0.3s ease forwards; }

/* --- Chain Link Animation (scenes) --- */
@keyframes chainLink {
  0% { stroke-dashoffset: 20; }
  100% { stroke-dashoffset: 0; }
}

/* --- Waveform (voice) --- */
@keyframes waveform {
  0%, 100% { height: 4px; }
  50% { height: 100%; }
}

/* --- Fade transitions --- */
.fade-enter { opacity: 0; transition: opacity var(--transition-base); }
.fade-enter-active { opacity: 1; }
.fade-exit { opacity: 1; transition: opacity var(--transition-base); }
.fade-exit-active { opacity: 0; }
