@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Noto+Serif+KR:wght@200;300;400&family=IBM+Plex+Mono:wght@300;400&display=swap');

:root {
  --text-primary: rgba(35, 25, 45, 0.85);
  --text-secondary: rgba(35, 25, 45, 0.5);
  --text-muted: rgba(35, 25, 45, 0.25);
  --accent-warm: rgba(255, 140, 100, 0.8);
}

/* Depth-specific palettes - distinct atmospheres per layer */
body.depth-1 {
  /* Surface - warm, bright, clear */
  --depth-overlay: rgba(255, 255, 255, 0);
  --depth-hue: 30;
  --depth-saturation: 1.0;
  --depth-brightness: 1.0;
  --depth-vignette-opacity: 0;
  --depth-tint: rgba(255, 245, 235, 0);
  --depth-tint-edge: rgba(255, 200, 170, 0.08);
}

body.depth-2 {
  /* Submerged - cool, aquatic, blue-green tint */
  --depth-overlay: rgba(35, 25, 45, 0.02);
  --depth-hue: 190;
  --depth-saturation: 0.92;
  --depth-brightness: 0.96;
  --depth-vignette-opacity: 0.12;
  --depth-tint: rgba(60, 100, 120, 0.06);
  --depth-tint-edge: rgba(40, 80, 110, 0.18);
}

body.depth-3 {
  /* Deep - dark, mysterious, purple vignette */
  --depth-overlay: rgba(35, 25, 45, 0.05);
  --depth-hue: 270;
  --depth-saturation: 0.8;
  --depth-brightness: 0.9;
  --depth-vignette-opacity: 0.28;
  --depth-tint: rgba(50, 40, 70, 0.1);
  --depth-tint-edge: rgba(35, 25, 55, 0.3);
}

body.depth-4 {
  /* Deeper - even darker */
  --depth-overlay: rgba(35, 25, 45, 0.1);
  --depth-hue: 280;
  --depth-saturation: 0.7;
  --depth-brightness: 0.85;
  --depth-vignette-opacity: 0.4;
  --depth-tint: rgba(45, 35, 65, 0.15);
  --depth-tint-edge: rgba(30, 20, 50, 0.4);
}

body.depth-5 {
  /* Abyss - darkest */
  --depth-overlay: rgba(35, 25, 45, 0.18);
  --depth-hue: 290;
  --depth-saturation: 0.5;
  --depth-brightness: 0.7;
  --depth-vignette-opacity: 0.6;
  --depth-tint: rgba(20, 15, 35, 0.25);
  --depth-tint-edge: rgba(15, 10, 30, 0.6);
}

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

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #e8e4df;
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  cursor: none;
  user-select: none;
}

#canvas-atmosphere {
  position: fixed;
  top: -50px;
  left: -50px;
  width: calc(100% + 100px);
  height: calc(100% + 100px);
  z-index: 0;
  will-change: transform;
  transition: opacity 0.8s ease;
  pointer-events: none;
  /* Blur is handled by low-res scaling now to save GPU */
  /* filter: blur(40px); */
}

/* Grain overlay for soft texture like watercolor paper */
#grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  will-change: transform;
  /* Use a static noise image instead of expensive SVG filter */
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAAGFBMVEUAAAAAAAACAgIHBwcDAwMGBgYFBQUAAAA1I78KAAAACHRSTlMAMwA1MzMzM7O0s14AAABSSURBVDjLpZMxCgAgDMN876/9gYMHdYyg4CDq/x9CKVVoC8YUkpI8Yx0A9d672WOvMcdYu495rTXX2ue819rnvf/e5/583/v/fR/7/30f+/99H/v/fR/7/30f+/99H6EAAAAASUVORK5CYII=");
}

/* Depth-specific overlay effects - using layered tints for smooth transitions */
#depth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Individual depth tint layers - fade in/out with transitions */
.depth-tint {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-out;
  pointer-events: none;
}

/* Depth 1 (Surface): Subtle warm edge tint */
.depth-tint-1 {
  background: radial-gradient(ellipse 150% 120% at 50% 50%, 
    transparent 60%, 
    rgba(255, 200, 170, 0.08) 100%);
}

/* Depth 2 (Submerged): Cool blue-green tint from edges */
.depth-tint-2 {
  background: radial-gradient(ellipse 140% 110% at 50% 50%, 
    rgba(60, 100, 120, 0.04) 0%,
    rgba(60, 100, 120, 0.06) 30%, 
    rgba(40, 80, 110, 0.18) 100%);
}

/* Depth 3 (Deep): Purple vignette */
.depth-tint-3 {
  background: radial-gradient(ellipse 130% 100% at 50% 50%, 
    rgba(50, 40, 70, 0.08) 0%,
    rgba(50, 40, 70, 0.12) 20%, 
    rgba(35, 25, 55, 0.32) 100%);
}

/* Show the appropriate tint based on depth class */
body.depth-1 .depth-tint-1 { opacity: 1; }
body.depth-2 .depth-tint-2 { opacity: 1; }
body.depth-3 .depth-tint-3 { opacity: 1; }
body.depth-4 .depth-tint-3 { opacity: 1; } /* Reuse depth 3 tint */

/* Abyss: INVERTED - darkness everywhere, light only from boat */
body.depth-5 #depth-overlay {
  background:
    radial-gradient(ellipse 25% 25% at var(--boat-x, 50%) var(--boat-y, 50%), transparent 0%, rgba(15, 10, 25, 0.3) 50%, rgba(15, 10, 25, 0.85) 100%);
  transition: background 0.3s ease;
}


body.depth-5 .landmark {
  opacity: 0.15 !important;
  filter: blur(2px) !important;
}

body.depth-5 .landmark-label {
  opacity: 0 !important;
}

body.depth-5 .contour {
  stroke: rgba(80, 60, 100, 0.15) !important;
}

body.depth-5 .notation {
  fill: rgba(120, 100, 150, 0.08) !important;
}

/* Glowing elements in abyss */
body.depth-5 .abyss-glow {
  filter: drop-shadow(0 0 8px rgba(180, 150, 220, 0.6));
  opacity: 0.9;
}

