/* ═══════════════════════════════════════════════════════════════
   호랭이 곳간 · 첫 화면 대문(인트로) — hero-intro.css  v3.0 (2026.10.05)
   순서: 한지 베이지 배경 + 수묵 산수(카메라 전진·좌우 흐름) → 호랑이(우) → 음식(좌 · 크게, 마스크 확산) → 워딩 → (워딩 사라지고 그 자리에) 로고 → 히어로로 열림
   · 총 7.6초, 화면 클릭 / 건너뛰기 / 스페이스·Esc 로 즉시 종료
   · 새로고침마다 재생 (세션당 1회 여부는 hero-intro.inc.php $TH_INTRO_ONCE) · 관리자 로그인 · ?ok=1 이면 생략
   · 워딩 2줄과 로고는 화면 위쪽(PC 12vh / 모바일 12vh)에 고정 — 음식·호랑이 그림과 겹치지 않게 (파일 아래쪽 60·61·62 블록이 최종값)
   · 로고는 인라인 svg: '호'의 ㅗ 꼬리 내리치기 + 랭·이·곳·간 튀어오름 (㊾·53·55·63·64 블록)
   · 붓터치 밑줄(.in-rule)은 숨김 (62 블록)
   · prefers-reduced-motion: 완성 장면을 1.2초 보여준 뒤 열림
   · 테마 CSS 맨 아래에 붙이고, index.php <body> 바로 뒤에 #thIntro 마크업, theme.js 끝에 스크립트
   ═══════════════════════════════════════════════════════════════ */
:root{
  --in-bg:#FFEEDC; --in-bg2:#F6E4CF; --in-ink:#1A1714; --in-ink2:#5B554D; --in-red:#A8321F;
  --in-ease:cubic-bezier(.16,1,.3,1);
}
#thIntro{position:fixed; inset:0; z-index:2147483000; overflow:hidden; background:var(--in-bg);   /* 팝업레이어(#hd_pop)·헤더 등 어떤 레이어보다 위 */
  color:var(--in-ink); font-family:Pretendard,"Noto Sans KR","Apple SD Gothic Neo","Malgun Gothic",sans-serif;
  -webkit-font-smoothing:antialiased; cursor:pointer;
  transition:opacity .9s var(--in-ease), transform 1.1s var(--in-ease)}
#thIntro.is-done{opacity:0; transform:translateY(-6%); pointer-events:none}
#thIntro.is-hidden{display:none}
body.th-intro-lock{overflow:hidden}
/* 대문이 재생되는 동안 그누보드 팝업레이어는 숨겼다가, 대문이 열린 뒤에 보여줍니다 */
body.th-intro-lock #hd_pop, body.th-intro-lock .hd_pops, html.th-intro-on #hd_pop, html.th-intro-on .hd_pops, html.th-intro-on [id^="hd_pop"]{
  visibility:hidden !important; opacity:0 !important; pointer-events:none !important}

/* 배경 — 베이지(#FFEEDC) 위에 한지 결(multiply) + 중앙 빛 */
#thIntro .in-bg{position:absolute; inset:0;
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(255,252,246,.75) 0%, rgba(255,238,220,0) 62%),
    linear-gradient(180deg, var(--in-bg) 0%, var(--in-bg2) 100%)}
#thIntro .in-bg::after{content:""; position:absolute; inset:0; opacity:.9; mix-blend-mode:multiply;
  background:url("../img/intro-paper.jpg") center/cover no-repeat}

/* 수묵 산수 — 카메라가 7초 동안 천천히 다가갑니다(1 → 1.14배, 우하단 기준이라 가까운 산의 오른쪽·아래 끝은 고정).
   · near(제일 진한 산) : 화면 우하단에 그림 끝을 딱 맞춰 산의 형태가 온전히 보이게 — 움직임은 카메라 줌만
   · mid (중간 산)      : 왼쪽 끝에 그림의 왼쪽 라인을 맞추고, 먼 산과 가까운 산 사이 높이에 — 살짝 왼쪽·아래로 흐름
   · far (제일 옅은 산) : 호랑이 뒤 오른쪽 끝, 천천히 왼쪽으로 흐름 (먼 산일수록 덜 움직여 깊이감) */
