/* ═══════════════════════════════════════════════════════════════ */
/* The Big Questions — grand open problems (hubs) orbited by the     */
/* foundational results that answered concrete steps toward them.    */
/* Light theme — matches the site (tokens.css).                      */
/* ═══════════════════════════════════════════════════════════════ */

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* ── Canvas (fills space below the shared header) ── */
#bq-svg {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: block;
  cursor: grab;
}
#bq-svg:active { cursor: grabbing; }

/* L3 open-problem nodes — small hollow circles hugging their L2 parent (open = unsolved) */
.l3node { cursor: pointer; }
.l3node circle {
  stroke-width: 1.3; fill: none;
  transition: stroke-width 0.18s, opacity 0.18s;
}
.l3node:hover circle, .l3node.lit circle { stroke-width: 2; }

/* Spokes hub → result */
.spoke {
  fill: none;
  stroke-opacity: 0.35;
  stroke-width: 1.65;
  transition: stroke-opacity 0.18s, stroke-width 0.18s;
}
.spoke.lit { stroke-opacity: 0.9; stroke-width: 2.3; }

/* Result (answered-question) nodes */
.result { cursor: pointer; }
.result circle {
  stroke: #fff; stroke-width: 1.3;
  transition: stroke-width 0.18s, opacity 0.18s;
}
.result:hover circle, .result.lit circle { stroke-width: 2; }
/* Hidden by default so 43 labels never collide; a cluster's labels reveal on hover/focus */
.result-label {
  font-size: 10px; fill: var(--text);
  pointer-events: none; font-weight: 500;
  opacity: 0; transition: opacity 0.15s;
  paint-order: stroke; stroke: rgba(255,255,255,0.95); stroke-width: 3.5px;
}
.result:hover .result-label, .result.lit .result-label { opacity: 1; }

/* Center anchor */
.bq-center-title {
  font-size: 28px; font-weight: 800; letter-spacing: 2px;
  text-anchor: middle; fill: var(--text-4); pointer-events: none;
}
/* Lines 2 & 3: same size, differentiated by weight (not size) */
.bq-center-sub {
  font-size: 15px; font-weight: 600; letter-spacing: 0.4px;
  text-anchor: middle; fill: var(--text-2); pointer-events: none;
}
.bq-center-hint {
  font-size: 15px; font-weight: 400; letter-spacing: 0.3px;
  text-anchor: middle; fill: var(--text-3); pointer-events: none;
}

/* Hub (big open question) nodes */
.hub { cursor: pointer; }
.hub circle.hub-core {
  stroke-width: 2;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.10));
  transition: stroke-width 0.18s, fill-opacity 0.18s;
}
.hub:hover circle.hub-core { stroke-width: 3; fill-opacity: 0.2 !important; }
.hub-label {
  font-size: 12.5px; font-weight: 700;
  text-anchor: middle; dominant-baseline: middle;
  pointer-events: none;
  paint-order: stroke; stroke: rgba(255,255,255,0.85); stroke-width: 2.5px;
}

.dimmed { opacity: 0.13 !important; }

.bq-hint {
  position: fixed; right: 18px; bottom: 14px; z-index: 30;
  font-size: 10.5px; color: var(--text-3); letter-spacing: 0.3px;
  transition: opacity 0.15s;
}
.bq-hint.is-hidden { opacity: 0; pointer-events: none; }


/* ── Credit (folded into the top bar) ── */
.bq-credit {
  margin-left: auto;
  font-size: 10px; line-height: 1.4;
  white-space: nowrap;
}
.bq-credit a { color: var(--text-3); text-decoration: none; font-style: italic; }
.bq-credit a:hover { color: var(--accent); text-decoration: underline; }

/* ── Detail panel — corner card, matched to the roadmap (roadmap.css .detail-panel) ── */
.bq-panel {
  position: fixed;
  width: min(500px, 38vw);
  max-height: calc(100vh - 110px);
  overflow: auto;
  background: #fff;
  border-left: 2px solid #cbd5e1;
  border-radius: 0;
  padding: 10px 12px 12px 10px;
  font-size: 12px; line-height: 1.45;
  color: var(--text-2);
  z-index: 50;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease;
}
.bq-panel.open { opacity: 1; pointer-events: auto; }

