:root {
  --bg: #000000;
  --fg: #e8e8e8;
  --fg-dim: #777777;
  --menu-bg: rgba(12, 12, 12, 0.92);
  --menu-border: rgba(255, 255, 255, 0.12);
  --accent: #e8e8e8;
}

body[data-theme='light'] {
  --bg: #f7f6f3;
  --fg: #1a1a1a;
  --fg-dim: #8a8a8a;
  --menu-bg: rgba(250, 250, 248, 0.94);
  --menu-border: rgba(0, 0, 0, 0.12);
  --accent: #1a1a1a;
}

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

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  transition: background 0.5s ease;
}

#graph { display: block; width: 100vw; height: 100vh; cursor: grab; }
#graph:active { cursor: grabbing; }

/* ── Hamburger — three thin lines, fades unless hovered ── */
#menu-toggle {
  position: fixed;
  top: 18px;
  left: 18px;
  width: 14px;  /* 40% of the original 34x30 (Kam, 2026-06-11) */
  height: 12px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  opacity: 0.35;
  transition: opacity 0.25s ease;
  z-index: 10;
}
#menu-toggle:hover, #menu-toggle.open { opacity: 0.9; }
#menu-toggle span {
  display: block;
  height: 1px;
  width: 9px;
  margin-left: 2px;
  background: var(--fg);
}

/* ── Menu panel — minimal, monochrome ── */
#menu {
  position: fixed;
  top: 56px;
  left: 18px;
  min-width: 210px;
  background: var(--menu-bg);
  border: 1px solid var(--menu-border);
  border-radius: 8px;
  padding: 14px;
  z-index: 9;
  backdrop-filter: blur(8px);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.menu-row { margin-bottom: 12px; }
.menu-row:last-child { margin-bottom: 0; }
.menu-label {
  display: block;
  color: var(--fg-dim);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.menu-options { display: flex; gap: 6px; }
.menu-options button, #reset {
  background: none;
  border: 1px solid var(--menu-border);
  border-radius: 5px;
  color: var(--fg-dim);
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.menu-options button.active, .menu-options button:hover, #reset:hover {
  color: var(--fg);
  border-color: var(--fg-dim);
}
#reset.wide { width: 100%; padding: 6px; }

/* News Item Size — a thin quiet slider, same weight as the other controls */
#size-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  margin: 6px 0 2px;
  background: var(--menu-border);
  border-radius: 1px;
  outline: none;
  cursor: pointer;
}
#size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fg-dim);
  transition: background 0.2s ease;
}
#size-slider:hover::-webkit-slider-thumb { background: var(--fg); }
#size-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: var(--fg-dim);
}
#size-slider:hover::-moz-range-thumb { background: var(--fg); }

.legend { display: flex; flex-wrap: wrap; gap: 5px 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--fg-dim); font-size: 10px; }
.legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
body[data-palette='mono'] .legend { display: none; }

.stats { color: var(--fg-dim); font-size: 10px; line-height: 1.5; }

/* ── Live feed — faint overlay strip on the lower 20% of the screen ── */
#ticker {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20vh;
  padding: 0 28px 18px;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.3); /* 30% grey on dark */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, black 30%);
          mask-image: linear-gradient(to bottom, transparent 0, black 30%);
}
body[data-theme='light'] #ticker { color: rgba(0, 0, 0, 0.3); }
body[data-feed='on'] #ticker { display: flex; }
#ticker .feed-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ticker .feed-meta { opacity: 0.75; }

/* ── Hover detail — what the story is and who's reporting it ── */
#tooltip {
  position: fixed;
  max-width: 340px;
  background: var(--menu-bg);
  border: 1px solid var(--menu-border);
  border-radius: 8px;
  padding: 11px 13px;
  z-index: 11;
  pointer-events: none;
  backdrop-filter: blur(8px);
  font-size: 12px;
  line-height: 1.5;
}
#tooltip .tip-subject {
  color: var(--fg);
  font-size: 13px;
  margin-bottom: 2px;
}
#tooltip .tip-meta {
  color: var(--fg-dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 7px;
}
#tooltip .tip-article { color: var(--fg); opacity: 0.85; margin-bottom: 5px; }
#tooltip .tip-article:last-child { margin-bottom: 0; }
#tooltip .tip-source { color: var(--fg-dim); }