/* Abyss: Inverted cursor - light on dark */
body.depth-5 #cursor::before {
  background: rgba(200, 180, 220, 0.9);
}

body.depth-5 #cursor::after {
  border-color: rgba(180, 160, 200, 0.4);
}

body.depth-5 #cursor.hovering::after {
  border-color: rgba(200, 180, 220, 0.7);
}

/* Abyss: Inverted text colors */
body.depth-5 #info-corner {
  color: rgba(180, 160, 200, 0.5);
}

body.depth-5 #depth-indicator .depth-mark {
  background: rgba(140, 120, 170, 0.25);
}

body.depth-5 #depth-indicator .depth-mark.active {
  background: rgba(200, 180, 220, 0.8);
}

body.depth-5 #depth-indicator .depth-label {
  color: rgba(180, 160, 200, 0.6);
}

/* Abyss: Inverted landmark hover text (SVG uses fill, not color) */
body.depth-5 .landmark-label {
  fill: rgba(200, 180, 220, 0.6) !important;
}

body.depth-5 .landmark-group:hover .landmark-label {
  fill: rgba(200, 180, 220, 0.9) !important;
}

/* Abyss: Inverted location display (hover popup) */
body.depth-5 #location-display .korean {
  color: rgba(180, 160, 200, 0.7);
}

body.depth-5 #location-display .english {
  color: rgba(200, 180, 220, 0.9);
}

#canvas-water {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  mix-blend-mode: overlay;
  opacity: 0.3;
  pointer-events: none;
}

#svg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: auto;
}

/* Disable pointer events on decorative SVG elements */
#svg-layer>g:not(.landmark-group):not(#boat-layer) {
  pointer-events: none;
}

.landmark-group {
  pointer-events: auto;
  cursor: pointer;
  /* Smooth opacity transitions for depth changes */
  /* NOTE: Do NOT use CSS transform here - it overrides SVG transform attribute used for positioning */
  transition: opacity 0.6s ease-out, filter 0.6s ease-out;
}

.landmark-hitbox {
  pointer-events: all;
}

.landmark-group:hover .landmark-symbol {
  filter: brightness(0.7);
}

/* Clock animation - single slow hand */
.clock-minute-group {
  animation: clock-rotate 120s linear infinite;
}

@keyframes clock-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Projection beam animation */
.projection-beam {
  animation: projection-scan 3s ease-in-out infinite;
}

@keyframes projection-scan {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.landmark-group:hover .landmark-label {
  fill: rgba(42, 26, 8, 1);
}

/* Fading out state - CSS transition handles the animation */
.landmark-group.fading-out {
  opacity: 0;
  pointer-events: none;
}

/* Fully hidden state - applied after transition completes */
.landmark-group.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Fading in state - CSS transition handles the animation */
.landmark-group.fading-in {
  opacity: 1;
}

#cursor {
  position: fixed;
  width: 12px;
  height: 12px;
  pointer-events: none;
  z-index: 100;
  transform: translate(-50%, -50%);
}

#cursor::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: background 0.5s ease;
}

#cursor::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border: 1px solid var(--text-secondary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease, border-color 0.5s ease;
}


#cursor.hovering::after {
  transform: translate(-50%, -50%) scale(2);
  border-color: var(--text-primary);
}

#info-corner {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 10;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: lowercase;
}

/* ═══ Three Days UI ═══ */

#cycle-display {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  text-align: right;
  font-family: 'Cormorant Garamond', serif;
  /* Click handling for debug panel */
  pointer-events: auto;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background 0.2s ease;
  /* Explicit sizing to prevent expansion */
  width: fit-content;
  max-width: 100px;
}

#cycle-display:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ═══ Subtitle Bar — 4 display modes ═══ */
#subtitle-bar {
  position: fixed;
  bottom: 60px;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 20px;
}

/* ── Shared base ── */
.subtitle-item {
  padding: 10px 24px;
  color: #ffffff;
  border-radius: 2px;
  max-width: 700px;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.subtitle-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.subtitle-item.fading {
  opacity: 0;
  transform: translateY(-10px);
}

.subtitle-speaker {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.6);
  margin-right: 12px;
}

.subtitle-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

/* ── Mode 1: bare — no boxes, text floats on water ── */
#subtitle-bar.mode-bare .subtitle-item {
  background: none;
  text-shadow:
    0 0 12px rgba(0, 0, 0, 0.9),
    0 0 24px rgba(0, 0, 0, 0.6),
    0 1px 3px rgba(0, 0, 0, 0.8);
}

/* ── Mode 2: single — one line, cinema subtitle with box ── */
#subtitle-bar.mode-single .subtitle-item {
  background: rgba(0, 0, 0, 0.75);
}

/* ── Mode 3: pane — single shared translucent container ── */
#subtitle-bar.mode-pane {
  background: rgba(0, 0, 0, 0.7);
  border-radius: 3px;
  max-width: 740px;
  margin: 0 auto;
  padding: 12px 16px;
  gap: 4px;
}

#subtitle-bar.mode-pane .subtitle-item {
  background: none;
  padding: 6px 12px;
}

/* Pane background only visible when it has children */
#subtitle-bar.mode-pane:empty {
  background: none;
  padding: 0;
}

/* ── Mode 4: minimal — one line, no box, just text ── */
#subtitle-bar.mode-minimal .subtitle-item {
  background: none;
  text-shadow:
    0 0 12px rgba(0, 0, 0, 0.9),
    0 0 24px rgba(0, 0, 0, 0.6),
    0 1px 3px rgba(0, 0, 0, 0.8);
}

/* ── Mode 5: boxes — original stacked boxes ── */
#subtitle-bar.mode-boxes .subtitle-item {
  background: rgba(0, 0, 0, 0.8);
}

#subtitle-bar.mode-boxes .subtitle-item.stage-direction {
  background: rgba(0, 0, 0, 0.6);
}

#subtitle-bar.mode-boxes .subtitle-item.voice-deep {
  background: rgba(8, 12, 25, 0.85);
}

/* ── Stage directions (all modes) ── */
.subtitle-item.stage-direction .subtitle-text {
  font-style: italic;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
}