#thIntro .in-land{position:absolute; inset:0; z-index:0; overflow:hidden; pointer-events:none;
  opacity:0; transform-origin:100% 100%; will-change:transform, opacity;
  animation:inCam 7.2s cubic-bezier(.22,.08,.2,1) forwards, inLandIn 1.6s ease-out forwards}
#thIntro .mt{position:absolute; display:block; will-change:transform}
#thIntro .mt.far {right:-3%; bottom:26%; width:46%; opacity:.9; animation:inFar 7.2s ease-in-out forwards}
#thIntro .mt.mid {left:0; bottom:15%; width:50%; opacity:.95; animation:inMid 7.2s ease-in-out forwards}   /* 왼쪽 끝에 맞춰 · 먼 산과 가까운 산 사이 높이 */
#thIntro .mt.near{right:0; bottom:0; width:96%}
/* 먼 산·중간 산은 가장자리가 직선으로 끊기지 않게 타원 마스크로 번지듯 */
#thIntro .mt.far{
  -webkit-mask:radial-gradient(ellipse 62% 78% at 50% 72%, #000 48%, rgba(0,0,0,0) 100%);
          mask:radial-gradient(ellipse 62% 78% at 50% 72%, #000 48%, rgba(0,0,0,0) 100%)}
#thIntro .mt.mid{   /* 왼쪽 라인은 살리고 오른쪽·아래만 번지듯 */
  -webkit-mask:linear-gradient(90deg, #000 0%, #000 62%, rgba(0,0,0,0) 100%), linear-gradient(180deg, #000 0%, #000 70%, rgba(0,0,0,0) 100%);
          mask:linear-gradient(90deg, #000 0%, #000 62%, rgba(0,0,0,0) 100%), linear-gradient(180deg, #000 0%, #000 70%, rgba(0,0,0,0) 100%);
  -webkit-mask-composite:source-in; mask-composite:intersect}
#thIntro .mt.near{
  -webkit-mask:linear-gradient(90deg, rgba(0,0,0,0) 0%, #000 10%, #000 100%);
          mask:linear-gradient(90deg, rgba(0,0,0,0) 0%, #000 10%, #000 100%)}
@keyframes inLandIn{to{opacity:1}}
@keyframes inCam{0%{transform:scale(1)} 55%{transform:scale(1.085)} 100%{transform:scale(1.14)}}
@keyframes inFar {0%{transform:translate3d(2.2%,0,0)}   100%{transform:translate3d(-2.4%,.6%,0)}}
@keyframes inMid {0%{transform:translate3d(0,0,0)}  100%{transform:translate3d(-1.6%,1.2%,0)}}   /* 왼쪽 라인이 빈틈 없이 유지되도록 왼쪽·아래로만 */
/* 산 위로 글이 올라가므로, 워딩 단계에서 산을 살짝 물러나게 */
#thIntro .in-land{transition:opacity .8s ease}
#thIntro.s3 .in-land{opacity:.78 !important}
#thIntro.s4 .in-land{opacity:.7 !important}

/* 무대 — 1280 기준 3열: 호랑이(좌) · 글/로고(중) · 곰탕(우) */
#thIntro .in-stage{position:absolute; inset:0; display:grid; place-items:center}
#thIntro .in-wrap{position:relative; width:min(1180px, 92vw); height:min(78vh, 760px)}

/* 1. 호랑이 — 오른쪽에 작게, 먹이 번지듯 아래에서 위로 드러남 */
#thIntro .in-tiger{position:absolute; right:-2%; bottom:0; height:78%; width:auto; z-index:1;
  opacity:0; transform:translateY(24px) scale(.98); transform-origin:50% 100%;
  clip-path:inset(100% 0 0 0);
  transition:opacity .5s ease, transform 1.4s var(--in-ease), clip-path 1.5s var(--in-ease)}
#thIntro.s1 .in-tiger{opacity:.92; transform:none; clip-path:inset(0 0 0 0)}
#thIntro.s2 .in-tiger, #thIntro.s3 .in-tiger, #thIntro.s4 .in-tiger{clip-path:none}
#thIntro.s2 .in-tiger{opacity:.6; transform:translateX(3%) scale(.95)}
#thIntro.s3 .in-tiger{opacity:.18; transform:translateX(10%) scale(.9)}

/* 2. 음식(본질) — 왼쪽에 호랑이보다 크게. 중심에서 원이 번지듯(clip-path) + 가장자리 마스크로 부드럽게 */
#thIntro .in-food{position:absolute; left:-12%; bottom:-4%; width:82%; aspect-ratio:1200/819; z-index:2;   /* 1.5배 */
  opacity:0; transform:translateY(16px) scale(1.03);
  -webkit-mask:radial-gradient(ellipse 60% 62% at 50% 54%, #000 62%, rgba(0,0,0,0) 100%);
          mask:radial-gradient(ellipse 60% 62% at 50% 54%, #000 62%, rgba(0,0,0,0) 100%);
  clip-path:circle(0% at 50% 55%);
  transition:opacity .5s ease, transform 1.8s var(--in-ease), clip-path 2.3s cubic-bezier(.45,0,.2,1)}   /* 천천히 퍼짐 */
#thIntro .in-food img:first-child{width:100%; height:100%; object-fit:contain; display:block}
#thIntro.s2 .in-food{opacity:1; transform:none; clip-path:circle(75% at 50% 55%)}
#thIntro.s3 .in-food{opacity:.55; transform:translateX(-8%) scale(.94)}
#thIntro.s4 .in-food{opacity:.45}
#thIntro .in-steam{position:absolute; left:46%; top:8%; width:34%; opacity:0; pointer-events:none;
  transform:translateY(20px) scale(.9); transform-origin:50% 100%;
  transition:opacity 1.2s ease .9s, transform 3s ease-out .9s}
#thIntro.s2 .in-steam{opacity:.7; transform:translateY(-30px) scale(1.06)}
#thIntro.s3 .in-steam{opacity:.3}

/* 3. 워딩 — 한 줄씩 올라옴 (독도체). 위치·크기 최종값은 파일 아래 '61·62' 블록(화면 위쪽, 2줄) */
#thIntro .in-copy{position:absolute; left:0; right:0; top:50%; transform:translateY(-50%); z-index:3;
  text-align:center; pointer-events:none}
#thIntro .in-copy .ln{display:block; overflow:hidden}
#thIntro .in-copy .ln span{display:block; transform:translateY(110%); opacity:0;
  font-family:"East Sea Dokdo","Noto Serif KR",Pretendard,serif; font-weight:400; letter-spacing:0; line-height:1.3;   /* 독도체 (index.php 에 이미 로드) */
  font-size:clamp(44px, 6.6vw, 86px); text-shadow:0 2px 24px rgba(255,238,220,.9);
  transition:transform 1.1s var(--in-ease), opacity .8s ease}
#thIntro .in-copy .ln:nth-child(2) span{transition-delay:.14s}
#thIntro .in-copy .ln:nth-child(3) span{transition-delay:.28s}
#thIntro .in-copy em{font-style:normal; color:var(--in-red)}
#thIntro.s3 .in-copy .ln span{transform:none; opacity:1}
#thIntro .in-copy{transition:transform 1s var(--in-ease), opacity .7s ease}
#thIntro.s4 .in-copy{opacity:0; transform:translateY(calc(-50% - 26px))}   /* 워딩이 위로 사라지고 그 자리에 로고 */

/* 4. 로고 — 붓으로 쓸리듯 좌→우 드러남 */
#thIntro .in-logo{position:absolute; left:50%; top:50%; z-index:4; transform:translate(-50%,-50%);
  width:clamp(220px, 27vw, 360px);   /* 푸터와 같은 워드마크(호랑이 없는 logo.png) */ opacity:0; clip-path:inset(0 100% 0 0);
  transition:opacity .3s ease .55s, clip-path 1.3s var(--in-ease) .55s}   /* 워딩이 빠진 뒤 등장 */
#thIntro .in-logo img{width:100%; height:auto; display:block}
#thIntro.s4 .in-logo{opacity:1; clip-path:inset(-40% -6% -40% -6%)}   /* 2026.10.04 ㊿ 다 그려진 뒤엔 여유 있게 — 꼬리 모션이 잘리지 않게 */

/* 붓선 한 획 — 워딩 아래 (2026.10.04 '62' 블록에서 숨김 처리됨) */
/* 2026.10.04 ㊷ 밑줄을 붓터치 이미지(img/brush-rule.png)로 교체 · 워딩(.in-copy) 안 마지막 줄 바로 아래 · 좌→우 와이프 그대로 */
#thIntro .in-rule{display:block; margin:10px auto 0; width:min(420px, 54vw); height:26px; opacity:.92;
  background:url(../img/brush-rule.png) center/100% 100% no-repeat;
  clip-path:inset(0 100% 0 0); transition:clip-path 1s var(--in-ease) .35s}
