@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&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 - same aesthetic, gradual shift */
body.depth-1 {
  /* Surface - bright, warm */
  --depth-overlay: rgba(255, 255, 255, 0);
}

body.depth-2 {
  /* Shallow - slightly muted */
  --depth-overlay: rgba(35, 25, 45, 0.02);
}

body.depth-3 {
  /* Mid-depth - cooler */
  --depth-overlay: rgba(35, 25, 45, 0.05);
}

body.depth-4 {
  /* Deep - darker */
  --depth-overlay: rgba(35, 25, 45, 0.1);
}

body.depth-5 {
  /* Abyss - darkest */
  --depth-overlay: rgba(35, 25, 45, 0.18);
}

* {
  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 */
#depth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.8s ease, background 0.8s ease;
}

/* Depth overlay - gradual darkening vignette */
body.depth-1 #depth-overlay {
  background: transparent;
}

body.depth-2 #depth-overlay {
  background: radial-gradient(ellipse 140% 100% at 50% 50%, transparent 50%, rgba(35, 25, 45, 0.03) 100%);
}

body.depth-3 #depth-overlay {
  background: radial-gradient(ellipse 130% 100% at 50% 50%, transparent 40%, rgba(35, 25, 45, 0.06) 100%);
}

body.depth-4 #depth-overlay {
  background: radial-gradient(ellipse 120% 100% at 50% 50%, transparent 30%, rgba(35, 25, 45, 0.12) 100%);
}

/* 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.8) !important;
}

body.depth-5 .landmark:hover~.landmark-label {
  opacity: 1 !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;
}

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

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

.landmark-group.hidden {
  pointer-events: none;
}

#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: 32px;
  right: 32px;
  z-index: 10;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-align: right;
  font-family: 'Cormorant Garamond', serif;
  pointer-events: none;
}

#subtitle-bar {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  padding: 12px 28px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  max-width: 85%;
  text-align: center;
}

#subtitle-bar.visible {
  opacity: 1;
}

.subtitle-speaker {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
}

.subtitle-text {
  font-family: 'Helvetica Neue', 'Arial', sans-serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

#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;
}

#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;
}

#introduction-screen .enter-btn {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-secondary);
  padding: 12px 32px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.3s ease;
}

#introduction-screen .enter-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

#depth-indicator {
  position: fixed;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
}

.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-top: 10px;
  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;
}

.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;
}

.clocktower-view .profile-text {
  font-size: 15px;
  font-weight: 300;
  line-height: 2;
  color: var(--text-secondary);
  font-family: 'Cormorant Garamond', serif;
  user-select: text;
  cursor: auto;
}

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

.clocktower-view .profile-text p {
  margin-bottom: 1.5em;
}

.clocktower-view .profile-text strong {
  font-weight: 500;
  color: var(--text-primary);
}

.clocktower-view .profile-text a {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(35, 25, 45, 0.2);
  transition: border-color 0.3s ease;
}

.clocktower-view .profile-text a:hover {
  border-color: var(--text-primary);
}

.clocktower-view .profile-text .credentials {
  margin-top: 2em;
  padding-top: 1.5em;
  border-top: 1px solid rgba(35, 25, 45, 0.1);
}

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

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

.landmark-label {
  font-family: 'Noto Serif KR', serif;
  font-size: 11px;
  font-weight: 200;
  letter-spacing: 0.15em;
  fill: var(--text-muted);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.landmark:hover~.landmark-label {
  opacity: 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;
  }
}

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

@media (max-width: 768px) {

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

  #cursor {
    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;
  }

  #introduction-screen .enter-btn {
    padding: 14px 36px;
  }

  /* 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 */
  #depth-indicator {
    right: 16px;
  }

  /* Cycle display repositioned */
  #cycle-display {
    bottom: 16px;
    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;
  }
}

@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;
    gap: 6px;
  }

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

  #depth-label {
    font-size: 9px;
  }
}