/* 디지털 방콕 인사이트 — 개념 은하
   콘셉트: 방콕의 밤하늘 위에 떠 있는 책의 한 쪽.
   우주는 어둡고 조용하게, 책(패널)은 종이의 물성으로. */

:root {
  --space: #070a14;
  --space-bg:
    radial-gradient(135% 95% at 50% 46%, rgba(72,47,20,0.24) 0%, rgba(20,14,26,0) 40%),
    radial-gradient(85% 75% at 15% 18%, rgba(28,54,88,0.34) 0%, rgba(10,14,26,0) 56%),
    radial-gradient(88% 82% at 87% 84%, rgba(80,26,68,0.24) 0%, rgba(10,10,22,0) 56%),
    radial-gradient(120% 120% at 50% 50%, rgba(3,4,10,0) 54%, rgba(1,1,4,0.92) 100%),
    linear-gradient(178deg, #0a0c1a 0%, #070814 52%, #040409 100%);
  --space-2: #0d1526;
  --paper: #f7f1e3;
  --paper-2: #efe5ce;
  --ink: #2b2318;
  --ink-soft: #6b5f4e;
  --gold: #e8a33d;
  --gold-2: #f5c97b;
  --line: #d8c9a8;
  --white-dim: rgba(235, 240, 255, 0.72);
  --white-faint: rgba(235, 240, 255, 0.38);
  /* 활자는 두 세계로 나뉜다.
     우주(어둠) = 고딕. 표지와 앱 크롬의 목소리.
     종이(패널) = 명조. 책 본문의 목소리.
     한국 책이 실제로 쓰는 문법이다. 표지와 제목은 고딕, 본문은 명조. */
  --display: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", system-ui, sans-serif;
  --sans: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --book: "Hahmlet", "Apple SD Gothic Neo", serif;
  --panel-w: 424px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: #05060d; }
html, body { height: 100%; }

body {
  background: var(--space-bg) fixed;
  color: var(--white-dim);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#stage { position: fixed; inset: 0; display: block; }

/* 성운 위 미세 그레인: 어두운 그라디언트의 밴딩을 없애고 필름 질감을 준다 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='130' height='130'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 130px 130px;
  opacity: 0.05;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
/* 금색은 책 자신을 가리킬 때만 쓴다(태양, 책 쪽 표시, 책의 인용, 읽은 별).
   조작 장치는 금색을 쓰지 않는다. 그래야 금색이 보일 때 뜻이 생긴다. */
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid #f2ecdd;
  outline-offset: 2px;
  border-radius: 4px;
}
/* 종이 위에서는 종이색 링이 보이지 않는다. 잉크색으로 뒤집는다 */
#panel button:focus-visible, #panel a:focus-visible, #panel input:focus-visible {
  outline-color: var(--ink);
}

/* ── 상단 바 ─────────────────────────── */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 0;
  z-index: 30;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

/* 브랜드는 누를 것이 없다. 링이 커지면 그 아래 별을 가리므로 클릭을 통과시킨다 */
.brand { display: flex; align-items: center; gap: 8px; pointer-events: none; }

/* 로고 뒤에서 고리가 퍼진다. 별의 펄스와 같은 문법이라, 브랜드도 하나의 광원으로 읽힌다 */
.brand-mark {
  position: relative;
  display: inline-flex;
  flex: none;
  width: 22px; height: 22px;
}
.brand-logo { width: 100%; height: 100%; position: relative; z-index: 1; }
.brand-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(242, 236, 221, 0.7);
  animation: brandpulse 3.4s cubic-bezier(0.2, 0.7, 0.3, 1) infinite;
}
.brand-pulse:nth-child(2) { animation-delay: 1.7s; }
@keyframes brandpulse {
  0%   { transform: scale(1);    opacity: 0.5; }
  70%  { opacity: 0; }
  100% { transform: scale(2.7);  opacity: 0; }
}
.brand-name {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #f2ecdd;
  white-space: nowrap;
}

/* ── 왼쪽 레일 (제목 + 범례) ───────────── */