#thIntro.s3 .in-rule{clip-path:inset(0 0 0 0)}
#thIntro.s4 .in-rule{opacity:0; transition:opacity .5s ease}

/* 건너뛰기 · 진행 점 */
#thIntro .in-skip{position:absolute; right:22px; bottom:22px; z-index:5; font:inherit; font-size:12.5px; font-weight:700;
  letter-spacing:.06em; color:var(--in-ink2); background:rgba(255,255,255,.55); border:1px solid rgba(26,23,20,.14);
  border-radius:999px; padding:9px 16px; cursor:pointer; backdrop-filter:blur(6px)}
#thIntro .in-skip:hover{color:var(--in-red); border-color:var(--in-red)}
#thIntro .in-dots{position:absolute; left:50%; bottom:26px; transform:translateX(-50%); display:flex; gap:7px; z-index:5}
#thIntro .in-dots i{width:6px; height:6px; border-radius:50%; background:rgba(26,23,20,.18); transition:background .3s, transform .3s}
#thIntro.s1 .in-dots i:nth-child(1), #thIntro.s2 .in-dots i:nth-child(2),
#thIntro.s3 .in-dots i:nth-child(3), #thIntro.s4 .in-dots i:nth-child(4){background:var(--in-red); transform:scale(1.35)}