/* Quadrant placement, matching the node's direction from centre (offset for the 44px header) */
/* Shadow points toward the inner corner (the 2 edges facing the map) */
.bq-panel.tr { top: 70px; right: 14px; left: auto; bottom: auto; box-shadow: -10px 10px 26px rgba(0,0,0,0.13); }
.bq-panel.tl { top: 70px; left: 14px; right: auto; bottom: auto; box-shadow: 10px 10px 26px rgba(0,0,0,0.13); }
.bq-panel.br { bottom: 26px; right: 14px; left: auto; top: auto; box-shadow: -10px -10px 26px rgba(0,0,0,0.13); }
.bq-panel.bl { bottom: 26px; left: 14px; right: auto; top: auto; box-shadow: 10px -10px 26px rgba(0,0,0,0.13); }

.bq-close {
  position: absolute; top: 8px; right: 10px;
  font-size: 17px; line-height: 1;
  color: var(--text-3); background: none; border: none; cursor: pointer;
}
.bq-close:hover { color: var(--text); }

.bq-kicker {
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
}
.bq-kicker .bq-dot { width: 9px; height: 9px; border-radius: 50%; }

.bq-badge {
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; padding: 2px 7px; border-radius: 3px;
  margin-left: 6px;
}
.bq-badge-open { background: var(--orange-bg); color: var(--orange); }
.bq-badge-answered { background: var(--green-bg); color: var(--green); }

.bq-headline {
  font-size: 16px; font-weight: 600; line-height: 1.4;
  color: var(--text); margin-bottom: 12px;
}
.bq-blurb, .bq-why {
  font-size: 12.5px; line-height: 1.55; color: var(--text-2);
  margin-bottom: 16px; text-align: justify;
}

/* Reference rows — home page's .pr component */
.pr {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer; text-decoration: none; color: inherit;
}
.pr:last-child { border-bottom: none; }
.pr:hover .pr-t { color: var(--accent); }
.pr-id {
  font-family: var(--mono); font-size: 10px; color: var(--accent);
  white-space: nowrap; min-width: 78px; flex-shrink: 0;
}
.pr-body { flex: 1; min-width: 0; }
.pr-t {
  font-size: 12px; font-weight: 500; color: var(--text); line-height: 1.35;
  transition: color 0.1s;
}
.pr-a {
  font-size: 10px; color: var(--text-2); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bq-why-label, .bq-list-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 6px;
}

/* Reference card */
.bq-ref {
  display: block; text-decoration: none;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 12px 14px; margin-top: 4px;
  transition: border-color 0.15s, background 0.15s;
}
.bq-ref:hover { border-color: var(--accent); background: var(--accent-bg); }
.bq-ref-title { font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.4; }
.bq-ref-meta { font-size: 11px; color: var(--text-2); margin-top: 3px; }
.bq-ref-link { font-size: 10.5px; color: var(--accent); font-weight: 600; margin-top: 6px; display: inline-block; }

/* Hub panel: list of answered milestones */
.bq-milestone {
  border-top: 1px solid var(--border-subtle);
  padding: 12px 0 2px;
}
.bq-milestone-q {
  font-size: 12.5px; font-weight: 500; color: var(--text); line-height: 1.4;
  margin-bottom: 2px; cursor: pointer;
}
.bq-milestone-q:hover { color: var(--accent); }
.bq-milestone .pr { border-bottom: none; padding: 5px 0 0; }
.bq-ref-wrap { margin-bottom: 14px; }
.bq-ref-wrap .pr { border-bottom: none; padding: 8px 0 0; }

/* Related open problems (L3) — questions, with a small "discussed in" pointer (not an answering ref) */
.bq-l3-item {
  border-top: 1px solid var(--border-subtle);  /* line under the heading + between items, like the L1 card */
  padding: 11px 0 3px;
}
.bq-l3-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 3px;
}
.bq-l3-q {
  font-size: 12.5px; font-weight: 500; color: var(--text); line-height: 1.4;
}
.bq-l3-src { font-size: 9.5px; color: var(--text-3); margin-top: 5px; }
.bq-l3-src a { color: var(--text-3); text-decoration: none; font-family: var(--mono); }
.bq-l3-src a:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 600px) {
  .bq-credit { max-width: 56vw; }
}
