:root {
  --ink: #061014;
  --ink-soft: #0b1b20;
  --mineral: #d9d6ca;
  --mineral-dim: #979b94;
  --line: rgba(217, 214, 202, 0.2);
  --line-strong: rgba(217, 214, 202, 0.38);
  --shallow: #e36f4d;
  --middle: #b86c9e;
  --deep: #5aa9b8;
  --accent: #e5a95b;
  --panel: rgba(5, 14, 18, 0.73);
  --panel-heavy: rgba(5, 14, 18, 0.9);
  color-scheme: dark;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

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

.observatory {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 580px;
  isolation: isolate;
  background:
    radial-gradient(circle at 48% 35%, rgba(40, 71, 76, 0.2), transparent 37%),
    linear-gradient(145deg, #08161a, #040b0e 58%, #071317);
}

#seismic-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#seismic-canvas:active {
  cursor: grabbing;
}

.grain,
.edge-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.grain {
  z-index: 1;
  opacity: 0.04;
  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='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.edge-vignette {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(3, 9, 11, 0.86), transparent 20%, transparent 79%, rgba(3, 9, 11, 0.72)),
    linear-gradient(0deg, rgba(3, 9, 11, 0.86), transparent 27%, transparent 80%, rgba(3, 9, 11, 0.5));
}

.masthead,
.readout,
.depth-legend,
.compass,
.pan-pad,
.layer-panel,
.control-deck,
.data-credit {
  position: absolute;
  z-index: 3;
}

.capital-labels,
.airport-labels,
.trough-labels {
  position: absolute;
  z-index: 3;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.airport-label {
  position: absolute;
  display: block;
  padding: 2px 5px 2px 7px;
  border-left: 2px solid rgba(75, 231, 255, 0.82);
  color: rgba(216, 249, 252, 0.94);
  background: linear-gradient(90deg, rgba(4, 25, 31, 0.9), rgba(5, 14, 18, 0.08));
  font-family: "Arial Narrow", "Yu Gothic UI", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.15;
  white-space: nowrap;
  text-shadow: 0 1px 6px #02080a;
  transform: translate(8px, -50%);
}

.airport-label.is-hub {
  border-left-color: rgba(88, 244, 255, 0.98);
  box-shadow: -5px 0 12px rgba(61, 224, 255, 0.12);
}

.capital-label {
  position: absolute;
  display: block;
  padding: 2px 4px 3px;
  border-bottom: 1px solid rgba(250, 199, 89, 0.72);
  color: rgba(245, 239, 215, 0.92);
  background: linear-gradient(0deg, rgba(5, 14, 18, 0.84), rgba(5, 14, 18, 0.16));
  font-family: "Arial Narrow", "Yu Gothic UI", sans-serif;
  font-size: 8px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 5px #02080a;
  transform: translate(-50%, calc(-100% - 5px));
}

.capital-label::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1px;
  height: 5px;
  background: rgba(250, 199, 89, 0.62);
  content: "";
}

.trough-label {
  position: absolute;
  display: grid;
  gap: 1px;
  padding: 3px 6px 3px 8px;
  border-left: 2px solid rgba(128, 146, 255, 0.82);
  color: rgba(218, 222, 255, 0.94);
  background: linear-gradient(90deg, rgba(8, 10, 31, 0.88), rgba(5, 14, 18, 0.08));
  font-family: "Arial Narrow", "Yu Gothic UI", sans-serif;
  line-height: 1.15;
  white-space: nowrap;
  text-shadow: 0 1px 6px #02040d;
  transform: translate(8px, -50%);
}

.trough-label b {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.trough-label small {
  color: rgba(184, 193, 244, 0.72);
  font-size: 7px;
  letter-spacing: 0.03em;
}

.trough-label.is-highlight {
  border-left-color: rgba(229, 112, 255, 0.96);
  color: rgba(249, 218, 255, 0.98);
  background: linear-gradient(90deg, rgba(31, 7, 40, 0.92), rgba(5, 14, 18, 0.08));
}

.masthead {
  top: 30px;
  left: 34px;
  right: 34px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}

.title-lockup {
  pointer-events: auto;
}

.eyebrow,
.dialog-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: "Arial Narrow", "Yu Gothic UI", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

h1 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(40px, 4vw, 64px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.lede {
  margin: 13px 0 0 2px;
  color: var(--mineral-dim);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.mast-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  background: rgba(7, 16, 20, 0.56);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

.view-button,
.icon-button {
  height: 32px;
  border: 0;
  color: var(--mineral-dim);
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.view-button {
  min-width: 48px;
  padding: 0 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.icon-button {
  width: 34px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
}

.icon-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.view-button:hover,
.icon-button:hover,
.view-button.is-active {
  color: var(--mineral);
  background: rgba(217, 214, 202, 0.1);
}

.readout {
  top: 50%;
  left: 34px;
  width: 188px;
  transform: translateY(-44%);
}

.year-block {
  display: flex;
  flex-direction: column;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
}

.year-kicker,
.mode-label,
.stat-label,
.legend-heading,
.select-control span,
.speed-control span,
.segmented legend {
  color: var(--mineral-dim);
  font-family: "Arial Narrow", "Yu Gothic UI", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.year-value {
  margin: 3px 0 0;
  font-family: "Arial Narrow", "Roboto Condensed", sans-serif;
  font-size: 58px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.mode-label {
  margin-top: 8px;
  letter-spacing: 0.08em;
}

.stat-grid {
  margin-top: 32px;
  border-top: 1px solid var(--line);
}

.stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.stat-value {
  font-family: "Arial Narrow", "Roboto Condensed", monospace;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.stat-label {
  text-align: right;
  letter-spacing: 0.06em;
}

.gesture-hint {
  margin: 14px 0 0;
  color: rgba(217, 214, 202, 0.5);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.gesture-hint span {
  display: inline-block;
  margin-right: 5px;
  color: var(--accent);
}

.depth-legend {
  top: 50%;
  right: 35px;
  width: 84px;
  transform: translateY(-45%);
}

.compass {
  top: 92px;
  right: 53px;
  width: 48px;
  height: 48px;
  color: var(--mineral-dim);
  pointer-events: none;
}

.pan-pad {
  top: 149px;
  right: 53px;
  display: grid;
  grid-template-columns: repeat(3, 16px);
  grid-template-rows: repeat(3, 16px);
  width: 48px;
  height: 48px;
}

.pan-button {
  display: grid;
  width: 16px;
  height: 16px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(217, 214, 202, 0.22);
  color: rgba(217, 214, 202, 0.66);
  background: rgba(5, 14, 18, 0.74);
  cursor: pointer;
  font-family: monospace;
  font-size: 9px;
  line-height: 1;
}

.pan-button:hover,
.pan-button:focus-visible {
  z-index: 1;
  border-color: rgba(229, 169, 91, 0.7);
  color: var(--accent);
  background: rgba(229, 169, 91, 0.1);
}

.pan-up { grid-area: 1 / 2; }
.pan-left { grid-area: 2 / 1; }
.pan-right { grid-area: 2 / 3; }
.pan-down { grid-area: 3 / 2; }

.pan-center {
  display: grid;
  grid-area: 2 / 2;
  place-items: center;
  color: rgba(229, 169, 91, 0.42);
  font-family: monospace;
  font-size: 8px;
}

.compass svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.compass-ring,
.compass-cross {
  fill: none;
  stroke: rgba(217, 214, 202, 0.24);
  stroke-width: 0.75;
}

.compass-arrow {
  fill: rgba(229, 169, 91, 0.82);
  stroke: var(--accent);
  stroke-width: 0.45;
}

.compass-east {
  fill: none;
  stroke: rgba(229, 169, 91, 0.78);
  stroke-width: 0.8;
}

.compass-pin {
  fill: var(--ink);
  stroke: var(--mineral);
  stroke-width: 0.7;
}

.compass text {
  fill: var(--accent);
  font-family: "Arial Narrow", monospace;
  font-size: 5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.layer-panel {
  top: 92px;
  right: 126px;
  width: 236px;
  border: 1px solid rgba(217, 214, 202, 0.25);
  background: linear-gradient(145deg, rgba(5, 14, 18, 0.9), rgba(8, 23, 27, 0.75));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.layer-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 47px;
  padding: 9px 10px 8px 12px;
  border-bottom: 1px solid var(--line);
}

.layer-panel-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--accent);
  font-family: "Arial Narrow", monospace;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.layer-panel h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.layer-panel-head button {
  width: 26px;
  height: 26px;
  padding: 0 0 2px;
  border: 1px solid var(--line);
  color: var(--mineral-dim);
  background: rgba(217, 214, 202, 0.035);
  cursor: pointer;
  font-family: monospace;
  font-size: 15px;
  line-height: 1;
}

.layer-panel-head button:hover {
  color: var(--mineral);
  border-color: var(--line-strong);
}

.layer-panel-body {
  max-height: calc(100vh - 305px);
  padding: 2px 12px 10px;
  overflow-y: auto;
  scrollbar-color: rgba(217, 214, 202, 0.24) transparent;
  scrollbar-width: thin;
}

.layer-panel.is-collapsed {
  width: 154px;
}

.layer-panel.is-collapsed .layer-panel-head {
  border-bottom: 0;
}

.layer-panel.is-collapsed .layer-panel-body {
  display: none;
}

.layer-row {
  padding: 9px 0 7px;
  border-bottom: 1px solid rgba(217, 214, 202, 0.11);
  transition: opacity 160ms ease;
}

.layer-row.is-off {
  opacity: 0.42;
}

.layer-row-priority {
  background: linear-gradient(90deg, rgba(255, 92, 43, 0.075), transparent 76%);
}

.layer-row-trough {
  background: linear-gradient(90deg, rgba(130, 83, 255, 0.09), transparent 78%);
}

.layer-row-basemap {
  background: linear-gradient(90deg, rgba(174, 188, 177, 0.07), transparent 78%);
}

.layer-row-airports {
  background: linear-gradient(90deg, rgba(65, 218, 239, 0.075), transparent 78%);
}

.layer-row-typhoon {
  background: linear-gradient(90deg, rgba(73, 204, 230, 0.09), rgba(255, 184, 72, 0.035) 58%, transparent 82%);
}

.layer-row-depth-maps {
  background: linear-gradient(90deg, rgba(126, 184, 180, 0.1), transparent 80%);
}

.layer-row-head,
.layer-toggle,
.layer-opacity {
  display: flex;
  align-items: center;
}

.layer-row-head {
  justify-content: space-between;
  gap: 10px;
}

.layer-row-head output {
  color: rgba(217, 214, 202, 0.52);
  font-family: "Arial Narrow", monospace;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.layer-toggle {
  position: relative;
  gap: 7px;
  min-width: 0;
  color: rgba(231, 229, 218, 0.9);
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.layer-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.layer-check {
  position: relative;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(217, 214, 202, 0.38);
}

.layer-toggle input:focus-visible + .layer-check {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.layer-toggle input:checked + .layer-check::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--accent);
  box-shadow: 0 0 7px rgba(229, 169, 91, 0.55);
}

.layer-swatch {
  display: block;
  flex: 0 0 auto;
  width: 16px;
  height: 2px;
  box-shadow: 0 0 5px currentColor;
}

.swatch-earthquakes { color: #dc8067; background: currentColor; }
.swatch-depth-maps {
  height: 9px;
  color: #8dc8c1;
  background:
    linear-gradient(180deg, transparent 0 20%, currentColor 20% 31%, transparent 31% 66%, currentColor 66% 77%, transparent 77%),
    linear-gradient(135deg, transparent 0 38%, rgba(141, 200, 193, 0.52) 39% 48%, transparent 49%);
  box-shadow: 0 0 7px rgba(115, 193, 187, 0.48);
}
.swatch-typhoons {
  height: 5px;
  color: #54d8ed;
  background: linear-gradient(90deg, currentColor, #ffc05c);
  clip-path: polygon(0 62%, 18% 18%, 38% 72%, 60% 24%, 80% 66%, 100% 30%, 100% 70%, 80% 100%, 60% 60%, 38% 100%, 18% 52%, 0 92%);
  box-shadow: 0 0 8px rgba(84, 216, 237, 0.7);
}
.swatch-basemap {
  height: 8px;
  border: 1px solid rgba(174, 196, 190, 0.65);
  color: #9eb5ad;
  background:
    linear-gradient(135deg, transparent 0 35%, currentColor 36% 45%, transparent 46% 62%, currentColor 63% 70%, transparent 71%),
    rgba(158, 181, 173, 0.16);
  box-shadow: none;
}
.swatch-faults { color: #ff315b; background: currentColor; }
.swatch-s-faults {
  height: 6px;
  color: #ff632f;
  background: currentColor;
  clip-path: polygon(0 34%, 100% 0, 100% 66%, 0 100%);
  box-shadow: 0 0 9px rgba(255, 83, 36, 0.9);
}
.swatch-troughs {
  height: 5px;
  color: #9a7dff;
  background: linear-gradient(180deg, transparent 0 25%, currentColor 25% 70%, #e570ff 70% 100%);
  clip-path: polygon(0 52%, 22% 18%, 46% 64%, 70% 25%, 100% 58%, 100% 100%, 0 100%);
  box-shadow: 0 0 8px rgba(154, 125, 255, 0.78);
}
.swatch-rivers {
  height: 5px;
  color: #2aa9ff;
  background: currentColor;
  clip-path: polygon(0 56%, 16% 18%, 34% 68%, 52% 28%, 70% 72%, 86% 34%, 100% 56%, 100% 84%, 86% 62%, 70% 100%, 52% 56%, 34% 96%, 16% 46%, 0 84%);
  box-shadow: 0 0 7px rgba(42, 169, 255, 0.72);
}
.swatch-shinkansen {
  height: 4px;
  color: #48f2bd;
  background: currentColor;
  box-shadow: 0 0 8px rgba(72, 242, 189, 0.72);
}
.swatch-highways {
  color: #45b4ff;
  background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 6px);
  box-shadow: 0 0 6px rgba(69, 180, 255, 0.58);
}
.swatch-power-plants {
  width: 8px;
  height: 8px;
  margin: 0 4px;
  border-radius: 50%;
  color: #ffd643;
  background: radial-gradient(circle, #fff4ad 0 24%, currentColor 28% 60%, transparent 64%);
  box-shadow: 0 0 8px rgba(255, 214, 67, 0.82);
}
.swatch-power-lines {
  height: 5px;
  color: #ffc34c;
  background: linear-gradient(180deg, currentColor 0 35%, transparent 35% 58%, currentColor 58% 100%);
  box-shadow: 0 0 7px rgba(255, 186, 59, 0.7);
}
.swatch-prefectures { color: #82b6b9; background: currentColor; }
.swatch-capitals {
  width: 6px;
  height: 6px;
  margin: 0 5px;
  border-radius: 50%;
  color: #f6c555;
  background: currentColor;
}
.swatch-airports {
  width: 9px;
  height: 9px;
  margin: 0 3px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: #52e6f7;
  background: radial-gradient(circle, currentColor 0 30%, transparent 34%);
}

.layer-opacity {
  gap: 9px;
  margin-top: 7px;
  padding-left: 19px;
}

.rank-chip {
  padding: 1px 4px 0;
  border: 1px solid rgba(255, 99, 47, 0.55);
  color: #ff8c65;
  font-family: "Arial Narrow", monospace;
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.typhoon-chip {
  padding: 1px 4px 0;
  border: 1px solid rgba(91, 216, 236, 0.52);
  color: #8be8f5;
  font-family: "Arial Narrow", monospace;
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.depth-map-chip {
  padding: 1px 4px 0;
  border: 1px solid rgba(126, 190, 185, 0.5);
  color: #a5d5d0;
  font-family: "Arial Narrow", monospace;
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.trough-chip {
  padding: 1px 4px 0;
  border: 1px solid rgba(211, 102, 255, 0.54);
  color: #e7a5ff;
  font-family: "Arial Narrow", monospace;
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.river-chip {
  padding: 1px 4px 0;
  border: 1px solid rgba(42, 169, 255, 0.5);
  color: #78caff;
  font-family: "Arial Narrow", monospace;
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.airport-chip {
  padding: 1px 4px 0;
  border: 1px solid rgba(82, 230, 247, 0.48);
  color: #8debf5;
  font-family: "Arial Narrow", monospace;
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.power-chip {
  padding: 1px 4px 0;
  border: 1px solid rgba(255, 195, 76, 0.5);
  color: #ffd179;
  font-family: "Arial Narrow", monospace;
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.layer-opacity span {
  flex: 0 0 auto;
  color: rgba(217, 214, 202, 0.42);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.layer-opacity input {
  width: 100%;
  height: 12px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
}

.layer-opacity input::-webkit-slider-runnable-track {
  height: 1px;
  background: rgba(217, 214, 202, 0.28);
}

.layer-opacity input::-webkit-slider-thumb {
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border: 0;
  border-radius: 50%;
  background: var(--mineral);
  box-shadow: 0 0 0 2px var(--ink-soft);
  appearance: none;
}

.layer-opacity input::-moz-range-track {
  height: 1px;
  background: rgba(217, 214, 202, 0.28);
}

.layer-opacity input::-moz-range-thumb {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 50%;
  background: var(--mineral);
}

.layer-zoom-note {
  margin: 9px 0 0;
  color: rgba(217, 214, 202, 0.4);
  font-size: 7px;
  letter-spacing: 0.04em;
}

.layer-rank-note {
  margin: 8px 0 0;
  color: rgba(255, 141, 101, 0.7);
  font-family: "Arial Narrow", monospace;
  font-size: 7px;
  letter-spacing: 0.03em;
}

.layer-typhoon-note {
  margin: 5px 0 0;
  color: rgba(108, 221, 237, 0.74);
  font-family: "Arial Narrow", monospace;
  font-size: 7px;
  letter-spacing: 0.03em;
}

.layer-depth-map-note {
  margin: 5px 0 0;
  color: rgba(145, 205, 199, 0.72);
  font-family: "Arial Narrow", monospace;
  font-size: 7px;
  letter-spacing: 0.03em;
}

.layer-trough-note {
  margin: 5px 0 0;
  color: rgba(181, 158, 255, 0.74);
  font-family: "Arial Narrow", monospace;
  font-size: 7px;
  letter-spacing: 0.03em;
}

.layer-river-note {
  margin: 5px 0 0;
  color: rgba(94, 190, 255, 0.72);
  font-family: "Arial Narrow", monospace;
  font-size: 7px;
  letter-spacing: 0.02em;
}

.layer-transport-note {
  margin: 5px 0 0;
  color: rgba(97, 210, 226, 0.66);
  font-family: "Arial Narrow", monospace;
  font-size: 7px;
  letter-spacing: 0.03em;
}

.layer-power-note {
  margin: 5px 0 0;
  color: rgba(255, 205, 103, 0.72);
  font-family: "Arial Narrow", monospace;
  font-size: 7px;
  letter-spacing: 0.02em;
}

.layer-airport-note {
  margin: 5px 0 0;
  color: rgba(105, 224, 238, 0.7);
  font-family: "Arial Narrow", monospace;
  font-size: 7px;
  letter-spacing: 0.03em;
}

.basemap-attribution {
  position: absolute;
  z-index: 3;
  right: 28px;
  bottom: 132px;
  display: grid;
  justify-items: end;
  gap: 2px;
  margin: 0;
  color: rgba(217, 214, 202, 0.46);
  font-family: "Arial Narrow", "Yu Gothic UI", sans-serif;
  font-size: 8px;
  letter-spacing: 0.02em;
  pointer-events: auto;
}

.basemap-attribution a {
  color: rgba(198, 214, 207, 0.68);
  text-decoration: none;
}

.basemap-attribution a:hover {
  color: rgba(235, 238, 228, 0.9);
}

.basemap-attribution small {
  font-size: 6px;
}

.basemap-attribution[hidden] {
  display: none;
}

.power-attribution {
  position: absolute;
  z-index: 3;
  right: 28px;
  bottom: 116px;
  margin: 0;
  font-family: "Arial Narrow", "Yu Gothic UI", sans-serif;
  font-size: 8px;
  letter-spacing: 0.02em;
  pointer-events: auto;
}

.power-attribution a {
  color: rgba(255, 213, 123, 0.68);
  text-decoration: none;
}

.power-attribution a:hover {
  color: rgba(255, 236, 194, 0.94);
}

.power-attribution[hidden] {
  display: none;
}

.layer-zoom-note span {
  margin-right: 4px;
  color: var(--accent);
}

.legend-heading {
  display: flex;
  justify-content: space-between;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  letter-spacing: 0.08em;
}

.depth-scale {
  display: flex;
  gap: 11px;
  height: 248px;
  padding: 14px 0 4px;
}

.depth-gradient {
  display: block;
  width: 6px;
  height: 100%;
  background: linear-gradient(to bottom, var(--shallow) 0%, #d99568 10%, var(--middle) 43%, #736b9c 66%, var(--deep) 100%);
  box-shadow: 0 0 12px rgba(184, 108, 158, 0.25);
}

.depth-ticks {
  position: relative;
  display: block;
  flex: 1;
  color: var(--mineral-dim);
  font-family: "Arial Narrow", monospace;
  font-size: 9px;
}

.depth-ticks span {
  position: absolute;
  left: 0;
  transform: translateY(-50%);
  white-space: nowrap;
}

.depth-ticks span.is-start {
  transform: none;
}

.depth-ticks span.is-end {
  transform: translateY(-100%);
}

.depth-ticks span::before {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(100% + 5px);
  width: 5px;
  border-top: 1px solid rgba(217, 214, 202, 0.4);
}

.depth-ticks b {
  color: var(--mineral);
  font-size: 10px;
  font-weight: 500;
}

.depth-ticks .depth-map-tick b {
  color: #9ed7d1;
}

.depth-map-tick em {
  margin-left: 3px;
  color: rgba(129, 201, 194, 0.78);
  font-size: 6px;
  font-style: normal;
  letter-spacing: 0.08em;
}

.distance-scale-note {
  margin: 8px 0 10px;
  color: rgba(229, 169, 91, 0.68);
  font-family: "Arial Narrow", monospace;
  font-size: 7px;
  letter-spacing: 0.03em;
  line-height: 1.35;
}

.magnitude-key {
  display: grid;
  grid-template-columns: 16px 1fr 16px 1fr;
  gap: 7px 3px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--mineral-dim);
  font-family: "Arial Narrow", monospace;
  font-size: 8px;
}

.magnitude-dot {
  display: block;
  justify-self: center;
  border: 1px solid var(--mineral);
  border-radius: 50%;
}

.magnitude-dot.m4 { width: 4px; height: 4px; }
.magnitude-dot.m6 { width: 8px; height: 8px; }
.magnitude-dot.m8 { width: 13px; height: 13px; }

.control-deck {
  right: 34px;
  bottom: 27px;
  left: 34px;
  padding: 15px 17px 13px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(90deg, rgba(5, 14, 18, 0.92), rgba(7, 20, 24, 0.78));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.transport {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  align-items: center;
}

.play-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 35px;
  padding: 0 12px;
  border: 1px solid rgba(229, 169, 91, 0.55);
  color: #f1d8b0;
  background: rgba(229, 169, 91, 0.1);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  transition: background 160ms ease, border-color 160ms ease;
}

.play-button:hover {
  border-color: var(--accent);
  background: rgba(229, 169, 91, 0.17);
}

.play-button svg {
  width: 14px;
  fill: currentColor;
}

.pause-icon,
.play-button.is-playing .play-icon {
  display: none;
}

.play-button.is-playing .pause-icon {
  display: block;
}

.timeline-wrap {
  position: relative;
  display: block;
  height: 38px;
  cursor: pointer;
}

#year-slider {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 38px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.timeline-track {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(217, 214, 202, 0.22);
}

.timeline-progress {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--accent);
  box-shadow: 0 0 9px rgba(229, 169, 91, 0.55);
}

.timeline-progress::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -6px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 14px rgba(229, 169, 91, 0.66);
  transform: translateY(-50%);
}

.era-mark {
  position: absolute;
  top: -3px;
  color: rgba(217, 214, 202, 0.45);
  font-family: "Arial Narrow", monospace;
  font-size: 8px;
  transform: translateX(-50%);
}

.era-mark i {
  display: block;
  width: 1px;
  height: 7px;
  margin: 0 auto 4px;
  background: rgba(217, 214, 202, 0.36);
}

.era-mark.major {
  color: rgba(227, 111, 77, 0.85);
}

.era-mark.major i {
  height: 12px;
  margin-top: -5px;
  background: rgba(227, 111, 77, 0.75);
}

.era-mark:first-of-type {
  transform: none;
}

.era-mark:last-of-type {
  transform: translateX(-100%);
}

.filters {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.segmented {
  display: flex;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented legend,
.select-control span,
.speed-control span {
  float: left;
  width: auto;
  margin: 0 8px 0 0;
  line-height: 28px;
  letter-spacing: 0.08em;
}

.segment {
  min-width: 52px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  color: var(--mineral-dim);
  background: rgba(217, 214, 202, 0.025);
  cursor: pointer;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.segment:hover,
.segment.is-active {
  border-color: rgba(217, 214, 202, 0.45);
  color: var(--mineral);
  background: rgba(217, 214, 202, 0.09);
}

.select-control,
.speed-control {
  display: flex;
  margin-left: auto;
}

.speed-control {
  margin-left: 0;
}

select {
  height: 28px;
  padding: 0 27px 0 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--mineral);
  background:
    linear-gradient(45deg, transparent 50%, var(--mineral-dim) 50%) calc(100% - 12px) 11px / 4px 4px no-repeat,
    linear-gradient(135deg, var(--mineral-dim) 50%, transparent 50%) calc(100% - 8px) 11px / 4px 4px no-repeat,
    rgba(217, 214, 202, 0.04);
  appearance: none;
  cursor: pointer;
  font-size: 9px;
}

.data-credit {
  right: 37px;
  bottom: 141px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(217, 214, 202, 0.48);
  font-family: "Arial Narrow", monospace;
  font-size: 8px;
  letter-spacing: 0.1em;
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 7px var(--accent);
}

.data-credit button {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(217, 214, 202, 0.25);
  border-radius: 50%;
  color: var(--mineral-dim);
  background: rgba(5, 14, 18, 0.7);
  cursor: pointer;
  font-family: serif;
  font-size: 11px;
}

.tooltip {
  position: absolute;
  z-index: 5;
  width: 218px;
  padding: 15px;
  border: 1px solid var(--line-strong);
  color: var(--mineral);
  background: var(--panel-heavy);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}

.tooltip-close,
.dialog-close {
  position: absolute;
  top: 7px;
  right: 8px;
  border: 0;
  color: var(--mineral-dim);
  background: transparent;
  cursor: pointer;
}

.tooltip-date {
  margin: 0 0 7px;
  color: var(--mineral-dim);
  font-family: "Arial Narrow", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.tooltip-mag {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: "Arial Narrow", monospace;
  font-size: 28px;
  font-weight: 300;
}

.tooltip dl {
  margin: 0;
  border-top: 1px solid var(--line);
}

.tooltip dl div {
  display: flex;
  justify-content: space-between;
  padding-top: 7px;
  font-size: 10px;
}

.tooltip dt { color: var(--mineral-dim); }
.tooltip dd { margin: 0; font-family: monospace; }

dialog {
  width: min(480px, calc(100vw - 36px));
  padding: 32px;
  border: 1px solid var(--line-strong);
  color: var(--mineral);
  background: #0a171b;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.72);
}

dialog::backdrop {
  background: rgba(2, 7, 9, 0.72);
  backdrop-filter: blur(4px);
}

dialog h2 {
  margin: 0 0 20px;
  font-family: "Yu Mincho", serif;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

dialog p:not(.dialog-kicker) {
  color: #b4b6af;
  font-size: 12px;
  line-height: 1.9;
}

.dialog-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 23px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.dialog-links a {
  color: var(--accent);
  font-size: 10px;
  text-decoration: none;
}

.loading-screen,
.no-webgl {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  background: #061014;
  transition: opacity 600ms ease, visibility 600ms ease;
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-screen p {
  margin: 20px 0 5px;
  font-size: 11px;
  letter-spacing: 0.14em;
}

.loading-screen small {
  color: var(--mineral-dim);
  font-family: "Arial Narrow", monospace;
  font-size: 8px;
  letter-spacing: 0.18em;
}

.loading-mark {
  position: relative;
  width: 70px;
  height: 48px;
}

.loading-mark span {
  position: absolute;
  left: 50%;
  width: 56px;
  height: 1px;
  background: var(--accent);
  transform: translateX(-50%) skewX(-34deg);
  animation: strata 1.5s ease-in-out infinite;
}

.loading-mark span:nth-child(1) { top: 8px; }
.loading-mark span:nth-child(2) { top: 23px; animation-delay: 120ms; }
.loading-mark span:nth-child(3) { top: 38px; animation-delay: 240ms; }

@keyframes strata {
  0%, 100% { opacity: 0.28; transform: translateX(-50%) skewX(-34deg) scaleX(0.75); }
  50% { opacity: 1; transform: translateX(-50%) skewX(-34deg) scaleX(1); }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .observatory { min-height: 500px; }
  .masthead { top: 19px; left: 19px; right: 19px; }
  h1 { font-size: 40px; }
  .lede { display: none; }
  .eyebrow { font-size: 8px; }
  .readout { top: 128px; left: 19px; width: 145px; transform: none; }
  .year-value { font-size: 43px; }
  .stat-grid { margin-top: 16px; }
  .stat { padding: 7px 0; }
  .stat-value { font-size: 14px; }
  .stat-label { font-size: 7px; }
  .gesture-hint { display: none; }
  .depth-legend { right: 18px; width: 67px; }
  .compass { top: 77px; right: 28px; width: 42px; height: 42px; }
  .pan-pad { display: none; }
  .layer-panel { top: 132px; right: 20px; width: 214px; }
  .depth-scale { height: 180px; }
  .magnitude-key { display: none; }
  .control-deck { right: 12px; bottom: 12px; left: 12px; padding: 12px; }
  .transport { grid-template-columns: 104px 1fr; gap: 10px; }
  .play-button { padding: 0 8px; font-size: 8px; }
  .filters { gap: 8px; overflow-x: auto; padding-bottom: 2px; }
  .segmented legend, .select-control span, .speed-control span { display: none; }
  .segment { min-width: 43px; padding: 0 7px; }
  .select-control { margin-left: 0; }
  .data-credit { right: 16px; bottom: 127px; }
  .view-button { min-width: 39px; padding: 0 7px; font-size: 9px; }
  .icon-button { width: 30px; }
}

@media (max-width: 520px) {
  .mast-actions .view-button[data-view="top"] { display: none; }
  .depth-legend { top: 45%; }
  .readout .stat-grid { width: 125px; }
  .speed-control { display: none; }
  .tooltip { width: 190px; }
  .layer-panel { top: 124px; right: 16px; width: 206px; }
  .layer-panel-body { padding-right: 10px; padding-left: 10px; }
  .layer-opacity { padding-left: 16px; }
  .capital-label { font-size: 7px; }
  .airport-label { font-size: 8px; }
  .basemap-attribution { right: 16px; bottom: 122px; }
  .power-attribution { right: 16px; bottom: 108px; }
}

@media (max-height: 600px) and (orientation: landscape) {
  .observatory { min-height: 0; }
  .masthead { top: 12px; left: 18px; right: 18px; }
  .eyebrow { margin-bottom: 4px; font-size: 7px; }
  h1 { font-size: 34px; }
  .lede { display: none; }
  .readout { top: 80px; left: 18px; width: 152px; transform: none; }
  .year-value { font-size: 38px; }
  .mode-label { margin-top: 4px; }
  .stat-grid { margin-top: 12px; }
  .stat { padding: 5px 0; }
  .stat-value { font-size: 13px; }
  .stat-label { font-size: 7px; }
  .gesture-hint { display: none; }
  .depth-legend { top: 43%; right: 18px; width: 68px; }
  .compass { top: 64px; right: 88px; width: 40px; height: 40px; }
  .pan-pad { top: 110px; right: 84px; }
  .layer-panel { top: 63px; right: 142px; width: 212px; }
  .layer-row { padding-top: 6px; padding-bottom: 5px; }
  .layer-opacity { margin-top: 4px; }
  .depth-scale { height: 145px; }
  .magnitude-key { display: none; }
  .control-deck { right: 18px; bottom: 10px; left: 18px; padding: 9px 12px 8px; }
  .transport { grid-template-columns: 110px 1fr; gap: 12px; }
  .play-button { min-height: 30px; padding: 0 8px; font-size: 8px; }
  .timeline-wrap { height: 31px; }
  #year-slider { height: 31px; }
  .timeline-track { top: 13px; }
  .filters { gap: 10px; margin-top: 7px; padding-top: 7px; }
  .segment, select { height: 25px; }
  .segmented legend, .select-control span, .speed-control span { display: none; }
  .select-control { margin-left: 0; }
  .data-credit { right: 21px; bottom: 105px; }
}

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