/* 탁한밤 vol.01 — 디자인 시스템 */

/* ───── 토큰 ───── */
:root {
  /* Night palette — 먹색 + 따뜻한 야경 */
  --bg-deep:    #14100c;   /* 가장 깊은 먹색 */
  --bg-warm:    #1c1612;   /* 따뜻한 야경 */
  --bg-card:    #221b15;   /* 카드 위에 약간 들어올려진 어두움 */
  --ink:        #2a2520;

  /* Paper (한지) */
  --paper:      #f1e7d3;
  --paper-2:    #e8dcc4;
  --paper-3:    #d9cab1;

  /* Gold — 탁한 황금빛 술잔 */
  --gold:       #c9a675;
  --gold-soft:  #b08e5d;
  --gold-light: #e8c896;

  /* 본문 톤 */
  --cream:      #efe3c8;
  --cream-dim:  rgba(239, 227, 200, 0.62);
  --cream-mute: rgba(239, 227, 200, 0.40);
  --cream-line: rgba(239, 227, 200, 0.16);

  --accent-red: #a14336;  /* 단주색 / 도장 */

  /* Type */
  --font-kr-serif: 'Gowun Batang', 'Noto Serif KR', serif;
  --font-en-serif: 'Cormorant Garamond', 'EB Garamond', serif;
  --font-en-sans:  'Inter', system-ui, sans-serif;
  --font-num:      'Inter', 'Cormorant Garamond', serif;

  /* Layout */
  --device-w: 390px;
  --pad-x: 24px;
}

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

body {
  background: #0a0806;
  color: var(--cream);
  font-family: var(--font-kr-serif);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

/* ───── 모바일 캔버스 (디바이스 프레임 내부) ───── */
.takhanbam {
  position: relative;
  width: 100%;
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--cream);
  overflow-x: hidden;
  /* 한지 그레인 */
  isolation: isolate;
}

/* 한지 텍스처 — 모든 화면 위에 은은하게 */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9  0 0 0 0 0.8  0 0 0 0 0.6  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.grain-overlay.subtle { opacity: 0.10; mix-blend-mode: soft-light; }

/* 한지 텍스처 (개별 카드용) */
.hanji {
  position: relative;
  background:
    radial-gradient(120% 70% at 30% 20%, #f7eedc 0%, var(--paper) 55%, var(--paper-3) 120%),
    var(--paper);
}
.hanji::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.4  0 0 0 0 0.32  0 0 0 0 0.22  0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.55;
  border-radius: inherit;
}
.hanji::after {
  /* 한지 결 — 미세한 세로선 */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(90deg, transparent 0 11px, rgba(80,60,40,0.05) 11px 12px);
  border-radius: inherit;
  opacity: 0.6;
}

/* ───── 타입 ───── */
.kr-serif  { font-family: var(--font-kr-serif); }
.en-serif  { font-family: var(--font-en-serif); }
.en-sans   { font-family: var(--font-en-sans); }
.eyebrow {
  font-family: var(--font-en-sans);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}
.section-num {
  font-family: var(--font-en-sans);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--gold-soft);
  font-weight: 500;
}
.k-heading {
  font-family: var(--font-kr-serif);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--cream);
}
.k-sub {
  font-family: var(--font-kr-serif);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.8;
  color: var(--cream-dim);
}

/* ───── 섹션 공통 ───── */
.section {
  position: relative;
  padding: 64px var(--pad-x) 64px;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.section-head .rule {
  flex: 1;
  height: 1px;
  background: var(--cream-line);
}

/* divider with seal */
.seal-divider {
  display: flex;
  justify-content: center;
  padding: 22px 0;
}
.seal-divider .seal {
  font-family: var(--font-kr-serif);
  font-weight: 700;
  color: var(--paper);
  background: var(--accent-red);
  font-size: 12px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  letter-spacing: 0;
  box-shadow: 0 0 0 2px rgba(161,67,54,0.25);
}

/* ───── Glow / lighting ───── */
.lamp-glow {
  position: absolute;
  pointer-events: none;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,200,150,0.22) 0%, rgba(232,200,150,0.08) 30%, transparent 65%);
  filter: blur(20px);
}

/* ───── Reveal animation utility ───── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s ease, transform 1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }
.reveal.delay-4 { transition-delay: 0.32s; }
.reveal.delay-5 { transition-delay: 0.40s; }

/* draw-in horizontal rule */
.rule-draw {
  height: 1px;
  background: var(--cream-line);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.rule-draw.in { transform: scaleX(1); }

/* vertical section label */
.vlabel {
  position: absolute;
  left: 8px;
  top: 60px;
  writing-mode: vertical-rl;
  font-family: var(--font-en-sans);
  font-size: 9px;
  letter-spacing: 0.4em;
  color: var(--cream-mute);
  text-transform: uppercase;
}

/* badges/chips */
.chip {
  display: inline-flex; align-items: center;
  padding: 5px 10px;
  font-family: var(--font-kr-serif);
  font-size: 11px;
  border: 1px solid var(--cream-line);
  border-radius: 999px;
  color: var(--cream-dim);
  background: transparent;
  letter-spacing: -0.005em;
}
.chip.gold { color: var(--gold-light); border-color: rgba(201,166,117,0.42); }
.chip.solid {
  background: rgba(201,166,117,0.10);
  border-color: rgba(201,166,117,0.32);
  color: var(--gold-light);
}

/* small bar */
.bar-track {
  position: relative;
  height: 3px;
  background: rgba(239,227,200,0.10);
  border-radius: 2px;
  overflow: hidden;
}
.bar-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-soft), var(--gold-light));
  border-radius: 2px;
  transition: width 1.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* link-ish */
.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-en-sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
}

/* paper card */
.paper-card {
  position: relative;
  border-radius: 2px;
  color: var(--ink);
  box-shadow:
    0 1px 0 rgba(0,0,0,0.4),
    0 30px 40px -20px rgba(0,0,0,0.6),
    0 60px 80px -40px rgba(0,0,0,0.7);
}

/* polaroid */
.polaroid {
  background: var(--paper);
  padding: 10px 10px 38px;
  box-shadow: 0 20px 30px -16px rgba(0,0,0,0.6), 0 1px 0 rgba(0,0,0,0.4);
  border-radius: 1px;
}
.polaroid image-slot {
  display: block;
  width: 100%;
}
.polaroid-cap {
  font-family: var(--font-kr-serif);
  font-size: 11px;
  color: var(--ink);
  opacity: 0.7;
  text-align: center;
  padding-top: 10px;
}

/* scroll cue */
@keyframes scrollCue {
  0% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(6px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0.6; }
}
.scroll-cue {
  animation: scrollCue 2.4s ease-in-out infinite;
}

/* glowing dot */
.lantern {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 14px 4px rgba(232,200,150,0.45);
}

/* scrollbar — invisible */
.takhanbam ::-webkit-scrollbar { width: 0; height: 0; }
