/* 첫 화면 인트로(story.js). 인트로 동안 랜딩·머리 줄·하단 메뉴는 감추고 화면을 꽉 채운다. */

/* <head> 의 한 줄이 처음 온 사람에게 html.bts-on 을 붙인다 — 랜딩이 잠깐 비쳤다가 덮이지 않게 먼저 가린다.
   story.js 가 어떤 이유로 안 뜨면 4초 뒤 저절로 다시 보인다(안전장치). */
html.bts-on body > :not(.bts) { visibility: hidden; animation: bts-failsafe 0s 4s forwards; }
html.bts-on body { overflow: hidden; background: #070b12; }
@keyframes bts-failsafe { to { visibility: visible; } }

.bts {
  position: fixed; inset: 0; z-index: 2000; overflow: hidden;
  background: #070b12; color: #f3ecdc; cursor: pointer;
  font-family: "Noto Serif KR", "Nanum Myeongjo", serif;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .7s ease;
}
.bts.out { opacity: 0; pointer-events: none; }

/* 장면 그림 — 화면이 가로로 길면(가로 ≥ 세로) 가로판(w), 아니면 세로판(m). 폭이 아니라 비율로 고른다 —
   정사각형에 가까운 큰 화면에 가로판을 꽉 채우면 양옆이 잘려 부엉이(오른쪽 끝)가 나간다. 'pre'·'on'만 그림을 받는다. */
.bts-img {
  /* 세로판이 위아래로 잘려야 할 때(휴대폰보다 덜 긴 화면) 그림의 중심(부엉이·탁자·마을)이 있는 위쪽을 남긴다 */
  position: absolute; inset: 0; background: center 22% / cover no-repeat;
  opacity: 0; transform: scale(1.06); transition: opacity 1.4s ease, transform 9s ease-out;
}
.bts-img.on { opacity: 1; transform: scale(1); }
.bts-s1.pre, .bts-s1.on { background-image: url(/assets/story/s1-m.webp); }
.bts-s2.pre, .bts-s2.on { background-image: url(/assets/story/s2-m.webp); }
.bts-s3.pre, .bts-s3.on { background-image: url(/assets/story/s3-m.webp); }
.bts-s4.pre, .bts-s4.on { background-image: url(/assets/story/s4-m.webp); }
@media (min-aspect-ratio: 1/1) {
  .bts-img { background-position: center center; }
  .bts-s1.pre, .bts-s1.on { background-image: url(/assets/story/s1-w.webp); }
  .bts-s2.pre, .bts-s2.on { background-image: url(/assets/story/s2-w.webp); }
  .bts-s3.pre, .bts-s3.on { background-image: url(/assets/story/s3-w.webp); }
  .bts-s4.pre, .bts-s4.on { background-image: url(/assets/story/s4-w.webp); }
  /* 가로판이 잘려야 할 때(16:9 보다 덜 넓은 화면) 하늘 쪽을 버리고 오른쪽의 부엉이를 남긴다 */
  .bts-s4 { background-position: right center; }
}
/* 글자가 그림 위에서 읽히게 — 아래쪽을 밤색으로 눌러 준다 */
.bts-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(7,11,18,0) 35%, rgba(7,11,18,.55) 62%, rgba(7,11,18,.88) 100%);
}
.bts.gate .bts-shade { background: radial-gradient(120% 90% at 50% 45%, rgba(7,11,18,.35), rgba(7,11,18,.92)); }

.bts-skip {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; z-index: 3;
  padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(243,236,220,.28);
  background: rgba(7,11,18,.45); color: rgba(243,236,220,.85);
  font: 500 13px/1 "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.bts.gate .bts-skip { display: none; }

.bts-text {
  position: absolute; left: 0; right: 0; bottom: calc(12vh + env(safe-area-inset-bottom)); z-index: 2;
  padding: 0 28px; text-align: center; pointer-events: none;
}
.bts.gate .bts-text { bottom: auto; top: 50%; transform: translateY(-50%); }
/* 부엉이가 말할 때 — 가로판(부엉이가 오른쪽)일 땐 반대편 왼쪽에 글을 둔다. 그림 고르는 조건과 같게 */
@media (min-aspect-ratio: 1/1) and (min-width: 720px) {
  .bts.owl .bts-text { left: 8%; right: auto; bottom: auto; top: 50%; transform: translateY(-50%); max-width: 46%; text-align: left; padding: 0; }
}
.bts-line {
  margin: 0 0 6px; font-size: clamp(21px, 5.6vw, 32px); line-height: 1.55; font-weight: 500;
  letter-spacing: .01em; word-break: keep-all; text-shadow: 0 2px 18px rgba(0,0,0,.65);
  opacity: 0; transform: translateY(8px); animation: bts-in 1s ease forwards;
}
.bts.owl .bts-line { color: #f6e7bf; }
@keyframes bts-in { to { opacity: 1; transform: none; } }

.bts-brand { font-size: clamp(30px, 8vw, 44px); font-weight: 600; color: #fff7e2; margin-bottom: 22px; }
.bts-brand span {
  display: block; margin-top: 6px; font-family: "Cormorant Garamond", "Noto Serif KR", serif;
  font-size: 13px; letter-spacing: .34em; text-transform: uppercase; color: rgba(212,175,55,.9);
}
.bts-enter, .bts-go, .bts-look {
  pointer-events: auto; cursor: pointer; text-decoration: none;
  font: 600 16px/1 "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
.bts-enter {
  margin-top: 30px; padding: 15px 44px; border-radius: 999px;
  border: 1px solid rgba(227,196,111,.75); background: rgba(227,196,111,.12); color: #f3e2b0; letter-spacing: .12em;
}
.bts-enter:hover { background: rgba(227,196,111,.22); }
.bts-answers {
  display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 22px;
  opacity: 0; animation: bts-in 1s ease forwards;
}
@media (min-aspect-ratio: 1/1) and (min-width: 720px) { .bts.owl .bts-answers { align-items: flex-start; } }
.bts-go {
  display: inline-block; padding: 16px 30px; border-radius: 12px; color: #1b1408;
  background: linear-gradient(180deg, #ecd383, #d4af37 60%, #b08d2c); box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.bts-look { padding: 10px 16px; border: 0; background: none; color: rgba(243,236,220,.75); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  .bts-img { transition: opacity .6s ease; transform: none; }
  .bts-img.on { transform: none; }
  .bts-line, .bts-answers { animation-duration: .01s; }
}