.rail {
  position: fixed;
  top: 0; left: 0;
  z-index: 25;
  width: min(420px, 38vw);
  max-height: 100vh;
  padding: 78px 24px 20px; /* 위는 헤더 브랜드 자리를 비운다 */
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  scrollbar-width: none;
  /* 배경을 깔지 않는다. 가독성은 글자 자체의 그림자로만 만든다 */
  pointer-events: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { pointer-events: auto; }

.rail-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(38px, 4.8vw, 62px);
  line-height: 0.96; /* 2행이 하나의 덩어리로 붙게 */
  letter-spacing: -0.032em;
  word-break: keep-all; /* br이 지워져도 어절 중간에서 끊지 않게 */
  color: #f7f2e6;
  text-shadow: 0 2px 24px rgba(5, 6, 13, 0.6);
  margin-top: 4px;
}
.rail-dot { color: var(--gold); }

.rail-lead {
  font-size: 14px;
  line-height: 1.55;
  color: var(--white-dim);
  word-break: keep-all;
}
.rail-lead b { color: #f2ecdd; font-weight: 700; }

/* ── 범례 (왼쪽 아래) ─────────────────── */

.legend-box {
  position: fixed;
  left: 24px;
  bottom: 22px;
  z-index: 25;
  padding: 11px 12px 9px;
  border: 1px solid rgba(235, 240, 255, 0.14);
  border-radius: 14px;
  background: rgba(8, 10, 22, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.legend-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--white-faint);
  padding: 0 6px 7px;
}

.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(235, 240, 255, 0.22);
  color: var(--white-dim);
  font-size: 13px;
  letter-spacing: 0.02em;
  background: rgba(13, 21, 38, 0.6);
  backdrop-filter: blur(8px);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.pill:hover { border-color: rgba(235, 240, 255, 0.5); color: #f2ecdd; }
.pill[aria-pressed="true"] { background: rgba(235, 240, 255, 0.14); border-color: rgba(235, 240, 255, 0.55); color: #f7f2e6; }
.pill.quiet { border-color: rgba(235, 240, 255, 0.18); color: var(--white-faint); }
.pill.quiet:hover { color: var(--white-dim); }
.pill.icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; }

/* 검색 */
.search { position: relative; }
.search input {
  width: 220px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(235, 240, 255, 0.16);
  background: rgba(13, 21, 38, 0.66);
  backdrop-filter: blur(8px);
  color: #f2ecdd;
  font: inherit;
  font-size: 13px;
}
.search input::placeholder { color: var(--white-faint); }
#search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 300px;
  max-height: 320px;
  overflow-y: auto;
  list-style: none;
  background: rgba(13, 21, 38, 0.94);
  border: 1px solid rgba(235, 240, 255, 0.18);
  border-radius: 12px;
  padding: 6px;
  backdrop-filter: blur(12px);
}
#search-results li { border-radius: 8px; }
#search-results .sr-hint {
  padding: 8px 10px 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--white-faint);
}
#search-results button {
  display: flex;
  width: 100%;
  gap: 8px;
  align-items: baseline;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--white-dim);
}
#search-results li.active button, #search-results button:hover { background: rgba(235, 240, 255, 0.11); color: #f2ecdd; }
#search-results .sr-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; transform: translateY(-1px); }
#search-results .sr-type { margin-left: auto; font-size: 11px; color: var(--white-faint); }

/* ── 범례(은하팔 필터) ────────────────── */

/* 박스와 라벨은 .legend-box가 담당한다. */
#legend {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.legend-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--white-dim);
  border: 1px solid transparent;
  transition: opacity 0.15s, border-color 0.15s, background-color 0.15s;
}
.legend-chip .dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.legend-chip:hover { border-color: rgba(235, 240, 255, 0.2); background: rgba(235, 240, 255, 0.05); }
.legend-chip[aria-pressed="false"] { opacity: 0.32; }
.legend-chip .cnt { color: var(--white-faint); font-size: 11px; }

