/* ============================================
   Digital Asset Academy — レスポンシブ (Dark)
   ============================================ */

/* ==========================================
   Mobile First — デフォルト (〜767px)
   ========================================== */

/* ── ナビ ── */
.site-header__nav {
  display: none;
}

.hamburger {
  display: flex;
}

/* ── コンテナ ── */
.container,
.site-header__inner {
  padding: 0 var(--sp-md);
}

/* ── セクション ── */
.section {
  padding: var(--sp-3xl) 0;
}

.section__header {
  margin-bottom: var(--sp-2xl);
}

.section__title {
  font-size: var(--fs-2xl);
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ── Hero ── */
.hero {
  min-height: 100svh;       /* safe viewport height (モバイルアドレスバー対応) */
  min-height: 100vh;        /* フォールバック */
}

.hero__webgl,
.hero__canvas {
  /* モバイルでは WebGL canvas の描画品質を下げる (JS側でも30fps制御) */
  image-rendering: auto;
}

.hero__content {
  flex-direction: column;
  text-align: center;
  padding: var(--sp-xl) var(--sp-md);
  gap: var(--sp-xl);
}

.hero__title {
  font-size: clamp(1.6rem, 7vw, 2rem);
  line-height: 1.25;
  word-break: keep-all;
}

.hero__desc {
  font-size: var(--fs-base);
  line-height: 1.8;
}

.hero__badge {
  font-size: var(--fs-sm);
  padding: 6px 14px;
}

.hero__actions {
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-md);
}

