:root {
  --ink: #e5ebe5;
  --muted: #8f9d96;
  --faint: #5d6b65;
  --night: #020706;
  --deep: #06100d;
  --panel: rgba(7, 17, 14, 0.88);
  --panel-solid: #07110e;
  --line: rgba(181, 207, 192, 0.14);
  --line-strong: rgba(181, 207, 192, 0.28);
  --moss: #9eb486;
  --signal: #b9d7a6;
  --warning: #ef735f;
  --amber: #d9aa69;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--night);
}

body {
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.app-shell {
  width: 100%;
  height: 100%;
  background: var(--night);
}

.brand {
  position: absolute;
  z-index: 40;
  top: 22px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  width: max-content;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  width: 1px;
  height: 38px;
  background: var(--line-strong);
  transform: rotate(42deg);
}

.brand-mark::after { transform: rotate(-42deg); }

.brand-mark span {
  position: absolute;
  z-index: 1;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 10px rgba(185, 215, 166, 0.55);
}

.brand-mark span:first-child { transform: translate(-8px, 3px); }
.brand-mark span:nth-child(2) { transform: translate(6px, -8px); }
.brand-mark span:last-child { transform: translate(7px, 8px); }

.brand-copy { display: grid; gap: 2px; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.65)); }
.brand-copy strong { font-size: 13px; letter-spacing: 0.24em; }
.brand-copy small { color: var(--faint); font: 400 9px/1 "DM Mono", monospace; letter-spacing: 0.18em; text-transform: uppercase; }

.live-status {
  position: absolute;
  z-index: 40;
  top: 66px;
  left: 25px;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  color: var(--faint);
  font: 400 9px/1 "DM Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.65));
}

.live-status strong { color: var(--ink); font-size: 11px; }

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 8px rgba(185, 215, 166, 0.75);
  animation: live-breathe 2.8s ease-in-out infinite;
}

.top-controls {
  position: absolute;
  z-index: 40;
  top: 20px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  display: grid;
  grid-template-columns: 18px auto auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  height: 36px;
  padding: 0 2px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: border-color 180ms ease, width 220ms ease;
}

.search-box:focus-within { border-color: var(--line-strong); }

.search-box input {
  width: 108px;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  transition: width 220ms ease;
}

.search-box:focus-within input,
.search-box input:not(:placeholder-shown) { width: 190px; }

.search-box input::placeholder { color: var(--faint); }

.search-box svg,
.icon-button svg,
.globe-hint svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.search-box svg { color: var(--faint); filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.6)); }

kbd {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--faint);
  font: 400 10px/1.4 "DM Mono", monospace;
}

.icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(2, 7, 6, 0.4);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}

.icon-button:hover { color: var(--ink); border-color: var(--line-strong); }

.icon-button b {
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--signal);
  color: var(--night);
  font: 500 9px/1 "DM Mono", monospace;
}

.style-switch {
  position: absolute;
  z-index: 40;
  top: 66px;
  right: 24px;
  display: inline-flex;
  border: 1px solid var(--line);
  background: rgba(2, 7, 6, 0.4);
}

.style-option {
  padding: 7px 13px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font: 400 9px/1 "DM Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.style-option:last-child { border-right: 0; }
.style-option:hover { color: var(--ink); }
.style-option.active { background: rgba(185, 215, 166, 0.11); color: var(--signal); }
.style-option.loading { color: var(--muted); cursor: progress; }
.style-option.loading::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 6px;
  border: 1px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: satellite-loading 700ms linear infinite;
}

@keyframes satellite-loading { to { transform: rotate(360deg); } }

.stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: transparent;
}

