/* 無銘 MUMEI — 一本の刀が、生まれるまで。
   炭黒 #0c0a09 を基調に、章の進行で --accent が 緋 → 鋼青 → 骨白 へ遷移する。
   遷移そのものは JS（assets/js/main.js）が CSS カスタムプロパティを補間して行う */

:root {
  --bg: #0c0a09;                       /* 炭黒 */
  --text: #ece7df;
  --accent: #e85d2c;                   /* 緋。JS がスクロールで補間する */
  --accent-glow: rgba(232, 93, 44, .35);
  --serif: "Cormorant Garamond", "Shippori Mincho", "Hiragino Mincho ProN", serif;
  --gothic: "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--gothic); font-weight: 400;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--bg); }

/* ──────────────────────────────────────────────
   和文タイポグラフィ調整
   1. palt        … 句読点・括弧まわりの余分なアキを詰める
   2. auto-phrase … 文節単位で折り返す（「書」「く。」のような分断を防ぐ）
   3. balance     … 見出しの行長を揃え、1文字だけ落ちる行を作らない
   4. strict      … 禁則処理を厳密にし、行頭に 。 、 」 が来ないようにする
   auto-phrase / balance / pretty は非対応ブラウザでは無視されるだけで、
   崩れることはない（プログレッシブ・エンハンスメント）
   ────────────────────────────────────────────── */
body {
  font-feature-settings: "palt" 1;
  font-kerning: normal;
  line-break: strict;
  word-break: normal;
}
h1, h2, h3, .eyebrow, .ch-no { word-break: auto-phrase; text-wrap: balance; }
p { text-wrap: pretty; }

/* 見出し＝明朝（Shippori Mincho）＋欧文セリフ / 本文＝BIZ UDPGothic */
h1, h2, h3, .ch-glyph, .ch-tate, .mei-caption, .gauge-seal, .brand span {
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
}
.eyebrow, .num, .stat .num, .brand em { font-family: var(--serif); }

/* ──────────────────────────────────────────────
   背景レイヤー（フレームスクラブ → 火の粉 → ビネット → フラッシュ）
   ────────────────────────────────────────────── */
#seq { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
#fx  { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.no-webgl #fx { display: none; }     /* WebGL 不可ならフレームスクラブのみで成立させる */
.vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 42%, rgba(0,0,0,.62) 100%);
}
/* 鎚打ちのフラッシュ。本文(z10)より下に敷き、文字は白飛びさせない */
#flash {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 58%,
    rgba(255, 240, 216, .95), rgba(255, 154, 64, .48) 42%, rgba(255, 110, 40, 0) 74%);
}

#loading {
  position: fixed; inset: 0; display: flex; z-index: 60;
  align-items: center; justify-content: center;
  font-family: "Shippori Mincho", serif;
  font-size: 13px; letter-spacing: .5em; text-indent: .5em; color: var(--accent);
  background: var(--bg); transition: opacity .8s ease;
}
#loading.hide { opacity: 0; pointer-events: none; }

#badge {
  position: fixed; left: 16px; bottom: 16px; z-index: 30;
  font-size: 10px; letter-spacing: .14em; line-height: 1.7;
  padding: 6px 10px; border: 1px solid rgba(255,255,255,.28);
  opacity: .75; border-radius: 2px; background: rgba(0,0,0,.4);
  max-width: min(60vw, 340px);
}

