/* ==========================================================================
   Polder-Canal Corridors — Pure MIT Senseable Minimalist Aesthetic
   Zero box clutter · High-contrast imagery · Crisp generous typography
   ========================================================================== */

:root {
  --bg: #05080D;
  --glass: rgba(8, 12, 20, 0.72);
  --line: rgba(255, 255, 255, 0.14);
  --line-hi: rgba(255, 255, 255, 0.36);
  --ink: #F5F7FA;
  --muted: rgba(245, 247, 250, 0.64);
  --dim: rgba(245, 247, 250, 0.40);
  --coral: #E86A66;
  --amber: #F5A36C;
  --cyan: #4DA6DC;
  --sage: #80BA88;
  --sans: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "Consolas", ui-monospace, SFMono-Regular, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.mapboxgl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right {
  left: auto !important;
  right: 12px !important;
  bottom: 8px !important;
  opacity: 0.28;
  pointer-events: none;
}

/* -------------------- Full-Screen 3D Background -------------------- */
.background-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  background: radial-gradient(circle at 55% 45%, #0D1724 0%, #05080D 80%);
}

#mapbox-stage,
#procedural-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.5s ease;
}

.vignette-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 8, 13, 0.76) 0%, rgba(5, 8, 13, 0.10) 42%, rgba(5, 8, 13, 0.25) 100%),
    linear-gradient(180deg, rgba(5, 8, 13, 0.65) 0%, transparent 18%, transparent 78%, rgba(5, 8, 13, 0.85) 100%);
}

/* -------------------- Minimalist Header -------------------- */
.hud-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 36px;
  background: linear-gradient(180deg, rgba(5, 8, 13, 0.85) 0%, rgba(5, 8, 13, 0.0) 100%);
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 12px var(--coral);
}

.hud-nav {
  display: flex;
  gap: 24px;
}

.nav-link {
  text-decoration: none;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
}

.hud-lang {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-hi);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.hud-lang:hover {
  background: var(--coral);
  border-color: var(--coral);
}

.scroll-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--coral);
  z-index: 101;
}

/* -------------------- Scrollytelling Tracks -------------------- */
.stream {
  position: relative;
  z-index: 10;
}

.act-track { position: relative; width: 100%; }
.track-hero      { height: 100svh; min-height: 560px; display: flex; align-items: flex-end; padding: 72px 5vw 6vh; }
.track-atlas     { height: 380vh; }
.track-anatomy   { height: 240vh; }
.track-evolution { height: 280vh; }
.track-pde       { height: 250vh; }
.track-phase     { height: 190vh; }

