:root {
  --bg: #08110f;
  --panel: rgba(9, 22, 19, 0.88);
  --panel-solid: #0d1916;
  --text: #f2efe7;
  --muted: #b7c4ba;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #d8a547;
  --water: #6fb7d8;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(73, 119, 93, 0.26), transparent 30%),
    radial-gradient(circle at 90% 20%, rgba(84, 57, 31, 0.25), transparent 30%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
p {
  margin-top: 0;
}

.atlas-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

/* Top nav */

.atlas-topbar {
  position: relative;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 17, 15, 0.82);
  backdrop-filter: blur(14px);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.03em;
}

.atlas-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  color: var(--muted);
  font-size: 0.95rem;
}

.atlas-nav a:hover,
.atlas-nav a[aria-current="page"] {
  color: var(--text);
}

/* Intro */

.intro-panel {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.1rem clamp(1rem, 4vw, 3rem) 0.85rem;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.intro-panel h1 {
  margin: 0 auto 0.55rem;
  font-size: clamp(2.75rem, 6vw, 5.25rem);
  line-height: 0.9;
  letter-spacing: -0.07em;
  text-align: center;
}

.intro-panel .summary {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.6vw, 1.15rem);
  line-height: 1.4;
  text-align: center;
}

.data-load-status,
.data-badge {
  display: inline-block;
  margin: 0.7rem 0 0;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
  font-weight: 800;
}

/* Map shell */

.map-stage {
  position: relative;
  height: calc(100vh - 205px);
  min-height: 620px;
  margin: 0 clamp(1rem, 3vw, 2rem) 1.5rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #10221d;
  box-shadow: var(--shadow);
}

#map {
  width: 100%;
  height: 100%;
  min-height: 620px;
  filter: saturate(0.85) contrast(1.05);
}

.leaflet-container {
  background: #10221d;
  font-family: inherit;
}

.leaflet-tile-pane {
  filter: grayscale(45%) saturate(75%) brightness(90%) contrast(100%);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  color: var(--text);
  background: var(--panel-solid);
}

path.leaflet-interactive:focus {
  outline: none;
}

/* Shared map cards */

.legend-card,
.stream-card,
.mode-control,
.layer-toggle-card,
.view-toggle-card {
  position: absolute;
  z-index: 500;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

/* View jump card - hidden for statewide Colorado view */

.view-toggle-card {
  display: none;
}

.view-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.view-buttons button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.45rem 0.7rem;
}

.view-buttons button:hover,
.view-buttons button:focus-visible {
  border-color: var(--accent);
  outline: none;
}

/* Layer toggle card */

.layer-toggle-card {
  position: absolute;
  top: 4.75rem;
  left: 1.25rem;
  right: auto;
  bottom: auto;
  width: 260px;
  padding: 1rem;
  z-index: 1000;
}

.layer-toggle-card .eyebrow {
  margin-bottom: 0.55rem;
}

