/* ===== Keyframes & Animations ===== */

/* --- Hero fire flicker on background image --- */
@keyframes fire-flicker {
  0%   { filter: brightness(1)    saturate(1);   }
  15%  { filter: brightness(1.08) saturate(1.1);  }
  30%  { filter: brightness(0.97) saturate(1.05); }
  50%  { filter: brightness(1.12) saturate(1.15); }
  65%  { filter: brightness(1.02) saturate(1);    }
  80%  { filter: brightness(1.1)  saturate(1.12); }
  100% { filter: brightness(1)    saturate(1);    }
}

.fire-flicker {
  animation: fire-flicker 4s ease-in-out infinite;
}

/* --- Glow pulse behind guitar --- */
@keyframes glow-pulse {
  0%, 100% {
    opacity: 0.5;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
  }
}

/* --- Fire pulse glow --- */
@keyframes fire-pulse {
  0%, 100% { box-shadow: 0 0 15px rgba(249, 115, 22, 0.2); }
  50% { box-shadow: 0 0 30px rgba(249, 115, 22, 0.4); }
}

.animate-fire-pulse {
  animation: fire-pulse 3s ease-in-out infinite;
}

/* --- Bounce (scroll indicator) --- */
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

.animate-bounce {
  animation: bounce 2.5s ease-in-out infinite;
}

/* --- Fade in up (hero content) --- */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  opacity: 0;
  animation: fade-in-up 0.7s ease forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.5s; }
.delay-4 { animation-delay: 0.7s; }
.delay-5 { animation-delay: 0.9s; }
.delay-6 { animation-delay: 1.1s; }

/* --- Hero headline with typing --- */
.hero-headline {
  color: #fff;
  min-height: 2.2em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

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

.shimmer-text {
  background: linear-gradient(
    90deg,
    var(--flame-400),
    var(--fire-500),
    var(--flame-300),
    var(--fire-500),
    var(--flame-400)
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}

/* --- Device frame shine --- */
@keyframes frame-shine {
  0% { left: -100%; }
  40%, 100% { left: 200%; }
}

.device-frame::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.02), transparent);
  transform: skewX(-20deg);
  animation: frame-shine 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

/* --- Typing effect (headline) --- */
#hero-typed {
  color: #fff;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.typed-cursor {
  color: var(--fire-400);
  font-weight: 300;
  animation: cursor-blink 0.6s step-end infinite;
  margin-left: 2px;
}

/* --- Active chord pulse --- */
@keyframes chord-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(249, 115, 22, 0.15); }
  50% { box-shadow: 0 0 16px rgba(249, 115, 22, 0.3); }
}

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

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

  .animate-fade-in-up {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .typed-cursor {
    animation: none;
    opacity: 1;
  }

  .fire-flicker {
    animation: none;
    filter: none;
  }

  .hero-fire-canvas {
    display: none;
  }

  .hero-glow {
    animation: none;
    opacity: 0.5;
  }

  html {
    scroll-behavior: auto;
  }
}
