@font-face { font-family: "Plex Mono"; src: url(/vendor/fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/vendor/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(/vendor/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(/vendor/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --ground: #0b1014;
  --panel: #141c22;
  --raised: #1b252c;
  --phosphor: #36f56c;
  --ink: #e3ece7;
  --ink-2: #9aaba3;
  --muted: #66766f;
  --pin: #ff4a3d;
  --sans: "Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --gutter: clamp(24px, 4.4vw, 72px);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
::selection { background: var(--phosphor); color: var(--ground); }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 3px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }

/* ---------- space ---------- */
.stars { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- globe ---------- */
.globe-wrap {
  position: fixed;
  inset: 0;
  overflow: hidden; /* the glow layers are 1000px boxes; never let them widen the page */
  opacity: 0;
  transition: opacity 600ms var(--ease-out);
}
.globe-wrap.ready { opacity: 1; }
.globe { position: absolute; inset: 0; }
/* Atmosphere and terminator: 1000px discs scaled onto the globe by script (transform only). */
.glow, .shade { position: absolute; left: 0; top: 0; width: 1000px; height: 1000px; border-radius: 50%; pointer-events: none; transform-origin: 0 0; opacity: 0; will-change: transform, opacity; }
.glow {
  /* Limb at 93.5% of the box: a thin bright shell on the edge, scattering outward, no gap. */
  background: radial-gradient(circle closest-side,
    rgba(140, 195, 255, 0) 88%, rgba(150, 205, 255, 0.22) 92.6%, rgba(160, 210, 255, 0.5) 93.5%,
    rgba(110, 170, 255, 0.22) 95.5%, rgba(80, 140, 255, 0.07) 98%, rgba(80, 140, 255, 0) 100%);
}
.shade { background: radial-gradient(circle at 32% 30%, rgba(11, 16, 20, 0) 38%, rgba(11, 16, 20, 0.28) 72%, rgba(11, 16, 20, 0.62) 100%); }
.poster { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: opacity 600ms var(--ease-out); }
.poster.gone { opacity: 0; }
.globe-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% 50%; }
.maplibregl-canvas { outline: none; }
.maplibregl-ctrl-bottom-right { right: 0; }
/* Darkens the map under the chat. Unlike a transparency mask it keeps the globe opaque,
   so the stars behind it can never show through the Earth. Opacity is set by script. */
.veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
}
.globe .veil { position: absolute; inset: 0; z-index: auto; }
.veil {
  background: linear-gradient(90deg, var(--ground) 0, var(--ground) 27%, rgba(11, 16, 20, 0.93) 31%, rgba(11, 16, 20, 0.8) 35%, rgba(11, 16, 20, 0.6) 39%, rgba(11, 16, 20, 0.38) 43%, rgba(11, 16, 20, 0.18) 47%, rgba(11, 16, 20, 0.05) 50%, rgba(11, 16, 20, 0) 52%);
}
/* Neutral scrim so the small print stays legible over bright imagery. */
.scrim { position: fixed; pointer-events: none; z-index: 1; }
.scrim-br { right: 0; bottom: 0; width: 820px; height: 170px; background: radial-gradient(ellipse at 100% 100%, rgba(11, 16, 20, 0.92), rgba(11, 16, 20, 0.6) 40%, rgba(11, 16, 20, 0) 72%); }
.maplibregl-ctrl.maplibregl-ctrl-attrib {
  margin: 0 var(--gutter) 18px 0;
  padding: 0;
  background: none;
  font: 400 10.5px/1.4 var(--sans);
  color: var(--muted);
}
.maplibregl-ctrl-attrib a { color: var(--muted); }
.maplibregl-ctrl-attrib-button { display: none; }

.attrib {
  position: fixed;
  z-index: 2;
  right: var(--gutter);
  bottom: 24px;
  margin: 0;
  font: 400 10.5px/1.3 var(--sans);
  color: #a3b1aa;
  text-shadow: 0 0 3px #0b1014, 0 0 8px #0b1014;
  pointer-events: none;
}

/* ---------- brand + meta ---------- */
.brand {
  position: fixed;
  z-index: 2;
  top: 28px;
  left: var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px;
}
.mark { height: 22px; width: auto; display: block; }
.mark path, .mark rect { fill: var(--phosphor); }
.mark .chev { fill: none; stroke: var(--phosphor); stroke-width: 13; stroke-linecap: square; }
.wordmark { font: 500 17px/1 var(--mono); color: var(--phosphor); letter-spacing: 0.01em; }
.brand .slogan { margin-left: 18px; }

.meta {
  position: fixed;
  z-index: 2;
  left: var(--gutter);
  bottom: 28px;
  display: flex;
  align-items: baseline;
  gap: 20px;
}
.slogan { margin: 0; font: 400 15px/1 var(--sans); color: var(--ink-2); }
.stealth { font: 400 13px/1.4 var(--sans); color: var(--ink-2); }
.contact {
  font: 400 13px/1.4 var(--mono);
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: rgba(154, 171, 163, 0.35);
  text-underline-offset: 3px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .contact:hover { color: var(--phosphor); text-decoration-color: currentColor; }
}

/* ---------- chat ---------- */
.chat {
  position: fixed;
  z-index: 3;
  left: var(--gutter);
  /* Anchored by its bottom edge: messages and a wrapping query grow upward, the input stays put. */
  bottom: calc(50% - 96px);
  width: min(600px, 40vw);
}
.chat.pre { opacity: 0; }
.transcript {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 14px;
  padding: 0 0 18px;
}
.msg { margin: 0; transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out); }
.msg.enter { opacity: 0; transform: translateY(8px); }
.msg.leave { opacity: 0; transform: translateY(-6px); }
.msg-user {
  max-width: 100%;
  padding: 10px 14px;
  background: var(--raised);
  border-radius: 12px;
  font: 400 17px/1.45 var(--mono);
  color: var(--ink);
  text-wrap: balance;
}
.msg-bot {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 400 15px/1.45 var(--sans);
  color: var(--ink);
}
.msg-bot .glyph { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--phosphor); }
.msg-bot.pending { opacity: 0; }
.msg-bot { padding-left: 2px; }
.msg-bot.searching .glyph { animation: breathe 1.1s ease-in-out infinite; }
.msg-bot.found .glyph { background: var(--pin); }
.msg-bot .count { font: 500 15px/1 var(--mono); color: var(--phosphor); }
.msg-bot .hint { color: #b3c1ba; }
@keyframes breathe { 50% { opacity: 0.25; } }
.dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.composer {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 0;
  padding: 10px 10px 10px 22px;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(54, 245, 108, 0.28), 0 0 0 6px rgba(54, 245, 108, 0.04);
}
.field {
  position: relative;
  flex: 1;
  min-width: 0;
  /* Two lines reserved from the start: the box never jumps while a long query wraps. */
  min-height: 88px;
  padding: 12px 0;
  font: 400 19px/32px var(--mono);
  color: var(--ink);
  overflow-wrap: anywhere;
}
/* The whole query stays readable: the field wraps and grows upward instead of scrolling. */
.caret {
  display: inline-block;
  vertical-align: -0.2em;
  width: 0.55em;
  height: 1.15em;
  margin-left: 1px;
  background: var(--phosphor);
  animation: blink 1.06s steps(1) infinite;
}
.field.typing .caret { animation: none; }
@keyframes blink { 50% { opacity: 0; } }
.placeholder { position: absolute; left: 0.85em; top: 12px; color: #74847d; pointer-events: none; transition: opacity 120ms ease; }
.field.filled .placeholder { opacity: 0; }

.send {
  position: relative;
  flex: none;
  width: 60px;
  height: 60px;
  border: 0;
  padding: 0;
  border-radius: 14px;
  background: var(--phosphor);
  color: var(--ground);
  cursor: default;
  transition: transform 220ms var(--ease-out), background-color 220ms ease, box-shadow 320ms ease;
}
.send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.send::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 2px var(--phosphor), 0 0 18px 2px rgba(54, 245, 108, 0.55);
  opacity: 0;
  pointer-events: none;
}
.send.pressed { transform: scale(0.88) translateY(2px); background: #b4ffc7; box-shadow: 0 0 0 4px rgba(54, 245, 108, 0.35), 0 0 28px 4px rgba(54, 245, 108, 0.45); transition-duration: 90ms; }
.send.ripple::after { animation: ripple 760ms var(--ease-out); }
@keyframes ripple { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.75); } }

