@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-600-latin.woff2") format("woff2");
  font-weight: 500 600;
  font-display: swap;
}
[hidden] { display: none !important; }
body { margin: 0; }
/* Layout: the globe fills the night sky; a translucent legend sheet floats top-left, tooltip follows the pointer.
   Deliberately single-theme: the subject is Earth seen from orbit at night. */
:root {
  color-scheme: dark;
  --space: #070a12;
  --space-2: #111a2e;
  --ocean: #0d1830;
  --sheet: rgba(12, 17, 30, 0.84);
  --ink: #eef0f6;
  --muted: #9aa3ba;
  --rule: #2a3550;
  --accent: #f6a34a;
  --r0: #3b2a6b; --r1: #b23a6e; --r2: #f08a3e; --r3: #fff1c2;
  --b0: #6c7896; --b1: #e05fa8; --b2: #46b6e0; --b3: #f6a34a;
  --f-display: "Archivo", "Arial Narrow", sans-serif;
  --f-body: "Archivo", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
html, body { height: 100%; }
body { background: radial-gradient(ellipse at 65% 45%, var(--space-2), var(--space) 70%) fixed, var(--space); color: var(--ink); font-family: var(--f-body); overflow: hidden; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; touch-action: none; }
.sheet {
  position: fixed; z-index: 2;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  left: max(16px, env(safe-area-inset-left, 0px));
  width: min(320px, calc(100vw - 32px));
  max-height: calc(100% - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  background: var(--sheet); backdrop-filter: blur(10px);
  border: 1px solid var(--rule); border-radius: 8px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 14px;
}
.eyebrow { font: 500 11px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1 { font: 800 32px/0.95 var(--f-display); letter-spacing: -.02em; margin: 6px 0 0; text-wrap: balance; }
.big { font: 600 22px/1 var(--f-display); color: var(--accent); font-variant-numeric: tabular-nums; }
.lede { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.lede strong { color: var(--ink); font-weight: 600; }
.group { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--rule); padding-top: 12px; }
.seg { display: flex; border: 1px solid var(--rule); border-radius: 5px; overflow: hidden; }
.seg button { flex: 1; font: 600 13px var(--f-body); padding: 7px 6px; background: transparent; color: var(--ink); border: 0; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--space); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ramp { height: 10px; border-radius: 2px; background: linear-gradient(90deg, var(--r0), var(--r1) 40%, var(--r2) 72%, var(--r3)); }
.ticks { position: relative; height: 14px; font: 400 11px var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ticks span:first-child { transform: none; }
.ticks span:last-child { transform: translateX(-100%); }
.note { font-size: 12px; color: var(--muted); margin: 0; }
.cities { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cities button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 8px; text-align: left; background: none; border: 0; padding: 5px 6px; margin: 0 -6px; border-radius: 4px; color: var(--ink); font: 400 13px var(--f-body); cursor: pointer; }
.cities button:hover { background: rgba(246, 163, 74, 0.14); }
.cities span:last-child { font: 400 12px var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.foot { font-size: 11.5px; color: var(--muted); line-height: 1.4; margin: 0; }
.foot a { color: inherit; }
#tip { position: fixed; z-index: 3; pointer-events: none; background: var(--sheet); border: 1px solid var(--rule); border-radius: 5px; padding: 8px 10px; font-size: 13px; line-height: 1.4; max-width: 250px; backdrop-filter: blur(6px); }
#tip strong { display: block; font: 600 17px var(--f-display); color: var(--accent); font-variant-numeric: tabular-nums; }
#tip .m { font: 400 12px var(--f-mono); color: var(--muted); }
#toggle { display: none; }
#labels { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 5px; white-space: nowrap; pointer-events: auto; cursor: pointer; background: none; border: 0; padding: 0; color: var(--ink); font: 600 12px/1 var(--f-body); text-shadow: 0 0 3px var(--space), 0 0 6px var(--space), 0 1px 2px var(--space); will-change: transform; }
.lbl::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 1.5px var(--space); flex: none; }
.lbl small { font: 400 10.5px/1 var(--f-mono); color: var(--muted); }
.lbl.big { font-size: 14px; font-family: var(--f-display); }
.lbl:hover { color: var(--accent); }
.lbl:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.keys2 { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; font-size: 12px; }
.keys2 span { display: flex; gap: 6px; align-items: center; }
.keys2 i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
#scatter { width: 100%; height: 230px; display: block; cursor: crosshair; }
#cmp-read { margin: 0; min-height: 2.8em; font: 400 12px/1.4 var(--f-mono); color: var(--muted); }
#cmp-read b { color: var(--ink); font-weight: 600; }
.row2 { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.sheet { overflow-x: hidden; }
.sheet > * { min-width: 0; }
.row2 label { font-size: 13px; display: flex; gap: 6px; align-items: center; }
.btn { font: 600 13px var(--f-body); background: transparent; color: var(--ink); border: 1px solid var(--rule); border-radius: 5px; padding: 6px 10px; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
#search { width: 100%; font: 400 14px var(--f-body); background: rgba(255,255,255,0.04); color: var(--ink); border: 1px solid var(--rule); border-radius: 5px; padding: 7px 9px; }
#search::placeholder { color: var(--muted); }
label.row { display: flex; justify-content: space-between; font-size: 13px; }
label.row output { font: 400 12px var(--f-mono); color: var(--muted); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="checkbox"] { accent-color: var(--accent); }
@media (max-width: 640px) {
  .sheet { top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); max-height: 46%; gap: 10px; padding: 12px 14px; }
  .sheet.collapsed > :not(header) { display: none; }
  #toggle { display: inline-block; font: 600 12px var(--f-body); background: none; border: 1px solid var(--rule); color: var(--ink); border-radius: 4px; padding: 4px 8px; }
  header { display: flex; justify-content: space-between; align-items: end; gap: 8px; }
  h1 { font-size: 26px; }
  .lede { display: none; }
}
.back { font: 500 12px/1 var(--f-mono); color: var(--muted); text-decoration: none; letter-spacing: .04em; }
.back:hover { color: var(--accent); }
.display-narrow { font-stretch: 78%; }
.back { display: block; }
