/* トップ「堂の内へ」#temples（2026-11-24 改・scripts/lp/temple-hall.py が節を書く）
   ねらい: 見た瞬間に「すごい」。像を画面いっぱいに置き、スクロールで堂の扉が開く。
   1) 扉: 黒い画面に縦の細い光が入り、扉が左右に開いて巨大な顔が現れる（わずかに寄る）
   2) 三体: 画面に留めたまま、仁王・手・弥勒が入れ替わる。一体に一行
   3) 千体: 並ぶ立像の壁が引いていき、「1,001」が浮かぶ
   香の煙（薄い・ゆっくり）と、蝋燭のような明かりの寄り（スクロールで動く）を全体に重ねる。
   動きは JS が .th-js を付けた時だけ。動きを減らす設定・JS 無しでは、全画面の写真を縦に並べた静かな形で全部見える。
   金はブランドの色として使わない。暖かい光は写真の中の明かりとしてだけ（彩度の低い琥珀を薄く）。 */

section.th { background: #070708 !important; color: rgba(246, 246, 248, .94); padding: 0; overflow: clip; position: relative; }
.th figure { margin: 0; }
.th-scene { position: relative; }
.th-stage { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: #070708; isolation: isolate; }

/* 写真は画面いっぱい */
.th-frame { position: absolute; inset: 0; }
.th-frame picture, .th-frame img { display: block; width: 100%; height: 100%; }
.th-frame img { object-fit: cover; transform-origin: 50% 45%; will-change: transform; }
.th-frame figcaption {
  position: absolute; left: 20px; top: 72px; right: 20px; z-index: 6;
  font-size: 11px; line-height: 1.5; letter-spacing: .04em; color: rgba(246, 246, 248, .62);
}

/* 煙と明かり */
.th-smoke { position: absolute; inset: -20%; z-index: 3; pointer-events: none; mix-blend-mode: screen; opacity: .1; }
.th-smoke i {
  position: absolute; inset: 0; background: url(/images/temples/th2-smoke-v1.webp) 0 0 / 760px 760px repeat;
  animation: th-drift 70s linear infinite;
}
.th-smoke i + i { background-size: 1100px 1100px; opacity: .7; animation-duration: 110s; animation-direction: reverse; }
@keyframes th-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-760px, -380px, 0); } }
.th-candle {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 62% at 50% var(--th-cy, 46%), rgba(255, 196, 140, .07) 0%, transparent 60%),
    radial-gradient(ellipse 90% 80% at 50% var(--th-cy, 46%), transparent 38%, rgba(7, 7, 8, .55) 72%, rgba(7, 7, 8, .92) 100%);
}

/* 1) 扉 */
.th-door { display: none; }
.th-slit { display: none; }
.th-copy {
  position: absolute; z-index: 7; left: 0; right: 0; bottom: 0; padding: 0 20px 112px;
  text-align: center; text-shadow: 0 2px 28px rgba(0, 0, 0, .65);
}
.th .th-title {
  margin: 0; font-family: 'Poppins', sans-serif; font-weight: 800; color: #F6F6F8;
  text-transform: uppercase !important; letter-spacing: -.035em; line-height: .9;
  font-size: clamp(56px, 15vw, 88px);
}
.th .th-title:is(:lang(ja), :lang(zh), :lang(zh-Hant), :lang(ko), :lang(hi)) { letter-spacing: .02em; line-height: 1.15; }
.th .th-lead { margin: 22px auto 0; max-width: 34em; font-size: 15px; line-height: 1.8; color: rgba(246, 246, 248, .84); }
.th .th-lead:lang(ja) { word-break: keep-all; overflow-wrap: anywhere; }

/* 2) 三体の一行 */
.th .th-line {
  position: absolute; z-index: 7; left: 20px; right: 20px; bottom: 112px; margin: 0;
  font-family: 'Poppins', sans-serif; font-weight: 600; letter-spacing: -.02em; line-height: 1.08;
  font-size: clamp(34px, 9.4vw, 56px); color: #F6F6F8; text-shadow: 0 2px 30px rgba(0, 0, 0, .7);
  max-width: 14em;
}
.th .th-line:is(:lang(ja), :lang(zh), :lang(zh-Hant), :lang(ko), :lang(hi)) { letter-spacing: .02em; line-height: 1.3; }