/* ── Character voices ── */
.subtitle-item.voice-fool .subtitle-text {
  font-size: 16px;
  letter-spacing: 0.02em;
}

.subtitle-item.voice-fool .subtitle-speaker {
  color: rgba(150, 200, 170, 0.8);
}

.subtitle-item.voice-theorizer .subtitle-text {
  font-size: 15px;
  line-height: 1.4;
}

.subtitle-item.voice-theorizer .subtitle-speaker {
  color: rgba(180, 150, 200, 0.8);
}

.subtitle-item.voice-sublimator .subtitle-text {
  font-style: italic;
  font-size: 16px;
  line-height: 1.6;
}

.subtitle-item.voice-sublimator .subtitle-speaker {
  color: rgba(200, 160, 140, 0.8);
}

/* ── Deep play voices ── */
.subtitle-item.voice-deep .subtitle-text {
  font-size: 15px;
  color: rgba(160, 175, 200, 0.9);
  line-height: 1.6;
}

.subtitle-item.voice-deep .subtitle-speaker {
  color: rgba(120, 140, 170, 0.5);
  letter-spacing: 0;
}

/* Deep play in boxed modes gets its own background */
#subtitle-bar.mode-single .subtitle-item.voice-deep {
  background: rgba(8, 12, 25, 0.85);
}

#flood-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(to top, rgba(20, 40, 80, 0.6) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* ═══ Introduction Screen ═══ */

#introduction-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background: rgba(232, 228, 223, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

#introduction-screen.visible {
  opacity: 1;
  pointer-events: auto;
  cursor: auto;
  /* Show native cursor on intro */
}

#introduction-screen .intro-content {
  text-align: center;
  max-width: 400px;
  padding: 40px;
  cursor: pointer;
}

#introduction-screen h1 {
  font-family: 'Noto Serif KR', serif;
  font-size: 48px;
  font-weight: 200;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}

#introduction-screen .subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 0.2em;
  margin-bottom: 40px;
}

#introduction-screen .intro-text {
  margin-bottom: 40px;
}

#introduction-screen .intro-text p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}

#introduction-screen .intro-text .hint {
  font-style: italic;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 24px;
}

#depth-indicator {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  transition: opacity 1.5s ease;
}

#depth-indicator.depth-hidden {
  opacity: 0;
  pointer-events: none;
}

.depth-mark {
  width: 22px;
  height: 3px;
  background: var(--text-muted);
  transition: all 0.3s ease;
  cursor: pointer;
  opacity: 0.4;
  position: relative;
}

/* Invisible expanded hit area */
.depth-mark::before {
  content: '';
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: -8px;
  right: -8px;
}

.depth-mark:hover {
  opacity: 0.8;
  width: 26px;
}

.depth-mark.active {
  background: var(--text-secondary);
  opacity: 1;
  width: 26px;
}

.depth-mark.below-active {
  opacity: 0.6;
}

/* Depth indicator - subtle color shift */
body.depth-1 .depth-mark.active {
  background: var(--text-secondary);
}

body.depth-2 .depth-mark.active {
  background: rgba(35, 25, 45, 0.55);
}

body.depth-3 .depth-mark.active {
  background: rgba(35, 25, 45, 0.6);
}

body.depth-4 .depth-mark.active {
  background: rgba(35, 25, 45, 0.65);
}

body.depth-5 .depth-mark.active {
  background: rgba(35, 25, 45, 0.7);
}

#depth-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-left: 8px;
  text-transform: uppercase;
}

#location-display {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

#location-display.visible {
  opacity: 1;
}

#location-display .korean {
  font-family: 'Noto Serif KR', serif;
  font-size: 14px;
  font-weight: 200;
  letter-spacing: 0.3em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

#location-display .english {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  text-transform: lowercase;
}

#location-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  background: rgba(232, 228, 223, 0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

#location-panel.open {
  opacity: 1;
  pointer-events: auto;
}

#location-panel .close-btn {
  position: fixed;
  top: 32px;
  right: 32px;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s ease;
  font-weight: 300;
  z-index: 51;
}

#location-panel .close-btn:hover {
  color: var(--text-primary);
}

#location-panel .back-btn {
  position: fixed;
  top: 32px;
  left: 32px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s ease;
  font-weight: 300;
  letter-spacing: 0.1em;
  z-index: 51;
  display: none;
}

#location-panel .back-btn:hover {
  color: var(--text-primary);
}

#location-panel .back-btn.visible {
  display: block;
}

#location-panel .content {
  max-width: 600px;
  width: 100%;
  padding: 120px 40px 80px;
  margin: 0 auto;
  text-align: left;
  user-select: text;
  min-height: 100vh;
  box-sizing: border-box;
}

#location-panel .content h2 {
  font-size: 28px;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 8px;
  text-align: center;
}

#location-panel .content .subtitle {
  font-family: 'Noto Serif KR', serif;
  font-size: 13px;
  font-weight: 200;
  letter-spacing: 0.2em;
  color: var(--text-secondary);
  margin-bottom: 40px;
  text-align: center;
}

#location-panel .content .library-desc {
  font-size: 13px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 40px;
}

#location-panel .content p {
  font-size: 16px;
  font-weight: 400;
  line-height: 2.2;
  color: var(--text-primary);
  font-style: normal;
  text-align: left;
}

/* Content list (poems, essays, etc.) */
.content-list {
  list-style: none;
  padding: 0;
  margin: 40px 0;
  text-align: left;
}

.content-list li {
  padding: 16px 0;
  border-bottom: 1px solid rgba(35, 25, 45, 0.08);
  cursor: pointer;
  transition: all 0.3s ease;
}

.content-list li:hover {
  padding-left: 12px;
  border-color: rgba(35, 25, 45, 0.2);
}

.content-list li:last-child {
  border-bottom: none;
}

