/* ============================================
   Animations — @keyframes・ユーティリティクラス
   ============================================ */

/* ---- Keyframes ---- */
@keyframes glowPulse {
  0%, 100% {
    text-shadow:
      0 0 20px rgba(230, 57, 70, 0.5),
      0 0 40px rgba(230, 57, 70, 0.3),
      0 0 80px rgba(230, 57, 70, 0.1);
  }
  50% {
    text-shadow:
      0 0 30px rgba(255, 23, 68, 0.8),
      0 0 60px rgba(255, 23, 68, 0.5),
      0 0 120px rgba(255, 23, 68, 0.2);
  }
}

@keyframes scrollLine {
  0% {
    transform: scaleY(0);
    transform-origin: top;
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  60% {
    transform: scaleY(1);
    transform-origin: top;
  }
  61% {
    transform-origin: bottom;
  }
  100% {
    transform: scaleY(0);
    transform-origin: bottom;
    opacity: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---- Hero Glow Text ---- */
.glow-text {
  color: var(--color-accent);
  animation: glowPulse 3s ease-in-out infinite;
}

/* ---- Scroll Animation Base ---- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Slide from left */
.animate-on-scroll--left {
  transform: translateX(-40px);
}

.animate-on-scroll--left.is-visible {
  transform: translateX(0);
}

/* Slide from right */
.animate-on-scroll--right {
  transform: translateX(40px);
}

.animate-on-scroll--right.is-visible {
  transform: translateX(0);
}

/* Scale in */
.animate-on-scroll--scale {
  transform: scale(0.9);
}

.animate-on-scroll--scale.is-visible {
  transform: scale(1);
}

/* Stagger children animation */
.stagger-children > .animate-on-scroll {
  transition-delay: calc(var(--stagger-index, 0) * 0.1s);
}

/* ---- Hero Animations ---- */
.hero__content {
  animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.hero__scroll-indicator {
  animation: fadeIn 1s ease 1.5s both;
}

/* ---- Hover Effects ---- */
.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

.hover-lift {
  transition: transform var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

/* ---- Link underline animation ---- */
.link-underline {
  position: relative;
  display: inline-block;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width var(--transition-base);
}

.link-underline:hover::after {
  width: 100%;
}

/* ---- 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-on-scroll {
    opacity: 1;
    transform: none;
  }

  .glow-text {
    animation: none;
    text-shadow:
      0 0 20px rgba(230, 57, 70, 0.5),
      0 0 40px rgba(230, 57, 70, 0.3);
  }
}