.hero__visual {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* ── ボタン ── */
.btn {
  min-height: 48px;         /* タッチターゲット推奨サイズ */
  padding: 13px 24px;
}

.btn--lg {
  padding: 15px 28px;
  font-size: var(--fs-base);
}

/* モバイルでは btn-jiggle は無効 (JSで制御済み) */
/* スイープアニメーションだけを維持 */

/* ── グリッド — 1列 ── */
.card-grid {
  grid-template-columns: 1fr;
  gap: var(--sp-lg);
}

.course-grid {
  grid-template-columns: 1fr;
  gap: var(--sp-lg);
}

.price-grid {
  grid-template-columns: 1fr;
  gap: var(--sp-2xl);
}

.price-card--featured {
  transform: none;
}

.live-grid {
  grid-template-columns: 1fr;
  gap: var(--sp-lg);
}

.achievement-grid {
  grid-template-columns: 1fr;
  gap: var(--sp-md);
}

.about-grid {
  grid-template-columns: 1fr;
  gap: var(--sp-2xl);
}

/* ── カード ── */
.card {
  padding: var(--sp-xl);
}

.ach-card {
  padding: var(--sp-lg);
}

.ach-card__amount {
  font-size: var(--fs-xl);
}

.testi-card {
  padding: var(--sp-xl);
}

.interview-card {
  padding: var(--sp-xl);
}

.interview-card__head {
  flex-direction: column;
  text-align: center;
}

.interview-card__tags {
  flex-direction: column;
  gap: var(--sp-md);
}

/* ── スクロールグロー: モバイルは軽いシャドウ ── */
.ach-card.scroll-glow,
.card.scroll-glow {
  animation:
    card-reveal-cyan 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
    /* ambient pulse はモバイルで省略 (バッテリー節約) */
}
.testi-card.scroll-glow {
  animation:
    card-reveal-gold 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.interview-card.scroll-glow,
.instructor-card.scroll-glow {
  animation:
    card-reveal-teal 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* ── チャートビデオ ── */
.chart-video-frame {
  max-width: 100%;
}

.chart-video {
  height: auto;
  max-height: 52vw;        /* モバイルで高さ制限 */
  object-fit: cover;
}

/* ── ステップ ── */
.payment-step {
  flex-direction: column;
  text-align: center;
}

.payment-step__content {
  text-align: center;
}

/* ── 運営会社テーブル ── */
.legal-table tr {
  display: flex;
  flex-direction: column;
}

.legal-table th {
  width: 100%;
  border-bottom: none;
  padding-bottom: var(--sp-xs);
}

.legal-table td {
  padding-top: var(--sp-xs);
}

/* ── フッター ── */
.site-footer__grid {
  grid-template-columns: 1fr;
  gap: var(--sp-2xl);
}

/* ── ページヘッダー ── */
.page-hero {
  padding: var(--sp-3xl) 0;
}

.page-hero__title {
  font-size: var(--fs-2xl);
}

.cta-section__title {
  font-size: var(--fs-2xl);
}

/* ── テキスト可読性 ── */
h2 {
  font-size: var(--fs-2xl);
  line-height: 1.3;
}

h3 {
  font-size: var(--fs-lg);
}

p {
  font-size: var(--fs-base);
}

/* ==========================================
   Tablet (768px〜)
   ========================================== */
@media (min-width: 768px) {
  .hero__title {
    font-size: var(--fs-3xl);
  }

  .hero__content {
    padding: var(--sp-2xl) var(--sp-xl);
    gap: var(--sp-2xl);
  }

  .hero__actions {
    gap: var(--sp-lg);
  }

  .btn--lg {
    padding: 17px 36px;
    font-size: var(--fs-md);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-xl);
  }

  .course-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-xl);
  }

  .price-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-xl);
  }

  .enroll-steps {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--sp-xs);
    justify-content: center;
    flex-wrap: nowrap;
  }

  .enroll-step {
    flex: 1;
    min-width: 0;
    max-width: 160px;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-sm);
    padding: 0;
    border-bottom: none;
    text-align: center;
  }

  .enroll-step__body {
    padding-top: 0;
  }

  .enroll-step__num {
    width: 56px;
    height: 56px;
    font-size: var(--fs-lg);
  }

  .enroll-step__title {
    font-size: var(--fs-sm);
    margin-bottom: 0;
  }

  .enroll-step__text {
    font-size: var(--fs-xs);
  }

  .enroll-step__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--sp-lg);
    color: rgba(0,194,255,0.4);
    flex-shrink: 0;
  }

  .enroll-step__arrow svg {
    width: 20px;
    height: 20px;
  }

  .achievement-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .about-grid {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .interview-card__head {
    flex-direction: row;
    text-align: left;
  }

  .interview-card__tags {
    flex-direction: row;
  }

  .payment-step {
    flex-direction: row;
    text-align: left;
  }

  .payment-step__content {
    text-align: left;
  }

  .legal-table tr {
    display: table-row;
  }

  .legal-table th {
    width: 200px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--sp-lg);
  }

  .legal-table td {
    padding-top: var(--sp-lg);
  }

  /* タブレットはambient pulseを復活 */
  .ach-card.scroll-glow,
  .card.scroll-glow {
    animation:
      card-reveal-cyan 1.0s cubic-bezier(0.22, 0.61, 0.36, 1) forwards,
      glow-pulse-cyan  3.8s ease-in-out 1.0s infinite;
  }
  .testi-card.scroll-glow {
    animation:
      card-reveal-gold 1.0s cubic-bezier(0.22, 0.61, 0.36, 1) forwards,
      glow-pulse-gold  3.8s ease-in-out 1.0s infinite;
  }
  .interview-card.scroll-glow,
  .instructor-card.scroll-glow {
    animation:
      card-reveal-teal 1.0s cubic-bezier(0.22, 0.61, 0.36, 1) forwards,
      glow-pulse-teal  3.8s ease-in-out 1.0s infinite;
  }

  h2 {
    font-size: var(--fs-3xl);
  }
}

/* ==========================================
   Desktop (1024px〜)
   ========================================== */