.layer-toggle-card label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.layer-toggle-card input[type="checkbox"] {
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.layer-help {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

/* Legend */

.legend-card {
  top: 1rem;
  right: 1rem;
  width: 290px;
  max-height: calc(100% - 2rem);
  overflow-y: auto;
  padding: 1rem;
  z-index: 550;
}

.legend-card h2,
.stream-card h2 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.45rem 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.swatch {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
}

/* Selected stream card */

.stream-card {
  left: 1.25rem;
  top: 12.25rem;
  width: min(430px, calc(100% - 2.5rem));
  max-height: calc(100% - 18rem);
  overflow-y: auto;
  padding: 1rem;
  z-index: 545;
}

.stream-card p {
  color: var(--muted);
  line-height: 1.45;
}

.stream-card dl {
  display: grid;
  grid-template-columns: 125px 1fr;
  gap: 0.45rem 0.75rem;
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.stream-card dt {
  color: var(--text);
  font-weight: 700;
}

.stream-card dd {
  margin: 0;
}

/* Mode slider */

.mode-control {
  left: 50%;
  bottom: 1rem;
  width: min(640px, calc(100% - 2rem));
  padding: 1rem;
  transform: translateX(-50%);
  z-index: 570;
}

.mode-labels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

#mode-description {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Tooltips */

.stream-tooltip {
  padding: 0.25rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #f2efe7;
  background: rgba(9, 22, 19, 0.9);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* Notes */

.atlas-notes {
  max-width: 900px;
  padding: 0 clamp(1rem, 4vw, 3rem) 3rem;
  color: var(--muted);
  line-height: 1.55;
}

.atlas-notes h2 {
  color: var(--text);
}

/* Tablet / mobile stacked layout */

@media (max-width: 1050px) {
  body {
    overflow-x: hidden;
  }

  .atlas-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro-panel {
    padding: 1rem 0.9rem 0.75rem;
  }

  .intro-panel h1 {
    font-size: clamp(2.6rem, 13vw, 3.8rem);
    line-height: 0.92;
  }

  .intro-panel .summary {
    font-size: 0.98rem;
    line-height: 1.4;
  }

  .map-stage {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: auto;
    min-height: 0;
    margin: 0 0.75rem 1.5rem;
    padding: 0.75rem;
    overflow: visible;
    border-radius: 22px;
  }

  #map {
    order: 1;
    height: 48vh;
    min-height: 340px;
    border-radius: 16px;
    overflow: hidden;
    flex: 0 0 auto;
  }

  .view-toggle-card,
  .layer-toggle-card,
  .legend-card,
  .stream-card,
  .mode-control {
    position: relative;
    z-index: 500;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
    transform: none;
  }

  .view-toggle-card {
  display: none;
  }

 .layer-toggle-card {
  order: 3;
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: 100%;
  max-width: none;
  padding: 1rem;
}

  .legend-card {
    order: 4;
    padding: 1rem;
  }

  .stream-card {
    order: 5;
    padding: 1rem;
  }

  .mode-control {
    order: 6;
    padding: 1rem;
  }

  .stream-card dl {
    grid-template-columns: 105px 1fr;
    gap: 0.45rem 0.6rem;
    font-size: 0.88rem;
  }

  .mode-labels {
    gap: 0.35rem;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
  }

  #mode-description {
    font-size: 0.85rem;
    line-height: 1.35;
  }

  .leaflet-control-zoom {
    margin-top: 0.75rem !important;
    margin-left: 0.75rem !important;
  }

  .atlas-notes {
    padding: 0 1rem 2rem;
  }
}
.species-guide-hero {
  max-width: 900px;
  margin: 4rem auto 3rem;
}

.eyebrow {
  margin-bottom: 0.75rem;
  color: var(--accent, #77bfa3);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.species-guide-list {
  display: grid;
  gap: 3rem;
  margin: 3rem 0 5rem;
}

.species-guide-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: 2rem;
  align-items: center;
}

.species-guide-row.reverse {
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
}

.species-guide-row.reverse .species-fish-panel {
  grid-column: 2;
  grid-row: 1;
}

.species-guide-row.reverse .species-text-panel {
  grid-column: 1;
  grid-row: 1;
}

.species-fish-panel,
.species-text-panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.species-fish-panel {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  overflow: hidden;
}

.species-text-panel {
  padding: 1.6rem;
}

.species-text-panel h2 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.scientific-name {
  margin-top: 0;
  color: var(--muted, #a8b3ad);
  font-style: italic;
}

.species-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 1.25rem;
}

.species-tags span {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(119, 191, 163, 0.12);
  color: var(--accent, #77bfa3);
  font-size: 0.78rem;
  font-weight: 700;
}

.featured-species .species-text-panel {
  border-color: rgba(230, 183, 77, 0.45);
}

/* CSS fish */
.css-fish {
  position: relative;
  width: min(100%, 420px);
  height: 180px;
}

.css-fish span {
  position: absolute;
  display: block;
}

.fish-body {
  left: 40px;
  top: 58px;
  width: 270px;
  height: 92px;
  border: 3px solid rgba(18, 24, 22, 0.92);
  border-radius: 65% 45% 45% 65%;
}

.fish-tail {
  right: 26px;
  top: 68px;
  width: 80px;
  height: 74px;
  border: 3px solid rgba(18, 24, 22, 0.92);
  clip-path: polygon(0 50%, 100% 0, 78% 50%, 100% 100%);
}

.fish-dorsal {
  left: 142px;
  top: 22px;
  width: 70px;
  height: 58px;
  border: 3px solid rgba(18, 24, 22, 0.92);
  clip-path: polygon(10% 100%, 48% 0, 88% 100%);
}

.fish-pectoral {
  left: 168px;
  top: 123px;
  width: 66px;
  height: 44px;
  border: 3px solid rgba(18, 24, 22, 0.92);
  clip-path: polygon(0 0, 100% 28%, 42% 100%);
}

.fish-eye {
  left: 86px;
  top: 86px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #111;
}

.fish-gill {
  left: 118px;
  top: 98px;
  width: 38px;
  height: 34px;
  border-left: 4px solid rgba(18, 24, 22, 0.92);
  transform: rotate(12deg);
}

/* Different trout colors */
.yellowfin-fish .fish-body {
  background: linear-gradient(180deg, #d2a74d 0%, #f2ca5c 48%, #b97837 100%);
}

.yellowfin-fish .fish-tail,
.yellowfin-fish .fish-dorsal,
.yellowfin-fish .fish-pectoral {
  background: #d9ad4a;
}

.greenback-fish .fish-body {
  background: linear-gradient(180deg, #637b58 0%, #b2a35b 50%, #8a633f 100%);
}

.greenback-fish .fish-tail,
.greenback-fish .fish-dorsal,
.greenback-fish .fish-pectoral {
  background: #8f8a4d;
}

.colorado-fish .fish-body {
  background: linear-gradient(180deg, #8b7751 0%, #c29a5a 52%, #9f6641 100%);
}

.colorado-fish .fish-tail,
.colorado-fish .fish-dorsal,
.colorado-fish .fish-pectoral {
  background: #b98246;
}

.rio-fish .fish-body {
  background: linear-gradient(180deg, #b08b55 0%, #d1ad63 48%, #a45f3f 100%);
}

.rio-fish .fish-tail,
.rio-fish .fish-dorsal,
.rio-fish .fish-pectoral {
  background: #c58b4b;
}

.lahontan-fish .fish-body {
  background: linear-gradient(180deg, #8f9a84 0%, #c6b071 48%, #9d7351 100%);
}

.lahontan-fish .fish-tail,
.lahontan-fish .fish-dorsal,
.lahontan-fish .fish-pectoral {
  background: #a89968;
}

@media (max-width: 800px) {
  .species-guide-row,
  .species-guide-row.reverse {
    grid-template-columns: 1fr;
  }

  .species-guide-row.reverse .species-fish-panel,
  .species-guide-row.reverse .species-text-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .species-guide-row.reverse .species-fish-panel {
    order: 1;
  }

  .species-guide-row.reverse .species-text-panel {
    order: 2;
  }

  .species-fish-panel {
    min-height: 260px;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    overflow: hidden;
  }

  .css-fish {
    transform: scale(0.82);
  }
}
.species-fish-art {
  width: 100%;
  max-width: 720px;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 22px 32px rgba(0, 0, 0, 0.28));
}
.species-guide-hero,
.species-guide-list {
  width: min(100% - 2rem, 1400px);
  margin-inline: auto;
}

.species-guide-list {
  gap: 2.5rem;
}
.deep-time-story {
  width: min(100% - 2rem, 1400px);
  margin: 3rem auto 5rem;
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
  gap: 3rem;
  align-items: start;
}

.deep-time-stage {
  position: sticky;
  top: 1.5rem;
  min-height: 680px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 20%, rgba(119, 191, 163, 0.18), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.deep-time-stage h1 {
  max-width: 680px;
  margin: 0 0 1.5rem;
  font-size: clamp(2.3rem, 5vw, 5.4rem);
  line-height: 0.95;
}

.deep-time-visual {
  position: relative;
  height: 320px;
  margin: 2rem 0;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(22, 42, 48, 0.9), rgba(17, 31, 28, 0.95)),
    radial-gradient(circle at 30% 60%, rgba(72, 126, 168, 0.55), transparent 40%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.water-line {
  position: absolute;
  height: 4px;
  border-radius: 999px;
  background: rgba(119, 191, 163, 0.65);
  transform-origin: left center;
  transition: all 450ms ease;
}

.water-line-one {
  width: 42%;
  left: 8%;
  top: 54%;
  transform: rotate(-8deg);
}

.water-line-two {
  width: 34%;
  left: 38%;
  top: 42%;
  transform: rotate(16deg);
}

.water-line-three {
  width: 28%;
  left: 62%;
  top: 62%;
  transform: rotate(-18deg);
}

.basin-dot {
  position: absolute;
  padding: 0.38rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(235, 244, 239, 0.72);
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 450ms ease;
}

.basin-coast {
  left: 8%;
  top: 48%;
}

.basin-columbia {
  left: 30%;
  top: 36%;
}

.basin-snake {
  left: 47%;
  top: 55%;
}

.basin-lahontan {
  left: 35%;
  top: 70%;
}

.basin-bonneville {
  left: 58%;
  top: 75%;
}

.basin-rockies {
  left: 72%;
  top: 42%;
}

.deep-time-visual[data-stage="coast"] .basin-coast,
.deep-time-visual[data-stage="inland"] .basin-columbia,
.deep-time-visual[data-stage="inland"] .basin-snake,
.deep-time-visual[data-stage="ice"] .basin-lahontan,
.deep-time-visual[data-stage="ice"] .basin-bonneville,
.deep-time-visual[data-stage="flood"] .water-line,
.deep-time-visual[data-stage="isolation"] .basin-dot,
.deep-time-visual[data-stage="modern"] .basin-dot {
  background: rgba(230, 183, 77, 0.22);
  color: #f2d27a;
  box-shadow: 0 0 26px rgba(230, 183, 77, 0.22);
}

.deep-time-visual[data-stage="flood"] .water-line-one {
  width: 76%;
  transform: rotate(3deg);
}

.deep-time-visual[data-stage="flood"] .water-line-two {
  width: 62%;
  left: 20%;
  transform: rotate(-13deg);
}

.deep-time-visual[data-stage="flood"] .water-line-three {
  width: 55%;
  left: 36%;
  transform: rotate(21deg);
}

.deep-time-visual[data-stage="isolation"] .water-line {
  opacity: 0.25;
  width: 18%;
}

.deep-time-visual[data-stage="modern"] .water-line {
  opacity: 0.45;
}

.deep-time-caption {
  max-width: 760px;
  color: var(--muted, #a8b3ad);
  font-size: 1.05rem;
  line-height: 1.7;
}

.deep-time-scenes {
  display: grid;
  gap: 2rem;
}

.deep-time-scene {
  min-height: 360px;
  padding: 2rem;
  display: grid;
  align-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.045);
}

.deep-time-scene span {
  color: var(--accent, #77bfa3);
  font-weight: 800;
  letter-spacing: 0.14em;
}

.deep-time-scene h2 {
  margin: 0.5rem 0 1rem;
  font-size: clamp(1.7rem, 3vw, 3rem);
}

.deep-time-scene p {
  max-width: 680px;
  color: var(--muted, #a8b3ad);
  font-size: 1.05rem;
  line-height: 1.75;
}

@media (max-width: 900px) {
  .deep-time-story {
    grid-template-columns: 1fr;
  }

  .deep-time-stage {
    position: relative;
    top: auto;
    min-height: auto;
  }

  .deep-time-visual {
    height: 260px;
  }

  .deep-time-scene {
    min-height: auto;
  }
}
.leaflet-control-attribution {
  font-size: 10px;
  opacity: 0.65;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 6px 0 0 0;
  padding: 2px 5px;
}