/* 모바일 — 호랑이 위·왼쪽, 곰탕 아래·오른쪽, 글은 중앙 */
@media (max-width:760px){
  #thIntro .in-wrap{width:100vw; height:100dvh}
  #thIntro .mt.far {right:-10%; bottom:34%; width:95%}
  #thIntro .mt.mid {left:0; bottom:22%; width:95%}
  #thIntro .mt.near{right:0; bottom:0; width:150%}
  #thIntro .in-tiger{right:-6%; bottom:auto; top:4%; height:44%}
  #thIntro.s3 .in-tiger{opacity:.22}
  #thIntro .in-food{left:-24%; bottom:-6%; width:140%}
  #thIntro.s3 .in-food{opacity:.5; transform:translateY(6%) scale(.94)}
  #thIntro .in-steam{left:44%; top:6%; width:40%}
  #thIntro .in-copy .ln span{font-size:clamp(38px, 11vw, 50px); line-height:1.3}
  #thIntro .in-logo{transform:translate(-50%,-50%); width:210px}
  #thIntro .in-rule{margin-top:6px; width:min(300px, 64vw); height:20px}
  #thIntro .in-skip{right:14px; bottom:calc(14px + env(safe-area-inset-bottom))}
}
@media (prefers-reduced-motion:reduce){
  #thIntro, #thIntro *{transition-duration:.01ms !important; transition-delay:0s !important; animation-duration:.01ms !important}
  #thIntro .in-land{opacity:1}
}

