/* ===== Custom Properties ===== */
:root {
  --abyss: #010D12;
  --midnight: #041C26;
  --twilight: #0E4D64;
  --floor: #072A3B;
  --teal: #00CED1;
  --seafoam: #7FDBCA;
  --orchid: #E8B4F8;
  --gold: #FFD700;
  --pale: #E0F7FA;
  --coral-text: #B2DFDB;
  --gilt: #B8860B;
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--abyss);
  color: var(--pale);
  overflow-x: hidden;
  line-height: 1.85;
  font-size: clamp(1rem, 1.1vw, 1.15rem);
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--midnight); }
::-webkit-scrollbar-thumb { background: var(--twilight); }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }

/* ===== Depth Gauge ===== */
.depth-gauge {
  position: fixed;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 40px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  pointer-events: none;
}
.gauge-track {
  position: absolute;
  left: 50%;
  top: 5%;
  bottom: 5%;
  width: 3px;
  background: rgba(10, 61, 92, 0.6);
  transform: translateX(-50%);
}
.gauge-node {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--seafoam);
  background: var(--midnight);
  position: relative;
  z-index: 1;
  transition: background 0.4s, box-shadow 0.4s;
}
.gauge-node.active {
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
}
.gauge-node.terminal {
  width: 12px;
  height: 12px;
  border-radius: 0;
  transform: rotate(45deg);
  border-color: var(--gold);
  animation: terminalPulse 4s ease-in-out infinite;
}
@keyframes terminalPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(255,215,0,0.3); }
  50% { box-shadow: 0 0 16px rgba(255,215,0,0.6); }
}
.gauge-label {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--seafoam);
  opacity: 0.5;
  white-space: nowrap;
}

/* ===== Bokeh Layer ===== */
.bokeh-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bokeh-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 2s ease;
  will-change: transform;
}
.bokeh-circle.active { opacity: var(--bokeh-opacity, 0.08); }

/* ===== Zones ===== */
.zone {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  padding: 6rem 2rem 6rem 80px;
}

/* Zone 1: Surface */
.zone-surface {
  min-height: 100vh;
  background: radial-gradient(ellipse at center, var(--twilight), var(--floor));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.caustic-overlay {
  position: absolute;
  inset: 0;
  background:
    repeating-conic-gradient(rgba(0,206,209,0.03) 0deg, transparent 15deg, rgba(0,206,209,0.02) 30deg);
  animation: causticShift 12s ease-in-out infinite;
  pointer-events: none;
}
@keyframes causticShift {
  0%, 100% { filter: hue-rotate(0deg); transform: scale(1); }
  50% { filter: hue-rotate(15deg); transform: scale(1.02); }
}
.wave-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.wave-svg { width: 100%; height: 200px; }
.wave-path {
  animation: waveShift 20s linear infinite;
}
@keyframes waveShift {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100px); }
}
.zone-content.centered { position: relative; z-index: 10; }
.site-title {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 5.5vw, 4.8rem);
  letter-spacing: 0.25em;
  color: var(--pale);
  text-shadow: 0 0 30px rgba(0,206,209,0.2);
}
.site-tagline {
  font-family: 'Nunito', sans-serif;
  font-weight: 300;
  font-size: 1.1rem;
  color: var(--seafoam);
  opacity: 0.7;
  margin-top: 1rem;
}
.scroll-chevron {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  color: var(--seafoam);
  animation: chevronPulse 3s ease-in-out infinite;
}
@keyframes chevronPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* Zone 2: Twilight */
.zone-twilight {
  background: linear-gradient(to bottom, var(--twilight), var(--floor));
  min-height: 150vh;
  padding-top: 8rem;
}
.wave-divider {
  width: 100%;
  height: 40px;
  margin-bottom: 3rem;
}
.timeline-spine {
  position: absolute;
  left: 15%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(127, 219, 202, 0.2);
}
.timeline-spine.glow {
  background: rgba(127, 219, 202, 0.35);
  box-shadow: 0 0 8px rgba(127, 219, 202, 0.1);
}

/* ===== Panels ===== */
.panel {
  max-width: 680px;
  padding: 2.5rem;
  background: rgba(10, 61, 92, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(127, 219, 202, 0.15);
  border-radius: 12px;
  margin-bottom: 6rem;
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.panel-left {
  margin-left: 15%;
  transform: translateX(-40px);
}
.panel-right {
  margin-left: auto;
  margin-right: 5%;
  transform: translateX(40px);
}
.panel.visible {
  opacity: 1;
  transform: translateX(0);
}
.panel-title {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  letter-spacing: 0.18em;
  margin-bottom: 1rem;
  color: var(--pale);
}
.panel p {
  color: var(--coral-text);
  font-weight: 300;
}

/* Glow panels (Zone 3) */
.glow-panel {
  box-shadow: 0 0 80px 20px rgba(0, 206, 209, 0.08);
}

/* Gilt panels (Zone 4) */
.gilt-panel {
  border: 1px solid rgba(184, 134, 11, 0.3);
  box-shadow: inset 0 0 0 3px rgba(10, 61, 92, 0.5), inset 0 0 0 4px rgba(184, 134, 11, 0.15), 0 0 60px 15px rgba(0, 206, 209, 0.06);
}

/* Hadal panel */
.hadal-panel {
  margin: 0 auto;
  box-shadow: 0 0 120px 40px rgba(0, 206, 209, 0.12);
}

/* Zone 3: Midnight */
.zone-midnight {
  background: var(--midnight);
  min-height: 150vh;
}
.depth-counter {
  text-align: center;
  margin-top: 3rem;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  color: var(--seafoam);
  opacity: 0.5;
}
.depth-reading { font-size: 1.4rem; }

/* Zone 4: Abyssal */
.zone-abyssal {
  background: #021018;
  min-height: 180vh;
}

/* Zone 5: Hadal */
.zone-hadal {
  background: var(--abyss);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.closing-inscription {
  margin-top: 6rem;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--seafoam);
  opacity: 0.3;
  text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .zone { padding: 4rem 1.5rem 4rem 1.5rem; }
  .depth-gauge { display: none; }
  .timeline-spine { left: 5%; }
  .panel-left { margin-left: 0; }
  .panel-right { margin-right: 0; margin-left: 0; }
  .panel { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .bokeh-circle { display: none; }
}