/* ──────────────────────────────────────────────
   ヘッダー（モバイルでも 1 段のまま収める）
   ────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 20px clamp(20px, 5vw, 64px);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand span { font-size: 16px; font-weight: 600; letter-spacing: .3em; white-space: nowrap; }
.brand em { font-style: normal; font-size: 11px; letter-spacing: .22em; opacity: .7; margin-left: 2px; }
.links { display: flex; align-items: center; gap: 24px; font-size: 12px; letter-spacing: .2em; white-space: nowrap; }
.links a { color: inherit; text-decoration: none; opacity: .82; }
.links a:hover { opacity: 1; }
.links .pill-btn {
  padding: 8px 18px; border: 1px solid var(--accent); border-radius: 999px;
  opacity: 1; transition: background .3s ease, color .3s ease;
}
.links .pill-btn:hover { background: var(--accent); color: var(--bg); }
@media (max-width: 560px) {
  .nav { padding: 14px 16px; }
  .brand span { font-size: 14px; letter-spacing: .18em; }
  .brand em { display: none; }
  .links { gap: 13px; font-size: 10.5px; letter-spacing: .08em; }
  .links .pill-btn { padding: 6px 12px; }
}

/* ──────────────────────────────────────────────
   焼き入れゲージ（右端の細い縦バー。下から 赤熱 → 鋼青）
   ────────────────────────────────────────────── */
.gauge {
  position: fixed; right: 14px; top: 50%; transform: translateY(-50%);
  height: 62vh; z-index: 25; display: flex; flex-direction: column; align-items: center; gap: 10px;
  pointer-events: none;
}
.gauge-seal {
  writing-mode: vertical-rl; font-size: 9px; letter-spacing: .32em; line-height: 1;
  color: var(--text); opacity: .85;
  border: 1px solid var(--accent); padding: 5px 3px;
  background: rgba(12,10,9,.55); transition: border-color .4s ease;
}
/* 狭幅では印章を落とし、誂え表との重なりを避ける(トラックは残す) */
@media (max-width: 560px) {
  .gauge-seal { display: none; }
}
.gauge-track {
  position: relative; flex: 1; width: 3px; border-radius: 2px; overflow: hidden;
  background: rgba(255,255,255,.13);
}
#gaugeFill {
  position: absolute; inset: 0; display: block;
  background: linear-gradient(to top, #ff5a1f, #ffb36b 34%, #cfd8de 62%, #7fa8c9);
  clip-path: inset(100% 0 0 0);      /* JS が進捗ぶんだけ下から開けていく */
}
@media (max-width: 560px) { .gauge { right: 8px; height: 46vh; } }

/* ──────────────────────────────────────────────
   本文
   ────────────────────────────────────────────── */
.content { position: relative; z-index: 10; }
section { padding: 0 clamp(20px, 5vw, 64px); position: relative; }

/* line-height は 375px で折り返したとき行が接触しない値にする（2026-09-02 実測） */
.eyebrow { font-size: 11px; letter-spacing: .34em; color: var(--accent); line-height: 1.7; transition: color .25s linear; }

/* ヒーロー */
.hero { height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.hero h1 {
  margin-top: 18px;
  font-size: clamp(40px, 6.6vw, 96px); font-weight: 600; line-height: 1.22;
  letter-spacing: .06em; text-shadow: 0 2px 34px rgba(0,0,0,.75);
}
.hero .lead {
  margin-top: 24px; font-size: clamp(12.5px, 1.2vw, 15px); line-height: 2.2;
  letter-spacing: .1em; opacity: .88; text-shadow: 0 1px 14px rgba(0,0,0,.85);
}
/* 免責文。輝炉の上でも読めるだけの明度と影を確保する */
.hero-note { margin-top: 26px; font-size: 10.5px; letter-spacing: .12em; line-height: 1.8; opacity: .78; text-shadow: 0 1px 8px rgba(0,0,0,.9); }
.scroll-cue {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 26px;
  font-size: 10px; letter-spacing: .3em; opacity: .6; white-space: nowrap;
}

/* 章。sticky で 1 画面ぶんの内容を据え、区間の長さでスクラブを味わわせる */
.chapter { min-height: 175vh; }
.ch-tsuchi { min-height: 250vh; }     /* ビート区間はたっぷり取る */
.ch-sticky {
  position: sticky; top: 0; height: 100vh;
  display: flex; align-items: center; gap: clamp(18px, 5vw, 80px);
}
/* 文字が載る側だけを落とす、画面いっぱいのやわらかい減光。
   透明になりきる位置がビューポート内なので、矩形の縁が出ない
   (火花・白蒸気のような明るいコマの上でだけ効く) */
.ch-sticky::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(62% 74% at var(--scrim-x, 44%) 50%,
    rgba(6,5,4,.74), rgba(6,5,4,.34) 46%, rgba(6,5,4,0) 78%);
}
.ch-mizu .ch-sticky, .ch-sei .ch-sticky { --scrim-x: 28%; }
.ch-glyph, .ch-text, .ch-tate { position: relative; z-index: 1; }
.ch-glyph {
  font-size: clamp(150px, 36vh, 320px); font-weight: 700; line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 60px var(--accent-glow), 0 4px 30px rgba(0,0,0,.6);
  transition: color .25s linear, text-shadow .25s linear;
  user-select: none;
}
/* 火花・白蒸気の明部でも本文が沈まないようにする。
   矩形のスクリムは明るい絵の上で箱が透けて見えるため使わず、
   字形に沿う多層の影（下の h2 / .ch-copy）だけで可読性を確保する */
