/* Data-Center Atlas — shared dark theme (landing + both map engines). Vanilla CSS, no framework. */

:root {
  --bg: #0C0C0E;
  --bg-2: #131318;
  --bg-3: #1B1B22;
  --panel: rgba(19, 19, 24, 0.92);
  --cream: #EAE3D0;
  --cream-dim: #9A9182;
  --muted: #5A5448;
  --gold: #B08A4A;
  --gold-bright: #D4B073;
  --rule: rgba(234, 227, 208, 0.10);
  --rule-strong: rgba(234, 227, 208, 0.20);

  --tier-primary: #34A853;
  --tier-primary-corroborated: #00A4A6;
  --tier-secondary: #D4A24A;
  --tier-estimate: #C77B3B;

  --status-executed: #46B66B;
  --status-in-progress: #D9A441;

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Full-screen map pages ---------- */
.map-page { overflow: hidden; }
#map, #cesiumContainer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #05060a;
}
#cesiumContainer .cesium-widget-credits { display: none !important; }

/* ---------- Top bar (over the map) ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(12, 12, 14, 0.92) 0%, rgba(12, 12, 14, 0.0) 100%);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}
.brand-sub { font-size: 12px; color: var(--cream-dim); }

.topbar-links { display: flex; gap: 14px; align-items: center; font-size: 12px; }
.topbar-links a { color: var(--cream-dim); letter-spacing: 0.04em; }
.topbar-links a.active { color: var(--gold-bright); }

/* ---------- Layer toggle ---------- */
.layer-toggle {
  position: fixed;
  top: 60px; right: 18px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 10px;
  backdrop-filter: blur(10px);
}
.layer-toggle button {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--cream-dim);
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  text-align: left;
  cursor: pointer;
}
.layer-toggle button:hover { color: var(--cream); background: var(--bg-3); }
.layer-toggle button.active { color: var(--bg); background: var(--gold); font-weight: 600; }

/* ---------- Legend ---------- */
.legend {
  position: fixed;
  bottom: 18px; left: 18px;
  z-index: 20;
  max-width: 260px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  font-size: 12px;
}
.legend h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
  font-weight: 500;
}
.legend-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; color: var(--cream-dim); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 6px rgba(0,0,0,0.6); }
.legend-status { display: flex; gap: 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule); }
.legend-ring { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--cream); flex: none; }
.legend-ring.exec { border-style: solid; }
.legend-ring.prog { border-style: dashed; }

/* ---------- Map markers ---------- */
/* Marker: MapLibre positions .dc-marker (no transition here, or it lags on zoom).
   The visible dot is an inner element so hover/scale never touches the position transform. */
.dc-marker { cursor: pointer; line-height: 0; }
.dc-dot {
  display: block; width: 16px; height: 16px;
  border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.6);
  transition: transform 0.12s ease;
}
.dc-marker:hover .dc-dot { transform: scale(1.35); }
.dc-dot.prog { border-style: dashed; }
.dc-dot.ai { box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 0 11px 2px rgba(212,176,115,0.95), 0 2px 8px rgba(0,0,0,0.6); }

/* Push the zoom / compass controls below the topbar title so they don't overlap it */
.maplibregl-ctrl-top-left { margin-top: 52px; }

/* Category filter (replaces the old basemap toggle) */
.cat-filter {
  position: fixed; top: 60px; right: 18px; z-index: 20;
  display: flex; flex-direction: column; gap: 4px; padding: 6px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; backdrop-filter: blur(10px);
}
.cat-filter button {
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.03em; color: var(--cream-dim);
  background: transparent; border: none; border-radius: 6px; padding: 7px 14px; text-align: left; cursor: pointer;
}
.cat-filter button:hover { color: var(--cream); background: var(--bg-3); }
.cat-filter button.active { color: var(--bg); background: var(--gold); font-weight: 600; }

/* AI / general badges */
.cat-badge { display: inline-block; font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 6px; border-radius: 20px; border: 1px solid currentColor; vertical-align: middle; }
.cat-ai { color: var(--gold-bright); }
.cat-general { color: var(--cream-dim); }
.ai-dot { background: var(--gold-bright) !important; box-shadow: 0 0 6px 1px rgba(212,176,115,0.9); }
.about-substat { font-size: 12px; color: var(--cream-dim); margin: 2px 0 6px; }
.about-line { font-size: 13px; color: var(--cream-dim); line-height: 1.6; background: var(--bg-3); border-left: 3px solid var(--gold); padding: 12px 14px; border-radius: 0 8px 8px 0; }

/* ---------- Popups (MapLibre override) ---------- */
.maplibregl-popup-content {
  background: var(--bg-2);
  color: var(--cream);
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.maplibregl-popup-tip { border-top-color: var(--bg-2) !important; border-bottom-color: var(--bg-2) !important; }
.maplibregl-popup-close-button { color: var(--cream-dim); font-size: 18px; padding: 2px 6px; }

.dc-popup { min-width: 180px; }
.dc-popup-op { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--cream-dim); letter-spacing: 0.04em; }
.op-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dc-popup-name { font-size: 15px; font-weight: 600; margin: 3px 0; }
.dc-popup-loc { font-size: 12px; color: var(--cream-dim); margin-bottom: 9px; }
.dc-popup-btn {
  width: 100%;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  color: var(--bg); background: var(--gold);
  border: none; border-radius: 6px; padding: 7px 10px; cursor: pointer;
}
.dc-popup-btn:hover { background: var(--gold-bright); }