/* 3) 千体の壁 */
.th-wall { position: absolute; inset: 0; z-index: 1; overflow: hidden; }
.th-wall-in {
  /* 1枚に描いた「堂の段」（手前ほど大きく・奥ほど小さく暗い）。始めは寄って一体ずつ像に見え、スクロールで引いて千体になる */
  position: absolute; inset: 0;
  background: #0A0A0B url(/images/temples/th2-hall-v1-2400.jpg) 50% 100% / cover no-repeat;
  background-image: image-set(url(/images/temples/th2-hall-v1-2400.avif) type("image/avif") 1x, url(/images/temples/th2-hall-v1-2400.webp) type("image/webp") 1x);
  transform-origin: 50% 92%; will-change: transform;
}
@media (min-width: 760px) {
  .th-wall-in {
    background-image: url(/images/temples/th2-hall-v1-3200.jpg);
    background-image: image-set(url(/images/temples/th2-hall-v1-3200.avif) type("image/avif") 1x, url(/images/temples/th2-hall-v1-3200.webp) type("image/webp") 1x);
  }
}
.th-num {
  position: absolute; z-index: 7; left: 0; right: 0; top: 50%; margin: 0; transform: translateY(-50%);
  text-align: center; font-family: 'Poppins', sans-serif; font-weight: 800; letter-spacing: -.05em; line-height: 1;
  font-size: clamp(96px, 30vw, 300px); color: #F6F6F8; text-shadow: 0 4px 60px rgba(0, 0, 0, .8);
}
.th-wallcap {
  position: absolute; z-index: 7; left: 20px; right: 20px; top: 72px; margin: 0;
  font-size: 11px; letter-spacing: .04em; color: rgba(246, 246, 248, .62);
}

/* 結び（2026-11-25: 背景を足した。千体の壁が漆の床に映ったように下へ溶けていく。
   帯は全幅・字の幅は前と同じ 600px（PC 544px）。字の後ろは暗がりを重ね、字は 4.5:1 以上を保つ） */
.th-close { position: relative; isolation: isolate; overflow: hidden; margin: 0; padding: 72px max(20px, calc((100% - 600px) / 2)) 112px; }
.th-close > p, .th-close > .th-link { position: relative; z-index: 2; }
.th-close-bg { position: absolute; inset: 0; z-index: -2; display: block; overflow: hidden; pointer-events: none; }
.th-close-bg img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.th-close::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 46% 52% at 50% 52%, rgba(7, 7, 8, .62) 0%, rgba(7, 7, 8, .3) 60%, transparent 100%),
    linear-gradient(180deg, transparent 70%, #070708 100%);
}
.th-close .th-smoke { z-index: -1; opacity: .08; }
.th-close p { margin: 0; font-size: 17px; line-height: 1.8; color: rgba(246, 246, 248, .8); }
.th-close p:lang(ja) { line-break: strict; }
.th .th-link {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 28px; min-height: 44px;
  font-size: 15px; font-weight: 500; color: #EAF1FE;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px;
}
.th .th-link svg { flex: none; transition: transform .3s ease; }
.th .th-link:hover svg { transform: translateX(4px); }

/* 静かな形（JS 無し・動きを減らす）: 三体の舞台は縦に3画面 */
.th:not(.th-js) .th-scene--seq .th-stage { height: auto; }
.th:not(.th-js) .th-scene--seq .th-frame { position: relative; height: 100vh; height: 100svh; }
.th:not(.th-js) .th-scene--seq .th-smoke, .th:not(.th-js) .th-scene--seq .th-candle { display: none; }
.th:not(.th-js) .th-frame figcaption { z-index: 6; }
.th:not(.th-js) .th-wall-in { transform: scale(1.35); }

@media (min-width: 760px) {
  .th-frame figcaption, .th-wallcap { left: 40px; top: auto; bottom: 28px; font-size: 11.5px; }
  .th-copy { padding: 0 48px 96px; }
  .th .th-title { font-size: clamp(88px, 10.5vw, 168px); }
  .th .th-lead { font-size: 18px; margin-top: 28px; }
  .th .th-line { left: 64px; bottom: 96px; font-size: clamp(48px, 5.6vw, 92px); }
  .th-close { padding: 112px max(48px, calc((100% - 544px) / 2)) 160px; }
  .th-close p { font-size: 20px; }
}