.ch-text { max-width: 34em; }
.ch-no { font-size: 11px; letter-spacing: .4em; color: var(--accent); transition: color .25s linear; }
.ch-text h2 {
  margin-top: 14px; font-size: clamp(24px, 3.4vw, 46px); font-weight: 600;
  line-height: 1.5; letter-spacing: .05em;
  text-shadow: 0 0 1px rgba(0,0,0,.95), 0 1px 3px rgba(0,0,0,.95),
               0 2px 14px rgba(0,0,0,.9), 0 0 36px rgba(0,0,0,.75);
}
.ch-copy {
  margin-top: 18px; font-size: clamp(12.5px, 1.15vw, 14.5px);
  line-height: 2.3; letter-spacing: .1em; opacity: 1;
  text-shadow: 0 0 1px rgba(0,0,0,.95), 0 1px 3px rgba(0,0,0,.95),
               0 2px 12px rgba(0,0,0,.92), 0 0 30px rgba(0,0,0,.75);
}
/* 章の添え書きは縦書きで和の余白をつくる */
.ch-tate {
  position: absolute; right: clamp(40px, 6vw, 96px); top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl; font-size: 12px; letter-spacing: .5em;
  opacity: .5; text-shadow: 0 1px 10px rgba(0,0,0,.8);
}
/* 章ごとに文字の寄せを互い違いに。縦書きの添え書きは本文と重ならない端へ逃がす */
.ch-mizu .ch-sticky, .ch-sei .ch-sticky { flex-direction: row-reverse; justify-content: flex-end; }
.ch-mizu .ch-tate, .ch-sei .ch-tate { right: auto; left: clamp(14px, 1.6vw, 28px); }
.ch-mizu .ch-text, .ch-sei .ch-text { margin-left: clamp(44px, 5vw, 90px); }

/* 見せ場: 映像だけを見せる余白 */
.breath { height: 55vh; }

/* 統計 */
.stats-sec { padding-top: 8vh; padding-bottom: 6vh; }
.stats {
  display: flex; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,.22);
  border-bottom: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(4px); background: rgba(6,5,4,.5);
}
.stat { flex: 1 1 160px; padding: 34px 18px; text-align: center; }
.stat + .stat { border-left: 1px solid rgba(255,255,255,.13); }
.stat .num { font-size: clamp(28px, 3.2vw, 46px); font-weight: 600; letter-spacing: .04em; }
.stat .num small { font-size: .5em; margin-left: 4px; font-family: "Shippori Mincho", serif; }
.stat .label { margin-top: 10px; font-size: 10.5px; letter-spacing: .26em; opacity: .7; }
.stats-note { margin-top: 12px; font-size: 10px; letter-spacing: .12em; opacity: .5; text-align: right; }

/* 終章 銘 */
.mei { height: 230vh; }
.mei-sticky {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  text-align: center;
}
#meiSvg { width: min(560px, 78vw); height: auto; overflow: visible;
  filter: drop-shadow(0 0 26px rgba(185, 198, 210, .18)); }
.mei-caption { font-size: clamp(14px, 1.6vw, 19px); letter-spacing: .3em; opacity: .85; }