.content-list .item-title {
  font-size: 16px;
  font-weight: 400;
  font-style: normal;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.content-list .item-type {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: lowercase;
  margin-top: 4px;
}

/* Sort toggle */
.sort-toggle {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 32px 0 16px;
}

.sort-btn {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: lowercase;
  cursor: pointer;
  padding: 8px 0;
  border: none;
  background: none;
  transition: color 0.3s ease;
  font-family: 'Cormorant Garamond', serif;
}

.sort-btn:hover {
  color: var(--text-secondary);
}

.sort-btn.active {
  color: var(--text-primary);
  border-bottom: 1px solid var(--text-primary);
}

/* Category sections */
.category-section {
  margin-top: 48px;
}

.category-section:first-of-type {
  margin-top: 16px;
}

/* Placeholder pages for landmarks without content */
.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 50vh;
  padding: 60px 40px;
}

.placeholder-symbol {
  font-size: 64px;
  color: var(--text-muted);
  opacity: 0.4;
  margin-bottom: 32px;
  line-height: 1;
}

.placeholder-page h2 {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.placeholder-korean {
  font-family: 'Noto Serif KR', serif;
  font-size: 14px;
  font-weight: 200;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.placeholder-description {
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-secondary);
  max-width: 280px;
  line-height: 1.8;
}

.placeholder-divider {
  width: 40px;
  height: 1px;
  background: var(--text-muted);
  opacity: 0.3;
  margin: 32px 0;
}

.placeholder-status {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: lowercase;
}

.category-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(35, 25, 45, 0.1);
}

.category-name {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  text-transform: lowercase;
}

.category-name-kr {
  font-family: 'Noto Serif KR', serif;
  font-size: 11px;
  font-weight: 200;
  color: var(--text-muted);
}

.category-count {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
}

/* Date display */
.content-list .item-date {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Year header for chronological view */
.year-header {
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-top: 40px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(35, 25, 45, 0.06);
}

.year-header:first-of-type {
  margin-top: 16px;
}

.content-list .item-subtitle {
  font-size: 12px;
  font-weight: 300;
  color: var(--text-muted);
  margin-top: 2px;
  font-style: normal;
}

.content-list .title-kr {
  font-family: 'Noto Serif KR', serif;
  font-size: 13px;
  font-weight: 200;
  color: var(--text-secondary);
  margin-left: 8px;
}

/* Reading view */
.reading-view {
  max-width: 540px;
  padding: 120px 40px 120px;
  text-align: left;
  margin: 0 auto;
  user-select: text;
  min-height: auto;
}

.reading-view h1 {
  font-size: 24px;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-align: center;
}

.reading-view .text-subtitle {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 48px;
  font-style: italic;
}

.reading-view .poem-text {
  font-size: 17px;
  font-weight: 400;
  line-height: 2.1;
  color: var(--text-primary);
  white-space: pre-wrap;
  font-family: 'Cormorant Garamond', serif;
  font-style: normal;
}

/* Essay styling */
.reading-view .essay-text {
  font-size: 17px;
  font-weight: 400;
  line-height: 2.1;
  color: var(--text-primary);
  font-family: 'Cormorant Garamond', serif;
  font-style: normal;
}

.essay-text h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 48px;
  color: var(--text-primary);
  text-align: center;
}

.essay-text h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 400;
  margin-top: 48px;
  margin-bottom: 24px;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.essay-text h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  font-weight: 400;
  margin-top: 32px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-style: italic;
}

.essay-text p {
  margin-bottom: 1.5em;
}

.essay-text hr {
  border: none;
  border-top: 1px solid var(--accent-muted);
  margin: 32px 0;
  opacity: 0.5;
}

.essay-text blockquote {
  margin: 24px 0;
  padding-left: 20px;
  border-left: 2px solid var(--accent-muted);
  color: var(--text-secondary);
  font-style: italic;
}

.essay-text blockquote p {
  margin-bottom: 0.8em;
}

.essay-text blockquote ul {
  margin: 12px 0;
  padding-left: 20px;
}

.essay-text blockquote li {
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.essay-text pre {
  background: rgba(0, 0, 0, 0.15);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 4px;
  overflow-x: auto;
}

.essay-text code {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.essay-text sup {
  font-size: 10px;
  color: var(--accent-warm);
}

#location-panel .essay-text .footnote,
.essay-text p.footnote {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1em;
}

.essay-text .chat-timestamp {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 0.5em;
}

.essay-text em {
  font-style: italic;
}

.essay-text strong {
  font-weight: 600;
}

/* ═══ Translation Booth ═══ */

.booth-page {
  text-align: center;
}

.booth-description {
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0 auto 32px;
  line-height: 1.8;
}

.booth-divider {
  font-family: 'Noto Serif KR', serif;
  font-size: 28px;
  font-weight: 200;
  color: var(--text-muted);
  opacity: 0.4;
  margin: 24px 0;
  letter-spacing: 0.3em;
}

/* The window between doors */
.booth-window {
  max-width: 400px;
  margin: 0 auto 40px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.booth-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--text-muted);
  padding: 12px 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-primary);
  resize: none;
  outline: none;
  line-height: 1.6;
  transition: border-color 0.3s ease;
}

.booth-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 300;
}

.booth-input:focus {
  border-color: var(--text-secondary);
}

.booth-send {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-secondary);
  padding: 8px 20px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.booth-send:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.booth-send.booth-loading {
  opacity: 0.5;
  pointer-events: none;
}

.booth-input:disabled {
  opacity: 0.4;
}

/* Translation output */
.booth-output {
  max-width: 480px;
  margin: 0 auto;
  text-align: left;
}

.booth-result {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(35, 25, 45, 0.06);
  transition: opacity 0.6s ease, transform 0.4s ease;
}

/* API response — what you said */
.booth-spoken {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-style: italic;
}

/* API response — what came through Door 2 */
.booth-passage {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 2;
  color: var(--text-primary);
  white-space: pre-wrap;
  letter-spacing: 0.01em;
}

/* Grotesque reaction — arrives late, fades in */
.booth-reaction {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(35, 25, 45, 0.06);
  opacity: 0;
  transition: opacity 1.2s ease;
}

.booth-reaction.visible {
  opacity: 1;
}

.booth-reaction-speaker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.booth-reaction-text {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 14px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.8;
}

.booth-result.entering {
  opacity: 0;
  transform: translateY(12px);
}

/* The two doors */
.booth-doors {
  display: flex;
  gap: 0;
  align-items: stretch;
  margin-bottom: 16px;
}