/* ---------- Status pill + tier chip ---------- */
.status-pill { display: inline-block; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border-radius: 20px; border: 1px solid; }
.status-executed { color: var(--status-executed); border-color: var(--status-executed); }
.status-in-progress { color: var(--status-in-progress); border-color: var(--status-in-progress); }

.tier-chip { display: inline-block; font-size: 10px; letter-spacing: 0.03em; padding: 1px 7px; border-radius: 20px; border: 1px solid currentColor; opacity: 0.9; }
.tier-primary { color: var(--tier-primary); }
.tier-primary-corroborated { color: var(--tier-primary-corroborated); }
.tier-secondary { color: var(--tier-secondary); }
.tier-estimate { color: var(--tier-estimate); }

/* ---------- Detail panel ---------- */
.detail-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(5, 6, 10, 0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.detail-backdrop.open { opacity: 1; pointer-events: auto; }

.detail-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: 400px; max-width: 92vw;
  background: var(--bg-2);
  border-left: 1px solid var(--rule-strong);
  box-shadow: -16px 0 40px rgba(0,0,0,0.5);
  padding: 28px 26px 40px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.detail-panel.open { transform: translateX(0); }

.detail-close {
  position: absolute; top: 14px; right: 16px;
  font-size: 26px; line-height: 1; color: var(--cream-dim);
  background: none; border: none; cursor: pointer;
}
.detail-close:hover { color: var(--cream); }

.detail-op {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cream-dim);
  padding-left: 10px; border-left: 3px solid var(--gold);
  margin-bottom: 10px;
}
.detail-name { font-size: 24px; font-weight: 600; line-height: 1.15; }
.detail-sub { font-size: 13px; color: var(--cream-dim); margin: 6px 0 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-area { font-size: 13.5px; color: var(--cream-dim); line-height: 1.55; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }

.field { padding: 13px 0; border-bottom: 1px solid var(--rule); }
.field-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-bottom: 5px; }
.field-value { font-size: 14px; line-height: 1.5; }
.field-value.undisclosed { color: var(--muted); font-style: italic; }
.field-meta { margin-top: 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.coord-prec { color: var(--cream-dim); font-size: 12px; }
.src-link { font-size: 11px; letter-spacing: 0.03em; }

.detail-sources { padding: 13px 0; }
.src-list { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.detail-foot { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 14px; }

/* ---------- Landing page ---------- */
.landing { min-height: 100%; display: flex; flex-direction: column; }
.landing-inner { max-width: 940px; margin: 0 auto; padding: 64px 24px 48px; width: 100%; }

.hero-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); }
.hero-title { font-size: 44px; font-weight: 700; line-height: 1.08; margin: 14px 0 12px; letter-spacing: -0.01em; }
.hero-lede { font-size: 17px; color: var(--cream-dim); max-width: 640px; line-height: 1.55; }

.stats { display: flex; gap: 28px; flex-wrap: wrap; margin: 30px 0 6px; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 30px; font-weight: 700; color: var(--gold-bright); font-family: var(--mono); }
.stat-label { font-size: 12px; color: var(--cream-dim); letter-spacing: 0.04em; }

.chooser { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 36px 0; }
.card {
  display: block;
  padding: 24px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 14px;
  transition: border-color 0.16s ease, transform 0.16s ease;
}
.card:hover { border-color: var(--gold); transform: translateY(-2px); text-decoration: none; }
.card-tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.card-title { font-size: 21px; font-weight: 600; margin: 8px 0 6px; color: var(--cream); }
.card-desc { font-size: 13.5px; color: var(--cream-dim); line-height: 1.55; }
.card-cta { display: inline-block; margin-top: 14px; font-size: 13px; color: var(--gold-bright); font-weight: 600; }

.section-h { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin: 30px 0 12px; }
.op-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.op-legend .legend-row { font-size: 13px; }

.disclaimer {
  margin-top: 36px; padding: 18px 20px;
  background: var(--bg-2); border: 1px solid var(--rule); border-radius: 12px;
  font-size: 13px; color: var(--cream-dim); line-height: 1.6;
}
.disclaimer strong { color: var(--cream); }

.landing-foot { margin-top: auto; padding: 22px 24px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- About button + modal ---------- */
.about-btn {
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.04em;
  color: var(--cream-dim); background: var(--panel);
  border: 1px solid var(--rule); border-radius: 8px;
  padding: 8px 15px; cursor: pointer; backdrop-filter: blur(10px);
}
.about-btn:hover { color: var(--cream); border-color: var(--gold); }

.about-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(5, 6, 10, 0.6); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.about-backdrop.open { opacity: 1; pointer-events: auto; }

.about-modal {
  position: fixed; z-index: 70; top: 50%; left: 50%;
  width: 540px; max-width: 92vw; max-height: 86vh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--rule-strong);
  border-radius: 16px; padding: 32px 32px 26px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, -48%) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.about-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.about-close { position: absolute; top: 14px; right: 16px; font-size: 26px; line-height: 1; color: var(--cream-dim); background: none; border: none; cursor: pointer; }
.about-close:hover { color: var(--cream); }
.about-title { font-size: 27px; font-weight: 700; }
.about-lede { color: var(--cream-dim); font-size: 14.5px; margin: 10px 0 18px; line-height: 1.55; }
.about-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 6px; }
.about-section-h { font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin: 18px 0 10px; }
.about-disclaimer { font-size: 13px; color: var(--cream-dim); line-height: 1.6; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
.about-foot { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 12px; }

@media (max-width: 680px) {
  .hero-title { font-size: 34px; }
  .layer-toggle { top: 56px; right: 10px; }
  .legend { display: none; }
  .about-modal { padding: 24px 20px; }
}