/* 2026.10.04 ㊾·53·55 대문 워드마크 SVG — 로고가 왼쪽부터 드러나자마자(s4 + .8s) 꼬리를 크게 들었다가 '탁' 내리치는 등장 모션(1.6s, 1회)을 먼저 보여주고,
   그 뒤 5s 마다 작은 꼬리치기 반복 */
#thIntro .in-logo .lg{display:block; width:100%; height:auto; color:#1B1916; overflow:visible}
#thIntro .in-logo .lg-ho, #thIntro .in-logo .lg-tip{transform-box:view-box; animation-play-state:paused}
#thIntro .in-logo .lg-ho{transform-origin:58px 262px;  animation:inTailIn 1.6s cubic-bezier(.3,.7,.2,1) .8s 1 both, inTail 5s ease-in-out 3.2s infinite}
#thIntro .in-logo .lg-tip{transform-origin:185px 330px; animation:inTipIn 1.6s cubic-bezier(.3,.7,.2,1) .8s 1 both, inTip 5s ease-in-out 3.2s infinite}
#thIntro.s4 .in-logo .lg-ho, #thIntro.s4 .in-logo .lg-tip{animation-play-state:running}
/* 등장: 천천히 크게 들어 올려 잠깐 멈췄다가 → 빠르게 내리치고 → 두 번 튕기며 정지 */
@keyframes inTailIn{ 0%{transform:none} 30%,42%{transform:rotate(-11deg)} 54%{transform:rotate(2.5deg)} 68%{transform:rotate(-3deg)} 82%{transform:rotate(1deg)} 100%{transform:none} }
@keyframes inTipIn{  0%{transform:none} 30%,42%{transform:rotate(-42deg)} 54%{transform:rotate(7deg)}   68%{transform:rotate(-12deg)} 82%{transform:rotate(3deg)} 100%{transform:none} }
/* 반복: 작게 */
@keyframes inTail{ 0%{transform:none} 8%{transform:rotate(-7deg)} 14%{transform:rotate(1.5deg)} 20%{transform:rotate(-2deg)} 26%,100%{transform:none} }
@keyframes inTip{  0%{transform:none} 8%{transform:rotate(-26deg)} 14%{transform:rotate(4deg)} 20%{transform:rotate(-7deg)} 26%,100%{transform:none} }
@media (prefers-reduced-motion:reduce){ #thIntro .in-logo .lg-ho, #thIntro .in-logo .lg-tip{animation:none} }

/* 2026.10.04 60 워딩·로고를 무대(.in-wrap)가 아닌 화면 전체 기준으로 정확히 중앙에 — 모니터 크기/배율과 무관하게 세로·가로 중앙 */
#thIntro .in-copy{position:fixed; inset:0; top:0; transform:none; display:flex; flex-direction:column; justify-content:center; align-items:center; padding:0 6vw}
#thIntro.s4 .in-copy{opacity:0; transform:translateY(-26px)}
#thIntro .in-logo{position:fixed; left:50%; top:50%; transform:translate(-50%,-50%)}
@media (max-width:760px){ #thIntro .in-logo{transform:translate(-50%,-50%)} }

/* 2026.10.04 61 워딩 2줄 + 상단 배치 — 음식·호랑이 그림과 겹치지 않게 화면 위쪽(PC 12vh / 모바일 14vh)에서 시작, 로고도 같은 높이 */
#thIntro .in-copy{justify-content:flex-start; padding-top:12vh}
#thIntro .in-copy .ln span{font-size:clamp(38px, 5.2vw, 72px); line-height:1.32}
#thIntro .in-copy .ln:nth-child(2) span{transition-delay:.16s}
#thIntro .in-logo{top:auto; top:calc(12vh + 90px); transform:translate(-50%,0)}
#thIntro.s4 .in-copy{transform:translateY(-26px)}
@media (max-width:760px){
  #thIntro .in-copy{padding-top:14vh}
  #thIntro .in-copy .ln span{font-size:clamp(30px, 8.4vw, 42px); line-height:1.3}
  #thIntro .in-logo{top:calc(14vh + 60px); transform:translate(-50%,0); width:220px}
}

/* 2026.10.04 62 붓터치 밑줄 제거 · 모바일 워딩 크게 */
#thIntro .in-rule{display:none !important}
@media (max-width:760px){
  #thIntro .in-copy{padding:12vh 4vw 0}
  #thIntro .in-copy .ln span{font-size:clamp(38px, 11vw, 54px); line-height:1.28}
  #thIntro .in-logo{top:calc(12vh + 150px); width:250px}
}

/* 2026.10.04 63 꼬리 모션이 페이지 로드 직후 몰래 다 돌아버리던 버그 — animation 축약형이 play-state 를 running 으로 되돌려서. s4 전에는 확실히 멈춤 */
#thIntro:not(.s4) .in-logo .lg-ho, #thIntro:not(.s4) .in-logo .lg-tip{animation-play-state:paused !important}

/* 2026.10.04 64 꼬리가 내리치는 순간 "랭·이·곳·간"이 각자 다른 높이로 통 튀어올랐다 제자리 — 등장(1.6s, 54%에 내리침)과 반복(5s, 14%에 내리침) 둘 다 */
#thIntro .in-logo .lg-ch{transform-box:fill-box; transform-origin:50% 100%;
  animation:chIn 1.6s cubic-bezier(.3,.7,.2,1) .8s 1 both, chLoop 5s ease-in-out 3.2s infinite}
#thIntro .in-logo .lg-ch.c1{--h:-16px; --d:0s}
#thIntro .in-logo .lg-ch.c2{--h:-24px; --d:.05s}
#thIntro .in-logo .lg-ch.c3{--h:-12px; --d:.1s}
#thIntro .in-logo .lg-ch.c4{--h:-20px; --d:.15s}
#thIntro .in-logo .lg-ch.c2, #thIntro .in-logo .lg-ch.c3, #thIntro .in-logo .lg-ch.c4{animation-delay:calc(.8s + var(--d)), calc(3.2s + var(--d))}
#thIntro:not(.s4) .in-logo .lg-ch{animation-play-state:paused !important}
@keyframes chIn{  0%,54%{transform:none} 63%{transform:translateY(var(--h)) scaleY(1.04)} 72%{transform:translateY(0) scaleY(.97)} 78%{transform:translateY(calc(var(--h) * .3))} 86%,100%{transform:none} }
@keyframes chLoop{0%,14%{transform:none} 20%{transform:translateY(var(--h)) scaleY(1.04)} 26%{transform:translateY(0) scaleY(.97)} 30%{transform:translateY(calc(var(--h) * .3))} 36%,100%{transform:none} }
@media (prefers-reduced-motion:reduce){ #thIntro .in-logo .lg-ch{animation:none} }

/* 2026.10.06 70 모바일 워딩 — 13 mini(375px) 등에서 첫 줄 '아닌'이 넘어가 3줄 되던 것. 첫 줄 폭 ≈ 글자크기 × 8.5 이므로 9.4vw 로 줄이고 줄바꿈 금지 */
@media (max-width:760px){
  #thIntro .in-copy{padding-left:3vw; padding-right:3vw}
  #thIntro .in-copy .ln span{font-size:clamp(26px, 9.4vw, 50px); white-space:nowrap}
}