.booth-door {
  flex: 1;
  padding: 16px;
  min-height: 60px;
}

.booth-door-left {
  border-right: none;
  text-align: right;
}

.booth-door-right {
  border-left: none;
  text-align: left;
}

.booth-door-gap {
  display: flex;
  align-items: center;
  font-family: 'Noto Serif KR', serif;
  font-size: 14px;
  color: var(--text-muted);
  opacity: 0.3;
  padding: 0 12px;
  flex-shrink: 0;
}

.booth-door-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: lowercase;
  margin-bottom: 8px;
  font-weight: 300;
}

.booth-door-text {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.8;
  color: var(--text-primary);
}

.booth-door-right .booth-door-text {
  color: var(--text-secondary);
}

/* Echo - play fragment that bleeds through */
.booth-echo {
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
  margin: 12px 0;
  letter-spacing: 0.02em;
}

/* Grotesque commentary */
.booth-commentary {
  margin-top: 12px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.03);
  text-align: left;
}

.booth-commentary-speaker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.booth-commentary-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Walls - accumulated past translations */
.booth-walls {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(35, 25, 45, 0.08);
  text-align: left;
}

.booth-walls-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: lowercase;
  margin-bottom: 24px;
  text-align: center;
  font-weight: 300;
}

.booth-wall-entry {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(35, 25, 45, 0.04);
  transition: opacity 0.3s ease;
}

.booth-wall-entry:last-child {
  border-bottom: none;
}

.booth-wall-original {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.booth-wall-arrow {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.4;
  margin: 2px 0;
}

.booth-wall-translated {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.booth-wall-commentary {
  font-size: 11px;
  font-style: italic;
  color: var(--text-muted);
  opacity: 0.6;
  margin-top: 4px;
}

.booth-wall-speaker {
  margin-right: 6px;
}

/* ─── The Clock ────────────────────────────────────────────── */

.clock-page {
  text-align: center;
}

.clock-description {
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0 auto 40px;
  line-height: 1.8;
}

.clock-face-container {
  margin: 0 auto 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.clock-face {
  opacity: 0.8;
}

.clock-face-time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.2em;
}

.clock-reading-container {
  max-width: 400px;
  margin: 0 auto 32px;
  min-height: 120px;
}

.clock-reading {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.clock-reading.visible {
  opacity: 1;
}

.clock-reading-text {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 2;
  color: var(--text-primary);
  white-space: pre-wrap;
  text-align: left;
  letter-spacing: 0.01em;
}

.clock-again {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-secondary);
  padding: 8px 28px;
  font-family: 'Noto Serif KR', serif;
  font-size: 13px;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 40px;
}

.clock-again:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.clock-again.clock-loading {
  opacity: 0.4;
  pointer-events: none;
}

.clock-past {
  max-width: 400px;
  margin: 0 auto;
  text-align: left;
  border-top: 1px solid rgba(35, 25, 45, 0.06);
  padding-top: 24px;
}

.clock-past:empty {
  border-top: none;
  padding-top: 0;
}

.clock-past-entry {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(35, 25, 45, 0.04);
  transition: opacity 0.6s ease;
}

.clock-past-entry .clock-reading-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ─── The Shadow ───────────────────────────────────────────── */

#location-panel.shadow-mode {
  background: rgba(8, 6, 10, 0.98);
  transition: background 1.5s ease, opacity 0.8s ease;
}

#location-panel.shadow-mode .close-btn {
  color: rgba(200, 190, 180, 0.3);
}

#location-panel.shadow-mode .close-btn:hover {
  color: rgba(200, 190, 180, 0.6);
}

.shadow-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}

.shadow-void {
  text-align: center;
  max-width: 360px;
}

.shadow-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.shadow-line {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 15px;
  font-weight: 300;
  font-style: italic;
  line-height: 1.8;
  color: rgba(200, 190, 180, 0.35);
  opacity: 0;
  transition: opacity 3s ease;
}

.shadow-line.visible {
  opacity: 1;
}

/* ─── The Throat ───────────────────────────────────────────── */

.throat-page {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.throat-description {
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0 auto 48px;
  line-height: 1.8;
}

.throat-offering {
  max-width: 360px;
  width: 100%;
}

.throat-ask {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 15px;
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.8;
  transition: opacity 2s ease;
}

.throat-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--text-muted);
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 15px;
  font-weight: 300;
  color: var(--text-primary);
  padding: 12px 0;
  text-align: center;
  outline: none;
  transition: opacity 0.6s ease, border-color 0.3s ease;
}

.throat-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.throat-input:focus {
  border-color: var(--text-secondary);
}

.throat-memory {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 15px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 320px;
}

.throat-rejection {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 13px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 16px;
  opacity: 0;
  transition: opacity 0.8s ease;
  min-height: 1.5em;
}

.throat-rejection.visible {
  opacity: 1;
}

/* ─── Midlevel Landmarks ──────────────────────────────────── */

.midlevel-page {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.midlevel-page h2 {
  font-size: 18px;
  font-weight: 300;
  color: var(--text-primary);
}

.midlevel-page .subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.midlevel-description {
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-secondary);
  max-width: 320px;
  margin: 32px auto 0;
  line-height: 1.8;
}

.midlevel-echo {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 12px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 48px;
  opacity: 0.3;
  max-width: 280px;
}

/* Midlevel landmarks on map — submerged, drifting */
.midlevel-landmark .landmark-symbol {
  animation: midlevel-drift 8s ease-in-out infinite;
}

.midlevel-landmark:nth-child(odd) .landmark-symbol {
  animation-delay: -3s;
  animation-duration: 9s;
}

.midlevel-landmark:nth-child(3n) .landmark-symbol {
  animation-delay: -6s;
  animation-duration: 7s;
}

.midlevel-landmark .midlevel-waterline {
  animation: waterline-shimmer 4s ease-in-out infinite;
}

.midlevel-landmark:nth-child(even) .midlevel-waterline {
  animation-delay: -2s;
}

@keyframes midlevel-drift {
  0%, 100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(-3px);
    opacity: 0.75;
  }
}