/* ── 動き（JS が .th-js を付けた時だけ） ── */
/* ⚠️ 高さは vh で書かない（2026-11-26 Tom「フォームに打とうとすると勝手に FAQ まで戻る」）。
   スマホでキーボードが開くと画面の高さが縮み、vh で書いたこの節（約10画面ぶん）が一緒に縮んで、
   下のフォームが2,700px 上へ飛んでいた。js/temple-hall.js が幅の変わった時だけ測る --th-vh（px）を使う。
   キーボード・アドレス欄の出し入れ（高さだけの変化）では変えない。 */
.th.th-js .th-scene--door { height: calc(var(--th-vh, 1vh) * 260); }
.th.th-js .th-scene--seq { height: calc(var(--th-vh, 1vh) * 420); }
.th.th-js .th-scene--wall { height: calc(var(--th-vh, 1vh) * 240); }
.th.th-js .th-stage { position: sticky; top: 0; height: calc(var(--th-vh, 1vh) * 100); }
.th.th-js .th-door {
  display: block; position: absolute; top: 0; bottom: 0; width: 50.5%; z-index: 5;
  background: linear-gradient(180deg, #0A0A0B, #050506 60%, #0A0A0B);
  will-change: transform;
}
/* 扉の板（2026-11-25・scripts/lp/temple-door.py が描いた木の板。写真ではない）。
   開く前から「閉じた堂の扉」に見せる。節に近づいた時だけ JS が .th-near を付けて読む（遅れて読む） */
.th.th-js .th-door::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: no-repeat right center / cover;
}
.th.th-js.th-near .th-door::before {
  background-image: url(/images/temples/th2-door-v1-900.jpg);
  background-image: image-set(url(/images/temples/th2-door-v1-900.webp) type("image/webp") 1x, url(/images/temples/th2-door-v1-900.jpg) type("image/jpeg") 1x);
}
.th.th-js .th-door--r::before { transform: scaleX(-1); }
.th.th-js .th-door--l { left: 0; box-shadow: inset -1px 0 0 rgba(255, 210, 160, .10); }
.th.th-js .th-door--r { right: 0; box-shadow: inset 1px 0 0 rgba(255, 210, 160, .10); }
.th.th-js .th-slit {
  display: block; position: absolute; z-index: 6; top: -10%; bottom: -10%; left: 50%; width: 46vw; margin-left: -23vw;
  pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse 9% 58% at 50% 50%, rgba(255, 214, 170, .55), rgba(255, 190, 130, .14) 42%, transparent 72%);
  filter: blur(6px);
}
.th.th-js .th-copy { opacity: 0; transform: translateY(24px); }
.th.th-js .th-scene--seq .th-frame > * { opacity: 0; }
.th.th-js .th-scene--seq .th-frame:first-of-type > * { opacity: 1; }
.th.th-js .th-num { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .th-smoke i { animation: none; }
}
/* 和文の大きな一行は語の途中で折らない */
.th .th-line:lang(ja), .th .th-title:lang(ja) { word-break: keep-all; overflow-wrap: anywhere; }

/* ── 案B（2026-11-25）──
   開く前: 扉を出さない。菩薩の顔が闇から浮かぶ（JS が明るさを上げる）。題は初めから
   結び: 「仏の手」（th2-hand・CC0）を右に大きく、左へ闇に溶かす */
.th.th-js .th-door, .th.th-js .th-slit { display: none; }
.th.th-js .th-copy { opacity: 1; transform: none; }
.th-close-bg { left: auto; width: 68%; }
.th-close-bg img { object-position: 30% 50%; filter: brightness(.9);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 40%), linear-gradient(180deg, transparent, #000 12%, #000 85%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent 0%, #000 40%), linear-gradient(180deg, transparent, #000 12%, #000 85%, transparent); mask-composite: intersect; }
.th-close::after { background: linear-gradient(90deg, rgba(7,7,8,.25) 30%, rgba(7,7,8,.55) 55%, rgba(7,7,8,.1) 85%); }
@media (max-width: 759px) { .th-close-bg { width: 100%; } .th-close-bg img { filter: brightness(.6); } .th-close::after { background: rgba(7,7,8,.35); } }
