/* =============================================================
   hero-forge.css — ヒーロー「整える → 加速する」
   金の粒子が カオス → "EVMEL" の文字 → 前方へワープ とモーフする。
   生WebGL（hero-forge.js・three.js不使用・依存ゼロ）。

   ・自己完結。既存の .hero-content 等とはクラスを分ける（hf-*）
   ・WebGL不可 / reduced-motion / JS無効 では静止画1枚の素のヒーローに畳む
   ・EVMEL は SEO 用に <h1 class="hf-sr"> を残す（視覚は粒子が担う）
   ============================================================= */

.hf-pin { position: relative; height: 400vh; }   /* カオス→文字→ボケ玉→タグライン→光が集まって保持（その間に映像がゆっくり育つ） */
.hf-pin .hero {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;                 /* iOSのアドレスバーでズレないように */
  overflow: hidden;
  padding: 0;
}
/* 既存 .hero::after のグレインは薄くして粒子を濁らせない */
.hf-pin .hero::after { opacity: 0.22; }

.hf-gl {
  position: absolute; inset: 0;
  width: 100%; height: 100%;      /* canvasは置換要素。inset:0だけでは伸びないので必須 */
  z-index: 1;
  opacity: 0;
  transition: opacity 1.2s var(--ease-smooth, ease);
}
.hf-gl.is-lit { opacity: 1; }

/* WebGL不可・reduced-motion時に見せる静止画（既定は隠す） */
.hf-fallback { position: absolute; inset: 0; z-index: 0; display: none; overflow: hidden; }
.hf-fallback img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }

.hf-vignette {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(10,10,10,0.6) 100%);
}

/* 中央：ボケ玉フェーズで浮かび上がるタグライン */
.hf-climax {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  z-index: 3; padding: 0 24px; pointer-events: none; opacity: 0; text-align: center;
}
.hf-climax::before {   /* 文字裏の軽い暗がり（可読性） */
  content: ""; position: absolute; inset: -60% -12%; z-index: -1;
  background: radial-gradient(ellipse 58% 130% at 50% 50%, rgba(10,10,10,0.68), rgba(10,10,10,0.28) 55%, transparent 74%);
}
.hf-climax .cl-line {
  font-family: var(--font-serif-ja); font-weight: 200;
  font-size: clamp(28px, 5.4vw, 64px); line-height: 1.5; letter-spacing: 0.1em; color: #fff;
}
.hf-climax .cl-line b { font-weight: 300; color: var(--gold-light); }
.hf-climax .cl-rule { width: 0; height: 1px; background: var(--gold-grad); margin: 28px auto 0; }

/* 収束：中央に集まる光 */
.hf-bloom {
  position: absolute; left: 50%; top: 50%; width: 70vmax; height: 70vmax; z-index: 4;
  pointer-events: none; opacity: 0; transform: translate(-50%,-50%) scale(0.2); mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255,250,240,0.95), rgba(255,238,205,0.35) 28%, transparent 62%);
}

/* 光の中から現れる映像（先頭カット）→ 下の scroll-film へつながる */
.hf-emerge { position: absolute; inset: 0; z-index: 5; opacity: 0; pointer-events: none; overflow: hidden; }
.hf-emerge picture { display: block; width: 100%; height: 100%; }
.hf-emerge img { width: 100%; height: 100%; object-fit: cover; filter: brightness(2.6); transform: scale(1.2); will-change: transform, filter; }
.hf-emerge .em-veil { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(10,10,10,0.5), rgba(10,10,10,0.15) 42%, rgba(10,10,10,0.85)); }
.hf-emerge .em-cap { position: absolute; left: 6vw; right: 6vw; bottom: 13%; }
.hf-emerge .em-idx { display: block; font-family: var(--font-label); font-size: 11px; letter-spacing: 0.35em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.hf-emerge .em-cap p { font-family: var(--font-serif-ja); font-weight: 300; font-size: clamp(24px,3.4vw,44px); line-height: 1.75; color: #fff; max-width: 660px; text-shadow: 0 1px 24px rgba(0,0,0,0.55); }

.hf-overlay {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  text-align: center; padding: 15vh 24px 12vh; pointer-events: none;
}
.hf-overlay a { pointer-events: auto; }

.hf-label {
  font-family: var(--font-label); font-size: 12px; letter-spacing: 0.4em;
  text-transform: uppercase; color: var(--gold-light);
}
.hf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hf-bottom { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 26px; }

.hf-caption {
  position: relative; height: 1.8em; width: 100%;
  font-family: var(--font-serif-ja); font-weight: 300;
  font-size: clamp(20px, 3.4vw, 36px); color: #f4ecd8; letter-spacing: 0.08em;
}
.hf-caption .cap {
  position: absolute; left: 0; right: 0; top: 0;
  opacity: 0; transform: translateY(14px); white-space: nowrap;
  transition: opacity 0.6s var(--ease-smooth, ease), transform 0.6s var(--ease-smooth, ease);
}
.hf-caption .cap.on { opacity: 1; transform: none; }
.hf-caption .cap b { font-weight: 400; color: var(--gold-light); }

.hf-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.hf-scroll {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--font-label); font-size: 10px; letter-spacing: 0.3em; color: var(--gold-light); opacity: 0.65;
}
.hf-scroll i { width: 1px; height: 42px; background: linear-gradient(var(--gold), transparent); animation: hfSp 2s ease-in-out infinite; }
@keyframes hfSp { 0%,100% { transform: scaleY(.3); transform-origin: top; opacity: .4; } 50% { transform: scaleY(1); opacity: 1; } }

@media (max-width: 860px) { .hf-pin { height: 300vh; } }

/* ---- フォールバック：素の1画面＋静止画 ---- */
.no-webgl .hf-pin, .hf-pin.hf-static { height: auto; }
.no-webgl .hf-pin .hero, .hf-pin.hf-static .hero { position: relative; }
.no-webgl .hf-fallback, .hf-pin.hf-static .hf-fallback { display: block; }
.no-webgl .hf-caption .cap:first-child, .hf-pin.hf-static .hf-caption .cap:first-child { opacity: 1; transform: none; }
.no-webgl .hf-cta, .hf-pin.hf-static .hf-cta { opacity: 1; }
.no-webgl .hf-label, .hf-pin.hf-static .hf-label { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .hf-pin { height: auto; }
  .hf-pin .hero { position: relative; }
  .hf-gl { display: none; }
  .hf-fallback { display: block; }
  .hf-caption .cap:first-child { opacity: 1; transform: none; }
  .hf-cta { opacity: 1; }
  .hf-label { opacity: 1; }
}