@keyframes waterline-shimmer {
  0%, 100% {
    opacity: 0.4;
    transform: scaleX(1);
  }
  50% {
    opacity: 0.15;
    transform: scaleX(0.85);
  }
}

/* Midlevel vignette text — materializes slowly */
.midlevel-vignette {
  margin-top: 36px;
  max-width: 300px;
}

.midlevel-vignette-line {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 2;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.midlevel-vignette-line.visible {
  opacity: 1;
}

/* ─── Midlevel Scenes ──────────────────────────────────────── */
/* The characters respond to the truth. Five modes, five rooms. */

.midlevel-scene {
  margin-top: 36px;
  max-width: 380px;
}

.scene-line {
  margin-bottom: 16px;
  opacity: 0;
  transition: opacity 1.5s ease;
  transform: translateY(4px);
  transition-property: opacity, transform;
}

.scene-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.scene-speaker {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.scene-text {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 15px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Speaker-specific tints */
.scene-line:has(.scene-speaker:first-child) {
  padding-left: 0;
}

/* ─── The Gap ──────────────────────────────────────────────── */
/* An absence on the map. Broken contour lines. The way down. */

.gap-landmark .landmark-symbol {
  animation: gap-pulse 6s ease-in-out infinite;
}

.gap-contour {
  animation: gap-rotate 20s linear infinite;
  transform-origin: center;
}

.gap-void {
  animation: gap-breathe 4s ease-in-out infinite;
}

@keyframes gap-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

@keyframes gap-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes gap-breathe {
  0%, 100% { r: 6; opacity: 0.08; }
  50% { r: 8; opacity: 0.04; }
}

/* ─── The Tower ────────────────────────────────────────────── */

.tower-page {
  text-align: center;
}

.tower-description {
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0 auto 40px;
  line-height: 1.8;
}

.tower-bio {
  max-width: 400px;
  margin: 0 auto 32px;
  text-align: left;
}

.tower-bio-text {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 15px;
  font-weight: 300;
  line-height: 2;
  color: var(--text-secondary);
  transition: opacity 0.4s ease;
}

.tower-remix {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-secondary);
  padding: 8px 28px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tower-remix:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.tower-remix.tower-loading {
  opacity: 0.4;
  pointer-events: none;
}

/* ─── The Parade Ground ────────────────────────────────────── */

.parade-page {
  text-align: center;
}

.parade-description {
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0 auto 48px;
  line-height: 1.8;
}

.parade-constellation {
  max-width: 440px;
  margin: 0 auto 40px;
  text-align: left;
}

.parade-fact {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.9;
  color: var(--text-primary);
  margin-bottom: 24px;
  transition: opacity 1s ease;
}

.parade-connection {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 24px;
  padding-left: 16px;
  border-left: 1px solid rgba(35, 25, 45, 0.08);
  transition: opacity 1s ease;
}

.parade-march {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-secondary);
  padding: 8px 28px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.parade-march:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.parade-march.parade-loading {
  opacity: 0.4;
  pointer-events: none;
}

.landmark {
  cursor: pointer;
  transition: all 0.4s ease;
}

.landmark:hover {
  filter: brightness(1.1);
}

.landmark-label {
  font-family: 'Noto Serif KR', serif;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.12em;
  fill: rgba(90, 74, 56, 0.85);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.landmark-group:hover .landmark-label {
  opacity: 1;
}

/* Grotesque (NPC) labels */
.grotesque text {
  transition: fill 0.3s ease;
}

.grotesque:hover text {
  fill: rgba(90, 74, 56, 1);
}

.contour {
  fill: none;
  stroke: rgba(35, 25, 45, 0.06);
  stroke-width: 0.75;
  transition: stroke 0.8s ease, stroke-width 0.8s ease;
}

.grid-line {
  stroke: rgba(35, 25, 45, 0.025);
  stroke-width: 0.5;
  transition: stroke 0.8s ease;
}

/* SVG layer transitions for depth changes */
#landmark-layer,
#submerged-layer,
#deep-layer,
#light-rays-layer,
#notation-layer,
#snake-layer,
#contour-layer,
#grid-layer {
  transition: opacity 0.8s ease, filter 0.8s ease;
}

.notation {
  fill: rgba(35, 25, 45, 0.12);
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  font-weight: 300;
  transition: fill 0.8s ease;
}

/* ═══════════════════════════════════════════════════════════════ */
/* DEPTH-SPECIFIC SVG STYLES - Gradual progression, same aesthetic */
/* ═══════════════════════════════════════════════════════════════ */

/* Depth 1: Surface - clear, vibrant */
body.depth-1 .contour {
  stroke: rgba(35, 25, 45, 0.08);
  stroke-width: 0.75;
}

body.depth-1 .grid-line {
  stroke: rgba(35, 25, 45, 0.025);
}

body.depth-1 .notation {
  fill: rgba(35, 25, 45, 0.15);
}

/* Depth 2: Shallow - slightly more visible structure */
body.depth-2 .contour {
  stroke: rgba(35, 25, 45, 0.1);
  stroke-width: 0.75;
}

body.depth-2 .grid-line {
  stroke: rgba(35, 25, 45, 0.035);
}

body.depth-2 .notation {
  fill: rgba(35, 25, 45, 0.18);
}

/* Depth 3: Mid-depth - structure more prominent */
body.depth-3 .contour {
  stroke: rgba(35, 25, 45, 0.12);
  stroke-width: 0.8;
}

body.depth-3 .grid-line {
  stroke: rgba(35, 25, 45, 0.045);
}

body.depth-3 .notation {
  fill: rgba(35, 25, 45, 0.2);
}

/* Depth 4: Deep - cooler tones start showing */
body.depth-4 .contour {
  stroke: rgba(45, 35, 65, 0.14);
  stroke-width: 0.85;
}

body.depth-4 .grid-line {
  stroke: rgba(45, 35, 65, 0.05);
}

body.depth-4 .notation {
  fill: rgba(45, 35, 65, 0.22);
}

/* Depth 5: Abyss - darkest, most prominent structure */
body.depth-5 .contour {
  stroke: rgba(55, 45, 75, 0.18);
  stroke-width: 0.9;
}

body.depth-5 .grid-line {
  stroke: rgba(55, 45, 75, 0.06);
}

body.depth-5 .notation {
  fill: rgba(55, 45, 75, 0.25);
}

/* Particles visibility - subtle, increases with depth */
.depth-particles {
  transition: opacity 0.8s ease;
  opacity: 0;
}

/* Particles fade in gradually at deeper levels */
body.depth-3 .depth-3-only {
  opacity: 0.3;
}

body.depth-4 .depth-3-only {
  opacity: 0.4;
}

body.depth-4 .depth-4-only {
  opacity: 0.3;
}

body.depth-5 .depth-3-only {
  opacity: 0.5;
}

body.depth-5 .depth-4-only {
  opacity: 0.4;
}

body.depth-5 .depth-5-only {
  opacity: 0.35;
}

/* Particle layer styling */
#particles-layer {
  transition: opacity 0.8s ease;
}

.boat {
  transition: transform 0.1s ease-out;
}

.wake {
  fill: none;
  stroke: rgba(35, 25, 45, 0.06);
  stroke-width: 0.5;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

@keyframes ripple {
  0% {
    r: 2;
    opacity: 0.3;
  }

  100% {
    r: 20;
    opacity: 0;
  }
}

/* ─── The Rock ──────────────────────────────────────────────── */

.rock-glow {
  animation: rock-pulse 8s ease-in-out infinite;
}

@keyframes rock-pulse {
  0%, 100% {
    opacity: 1;
    rx: 28;
    ry: 22;
  }
  50% {
    opacity: 0.5;
    rx: 32;
    ry: 25;
  }
}

.rock-shine {
  animation: rock-shine 6s ease-in-out infinite;
}

@keyframes rock-shine {
  0%, 100% {
    opacity: 1;
    r: 2.5;
  }
  50% {
    opacity: 0.6;
    r: 3.5;
  }
}

/* ─── Frozen Mode (Depth 3 Panel) ────────────────────────────── */

#location-panel.frozen-mode {
  background: rgba(10, 12, 18, 0.98);
  transition: background 1.5s ease, opacity 0.8s ease;
}

#location-panel.frozen-mode .close-btn {
  color: rgba(140, 155, 180, 0.3);
}

#location-panel.frozen-mode .close-btn:hover {
  color: rgba(140, 155, 180, 0.6);
}

