/* 현정암 첫 화면 v4(#hero) — 실시간 3D 법당. 이 파일 + hero-v4.js + hall-v4.js + hall/ 만 바꾸면 첫 화면을 갈아 끼울 수 있다.
   공용 토큰(:root 색·글꼴), .btn, .status, .actions 는 style-v3 계열 본문 CSS 것을 쓴다.
   스크롤 길이 동안 무대(stage)가 화면에 붙어 있고, 끝나면 靑 장면(#1D3566)으로 그대로 이어진다. */
.hall{position:relative;height:400vh;background:#1D3566;padding:0;min-height:0;display:block}
.hall-stage{position:sticky;top:0;height:100vh;height:100svh;overflow:hidden;background:#07080D;isolation:isolate}
.hall-still,.hall-still-end,.hall-gl{position:absolute;inset:0;width:100%;height:100%}
.hall-still img,.hall-still-end img{width:100%;height:100%;object-fit:cover}
.hall-still-end{display:none}
.hall-gl{display:block;opacity:0;transition:opacity 1.4s ease}
.hall-gl-on .hall-gl{opacity:1}
.hall-load{position:absolute;left:0;top:0;height:2px;width:100%;background:var(--candle);transform-origin:left;transform:scaleX(var(--load,0));opacity:.7;transition:transform .3s,opacity .6s;z-index:4}
.hall-gl-on .hall-load{opacity:0}
/* 글자가 잘 읽히게 아래쪽만 어둡게 + 끝에서 靑 쪽빛으로 이어짐 */
.hall-shade{position:absolute;inset:0;pointer-events:none;z-index:1;
  background:linear-gradient(to top,rgba(7,8,13,.88) 0%,rgba(7,8,13,.55) 26%,rgba(7,8,13,0) 52%),linear-gradient(to bottom,rgba(7,8,13,.55),rgba(7,8,13,0) 18%)}
.hall-stage::after{content:"";position:absolute;left:0;right:0;bottom:0;height:9%;z-index:2;pointer-events:none;background:linear-gradient(to top,#1D3566,rgba(29,53,102,0));opacity:0}
/* 법당 바로 다음 靑 장면은 위 여백을 줄여 빈 쪽빛 면이 길지 않게 */
.hall + .scene{padding-top:48px}
.hall + .scene .sc-split{align-items:start}
/* 법당을 벗어나기 시작하면 현판·글은 먼저 사라짐(머리 줄과 겹치지 않게) */
.hall.p-end.p-out .hall-end,.hall.p-out .hall-end{opacity:0;visibility:hidden;transition:opacity .35s,visibility 0s linear .35s}

.hall-intro,.hall-end,.hall-line,.hall-hint,.hall-skip{z-index:3}
.hall-intro,.hall-end .end-text{text-shadow:0 2px 22px rgba(0,0,0,.55)}
/* 처음 화면 글 */
.hall-intro{position:absolute;left:var(--gut);right:var(--gut);bottom:max(40px,6svh);max-width:620px;transition:opacity .6s,transform .6s}
.hall.p-moved .hall-intro{opacity:0;transform:translateY(-14px);pointer-events:none}
.hall-eyebrow{display:flex;align-items:center;gap:12px;font-size:15px;letter-spacing:.14em;color:var(--hanji2)}
.hall-eyebrow .mark-o i{height:16px}
.hall .lede{margin-top:18px;font-family:var(--title);font-weight:400;font-size:clamp(2.1rem,3.7vw,3.5rem);line-height:1.3;color:var(--hanji)}
.hall .lede span{display:block;white-space:nowrap}
.hall .facts{display:flex;flex-wrap:wrap;gap:4px 16px;margin-top:18px;font-size:16px;color:var(--hanji)}
.hall .facts span+span::before{content:"·";margin-right:16px;color:var(--dim)}
.hall .status{margin-top:10px}
.hall .status .dot{background:#6B6358}
.hall .status.open .dot{background:var(--o-red);box-shadow:0 0 0 5px rgba(181,48,42,.28)}
.hall .actions{margin-top:22px}
/* 들어가는 동안 대표님 소개글 두 줄 */
.hall-line{position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);text-align:center;font-family:var(--serif);font-size:clamp(20px,2.1vw,28px);line-height:1.7;color:var(--hanji);opacity:0;transition:opacity .7s;pointer-events:none;text-shadow:0 2px 24px rgba(0,0,0,.8),0 0 2px rgba(0,0,0,.6)}
.hall-line span{display:block}
.hall.p-l1 .l1,.hall.p-l2 .l2{opacity:1}
/* 제단 앞에 도착 */
.hall-end{position:absolute;inset:0;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .9s ease,visibility 0s linear .9s}
.hall.p-end .hall-end{opacity:1;visibility:visible;transition:opacity .9s ease;pointer-events:none}
.hall-end .end-text,.hall-end .hyeonpan{pointer-events:auto}
.hyeonpan{position:absolute;left:var(--gut);top:96px;display:flex;flex-direction:column;align-items:stretch;clip-path:inset(0 0 100% 0);transition:clip-path 1.3s cubic-bezier(.66,0,.22,1) .1s}
.hall.p-end .hyeonpan{clip-path:inset(0 0 0 0)}
.name{writing-mode:vertical-rl;display:flex;flex-direction:column;align-items:center;gap:10px;font-weight:400;padding:24px 12px;background:#1F1A15;border:1px solid rgba(238,231,218,.42);box-shadow:inset 0 0 0 5px #1F1A15,inset 0 0 0 6px rgba(238,231,218,.2),0 18px 40px rgba(0,0,0,.45)}
.name-t{font-family:var(--title);font-size:clamp(2.6rem,5.2vw,4.6rem);line-height:1;letter-spacing:.12em;color:var(--hanji)}
.name-s{font-size:14px;letter-spacing:.3em;color:var(--dim);padding-top:4px}
.tails{display:flex;justify-content:center;height:84px;padding:0 14px}
.tails i{flex:0 0 14%;margin:0 -1px;clip-path:polygon(0 0,100% 0,100% 100%,50% 84%,0 100%);box-shadow:inset -2px 0 0 rgba(0,0,0,.18)}
.tails i:nth-child(1){background:var(--o-blue)}
.tails i:nth-child(2){background:var(--o-red)}
.tails i:nth-child(3){background:var(--o-yellow)}
.tails i:nth-child(4){background:var(--o-white)}
.tails i:nth-child(5){background:#0A0908;box-shadow:inset 0 0 0 1px rgba(238,231,218,.5)}
.end-text{position:absolute;left:var(--gut);right:var(--gut);bottom:max(40px,6svh);max-width:640px;transform:translateY(16px);transition:transform 1s cubic-bezier(.2,.7,.2,1) .25s}
.hall.p-end .end-text{transform:none}
.end-q{font-family:var(--title);font-size:clamp(1.9rem,3.2vw,3rem);line-height:1.3;color:var(--hanji)}
.end-q span{white-space:nowrap}
/* 안내 */
.hall-hint{position:absolute;right:var(--gut);bottom:calc(max(30px,4.6svh) + 46px);text-align:right;font-size:15px;color:var(--hanji2);pointer-events:none;transition:opacity .6s;white-space:nowrap}
.hall-hint i{display:block;width:1px;height:42px;margin:12px 0 0 auto;background:linear-gradient(var(--candle),transparent);animation:hall-drip 2.6s ease-in-out infinite}
@keyframes hall-drip{0%{transform:scaleY(0);transform-origin:top}50%{transform:scaleY(1);transform-origin:top}51%{transform-origin:bottom}100%{transform:scaleY(0);transform-origin:bottom}}
.hall.p-moved .hall-hint{opacity:0}
.hall-skip{position:absolute;right:var(--gut);bottom:max(30px,4.6svh);font-size:15px;color:var(--hanji2);text-decoration:none;border-bottom:1px solid rgba(238,231,218,.35);padding:10px 0 4px;transition:opacity .5s,color .2s}
.hall-skip:hover{color:var(--hanji)}
.hall.p-late .hall-skip,.hall.p-late .hall-hint{opacity:0;pointer-events:none}
/* 머리 줄: 법당 안에서는 투명하게 */
.nav.in-hall{background:rgba(7,8,13,.5)!important;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);box-shadow:none!important}

/* 넓은 화면: 현판은 왼쪽 위, 글은 왼쪽 아래 */
@media (min-width:1100px){
  .hall-intro{bottom:max(56px,7svh)}
  .hyeonpan{top:112px}
  .end-text{left:calc(var(--gut) + 150px);bottom:max(56px,7svh)}
  .tails{height:110px}
}
@media (min-width:1200px){
  .hall-intro{left:150px}
  .hyeonpan{left:56px}
}
/* 중간 폭 */
@media (min-width:701px) and (max-width:1099px){
  .hyeonpan{top:100px}
  .end-text{left:calc(var(--gut) + 128px)}
  .hall .actions{display:none}
  .hall-intro,.end-text{bottom:96px}
  .hall-skip{bottom:100px}
  .hall-hint{display:none}
}
/* 휴대폰: 아래 고정 줄(전화·비용·톡톡) 위로 */
@media (max-width:700px){
  .hall{height:340vh}
  .hall-intro{bottom:86px}
  .hall-eyebrow{font-size:13px;letter-spacing:.08em}
  .hall .lede{font-size:min(2rem,8.4vw);margin-top:12px}
  .hall .facts{gap:2px 12px;font-size:15px;margin-top:12px}
  .hall .facts span+span::before{content:none}
  .hall .actions{display:none}
  .hall-line{font-size:19px;padding:0 20px}
  .hyeonpan{top:84px;left:var(--gut)}
  .name{padding:16px 8px}
  .name-t{font-size:2.3rem}
  .name-s{display:none}
  .tails{height:52px;padding:0 6px}
  .end-text{bottom:86px}
  .end-q{font-size:min(1.85rem,7.6vw)}
  .end-q span{display:block}
  .hall-hint{display:none}
  .hall-skip{right:var(--gut);bottom:auto;top:84px;font-size:14px}
}
@media (max-width:380px){ .hall .lede{font-size:7.9vw} }
/* 3D가 없을 때(움직임 줄이기·WebGL 불가): 한 화면짜리 정지 사진 + 도착 화면 */
.hall-static .hall{height:auto}
.hall-static .hall-stage{position:relative;height:100vh;height:100svh;min-height:560px}
.hall-static .hall-gl,.hall-static .hall-intro,.hall-static .hall-line,.hall-static .hall-hint,.hall-static .hall-skip,.hall-static .hall-load,.hall-static .hall-still{display:none}
.hall-static .hall-still-end{display:block}
.hall-static .hall-end{opacity:1;visibility:visible}
.hall-static .hyeonpan{clip-path:none}
.hall-static .end-text{transform:none}
.hall-static .hall-stage::after{opacity:1;height:8%}
@media (prefers-reduced-motion:reduce){
  .hall-hint i{animation:none}
  .hyeonpan,.end-text,.hall-intro,.hall-line,.hall-end{transition:none}
}
/* 3D를 도중에 멈춘 경우(느린 기기·로딩 실패): 스크롤은 그대로, 사진만 */
.hall-nogl .hall-gl,.hall-nogl .hall-load{display:none}
.hall-nogl .hall.p-end .hall-still-end{display:block}

/* 왼쪽 장면 표시: 어두운 장면에서도 글자가 보이게 */
@media (min-width:1200px){ .rail a{color:var(--hanji)} .rail a:not(.on) span{opacity:.8} }

/* 靑 장면 윗변을 촛불 장면 위로 부드럽게 겹침(딱 잘린 경계 대신) */
.hall-stage::after{height:30%;background:linear-gradient(to top,#1D3566 0%,#1D3566 10%,rgba(29,53,102,.7) 45%,rgba(29,53,102,0));transition:opacity .45s ease}
.hall.p-out .hall-stage::after{opacity:1}
/* 왼쪽 장면 표시 글자: 어떤 바탕에서도 보이게 */
@media (min-width:1200px){ .rail a{text-shadow:0 0 8px rgba(0,0,0,.85),0 0 2px rgba(0,0,0,.9)} .rail.light a{text-shadow:0 0 8px rgba(255,255,255,.8),0 0 2px rgba(255,255,255,.9)} }
/* 끝 장면: 글 뒤 앞쪽 촛불이 어지럽지 않게 아래를 더 눌러 줌 */
.hall-shade{transition:opacity .8s}
.hall.p-end .hall-shade{background:linear-gradient(to top,rgba(7,8,13,.94) 0%,rgba(7,8,13,.78) 30%,rgba(7,8,13,0) 58%),linear-gradient(to bottom,rgba(7,8,13,.55),rgba(7,8,13,0) 18%)}
/* 머리 줄은 본문에서 거의 불투명하게, 왼쪽 장면 표시는 어두운 판 위에(어떤 바탕에서도 읽힘) */
.nav.scrolled:not(.in-hall){background:rgba(19,17,15,.985)}
@media (min-width:1200px){
  .rail{background:rgba(12,11,10,.72);padding:14px 14px 14px 10px;border-radius:2px;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
  .rail a,.rail.light a{color:var(--hanji);text-shadow:none}
}
