/* ===== Fonts ===== */
@font-face {
  font-family: 'NanumMyeongjo';
  src: url('assets/fonts/NanumMyeongjo.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'NanumMyeongjoYet';
  src: url('assets/fonts/NanumMyeongjo-YetHangul.otf') format('opentype'),
       url('assets/fonts/NanumMyeongjo-YetHangul.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Kanibuk';
  src: url('assets/fonts/Kanibuk.TTF') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Wolin';
  src: url('assets/fonts/Wolin.ttf') format('truetype'),
       url('assets/fonts/Wolin.TTF') format('truetype');
  font-weight: 400;
  font-display: swap;
}

:root {
  --serif: 'NanumMyeongjo', 'Noto Serif KR', serif;
  --yet: 'NanumMyeongjoYet', 'NanumMyeongjo', serif;
  --sans: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --display: 'Kanibuk', serif;
  --wolin: 'Wolin', 'NanumMyeongjo', serif;

  /* Part 1: 고문서 */
  --paper: #e8dfcc;
  --paper-dark: #c9bea0;
  --ink: #1a1612;
  --seal: #8a2419;

  /* Part 2: SNS */
  --insta-bg: #fafafa;
  --insta-accent: #e4405f;

  /* Part 5~6: 어둠 */
  --dark: #0a0a0c;
  --dim: #14141a;

  /* Part 7: 푸른 강 */
  --river-deep: #0f2438;
  --river-mid: #1a3a54;
  --river-ink: #d4c896;
}

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

html, body {
  width: 100%;
  overflow-x: hidden;
  font-family: var(--serif);
  color: var(--ink);
  background: #000;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root { width: 100%; }

/* Full-viewport section default */
.page {
  width: 100vw;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Navigation UI */
.nav-dots {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 6px;
}
.nav-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.25;
  transition: opacity .3s, transform .3s;
  cursor: pointer;
  border: none;
  padding: 0;
}
.nav-dot:hover { opacity: 0.6; }
.nav-dot.active { opacity: 1; transform: scale(1.6); }

.page-counter {
  position: fixed;
  bottom: 24px;
  left: 32px;
  z-index: 100;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: currentColor;
  opacity: 0.5;
  mix-blend-mode: difference;
}

.next-hint {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: currentColor;
  opacity: 0.4;
  z-index: 10;
  pointer-events: none;
  animation: hintPulse 2.4s ease-in-out infinite;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.3; transform: translate(-50%, 0); }
  50% { opacity: 0.7; transform: translate(-50%, 6px); }
}

.next-btn {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.3em;
  padding: 14px 32px;
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  border-radius: 1px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity .3s, background .3s, color .3s;
  z-index: 10;
}
.next-btn:hover { opacity: 1; background: currentColor; color: var(--paper); }

/* Placeholder for missing assets */
.ph {
  background: repeating-linear-gradient(
    45deg,
    rgba(120,120,120,0.08),
    rgba(120,120,120,0.08) 8px,
    rgba(120,120,120,0.14) 8px,
    rgba(120,120,120,0.14) 16px
  );
  border: 1px solid rgba(120,120,120,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(120,120,120,0.7);
  text-transform: uppercase;
}

/* Utilities */
.fade-in { animation: fadeIn 1.2s ease forwards; opacity: 0; }
.fade-up { animation: fadeUp 1.2s ease forwards; opacity: 0; transform: translateY(20px); }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.center-col {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Page tonalities */
.tone-paper { background: var(--paper); color: var(--ink); }
.tone-paper-warm {
  background: radial-gradient(ellipse at center, #efe6d1 0%, #d4c6a3 100%);
  color: var(--ink);
}
.tone-insta { background: var(--insta-bg); color: #262626; }
.tone-dark { background: var(--dark); color: #e5e2d8; }
.tone-river {
  background: linear-gradient(180deg, #0f2438 0%, #1a3a54 50%, #0a1a2a 100%);
  color: var(--river-ink);
}

/* Scrollbar hide for horizontal */
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Paper noise overlay */
.paper-noise::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0 0.05 0 0 0 0.25 0'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='0.6'/></svg>");
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.35;
}