/* ─── Deep Landmarks ─────────────────────────────────────────── */

.deep-landmark-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.deep-landmark-page h2 {
  font-size: 20px;
  font-weight: 300;
  color: rgba(140, 155, 180, 0.6);
}

.deep-landmark-page .subtitle {
  font-size: 13px;
  color: rgba(140, 155, 180, 0.25);
  margin-top: 4px;
  margin-bottom: 48px;
}

.deep-landmark-text {
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.deep-line {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 15px;
  font-weight: 300;
  font-style: italic;
  line-height: 1.8;
  color: rgba(140, 155, 180, 0.4);
  opacity: 0;
  transition: opacity 2s ease;
  text-align: center;
}

.deep-line.visible {
  opacity: 1;
}

/* Deep truths — collective sediment from Supabase */
.deep-truths {
  margin-top: 32px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.deep-truth {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
  line-height: 1.7;
  color: rgba(140, 155, 180, 0.3);
  opacity: 0;
  transition: opacity 2.5s ease;
  text-align: center;
  letter-spacing: 0.02em;
}

.deep-truth.visible {
  opacity: 1;
}

.deep-truth:nth-child(odd) {
  color: rgba(160, 145, 170, 0.3);
}

.deep-truth:nth-child(3n) {
  color: rgba(130, 165, 175, 0.25);
}

/* Deep landmark map symbols — crystalline, slow drift */
.deep-landmark .landmark-symbol {
  animation: deep-drift 12s ease-in-out infinite;
}

.deep-landmark:nth-child(odd) .landmark-symbol {
  animation-delay: -4s;
  animation-duration: 14s;
}

.deep-landmark:nth-child(3n) .landmark-symbol {
  animation-delay: -8s;
  animation-duration: 10s;
}

@keyframes deep-drift {
  0%, 100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(-2px);
    opacity: 0.7;
  }
}

/* Settling dots at the bed */
.deep-settling-dot {
  animation: settle 6s ease-in-out infinite;
}

.deep-settling-dot:nth-child(odd) {
  animation-delay: -2s;
}

.deep-settling-dot:nth-child(3n) {
  animation-delay: -4s;
  animation-duration: 8s;
}

@keyframes settle {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  50% {
    transform: translateY(2px);
    opacity: 0.15;
  }
}

/* Depth 3 locked indicator */
.depth-mark.depth-locked {
  opacity: 0.15;
  cursor: default;
}

.depth-mark.depth-locked:hover {
  opacity: 0.15;
  width: 22px;
}

/* ═══════════════════════════════════════════════════════════════ */
/* MOBILE RESPONSIVE STYLES                                        */
/* ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* Use native cursor on touch devices */
  body {
    cursor: auto;
  }

  #cursor {
    display: none;
  }

  /* ═══ MOBILE VISUAL DECLUTTER ═══ */
  /* Hide/reduce visual noise for cleaner mobile experience */

  /* Hide grid lines entirely on mobile */
  #grid-layer {
    display: none;
  }

  /* Reduce contour opacity slightly for cleaner look */
  #contour-layer {
    opacity: 0.6;
  }

  /* Hide notation symbols on mobile */
  #notation-layer {
    display: none;
  }

  /* Introduction screen adjustments */
  #introduction-screen h1 {
    font-size: 36px;
  }

  #introduction-screen .subtitle {
    font-size: 12px;
    margin-bottom: 32px;
  }

  #introduction-screen .intro-text p {
    font-size: 14px;
  }


  /* Location panel - full width on mobile */
  #location-panel .content {
    padding: 80px 24px 60px;
    max-width: 100%;
  }

  #location-panel .content h2 {
    font-size: 24px;
  }

  #location-panel .content .subtitle {
    font-size: 12px;
  }

  /* Reading view */
  .reading-view {
    padding: 80px 24px 80px;
    max-width: 100%;
  }

  .reading-view h1 {
    font-size: 20px;
  }

  .reading-view .poem-text,
  .reading-view .essay-text {
    font-size: 15px;
  }

  .essay-text .footnote {
    font-size: 10px;
  }

  /* Content list */
  .content-list li {
    padding: 14px 0;
  }

  .content-list .item-title {
    font-size: 15px;
  }

  /* Depth indicator repositioned to bottom right */
  #depth-indicator {
    right: 16px;
    bottom: 16px;
    top: auto;
  }

  /* Shrink hit areas on mobile so they don't eat the right side */
  .depth-mark::before {
    top: -6px;
    bottom: -6px;
    left: -4px;
    right: -4px;
  }

  /* Cycle display repositioned to top-left on mobile */
  #cycle-display {
    top: 16px;
    right: auto;
    bottom: auto;
    left: 16px;
    font-size: 11px;
  }

  /* Location display */
  #location-display {
    font-size: 13px;
  }

  /* Close/back buttons more touch-friendly */
  #location-panel .close-btn,
  #location-panel .back-btn {
    padding: 12px;
    font-size: 18px;
  }

  /* Translation booth mobile */
  .booth-window {
    flex-direction: column;
    gap: 8px;
  }

  .booth-send {
    align-self: flex-end;
  }

  .booth-doors {
    flex-direction: column;
    gap: 0;
  }

  .booth-door-left {
    text-align: left;
    border-right: none;
    border-bottom: none;
    padding-bottom: 8px;
  }

  .booth-door-right {
    border-left: none;
    border-top: none;
    padding-top: 8px;
  }

  .booth-door-gap {
    justify-content: center;
    padding: 4px 0;
  }

  /* Clock mobile */
  .clock-reading-container {
    max-width: 100%;
  }

  .clock-past {
    max-width: 100%;
  }

  .deep-line {
    font-size: 14px;
  }

  .deep-truths {
    max-width: 280px;
  }

  .deep-truth {
    font-size: 13px;
  }
}