.atmosphere {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: min(70vw, 860px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(89, 139, 115, 0.12) 0, rgba(32, 78, 58, 0.06) 50%, transparent 72%);
  filter: blur(18px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.grain {
  position: absolute;
  z-index: 30;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--moss);
  font: 400 9px/1.2 "DM Mono", monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.intro-card {
  position: absolute;
  z-index: 15;
  left: clamp(24px, 6vw, 92px);
  top: 50%;
  width: min(390px, calc(100vw - 48px));
  padding-left: 22px;
  border-left: 1px solid var(--line-strong);
  transform: translateY(-50%);
  transition: opacity 500ms ease, transform 700ms cubic-bezier(.2,.8,.2,1);
}

.intro-card.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-20px, -50%);
}

.intro-card h1 {
  max-width: 340px;
  margin: 0;
  font-size: clamp(38px, 4.4vw, 66px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.intro-card > p:not(.eyebrow) {
  max-width: 330px;
  margin: 22px 0 26px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.intro-card button,
.reset-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: 500 10px/1 "DM Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro-card button { padding: 0 0 8px; border-bottom: 1px solid var(--moss); }
.intro-card button span { display: inline-block; margin-left: 8px; transition: transform 180ms ease; }
.intro-card button:hover span { transform: translate(3px, -3px); }

.filter-panel,
.detail-panel {
  position: absolute;
  z-index: 20;
  border: 1px solid var(--line);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

.filter-panel {
  background: var(--panel);
  backdrop-filter: blur(16px);
}

.filter-panel {
  top: 72px;
  right: 24px;
  width: 274px;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.filter-panel.open { opacity: 1; pointer-events: auto; transform: none; }

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.panel-heading .eyebrow { margin-bottom: 7px; }
.panel-heading h2 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: -0.03em; }

.field-label {
  display: block;
  margin: 16px 0 7px;
  color: var(--faint);
  font: 400 9px/1.2 "DM Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.select-wrap { position: relative; }
.select-wrap::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--faint);
  transform: translateY(-58%);
  pointer-events: none;
}

select {
  width: 100%;
  height: 39px;
  appearance: none;
  padding: 0 32px 0 11px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink);
  font-size: 11px;
}

select option { background: var(--panel-solid); }

.activity-fieldset { margin: 0; padding: 0; border: 0; }
.activity-options { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }

.activity-chip {
  min-width: 0;
  padding: 9px 3px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font-size: 9px;
}

.activity-chip:last-child { border-right: 0; }
.activity-chip.active { background: rgba(185, 215, 166, 0.11); color: var(--signal); }

.reset-button { margin-top: 22px; padding: 0 0 5px; color: var(--muted); border-bottom: 1px solid var(--line-strong); }

.privacy-note {
  display: flex;
  gap: 8px;
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font: 300 9px/1.6 "DM Mono", monospace;
}

.privacy-note span { color: var(--moss); }

.detail-panel {
  top: 72px;
  right: 24px;
  width: min(408px, calc(100vw - 48px));
  max-height: calc(100% - 96px);
  overflow: auto;
  padding: 0;
  background: var(--panel-solid);
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
  transition: opacity 260ms ease, transform 360ms cubic-bezier(.2,.8,.2,1);
}

.detail-panel.open { opacity: 1; pointer-events: auto; transform: none; }

.close-button {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 15px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: rgba(2, 7, 6, 0.5);
  color: var(--ink);
  cursor: pointer;
  font-size: 22px;
  font-weight: 300;
}

.close-button:hover { color: var(--ink); background: rgba(2, 7, 6, 0.78); }

.detail-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.detail-icon img { width: 38px; height: 38px; object-fit: contain; }

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: var(--muted);
  font: 400 8px/1 "DM Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-tag.status-cr { font-weight: 500; text-shadow: 0 0 12px rgba(229, 72, 77, 0.34); }
.status-tag.status-cr::before { width: 7px; height: 7px; box-shadow: 0 0 10px currentColor; }
.status-tag.status-lc { opacity: 0.62; }
.status-tag.status-dd,
.status-tag.status-ne { opacity: 0.72; }

/* Collapsed map card — photo, identity, status, location, model update, journey entry */

.animal-card { display: block; }

.card-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--deep);
  cursor: pointer;
}

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