#progress {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 25;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--white-faint);
}
#progress b { color: var(--gold-2); font-weight: 600; }

/* ── 패널: 우주에 떠 있는 책의 한 쪽 ───── */

#panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: var(--panel-w);
  max-width: 92vw;
  z-index: 40;
  background:
    linear-gradient(90deg, rgba(43, 35, 24, 0.10), rgba(43, 35, 24, 0) 14px),
    repeating-linear-gradient(0deg, rgba(43, 35, 24, 0.015) 0 2px, transparent 2px 4px),
    var(--paper);
  color: var(--ink);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.55);
  transform: translateX(102%);
  transition: transform 0.38s cubic-bezier(0.22, 0.9, 0.3, 1);
  display: flex;
  flex-direction: column;
}
#panel.open { transform: translateX(0); }

.panel-close {
  position: absolute;
  top: 10px; right: 12px;
  width: 34px; height: 34px;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft);
  z-index: 2;
  border-radius: 50%;
}
.panel-close:hover { color: var(--ink); background: rgba(43, 35, 24, 0.06); }

.sheet-grip { display: none; }

.panel-scroll {
  overflow-y: auto;
  height: 100%;
  padding: 30px 30px 26px;
  overscroll-behavior: contain;
}

.doc-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.doc-eyebrow .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

.doc-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: 27px;
  line-height: 1.25;
  margin: 10px 0 2px;
  color: #211a10;
}
.doc-sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.doc-sub .type-badge {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-right: 6px;
  color: var(--ink-soft);
  vertical-align: 1px;
}

.doc-rule { border: 0; border-top: 2px solid var(--gold); width: 44px; margin: 14px 0 16px; }

/* 인용은 책에서 그대로 옮겨 온 문장이다. 본문보다 한 급 크게, 같은 책 활자로 */
.doc-quote {
  font-family: var(--book);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.85;
  color: #4a3d2a;
  border-left: 3px solid var(--gold);
  padding: 2px 0 2px 14px;
  margin: 0 0 20px;
}
.doc-quote cite {
  display: block;
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  font-style: normal;
  margin-top: 8px;
}