@media (max-width: 480px) {

  /* Phone-sized adjustments */
  #location-panel .content {
    padding: 60px 16px 40px;
  }

  .reading-view {
    padding: 60px 16px 60px;
  }

  .reading-view h1 {
    font-size: 18px;
  }

  .reading-view .poem-text,
  .reading-view .essay-text {
    font-size: 14px;
    line-height: 1.9;
  }

  .content-list li {
    padding: 12px 0;
  }

  /* Intro screen */
  #introduction-screen h1 {
    font-size: 28px;
  }

  #introduction-screen .intro-content {
    padding: 24px;
  }

  /* Depth indicator smaller */
  #depth-indicator {
    right: 12px;
    bottom: 12px;
    top: auto;
    gap: 4px;
    padding: 6px 10px;
  }

  .depth-mark {
    width: 14px;
    height: 2px;
  }

  #depth-label {
    font-size: 8px;
    margin-top: 0;
    margin-left: 6px;
  }
}


/* ═══════════════════════════════════════════════════════════════ */
/* HARBOUR — The shared boat space                                */
/* The one thing the flood cannot drown.                          */
/* ═══════════════════════════════════════════════════════════════ */

/* Harbour landmark on the map */
.harbour-landmark {
  animation: harbour-drift 10s ease-in-out infinite;
}

.harbour-landmark .harbour-boat {
  animation: harbour-boat-bob 4s ease-in-out infinite;
}

.harbour-landmark .harbour-boat:nth-child(2) {
  animation-delay: -1.5s;
}

.harbour-landmark .harbour-boat:nth-child(3) {
  animation-delay: -3s;
}

.harbour-landmark .harbour-ripple {
  animation: harbour-ripple-shimmer 5s ease-in-out infinite;
}

@keyframes harbour-drift {
  0%, 100% { transform: translate(var(--x, 0), var(--y, 0)); }
  50% { transform: translate(var(--x, 0), calc(var(--y, 0) - 2px)); }
}

@keyframes harbour-boat-bob {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.8; }
}

@keyframes harbour-ripple-shimmer {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.15; }
}

/* Harbour mode panel — larger, darker, contemplative */
#location-panel.harbour-mode {
  background: rgba(15, 18, 25, 0.97);
  transition: background 1.5s ease, opacity 0.8s ease;
}

#location-panel.harbour-mode .close-btn {
  color: rgba(140, 155, 180, 0.3);
}

#location-panel.harbour-mode .close-btn:hover {
  color: rgba(140, 155, 180, 0.6);
}

/* Harbour page layout */
.harbour-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 20px 0;
}

.harbour-space {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 3 / 2;
  position: relative;
}

/* Shared space SVG */
.shared-space-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.shared-water line {
  opacity: 0.5;
}

/* Shared boat styles */
.shared-boat {
  transition: opacity 0.6s ease, transform 0.5s ease;
}

/* Live boats — solid, present */
.shared-boat.live .shared-boat-body {
  fill: rgba(180, 195, 220, 0.85);
  stroke: rgba(200, 210, 230, 0.6);
  stroke-width: 0.5;
}

/* Ghost boats — hollow, drifting, flickering */
.shared-boat.historical {
  animation: ghost-flicker 8s ease-in-out infinite;
}

.shared-boat.historical .shared-boat-body {
  fill: none;
  stroke: rgba(140, 155, 180, 0.35);
  stroke-width: 0.4;
  stroke-dasharray: 2 1;
}

@keyframes ghost-flicker {
  0%, 100% { opacity: 0.45; }
  30% { opacity: 0.3; }
  60% { opacity: 0.5; }
  80% { opacity: 0.25; }
}

.shared-boat-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 5px;
  letter-spacing: 0.08em;
  fill: rgba(180, 195, 220, 0.6);
}

.shared-boat.historical .shared-boat-name {
  fill: rgba(140, 155, 180, 0.3);
  font-size: 4px;
  letter-spacing: 0.12em;
}

/* Mobile adjustments for harbour */
@media (max-width: 768px), (max-height: 500px) {
  .harbour-space {
    max-width: 100%;
  }

  .shared-boat-name {
    font-size: 6px;
  }

  .shared-boat.historical .shared-boat-name {
    font-size: 5px;
  }
}