.sticky-frame {
  position: sticky;
  top: 0;
  height: 100svh;
  width: 100%;
  padding: 68px 4vw 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.dark-stage {
  background: rgba(5, 8, 13, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* -------------------- 00 · Hero (Frameless Typography) -------------------- */
.hero-content {
  max-width: 780px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.88rem;
  letter-spacing: 0.24em;
  color: var(--coral);
  margin-bottom: 12px;
}

.hero-content h1 {
  font-size: clamp(3.2rem, min(7.2vw, 11.2vh), 6.4rem);
  font-weight: 300;
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin-bottom: clamp(14px, 2.2vh, 22px);
}

.hero-sub {
  font-size: clamp(1.08rem, min(1.45vw, 2.3vh), 1.32rem);
  font-weight: 300;
  line-height: 1.5;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: clamp(20px, 3.8vh, 38px);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 42px;
}

.hero-stats strong {
  display: block;
  font-size: clamp(1.9rem, min(3.2vw, 5.2vh), 3.0rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
}

.hero-stats span {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 0.80rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* -------------------- 01 · Unobstructed 3D Corridor Tour -------------------- */
.atlas-floating-info {
  max-width: 560px;
  pointer-events: auto;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.9);
}

.atlas-index {
  font-family: var(--mono);
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  color: var(--coral);
  margin-bottom: 6px;
}

.atlas-index .sep { margin: 0 8px; color: var(--dim); }

.atlas-floating-info h2 {
  font-size: clamp(2.0rem, 3.4vw, 3.0rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 14px;
}

.atlas-inline-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 1.08rem;
}

.atlas-inline-metrics strong {
  font-weight: 600;
  color: var(--ink);
}

.atlas-inline-metrics em {
  font-style: normal;
  color: var(--muted);
  margin-left: 4px;
  font-size: 0.92rem;
}

.filmstrip {
  display: grid;
  grid-template-columns: repeat(12, minmax(112px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  pointer-events: auto;
}

.exhibit-card {
  background: rgba(10, 15, 24, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  color: var(--ink);
  text-align: left;
  transition: all 0.22s ease;
}

.exhibit-card:hover {
  border-color: var(--line-hi);
  transform: translateY(-3px);
}

.exhibit-card.active {
  border-color: var(--coral);
  box-shadow: 0 6px 22px rgba(232, 106, 102, 0.35);
  transform: translateY(-4px);
}

.exhibit-card img {
  width: 100%;
  height: 52px;
  object-fit: cover;
  display: block;
}

.ex-card-label {
  display: block;
  padding: 6px 8px;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -------------------- Shared Minimal Section Header & Pills -------------------- */
.minimal-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  flex-wrap: wrap;
}

.minimal-top-bar > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.sec-num {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--coral);
  letter-spacing: 0.1em;
}

.minimal-top-bar h2 {
  font-size: clamp(1.6rem, 2.3vw, 2.2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.pill-row,
.mode-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 7px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.pill-btn:hover {
  color: var(--ink);
  border-color: var(--line-hi);
}

.pill-btn.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--ink);
  color: #fff;
}

.pill-btn.accent,
.pill-btn.shock:hover {
  background: var(--coral);
  border-color: var(--coral);
  color: #fff;
}

.pill-btn.shock {
  border-color: rgba(232, 106, 102, 0.65);
  color: var(--coral);
}

/* -------------------- 02 · Optical Split-Curtain & Laser Profile -------------------- */
.curtain-viewport {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: ew-resize;
  user-select: none;
  margin: 12px 0;
}

.curtain-viewport img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.curtain-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #fff;
  pointer-events: none;
}

.curtain-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--glass);
  backdrop-filter: blur(8px);
  border: 1.5px solid #fff;
}

.curtain-tag {
  position: absolute;
  bottom: 14px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  padding: 5px 12px;
  border-radius: 4px;
  background: rgba(5, 8, 13, 0.75);
}

.curtain-tag.left { left: 16px; color: #fff; }
.curtain-tag.right { right: 16px; color: var(--coral); }

.cliff-strip {
  height: 105px;
  width: 100%;
}

#canyon-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* -------------------- 03 · 1985–2022 4D Evolution -------------------- */
.evo-readout {
  display: flex;
  align-items: baseline;
  gap: 24px;
}

.big-year {
  font-family: var(--mono);
  font-size: 2.8rem;
  font-weight: 500;
  color: var(--coral);
  line-height: 1;
}

.evo-meta {
  display: flex;
  gap: 20px;
  font-size: 1.02rem;
}

.evo-meta em {
  font-style: normal;
  color: var(--muted);
  margin-left: 4px;
}

.evo-canvas-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin: 10px 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #060A11;
}

#timelapse-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.evo-mini-chart {
  position: absolute;
  right: 20px;
  bottom: 18px;
  width: 280px;
  background: rgba(5, 8, 13, 0.74);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  pointer-events: none;
}

#tl-sensor-canvas { width: 100%; height: auto; display: block; }

.evo-legend {
  position: absolute;
  left: 20px;
  bottom: 18px;
  display: flex;
  gap: 18px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  background: rgba(5, 8, 13, 0.72);
  padding: 6px 14px;
  border-radius: 999px;
}

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.d-85 { background: #4DA6DC; }
.d-00 { background: #F5A36C; }
.d-22 { background: #E86A66; }

.timeline-bar {
  display: grid;
  grid-template-columns: 54px 1fr;
  grid-template-rows: auto auto;
  column-gap: 16px;
  row-gap: 4px;
  align-items: center;
}

.timeline-bar .pill-btn { grid-row: 1 / 3; padding: 8px 0; text-align: center; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.20);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--coral);
  border: 2px solid #fff;
  cursor: pointer;
}

.yr-marks {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--dim);
}

/* -------------------- 04 · High-Res WebGL2 PDE Stage & Floating Capsule -------------------- */
.pde-metrics-inline {
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: var(--mono);
  font-size: 0.92rem;
}

.regime-tag {
  color: var(--coral);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.pde-metrics-inline em {
  font-style: normal;
  color: var(--muted);
}

.pde-stage-box {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin: 12px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #050910;
  display: flex;
  align-items: center;
  justify-content: center;
}

#pde-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: crosshair;
  display: block;
}

.pde-hint {
  position: absolute;
  left: 16px;
  bottom: 14px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(5, 8, 13, 0.70);
  padding: 5px 12px;
  border-radius: 999px;
  pointer-events: none;
}

.capsule-bar {
  align-self: center;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line-hi);
  padding: 10px 22px;
  border-radius: 999px;
}

.v-div {
  width: 1px;
  height: 22px;
  background: var(--line);
}

.sl-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--muted);
}

.sl-inline input[type="range"] { width: 105px; }
.sl-inline strong { color: var(--ink); min-width: 40px; }

/* -------------------- 05 · Phase Space -------------------- */
.phase-stage-box {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #060A11;
  overflow: hidden;
}

#phase-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

.floating-star-card {
  position: absolute;
  right: 24px;
  top: 24px;
  width: 260px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.floating-star-card img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}

.star-meta { padding: 12px 14px; }
.star-head { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.86rem; color: var(--coral); }
.star-sub { font-size: 0.95rem; margin: 4px 0 10px; color: var(--ink); }
.star-nums { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--muted); margin-bottom: 12px; }
.star-nums em { font-style: normal; }
.star-nums strong { color: var(--ink); display: block; font-size: 0.96rem; }
.pill-btn.full { width: 100%; }

@media (max-width: 980px) {
  .hud-nav, .v-div, .evo-mini-chart { display: none; }
  .capsule-bar { border-radius: 16px; }
}