/* 종이 위의 본문은 책 활자로 짠다. 줄 사이를 책만큼 벌린다 */
.doc-body { color: #372e20; }
.doc-body p {
  font-family: var(--book);
  font-weight: 400;
  font-size: 15.5px;
  line-height: 1.95;
  letter-spacing: -0.003em;
  margin-bottom: 15px;
}
.doc-body p strong, .doc-body strong { font-weight: 700; color: #211a10; }
.doc-body li { font-family: var(--book); font-size: 15px; line-height: 1.9; }
.doc-body ul { margin: 0 0 12px 18px; }
.doc-body li { margin-bottom: 4px; }
.doc-body blockquote {
  border-left: 3px solid var(--line);
  padding-left: 12px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.doc-related { margin-top: 20px; }
.doc-related h3, .doc-next h3 {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: #4a3d2a;
  background: rgba(255, 255, 255, 0.4);
  transition: border-color 0.15s, background 0.15s;
}
.chip:hover { border-color: #a89372; background: #fff; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.chip.visited::after { content: "·읽음"; font-size: 10px; color: var(--ink-soft); }

.doc-next { margin-top: 18px; }
.next-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  color: #211a10;
  transition: background 0.15s;
}
.next-btn:hover { background: #fff; border-color: #a89372; }
.next-btn .arrow { color: var(--ink-soft); font-size: 18px; }

.doc-foot {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.doc-foot .pageref { font-style: italic; }
.doc-foot .share-btn {
  font-size: 12px;
  color: #4a3d2a;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
}
.doc-foot .share-btn:hover { border-color: #a89372; }
.doc-foot a { color: #7a5a1f; }

/* ── 목록 보기 (3D 비의존 경로) ─────────── */

#list-view {
  position: fixed; inset: 0;
  z-index: 50;
  background: rgba(7, 10, 20, 0.9);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  padding: 76px 24px 40px;
}
.list-frame { max-width: 860px; margin: 0 auto; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.list-head h2 { font-family: var(--display); font-weight: 900; font-size: 24px; color: #f2ecdd; }
.list-part { margin-bottom: 26px; }
.list-part > h3 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  color: #f2ecdd;
  border-bottom: 1px solid rgba(235, 240, 255, 0.16);
  padding-bottom: 6px;
  margin-bottom: 4px;
}
.list-row {
  display: flex;
  width: 100%;
  align-items: baseline;
  gap: 10px;
  text-align: left;
  padding: 8px 8px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--white-dim);
}
.list-row:hover, .list-row:focus-visible { background: rgba(235, 240, 255, 0.07); color: #fff; }
.list-row .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; transform: translateY(-1px); }
.list-row .t { color: var(--white-faint); font-size: 12px; }
.list-row .imp { margin-left: auto; letter-spacing: 2px; color: rgba(232, 163, 61, 0.7); font-size: 10px; }
.list-row .seen { color: var(--white-faint); font-size: 11px; }

/* ── 투어 카드 ──────────────────────── */

#tour-card {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 45;
  width: min(520px, calc(100vw - 32px));
  background: rgba(13, 21, 38, 0.92);
  border: 1px solid rgba(235, 240, 255, 0.2);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  padding: 14px 18px;
}
.tour-meta { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.tour-meta .eyebrow { font-size: 11px; letter-spacing: 0.16em; color: var(--gold); }
#tour-step { font-size: 12px; color: var(--white-faint); }
#tour-intro { font-size: 13.5px; line-height: 1.7; color: var(--white-dim); margin-bottom: 10px; }
.tour-controls { display: flex; gap: 6px; }
.tour-controls .pill { font-size: 12px; padding: 5px 12px; }
.tour-controls #tour-exit { margin-left: auto; }

/* ── 로딩과 코치마크 ─────────────────── */

/* ── 별 라벨(CSS2D) ─────────────────── */

.star-label {
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  color: rgba(242, 236, 221, 0.85);
  text-shadow: 0 1px 6px rgba(7, 10, 20, 0.9);
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-14px);
}
.hover-label {
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  background: rgba(13, 21, 38, 0.85);
  border: 1px solid rgba(235, 240, 255, 0.28);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-20px);
}
#toast {
  position: fixed;
  left: 50%; bottom: 70px;
  transform: translateX(-50%);
  z-index: 90;
  background: rgba(13, 21, 38, 0.94);
  color: #f2ecdd;
  border: 1px solid rgba(235, 240, 255, 0.28);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
}

#debug {
  position: fixed;
  top: 70px; left: 24px;
  z-index: 90;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: #9fe89f;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 6px;
}

.noscript {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--space); color: var(--white-dim);
  padding: 40px; text-align: center;
}

/* ── 모바일: 패널은 바텀시트 ───────────── */

@media (max-width: 720px) {
  .topbar { padding: 14px 14px 0; }
  .search input { width: 150px; }
  #progress { right: 14px; bottom: 16px; }

  /* 컨트롤이 두 줄로 접혀도 브랜드는 첫 줄에 붙어 있게 한다 */
  .topbar { align-items: flex-start; }
  .brand { padding-top: 5px; }
  .brand-mark { width: 20px; height: 20px; }
  .brand-name { font-size: 10.5px; letter-spacing: 0.14em; }

  /* 레일은 화면 폭을 다 쓰되, 헤더와 겹치지 않게 위를 비운다 */
  .rail {
    width: 100%;
    padding: 84px 16px 18px;
    gap: 11px;
  }
  .rail-title { font-size: 34px; }
  .rail-lead { font-size: 13px; }

  .legend-box { left: 12px; bottom: 14px; transform-origin: bottom left; transform: scale(0.92); }
  /* 바텀시트가 올라오면 범례를 덮으므로 아예 비운다. 시트를 닫으면 돌아온다 */
  body:has(#panel.open) .legend-box { opacity: 0; pointer-events: none; }

  #panel {
    top: auto;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    max-width: none;
    height: 78vh;
    border-radius: 18px 18px 0 0;
    transform: translateY(105%);
    transition: transform 0.34s cubic-bezier(0.22, 0.9, 0.3, 1), height 0.25s;
  }
  #panel.open { transform: translateY(calc(100% - 190px)); } /* peek */
  #panel.open.full { transform: translateY(0); }
  .sheet-grip {
    display: flex;
    justify-content: center;
    padding: 10px 0 4px;
    touch-action: none;
    cursor: grab;
  }
  .sheet-grip span { width: 44px; height: 4px; border-radius: 2px; background: var(--line); }
  .panel-scroll { padding: 6px 22px 26px; }
  .doc-title { font-size: 23px; }
  #tour-card { bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-pulse { animation: none; opacity: 0.28; }
  #panel { transition: none; }
}

/* ── 표지에서 은하로 (인트로) ──────────────
   표지는 하프톤 망점으로 인쇄돼 있고, 은하는 점광원의 집합이다.
   그래서 전환은 페이드가 아니라 잉크가 떨어져 나와 별이 되는 것이다.
   색은 전부 표지에서 뽑았다. 새로 만든 색이 없다. */

#intro {
  --paper: #F5F1E8;
  --cobalt: #013C96;
  position: fixed;
  inset: 0;
  z-index: 300;
  transition: opacity 0.5s ease;
}
/* 지면. 한가운데에서 바깥으로 뚫리며 뒤의 은하를 드러낸다 */
.intro-paper {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--paper);
}
/* 끝나도 지우지 않는다. p=1이면 지면도 표지도 이미 없고, 되돌아올 수 있어야 한다. */
#intro.done { pointer-events: none; }
#intro.done .intro-scroll { pointer-events: none; }

