/* Bubble landing page — All Billionaires Are Bastards */

:root {
  --bg: #07090f;
  --bg-elev: #11192b;
  --bg-elev-2: #18223a;
  --border: #1f2a44;
  --border-strong: #2a385a;
  --text: #e8ecf4;
  --text-dim: #9aa6c0;
  --text-muted: #6a7896;
  --accent: #f59e0b;
  --accent-soft: #fbbf24;
  --link: #38bdf8;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: #8eb0ff; text-decoration: underline; }
.muted { color: var(--text-muted); }
.hint  { color: var(--text-muted); font-size: 12px; margin: 8px 0 0; }
.hl-amber { color: var(--accent); font-weight: 600; }

/* Header */
.header {
  background: linear-gradient(180deg, #0e1628 0%, #07090f 100%);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px 18px;
}
.header-inner { max-width: 1800px; margin: 0 auto; }
.header-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 16px;
}
.abab-mark {
  display: inline-flex; align-items: baseline; gap: 10px;
  text-decoration: none;
}
.abab-mark:hover .abab-badge { background: var(--accent-soft); }
.abab-badge {
  background: var(--accent); color: #0a0a0a;
  padding: 3px 8px; border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  transition: background 120ms;
}
.abab-text {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px; color: var(--text-muted); letter-spacing: 0.3px;
}
.topnav-links { display: flex; gap: 8px; }
.manifesto-link {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px; color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border-strong);
  padding: 5px 11px; border-radius: 4px;
  transition: all 120ms;
}
.manifesto-link:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.manifesto-link.active { color: var(--text); border-color: var(--accent); }

.header h1 {
  margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.01em;
}
.subtitle {
  margin: 8px 0 0; color: var(--text-dim); font-size: 14px; max-width: 900px;
  line-height: 1.55;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 16px;
  padding: 16px 16px 0;
  max-width: 1800px;
  margin: 0 auto;
  align-items: stretch;
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding-right: 4px;
}

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.panel h2 {
  margin: 0; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-dim);
}

/* Group-by toggle */
.seg {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--bg-elev-2);
  padding: 4px;
  border-radius: 6px;
}
.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 11.5px;
  font-family: ui-monospace, monospace;
  padding: 6px 0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 120ms;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: var(--accent);
  color: #0a0a0a;
  font-weight: 600;
}

/* Search */
#search-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12.5px;
  font-family: inherit;
}
#search-input:focus { outline: none; border-color: var(--accent); }
.search-results {
  list-style: none; margin: 6px 0 0; padding: 0;
  max-height: 280px; overflow-y: auto;
}
.search-results li {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 4px; cursor: pointer; font-size: 12.5px;
}
.search-results li:hover { background: var(--bg-elev-2); }
.search-results li .flag { font-size: 13px; }
.search-results li .lbl { flex: 1; }
.search-results li .meta {
  margin-left: auto; color: var(--accent); font-size: 11.5px;
  font-family: ui-monospace, monospace;
}
.search-results li.empty {
  color: var(--text-muted); cursor: default; font-style: italic;
}

/* Stats */
.stats-list { list-style: none; padding: 0; margin: 0; }
.stats-list li {
  display: grid; grid-template-columns: 80px 1fr; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.stats-list li:last-child { border-bottom: none; }
.stat-num {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 18px; font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.stat-label { color: var(--text-dim); font-size: 12.5px; line-height: 1.4; }

/* Rushkoff */
.rushkoff {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 14px;
  font-style: italic;
  color: var(--text);
  line-height: 1.5;
  border-left: 3px solid var(--accent);
  padding: 6px 0 6px 14px;
}
.rushkoff cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Canvas */
.canvas-wrap {
  background: radial-gradient(ellipse at center, #0a1020 0%, #07090f 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  position: relative;
  min-height: 720px;
  overflow: hidden;
}
#bubbles { display: block; width: 100%; height: 100%; }

g.bubble:hover circle.bubble-circle {
  fill-opacity: 1;
  stroke: #fff;
  stroke-width: 2.5;
}
g.bubble.dimmed circle.bubble-circle { fill-opacity: 0.25; }

/* Tooltip */
.tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(7, 9, 15, 0.95);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 10px 14px;
  max-width: 320px;
  font-size: 12.5px;
  color: var(--text);
  opacity: 0;
  transition: opacity 80ms;
  z-index: 30;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.tooltip.visible { opacity: 1; }
.tooltip .name { font-weight: 700; margin-bottom: 4px; color: var(--accent); }
.tooltip .meta { color: var(--text-dim); font-size: 11.5px; line-height: 1.45; }
.tooltip .meta.note { color: var(--text); font-style: italic; margin-top: 4px; }
.tooltip .meta.hl-amber { color: var(--accent); margin-top: 4px; }
.tooltip .hint { font-size: 10.5px; color: var(--text-muted); margin-top: 6px; font-style: italic; }

/* Info panel */
.info-panel { font-size: 13.5px; line-height: 1.55; }
.empty-info {
  color: var(--text-dim); text-align: center; padding: 30px 10px;
}
.empty-info h3 {
  margin: 0 0 8px; color: var(--text); font-size: 15px; font-weight: 600;
}
.info-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.info-header .flag { font-size: 26px; }
.info-header h3 {
  margin: 0; font-size: 16px; font-weight: 700;
  color: var(--text); line-height: 1.25;
}
.info-tag {
  display: inline-block;
  font-family: ui-monospace, monospace;
  font-size: 10.5px; letter-spacing: 0.5px;
  border: 1px solid; padding: 2px 8px; border-radius: 3px;
  margin-bottom: 12px;
}
.info-meta {
  margin-bottom: 14px; font-size: 12.5px; line-height: 1.7;
  color: var(--text-dim);
}
.info-meta strong { color: var(--text); font-weight: 600; }
.info-status {
  font-size: 12.5px;
  background: rgba(245, 158, 11, 0.06);
  border-left: 2px solid var(--accent);
  padding: 8px 12px; border-radius: 3px;
  color: var(--text);
  margin-bottom: 14px;
}
.info-status strong { color: var(--accent); }
.info-source {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}
.info-source a {
  font-family: ui-monospace, monospace;
  color: var(--accent);
}

/* Manifesto strip */
.manifesto-strip {
  background: linear-gradient(180deg, var(--bg) 0%, #0e1628 100%);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  margin-top: 24px;
}
.manifesto-strip-inner {
  max-width: 800px; margin: 0 auto; text-align: center;
}
.manifesto-strip h2 {
  margin: 0 0 16px;
  font-family: ui-monospace, monospace;
  font-size: 12px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--accent);
}
.manifesto-strip p {
  font-size: 17px; line-height: 1.55; color: var(--text);
  font-family: Georgia, serif; margin: 0 0 20px;
}
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-link {
  display: inline-block;
  font-family: ui-monospace, monospace;
  font-size: 14px;
  color: #0a0a0a;
  background: var(--accent);
  padding: 12px 22px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}
.cta-link:hover { background: var(--accent-soft); text-decoration: none; }
.cta-link-secondary {
  background: transparent; color: var(--accent); border: 1px solid var(--accent);
}
.cta-link-secondary:hover { background: rgba(245,158,11,0.1); }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
}

@media (max-width: 1200px) {
  .layout { grid-template-columns: 240px 1fr 280px; }
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { max-height: none; }
}