@media (min-width: 1024px) {
  .site-header__nav {
    display: flex;
  }

  .hamburger {
    display: none;
  }

  .hero__content {
    flex-direction: row;
    text-align: left;
    padding: var(--sp-4xl) var(--sp-xl);
    gap: var(--sp-4xl);
  }

  .hero__title {
    font-size: var(--fs-4xl);
  }

  .hero__actions {
    justify-content: flex-start;
  }

  .hero__visual {
    width: 48%;
    max-width: none;
  }

  .btn {
    min-height: auto;
  }

  .btn--lg {
    padding: 18px 40px;
    font-size: var(--fs-lg);
  }

  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-grid--2col {
    grid-template-columns: repeat(2, 1fr);
  }

  .course-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .price-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .price-card--featured {
    transform: translateY(-6px);
  }

  .achievement-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .section {
    padding: var(--sp-5xl) 0;
  }

  .site-footer__grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  h2 {
    font-size: var(--fs-3xl);
  }
}

/* ==========================================
   Large Desktop (1280px〜)
   ========================================== */
@media (min-width: 768px) {
  /* PC: 横スクロールなし、3枚フレックス表示 */
  .testi-carousel {
    overflow-x: visible;
    scroll-snap-type: none;
    cursor: default;
    padding: 0 var(--sp-xl);
    flex-wrap: nowrap;
  }
  .testi-carousel .testi-card {
    flex: 1 1 0;
    min-width: 0;
    scroll-snap-align: none;
    animation: none;
    filter: none !important;
  }
  /* カード毎に固有の hue を設定 */
  .testi-carousel .testi-card:nth-child(1) { --glow-hue: 195; }
  .testi-carousel .testi-card:nth-child(2) { --glow-hue: 45;  }
  .testi-carousel .testi-card:nth-child(3) { --glow-hue: 160; }
  /* ドット非表示 */
  .testi-dots { display: none; }
  /* セクションのスクロール hue アニメ不要 */
  #voices { animation: none; }
}

@media (min-width: 1280px) {
  .hero__title {
    font-size: var(--fs-5xl);
  }
}

/* ==========================================
   Mobile Scroll-triggered Hover Replacements
   ========================================== */
@media (max-width: 1023px) {
  .card.animated,
  .ach-card.animated,
  .recommend-item.animated {
    animation: mobileAutoPop 1.8s ease-in-out forwards;
    animation-delay: 0.5s;
  }

  .card.animated::before,
  .ach-card.animated::before {
    animation: mobileAutoSweep 1.8s ease-in-out forwards;
    animation-delay: 0.5s;
  }

  /* モバイルではカードホバースポットライト無効 */
  .ach-card::after,
  .card::after,
  .testi-card::after,
  .interview-card::after,
  .instructor-card::after {
    display: none;
  }
}

@keyframes mobileAutoPop {
  0% {
    transform: translateY(0);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    border-color: rgba(200, 210, 240, 0.08);
  }
  50% {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35), 0 0 22px rgba(0, 194, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    border-color: rgba(0, 194, 255, 0.2);
  }
  100% {
    transform: translateY(0);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    border-color: rgba(200, 210, 240, 0.08);
  }
}

@keyframes mobileAutoSweep {
  0%   { left: -100%; }
  100% { left: 100%; }
}

/* ==========================================
   アクセシビリティ — モーション低減
   ========================================== */
@media (prefers-reduced-motion: reduce) {
  .btn--primary::before,
  .btn--primary::after,
  .btn--primary.btn-shine::before,
  .btn--primary.btn-shine::after {
    animation: none !important;
    opacity: 0;
  }

  .ach-card.scroll-glow,
  .card.scroll-glow,
  .testi-card.scroll-glow,
  .interview-card.scroll-glow,
  .instructor-card.scroll-glow {
    animation: none !important;
    box-shadow:
      0 0 0 1px rgba(0, 194, 255, 0.20),
      0 8px 25px rgba(0, 0, 0, 0.35);
  }

  .hero__webgl {
    display: none; /* 動きの激しいWebGLを完全オフ */
  }
}