/* 誂えの仕様 + CTA */
.spec { padding-top: 8vh; padding-bottom: 16vh; display: flex; justify-content: center; }
.spec-panel {
  width: min(680px, 100%);
  background: rgba(8,7,6,.72); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.14); border-radius: 6px;
  padding: clamp(26px, 4vw, 46px);
}
.spec-panel h2 { margin-top: 12px; font-size: clamp(22px, 2.6vw, 34px); font-weight: 600; letter-spacing: .1em; }
.spec-panel table { width: 100%; margin-top: 26px; border-collapse: collapse; font-size: 13px; }
.spec-panel th, .spec-panel td {
  text-align: left; padding: 13px 8px; border-bottom: 1px solid rgba(255,255,255,.12);
  line-height: 1.8; vertical-align: top;
}
.spec-panel th { width: 8.5em; font-weight: 400; letter-spacing: .2em; opacity: .7; white-space: nowrap; }
.cta-row { margin-top: 30px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
#visitBtn {
  font-family: var(--gothic); font-size: 12.5px; letter-spacing: .2em;
  color: var(--text); background: transparent;
  border: 1px solid var(--accent); border-radius: 999px;
  padding: 14px 34px; cursor: pointer;
  transition: background .3s ease, color .3s ease;
}
#visitBtn:hover { background: var(--accent); color: var(--bg); }
.cta-note { font-size: 11px; letter-spacing: .1em; opacity: .6; }

/* フッター（架空明示 2 文） */
.foot {
  position: relative; z-index: 10;
  padding: 30px clamp(20px, 5vw, 64px) 90px;
  border-top: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.5);
  font-size: 10.5px; letter-spacing: .08em; line-height: 2; opacity: .75;
}
.foot p + p { margin-top: 6px; }

/* トースト */
#toast {
  position: fixed; left: 50%; bottom: 68px; transform: translate(-50%, 16px);
  z-index: 50; opacity: 0; pointer-events: none;
  font-size: 12px; letter-spacing: .1em;
  padding: 12px 22px; border-radius: 999px;
  background: rgba(20,17,15,.92); border: 1px solid var(--accent);
  transition: opacity .35s ease, transform .35s ease;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ──────────────────────────────────────────────
   出現アニメーション（IntersectionObserver が .on を付ける）
   JS が生きているときだけ隠す。落ちたら 3 秒で全表示に戻る
   ────────────────────────────────────────────── */
.js [data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.22, .61, .21, 1);
}
.js [data-reveal].on { opacity: 1; transform: none; }
/* 章の一文字は「にじみ出る」墨の出方にする */
.js .ch-glyph[data-reveal] { transform: none; filter: blur(18px); transition: opacity 1.3s ease, filter 1.3s ease; }
.js .ch-glyph[data-reveal].on { filter: blur(0); }

/* ──────────────────────────────────────────────
   モバイル
   ────────────────────────────────────────────── */
@media (max-width: 760px) {
  .ch-sticky {
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px;
    padding-bottom: 88px;   /* デモバッジ・バックリンクと本文が重ならない下余白 */
  }
  .ch-mizu .ch-sticky, .ch-sei .ch-sticky { flex-direction: column; }
  .ch-mizu .ch-text, .ch-sei .ch-text { margin-left: 0; }
  .ch-glyph { font-size: clamp(96px, 19vh, 150px); }
  .ch-tate { display: none; }
  .hero .lead br { display: none; }
  .hero-inner { padding-bottom: 40px; }
  .stat { flex: 1 1 46%; }
  .stat:nth-child(3) { border-left: none; }
  .stat:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.13); }
  /* デモバッジは 1 行に畳む */
  #badge { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62vw; }
  .scroll-cue { bottom: 54px; }
}

/* ──────────────────────────────────────────────
   動きを減らす設定: スクラブは静止 1 枚・ビート無効（JS 側で停止）
   出現アニメーションも遷移も止める
   ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .breath { height: 16vh; }
  .chapter, .ch-tsuchi { min-height: 120vh; }
  #flash { display: none; }
}