.intro-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
  pointer-events: none;
  will-change: transform;
}

.cover {
  position: relative;
  height: min(56vh, 520px);
  aspect-ratio: 810 / 1200;
}
.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
/* 잉크가 지면을 벗어나 날아갈 수 있도록 화면 전체를 덮는다 */
#cover-dots {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
/* 종이가 바닥에서 살짝 떠 있다. 지워지기 시작하면 그림자도 함께 걷힌다. */
.cover img {
  object-fit: cover;
  box-shadow:
    0 1px 0 rgba(1, 60, 150, 0.14),
    0 34px 60px -26px rgba(1, 60, 150, 0.42);
  transition: box-shadow 0.4s ease;
}

.intro-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.intro-eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(1, 60, 150, 0.55);
}
.intro-line {
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--cobalt);
}
.intro-cue {
  max-width: 34ch;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(1, 60, 150, 0.5);
}
.intro-cue::after {
  content: "";
  width: 1px;
  height: 22px;
  background: linear-gradient(rgba(1, 60, 150, 0.45), rgba(1, 60, 150, 0));
  animation: cue-drop 2.4s ease-in-out infinite;
}
@keyframes cue-drop {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* 스크롤을 받는 층. 무대 위에 덮여 휠·터치·키보드를 모두 받는다 */
.intro-scroll {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.intro-scroll::-webkit-scrollbar { display: none; }
.intro-track { height: 280vh; }

.intro-skip {
  position: absolute;
  z-index: 4;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(1, 60, 150, 0.6);
  border: 1px solid rgba(1, 60, 150, 0.22);
  border-radius: 999px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.5);
  transition: color 0.15s, border-color 0.15s;
}
.intro-skip:hover { color: var(--cobalt); border-color: rgba(1, 60, 150, 0.5); }

/* 인트로 동안 앱 크롬은 숨는다 */
body.intro-on .topbar,
body.intro-on .rail,
body.intro-on .legend-box,
body.intro-on #progress { opacity: 0; }
body.intro-on .rail, body.intro-on .legend-box { pointer-events: none; }
.topbar, .rail, .legend-box, #progress { transition: opacity 0.6s ease; }

@media (max-width: 720px) {
  .cover { height: min(48vh, 420px); }
  .intro-stage { gap: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .intro-cue::after { animation: none; }
}