.card-photo::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(rgba(2, 7, 6, 0), rgba(2, 7, 6, 0.75));
  pointer-events: none;
}

.photo-credit {
  position: absolute;
  z-index: 1;
  left: 14px;
  right: 44px;
  bottom: 10px;
  margin: 0;
  color: rgba(229, 235, 229, 0.72);
  font: 400 8px/1.5 "DM Mono", monospace;
  letter-spacing: 0.04em;
}

.photo-credit a { color: var(--signal); }

.photo-loading,
.photo-fallback {
  display: grid;
  place-items: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  color: var(--faint);
  font: 400 9px/1.5 "DM Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 20px;
}

.photo-loading span { animation: photo-loading 1.4s ease-in-out infinite; }

@keyframes photo-loading {
  0%, 100% { opacity: 0.38; }
  50% { opacity: 0.9; }
}

.card-body { padding: 20px 22px 22px; }
.card-body h2 { margin: 0; font-size: 25px; font-weight: 500; letter-spacing: -0.045em; }
.card-species { margin: 5px 0 0; color: var(--faint); font-size: 11px; }
.card-species i { font-style: italic; }

.card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.card-meta dt { margin: 0 0 6px; color: var(--faint); font: 400 8px/1 "DM Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; }
.card-meta dd { margin: 0; font-size: 11px; color: var(--muted); }

.detail-source,
.profile-source {
  margin: 15px 0 0;
  color: var(--faint);
  font: 400 8px/1.55 "DM Mono", monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-source span,
.profile-source span { color: var(--moss); }

.profile-source { margin: 0; padding: 11px 20px; border-bottom: 1px solid var(--line); background: rgba(2, 7, 6, 0.42); }

.view-journey {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 20px;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: 500 10px/1 "DM Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.view-journey span { transition: transform 180ms ease; }
.view-journey:hover span { transform: translate(3px, -3px); }

/* Expanded editorial profile */

.profile-hero { position: relative; width: 100%; aspect-ratio: 5 / 4; overflow: hidden; background: var(--deep); }
.profile-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 65%;
  background: linear-gradient(rgba(2, 7, 6, 0), rgba(2, 7, 6, 0.92));
  pointer-events: none;
}

.profile-hero-overlay { position: absolute; z-index: 1; left: 22px; right: 44px; bottom: 16px; }
.profile-hero-overlay h2 { margin: 0; font-size: 30px; font-weight: 500; letter-spacing: -0.05em; line-height: 1; }
.profile-hero-overlay p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.profile-hero-overlay p i { font-style: italic; }
.profile-hero .photo-credit { right: 44px; }

.profile-tabs { display: flex; border-bottom: 1px solid var(--line); }

.tab {
  flex: 1;
  padding: 13px 4px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font: 400 9px/1 "DM Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tab:last-child { border-right: 0; }
.tab:hover { color: var(--muted); }
.tab.active { color: var(--signal); box-shadow: inset 0 -1px 0 var(--signal); }

.profile-tab-content { padding: 22px; }

.profile-story { margin: 0 0 22px; color: var(--muted); font-size: 12px; line-height: 1.75; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 22px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.stat-strip.three { grid-template-columns: repeat(3, 1fr); }

.stat { padding: 12px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat span { display: block; margin-bottom: 8px; color: var(--faint); font: 400 8px/1 "DM Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; }
.stat strong { display: block; font-size: 12px; font-weight: 500; line-height: 1.35; }

.route-block { padding-top: 18px; border-top: 1px solid var(--line); }
.route-title { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.route-title h3 { margin: 0; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; }
.route-title span { color: var(--faint); font: 400 8px/1.4 "DM Mono", monospace; text-align: right; }

.route-line { position: relative; display: grid; gap: 15px; margin-left: 3px; }
.route-line::before { content: ""; position: absolute; top: 6px; bottom: 6px; left: 3px; width: 1px; background: linear-gradient(var(--faint), transparent); }
.route-stop { position: relative; padding-left: 18px; color: var(--muted); font-size: 10px; }
.route-stop::before { content: ""; position: absolute; top: 4px; left: 0; width: 7px; height: 7px; border: 1px solid var(--moss); border-radius: 50%; background: var(--panel-solid); }
.route-stop.current { color: var(--ink); }
.route-stop.current::before { background: var(--signal); box-shadow: 0 0 10px rgba(185, 215, 166, 0.45); }

/* Journey tab */

.journey-label { margin: 0 0 16px; color: var(--faint); font: 400 8px/1.6 "DM Mono", monospace; letter-spacing: 0.06em; text-transform: uppercase; }

.range-chips { display: flex; gap: 0; margin-bottom: 18px; border: 1px solid var(--line); }
.range-chip { flex: 1; padding: 9px 3px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--faint); cursor: pointer; font: 400 9px/1 "DM Mono", monospace; letter-spacing: 0.06em; text-transform: uppercase; }
.range-chip:last-child { border-right: 0; }
.range-chip.active { background: rgba(185, 215, 166, 0.11); color: var(--signal); }

.journey-player { margin-bottom: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.journey-player-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

.journey-play {
  padding: 0 0 5px;
  border: 0;
  border-bottom: 1px solid var(--moss);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: 500 10px/1 "DM Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.journey-readout { color: var(--signal); font: 400 9px/1 "DM Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; }

#journey-scrub {
  width: 100%;
  height: 14px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

#journey-scrub::-webkit-slider-runnable-track { height: 1px; background: var(--line-strong); }
#journey-scrub::-moz-range-track { height: 1px; background: var(--line-strong); }
#journey-scrub::-webkit-slider-thumb { appearance: none; width: 9px; height: 9px; margin-top: -4px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 8px rgba(185, 215, 166, 0.6); }
#journey-scrub::-moz-range-thumb { width: 9px; height: 9px; border: 0; border-radius: 50%; background: var(--signal); box-shadow: 0 0 8px rgba(185, 215, 166, 0.6); }

.milestone-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }

.milestone-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 12px;
  border: 0;
  background: var(--panel-solid);
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.milestone-item:hover { background: rgba(185, 215, 166, 0.06); color: var(--ink); }
.milestone-date { flex-shrink: 0; color: var(--faint); font: 400 9px/1 "DM Mono", monospace; letter-spacing: 0.06em; text-transform: uppercase; }
.milestone-label { font-size: 11px; }

/* Species tab */

.species-identity { margin-bottom: 20px; }
.species-identity h3 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
.scientific-name { margin: 4px 0 8px; color: var(--faint); font-size: 11px; font-style: italic; }
.family-tag { display: inline-block; color: var(--moss); font: 400 8px/1 "DM Mono", monospace; letter-spacing: 0.12em; text-transform: uppercase; }

.species-facts { display: grid; gap: 16px; padding-top: 18px; border-top: 1px solid var(--line); }
.species-facts > div { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.species-facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.species-facts dt { margin: 0 0 6px; color: var(--faint); font: 400 8px/1 "DM Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; }
.species-facts dd { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.fact-list { display: grid; gap: 12px; margin: 20px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); list-style: none; }
.fact-list li { position: relative; padding-left: 16px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.fact-list li::before { content: ""; position: absolute; top: 7px; left: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--moss); }

.privacy-note.standalone { margin-top: 4px; }

.timeline {
  position: absolute;
  z-index: 25;
  left: 50%;
  bottom: 26px;
  width: min(420px, calc(100vw - 48px));
  padding: 14px 18px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 260ms ease, transform 360ms cubic-bezier(.2,.8,.2,1);
}

.timeline.visible { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }

.timeline-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.timeline-heading .eyebrow { margin: 0; }
.timeline-readout { color: var(--signal); font: 400 9px/1 "DM Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; }

.timeline input[type="range"] {
  width: 100%;
  height: 14px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.timeline input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--line-strong); }
.timeline input[type="range"]::-moz-range-track { height: 1px; background: var(--line-strong); }
.timeline input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 9px;
  height: 9px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 8px rgba(185, 215, 166, 0.6);
}
.timeline input[type="range"]::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 8px rgba(185, 215, 166, 0.6);
}

.timeline-axis { display: flex; justify-content: space-between; margin-top: 2px; color: var(--faint); font: 400 8px/1.4 "DM Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; }

.map-key {
  position: absolute;
  z-index: 10;
  left: 24px;
  bottom: 20px;
  display: flex;
  gap: 18px;
  color: var(--faint);
  font: 400 8px/1 "DM Mono", monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.map-key span { display: inline-flex; align-items: center; gap: 7px; }
.key-marker { width: 6px; height: 6px; border-radius: 50%; background: var(--moss); }
.key-marker.active { box-shadow: 0 0 8px var(--signal); background: var(--signal); }
.key-marker.quiet { opacity: 0.42; }
.key-marker.critical { width: 8px; height: 8px; border: 1px solid var(--warning); background: transparent; }

.globe-hint {
  position: absolute;
  z-index: 10;
  right: 24px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--faint);
  font: 400 8px/1 "DM Mono", monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: opacity 300ms ease;
}

.globe-hint.hidden { opacity: 0; }
.globe-hint svg { width: 16px; }

.data-attribution {
  position: absolute;
  z-index: 9;
  right: 24px;
  bottom: 42px;
  max-width: 390px;
  margin: 0;
  color: rgba(143, 157, 150, 0.62);
  font: 400 7px/1.45 "DM Mono", monospace;
  letter-spacing: 0.035em;
  text-align: right;
}

.status-toast {
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: 56px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--muted);
  font: 400 9px/1.4 "DM Mono", monospace;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.status-toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-only { display: none; }

.maplibregl-ctrl-bottom-right { right: 18px; bottom: 42px; }
.maplibregl-ctrl-group { overflow: hidden; border: 1px solid var(--line) !important; border-radius: 0 !important; background: rgba(7, 17, 14, 0.74) !important; box-shadow: none !important; backdrop-filter: blur(12px); }
.maplibregl-ctrl-group button { width: 34px; height: 34px; }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1) opacity(.58); }
.maplibregl-ctrl-attrib { color: var(--faint); background: rgba(2, 7, 6, 0.7) !important; font-size: 8px; }
.maplibregl-ctrl-attrib a { color: var(--muted); }
.maplibregl-canvas { outline: none; }

@keyframes live-breathe {
  0%, 100% { opacity: 0.48; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.12); }
}

@media (max-width: 820px) {
  .brand { top: 16px; left: 16px; }
  .brand-copy small { display: none; }
  .brand-copy strong { font-size: 11px; }
  .brand-mark { width: 28px; height: 28px; }
  .live-status { top: 54px; left: 17px; }
  .live-status span:last-child { display: none; }
  .top-controls { top: 14px; right: 16px; gap: 6px; }
  .style-switch { top: 54px; right: 16px; }
  .style-option { padding: 6px 9px; font-size: 8px; }
  .search-box input, .search-box:focus-within input, .search-box input:not(:placeholder-shown) { width: 34vw; max-width: 130px; }
  kbd { display: none; }
  .icon-button span { display: none; }
  .icon-button { width: 36px; padding: 0; }
  .timeline { display: none; }
  .filter-panel {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    width: auto;
    max-height: calc(100dvh - 56px);
    overflow: auto;
    padding: 24px 20px calc(24px + var(--safe-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    transform: translateY(100%);
  }
  .filter-panel.open { transform: none; }
  .mobile-only { display: grid; }
  .detail-panel {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 55;
    width: auto;
    max-height: min(78dvh, 680px);
    padding-bottom: var(--safe-bottom);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    transform: translateY(100%);
  }
  .detail-panel.open { transform: none; }
  .profile-hero, .card-photo { aspect-ratio: 16 / 10; }
  .data-attribution { right: 16px; bottom: 62px; max-width: 300px; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-strip.three { grid-template-columns: repeat(3, 1fr); }
  .intro-card { left: 22px; top: auto; bottom: 92px; transform: none; }
  .intro-card.hidden { transform: translateY(15px); }
  .intro-card h1 { max-width: 300px; font-size: clamp(37px, 12vw, 53px); }
  .intro-card > p:not(.eyebrow) { max-width: 300px; font-size: 12px; }
  .map-key { left: 14px; bottom: 14px; gap: 10px; }
  .map-key span:nth-child(2) { display: none; }
  .globe-hint { display: none; }
  .maplibregl-ctrl-bottom-right { right: 8px; bottom: 44px; }
}

@media (max-width: 520px) {
  .brand-copy { display: none; }
  .live-status { top: 20px; left: auto; right: 16px; }
  .search-box input { font-size: 11px; }
  .intro-card { bottom: 78px; }
  .data-attribution { right: 16px; bottom: 54px; left: 16px; max-width: none; text-align: center; font-size: 6px; }
  .map-key span:last-child { display: none; }
  .card-body h2, .profile-hero-overlay h2 { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Cinematic exploration layer */
.view-switch {
  position: absolute;
  z-index: 40;
  top: 108px;
  right: 24px;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(2, 7, 6, 0.62);
  backdrop-filter: blur(16px);
}

.view-option {
  min-height: 31px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font: 400 8px/1 "DM Mono", monospace;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.view-option:last-child { border-right: 0; }
.view-option:hover { color: var(--ink); }
.view-option.active { background: rgba(217, 170, 105, .11); color: #e4bc7e; }

.intro-card { width: min(570px, calc(100vw - 48px)); }
.intro-card h1 {
  max-width: 560px;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(52px, 6.8vw, 96px);
  font-weight: 300;
  line-height: .88;
  letter-spacing: -.055em;
}

.intro-card > p:not(.eyebrow) { max-width: 470px; }
.intro-actions { display: flex; align-items: center; gap: 22px; margin-top: 28px; }
.intro-actions button { margin: 0; }
.intro-actions .text-action { border-bottom-color: transparent; color: var(--faint); }
.intro-actions .text-action:hover { color: var(--ink); border-bottom-color: var(--line-strong); }

.discovery-dock {
  position: absolute;
  z-index: 32;
  left: 24px;
  bottom: 28px;
  display: grid;
  gap: 10px;
  width: min(330px, calc(100vw - 48px));
  transition: opacity 240ms ease, transform 300ms ease;
}

.safari-launch {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 66px;
  padding: 10px 16px 10px 12px;
  border: 1px solid rgba(217, 170, 105, .36);
  background: linear-gradient(110deg, rgba(35, 28, 15, .92), rgba(5, 14, 11, .86));
  box-shadow: 0 18px 60px rgba(0, 0, 0, .25);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  backdrop-filter: blur(18px);
}

.safari-launch:hover { border-color: rgba(238, 198, 133, .7); transform: translateY(-2px); }
.safari-launch > span:nth-child(2) { display: grid; gap: 4px; }
.safari-launch small { color: var(--amber); font: 400 8px/1 "DM Mono", monospace; letter-spacing: .12em; text-transform: uppercase; }
.safari-launch strong { font-family: "Newsreader", Georgia, serif; font-size: 19px; font-weight: 400; }
.safari-orbit { position: relative; width: 32px; height: 32px; border: 1px solid rgba(217, 170, 105, .5); border-radius: 50%; }
.safari-orbit::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 18px rgba(217, 170, 105, .65); }
.safari-orbit::after { content: ""; position: absolute; top: 15px; left: -4px; width: 38px; height: 1px; background: rgba(217, 170, 105, .45); transform: rotate(-25deg); }

.discovery-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font: 400 8px/1 "DM Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.discovery-list > span { margin-right: 3px; }
.discovery-list button {
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: rgba(2, 7, 6, .64);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  letter-spacing: .04em;
  text-transform: none;
}
.discovery-list button:hover { border-color: var(--line-strong); color: var(--ink); }

.safari-panel {
  position: absolute;
  z-index: 70;
  right: 24px;
  bottom: 96px;
  width: min(430px, calc(100vw - 48px));
  padding: 0 26px 24px;
  border: 1px solid rgba(217, 170, 105, .26);
  background: linear-gradient(145deg, rgba(9, 17, 13, .94), rgba(22, 18, 10, .9));
  box-shadow: 0 32px 100px rgba(0, 0, 0, .48);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 260ms ease, transform 420ms cubic-bezier(.2,.8,.2,1);
  backdrop-filter: blur(26px);
}
.safari-panel[hidden], .journey-story[hidden] { display: none; }
.safari-panel.visible { opacity: 1; transform: none; }
.safari-progress { height: 2px; margin: 0 -26px 22px; background: rgba(255,255,255,.08); }
.safari-progress span { display: block; width: 0; height: 100%; background: var(--amber); box-shadow: 0 0 16px rgba(217, 170, 105, .65); transition: width 700ms ease; }
.safari-meta { display: flex; justify-content: space-between; color: var(--faint); font: 400 8px/1 "DM Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.safari-meta .eyebrow { margin: 0; color: var(--amber); }
.safari-panel h2 { margin: 20px 0 10px; font-family: "Newsreader", Georgia, serif; font-size: clamp(38px, 5vw, 56px); font-weight: 300; line-height: .95; letter-spacing: -.04em; }
.safari-panel > p { margin: 0; color: #bbc5bc; font-size: 13px; line-height: 1.7; }
.safari-panel .interpretation-label { margin-top: 14px; color: var(--faint); font: 400 8px/1.4 "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.safari-actions { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
.safari-actions button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; }
.safari-actions button:hover { border-color: var(--line-strong); color: var(--ink); }
#safari-detail { border-color: rgba(217, 170, 105, .45); color: #ecc98f; }
#safari-stop { margin-left: auto; width: 34px; padding: 0; font-size: 17px; }

.journey-story {
  position: absolute;
  z-index: 68;
  left: 50%;
  bottom: 104px;
  width: min(440px, calc(100vw - 48px));
  padding: 20px 22px;
  border-left: 2px solid var(--signal);
  background: rgba(5, 13, 10, .88);
  box-shadow: 0 24px 80px rgba(0,0,0,.36);
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity 260ms ease, transform 320ms ease;
  backdrop-filter: blur(20px);
}
.journey-story.visible { opacity: 1; transform: translate(-50%, 0); }
.journey-story .eyebrow { margin: 0 0 8px; }
.journey-story h2 { margin: 0 0 7px; font-family: "Newsreader", Georgia, serif; font-size: 25px; font-weight: 300; }
.journey-story p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

.population-snapshot {
  display: grid;
  grid-template-columns: .65fr 1.5fr .8fr;
  margin: 2px 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.population-snapshot > div { display: grid; gap: 7px; padding: 13px 10px 13px 0; border-right: 1px solid var(--line); }
.population-snapshot > div:not(:first-child) { padding-left: 10px; }
.population-snapshot > div:last-child { border-right: 0; }
.population-snapshot span, .threat-block > span { color: var(--faint); font: 400 7px/1.25 "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.population-snapshot strong { color: var(--ink); font-size: 11px; font-weight: 500; line-height: 1.3; }

.inference-card { margin: 18px 0; padding: 15px 16px; border: 1px solid rgba(217, 170, 105, .2); background: rgba(217, 170, 105, .055); }
.inference-card span { color: var(--amber); font: 400 8px/1 "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.inference-card p { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.threat-block { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 18px 0 2px; }
.threat-block > span { width: 100%; margin-bottom: 2px; }
.threat-block b { padding: 6px 8px; border: 1px solid rgba(239, 115, 95, .18); color: #cfaaa2; font-size: 9px; font-weight: 400; }
.key-marker.heat { width: 16px; border-radius: 50%; background: radial-gradient(circle, var(--amber), rgba(158,180,134,.35) 45%, transparent 72%); box-shadow: 0 0 13px rgba(217,170,105,.48); }

@media (max-width: 820px) {
  .view-switch { top: 91px; right: 16px; }
  .view-option { padding: 0 8px; font-size: 7px; }
  .discovery-dock { left: 14px; bottom: 14px; width: min(315px, calc(100vw - 86px)); }
  .discovery-list { display: none; }
  .safari-launch { min-height: 56px; }
  .safari-panel { right: 14px; bottom: 80px; width: calc(100vw - 28px); }
  .journey-story { bottom: 76px; }
  .intro-actions { align-items: flex-start; flex-direction: column; gap: 13px; }
  .intro-card h1 { font-size: clamp(48px, 14vw, 72px); }
  .map-key { display: none; }
}

@media (max-width: 520px) {
  .style-switch { top: 52px; }
  .view-switch { top: 86px; }
  .view-option { min-height: 27px; }
  .intro-card { bottom: 96px; }
  .safari-launch strong { font-size: 17px; }
  .safari-panel { padding: 0 20px 20px; }
  .safari-progress { margin-right: -20px; margin-left: -20px; }
  .safari-panel h2 { font-size: 42px; }
  .population-snapshot { grid-template-columns: 1fr 1fr; }
  .population-snapshot > div:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); }
}

.journey-story-media {
  display: none;
  height: 150px;
  margin: -20px -22px 18px;
  background-position: center;
  background-size: cover;
  filter: saturate(.72) contrast(1.08);
}
.journey-story.has-photo .journey-story-media { display: block; }

/* Journey control deck */
.journey-player {
  position: sticky;
  top: -1px;
  z-index: 5;
  margin: 0 -18px 22px;
  padding: 17px 18px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 14, .96);
  box-shadow: 0 16px 30px rgba(2, 7, 6, .22);
  backdrop-filter: blur(18px);
}

.journey-player-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.journey-player-heading > div { display: grid; gap: 4px; }
.journey-player-label { color: var(--faint); font: 400 7px/1 "DM Mono", monospace; letter-spacing: .12em; text-transform: uppercase; }
.journey-player-heading strong { color: var(--ink); font-family: "Newsreader", Georgia, serif; font-size: 17px; font-weight: 300; }

.journey-controlbar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 13px;
}

.journey-control {
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .015);
  color: var(--muted);
  cursor: pointer;
  font: 400 8px/1 "DM Mono", monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.journey-control:hover { border-color: var(--line-strong); color: var(--ink); }
.journey-control.primary { border-color: rgba(185, 215, 166, .38); background: rgba(185, 215, 166, .08); color: var(--signal); }
.journey-control span { display: inline-block; min-width: 12px; margin-right: 3px; }

#journey-scrub::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(185,215,166,.78) 0 var(--journey-progress, 0%), var(--line-strong) var(--journey-progress, 0%) 100%); }
#journey-scrub::-moz-range-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(185,215,166,.78) 0 var(--journey-progress, 0%), var(--line-strong) var(--journey-progress, 0%) 100%); }
#journey-scrub::-webkit-slider-thumb { width: 13px; height: 13px; margin-top: -5px; border: 2px solid var(--panel-solid); }
#journey-scrub::-moz-range-thumb { width: 13px; height: 13px; border: 2px solid var(--panel-solid); }

.journey-progress-meta {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--faint);
  font: 400 7px/1 "DM Mono", monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.journey-progress-meta strong { color: var(--signal); font-weight: 400; text-align: center; }
.journey-progress-meta span:last-child { text-align: right; }

@media (max-width: 520px) {
  .journey-controlbar { grid-template-columns: 1.1fr 1fr .9fr; }
  .journey-control { padding: 0 4px; font-size: 7px; letter-spacing: .03em; }
  .journey-player-heading strong { font-size: 15px; }
}
