/**
 * アニメーション
 * namwa-recruit テーマ
 */

/* ========================================
   キーフレーム
   ======================================== */

@keyframes scrollPulse {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50%       { opacity: 0.4; transform: scaleY(0.7); }
}

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

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

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

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

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

/* ========================================
   スクロールトリガーアニメーション
   ======================================== */

/* 初期状態（JavaScriptで .animated クラスが付与される） */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* 遅延バリエーション */
.animate-delay-1 { transition-delay: 0.1s; }
.animate-delay-2 { transition-delay: 0.2s; }
.animate-delay-3 { transition-delay: 0.3s; }
.animate-delay-4 { transition-delay: 0.4s; }
.animate-delay-5 { transition-delay: 0.5s; }

/* ========================================
   ヒーロー入場アニメーション
   ======================================== */

.hero__en-label {
  animation: fadeIn 0.8s ease 0.3s both;
}

.hero__heading {
  animation: fadeInUp 0.9s ease 0.5s both;
}

.hero__subtext {
  animation: fadeInUp 0.9s ease 0.7s both;
}

.hero__pillars {
  animation: fadeInUp 0.9s ease 0.9s both;
}

.hero__cta {
  animation: fadeInUp 0.9s ease 1.1s both;
}

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

/* ========================================
   ゴールドシマーエフェクト（テキスト）
   ======================================== */

.gold-shimmer {
  background: linear-gradient(
    90deg,
    #2cd15c 0%,
    #e8c870 40%,
    #2cd15c 60%,
    #2cd15c 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: goldShimmer 3s linear infinite;
}

/* ========================================
   FAQアコーディオン アニメーション
   ======================================== */

.faq__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.faq__answer.open {
  max-height: 500px;
}

/* hidden属性の上書き（JSが動かない場合のフォールバック） */
.faq__answer[hidden] {
  display: block !important;
  max-height: 0;
  overflow: hidden;
}

/* ========================================
   ナンバーカウントアップ
   ======================================== */

.numbers__num.counting {
  animation: counterSpin 0.3s ease;
}

/* ========================================
   ホバーエフェクト
   ======================================== */

/* カードホバー発光 */
.about__card,
.reward__benefit-item,
.training__feature {
  position: relative;
  overflow: hidden;
}

.about__card::before,
.reward__benefit-item::before,
.training__feature::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-gold-alpha, rgba(44, 209, 92,0.15)), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.about__card:hover::before,
.reward__benefit-item:hover::before,
.training__feature:hover::before {
  opacity: 1;
}

/* ========================================
   ページ遷移ローダー
   ======================================== */

.page-loader {
  position: fixed;
  inset: 0;
  background: #1a1a1a;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.page-loader.loaded {
  opacity: 0;
  pointer-events: none;
}

.page-loader__logo {
  font-family: var(--font-en, 'Montserrat', sans-serif);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  color: var(--color-gold, #2cd15c);
  animation: pulse 1.5s ease-in-out infinite;
}

/* ========================================
   モーション軽減（アクセシビリティ）
   ======================================== */

@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;
  }
}