.chips { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.chips { flex-direction: row; flex-wrap: wrap; }
.chip {
  text-align: left;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px rgba(227, 236, 231, 0.12);
  color: var(--ink);
  font: 400 13.5px/1.4 var(--mono);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.chip[aria-pressed="true"] { background: var(--phosphor); color: var(--ground); box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .chip:not([aria-pressed="true"]):hover { box-shadow: inset 0 0 0 1px rgba(54, 245, 108, 0.5); } }

/* ---------- pins ---------- */
.pin {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.pin-in { position: relative; width: 14px; height: 14px; display: block; }
.pin-dot {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--pin);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0 0 3.5px rgba(11, 16, 20, 0.55), 0 2px 6px rgba(0, 0, 0, 0.6);
  transition: box-shadow 200ms ease;
}
.pin-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 2.5px var(--pin);
  opacity: 0;
}
/* backwards, not both: a filled end state would pin transform to none and swallow the hover scale. */
.pin.drop .pin-in { animation: drop 520ms var(--ease-out) backwards; animation-delay: var(--d); }
.pin.drop .pin-ring { animation: pulse 1600ms var(--ease-out) 2 both; animation-delay: calc(var(--d) + 380ms); }
.pin.leave .pin-in { transform: scale(0.4); opacity: 0; transition: transform 200ms var(--ease-out), opacity 200ms ease; }
@keyframes drop { from { opacity: 0; transform: translateY(-22px) scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes pulse { from { opacity: 0.8; transform: scale(1); } to { opacity: 0; transform: scale(2.8); } }
.pin.active .pin-in { transform: scale(1.75); }
.pin.active .pin-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(255, 74, 61, 0.35), 0 0 18px 4px rgba(255, 74, 61, 0.7); }
@media (hover: hover) and (pointer: fine) {
  .pin:hover .pin-in { transform: scale(1.75); }
  .pin:hover .pin-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(255, 74, 61, 0.35), 0 0 18px 4px rgba(255, 74, 61, 0.7); }
}

/* ---------- card ---------- */
.card[hidden] { display: none !important; }
/* Caret on the edge that faces the pin; --caret is its offset along that edge. */
.card::before {
  content: ""; position: absolute; z-index: 1; width: 12px; height: 12px; background: #10171c;
  transform: rotate(45deg); box-shadow: -1px 1px 0 rgba(227, 236, 231, 0.07);
}
.card[data-side="right"]::before { left: -6px; top: calc(var(--caret) - 6px); }
.card[data-side="left"]::before { right: -6px; top: calc(var(--caret) - 6px); box-shadow: 1px -1px 0 rgba(227, 236, 231, 0.07); }
.card[data-side="below"]::before { top: -6px; left: calc(var(--caret) - 6px); background: var(--raised); }
.card[data-side="above"]::before { bottom: -6px; left: calc(var(--caret) - 6px); }
.card { overflow: visible; }
.card-chip { border-radius: 14px 14px 0 0; overflow: hidden; }
.card-close {
  display: none; position: absolute; z-index: 2; top: 10px; right: 10px; width: 32px; height: 32px;
  border: 0; border-radius: 50%; padding: 0; background: rgba(11, 16, 20, 0.72); color: var(--ink); cursor: pointer;
}
.card-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (hover: none), (pointer: coarse) { .card-close { display: grid; place-items: center; } }
/* While a card is open the other pins step back, so it is obvious which one it belongs to. */
/* On the inner element: MapLibre owns the marker's own inline opacity. */
.globe.has-active .pin:not(.active) .pin-in { opacity: 0.4; }
.pin-in { transition: transform 200ms var(--ease-out), opacity 200ms ease; }
.card {
  position: fixed;
  z-index: 10;
  width: 300px;
  background: #10171c;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(227, 236, 231, 0.07), 0 18px 48px rgba(0, 0, 0, 0.55);
  transform-origin: var(--origin, left center);
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.card.enter { opacity: 0; transform: scale(0.96); }
.card-chip { aspect-ratio: 5 / 3; background: var(--raised); position: relative; }
.card-chip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 240ms ease; }
.card-chip img.loaded { opacity: 1; }
/* Loading: a slow light sweep across the empty chip (transform only). */
.card-chip { overflow: hidden; }
.card-chip.loading::before {
  content: ""; position: absolute; inset: 0; width: 60%;
  background: linear-gradient(90deg, rgba(227, 236, 231, 0), rgba(227, 236, 231, 0.07), rgba(227, 236, 231, 0));
  animation: sweep 1.2s ease-in-out infinite;
}
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(270%); } }
.chip-failed { display: none; position: absolute; inset: 0; place-items: center; font: 400 12.5px/1 var(--sans); color: var(--ink-2); }
.card-chip.failed .chip-failed { display: grid; }
.card-chip.failed::after { display: none; }
.card-chip::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--pin), 0 0 0 4px rgba(0, 0, 0, 0.35);
}
.card-body { padding: 14px 16px 16px; }
.card-name { margin: 0; font: 500 15.5px/1.3 var(--sans); color: var(--ink); }
.card-place { margin: 2px 0 0; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); white-space: pre-line; }
.card-coords { margin: 8px 0 0; font: 400 12.5px/1.3 var(--mono); color: var(--phosphor); }
.card-fact { margin: 10px 0 0; font-size: 14px; line-height: 1.45; color: var(--ink); }
.card-status { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.card-links { display: flex; gap: 18px; margin: 12px 0 0; font: 400 13px/1 var(--mono); }
.card-links a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(227, 236, 231, 0.3); text-underline-offset: 3px; transition: color 160ms ease, text-decoration-color 160ms ease; }
.card-links a::after { content: " \2197"; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .card-links a:hover { color: var(--phosphor); text-decoration-color: currentColor; } }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  :root { --hdr: 74px; --stage: 54svh; }
  body { overflow-x: hidden; overflow-y: auto; }
  .brand { position: relative; top: auto; left: auto; flex-wrap: wrap; row-gap: 9px; height: var(--hdr); padding: 18px 16px 0; align-content: flex-start; }
  .mark { height: 18px; }
  .wordmark { font-size: 15px; }
  .brand .slogan { flex-basis: 100%; margin-left: 0; font-size: 13.5px; }
  .stars { position: absolute; top: var(--hdr); height: var(--stage); }
  .poster { position: absolute; top: var(--hdr); height: var(--stage); }
  .globe-fallback { object-position: 50% 50%; }
  .globe-wrap { position: absolute; top: var(--hdr); left: 0; right: 0; bottom: auto; height: var(--stage); }
  .scrim { display: none; }
  .attrib { position: absolute; top: calc(var(--hdr) + var(--stage) + 2px); bottom: auto; right: 16px; left: 16px; text-align: right; font-size: 9.5px; }
  .chat { position: relative; left: auto; top: auto; bottom: auto; transform: none; width: auto; margin: calc(var(--stage) + 22px) 16px 0; }
  .globe .veil { top: 0; height: auto; }
  .veil { position: absolute; inset: auto 0 auto 0; top: var(--hdr); height: calc(var(--stage) + 1px); background: linear-gradient(var(--ground) 0, rgba(11, 16, 20, 0) 12%, rgba(11, 16, 20, 0) 74%, rgba(11, 16, 20, 0.7) 88%, var(--ground) 100%); }
  .transcript { min-height: 118px; padding: 0 0 12px; }
  .msg-user { font-size: 15px; }
  .msg-bot { font-size: 14.5px; }
  .field { font-size: 15.5px; line-height: 23px; min-height: 68px; padding: 11px 0; }
  .placeholder { top: 11px; }
  .composer { padding: 6px 6px 6px 16px; }
  .send { width: 44px; height: 44px; }
  .meta { position: static; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin: 26px 16px 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  /* Bottom sheet: the tapped pin stays visible on the globe above. */
  .card { position: fixed !important; left: 12px !important; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); top: auto !important; width: auto; transform-origin: center bottom; }
  .card-chip { aspect-ratio: 16 / 6; }
  .card-body { padding: 12px 16px 16px; }
  .card::before { display: none; }
  .chip { border-radius: 14px; }
  .card-chip { border-radius: 14px 14px 0 0; }
  .card.enter { opacity: 0; transform: translateY(16px); }
}

@media (min-width: 761px) { .scrim-top, .scrim-bottom { display: none; } }
.static .transcript { min-height: 0; }

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
  .globe-wrap { transition: none; }
  .msg-bot.searching .glyph, .dots::after { animation: none; }
}
