/* "Billion Users, Million Journeys": the long read that joins the mathematics, the proposal
   (pw.css) and the evidence (ias.css). This file styles the cover note, the mathematics,
   the joins and the conclusions. Colour lives in the graphics, from the SPAN chord. */
.bh {
  --muted: var(--ink-muted);
  --faint: color-mix(in srgb, var(--color-text) 58%, transparent);
  --hair: color-mix(in srgb, var(--color-text) 20%, transparent);
  --mono: var(--font-mono, "IBM Plex Mono", ui-monospace, monospace);
  --m1: var(--c1, #E03A2F); --m2: var(--c2, #F6C327); --m3: var(--c3, #2F5DA8);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}
.bh-part { margin-top: 72px; padding-top: 14px; border-top: 6px solid var(--color-text); scroll-margin-top: 24px; }
.bh-part .bh-kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.bh-part h2 { font-size: clamp(30px, 4.2vw, 52px); font-weight: 900; line-height: 1; letter-spacing: -0.02em; margin: 0 0 16px; max-width: 20ch; }
.bh-part .bh-from { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.bh-prose { max-width: 66ch; }
.bh-prose p { margin: 0 0 14px; }
.bh-prose h3 { font-size: 22px; font-weight: 800; margin: 32px 0 10px; }
.bh-prose ul, .bh-prose ol { margin: 0 0 14px; padding-left: 1.2em; }
.bh-prose li { margin-bottom: 6px; }
.bh-prose li::marker { color: var(--m1); }
.bh-prose strong { font-weight: 800; }
.bh-note { font-size: 14px; color: var(--muted); max-width: 72ch; }
.bh-join { margin: 40px 0 0; padding: 16px 0 4px 18px; border-left: 6px solid var(--m3); max-width: 66ch; }
.bh-join p { margin: 0 0 10px; }
.bh-join .bh-kicker { margin-bottom: 4px; }

/* the chart */
.bh-fig { margin: 28px 0 8px; }
.bh-fig figcaption { font-size: 14px; color: var(--muted); max-width: 80ch; margin-top: 8px; }
.bh-chart { display: block; width: 100%; height: auto; overflow: visible; }
.bh-chart text { font-family: var(--font-body); fill: var(--color-text); }
.bh-axis { stroke: var(--color-text); stroke-width: 2; }
.bh-axis-arrow { fill: none; stroke: var(--color-text); stroke-width: 2; }
.bh-line { fill: none; stroke: var(--color-text); stroke-width: 2.5; stroke-linejoin: round; }
.bh-r1 { fill: color-mix(in srgb, var(--m3) 70%, transparent); }
.bh-r2 { fill: color-mix(in srgb, var(--m3) 38%, transparent); }
.bh-r3 { fill: color-mix(in srgb, var(--m1) 30%, transparent); }
.bh-tick { stroke: var(--color-text); stroke-width: 1; stroke-dasharray: 2 3; }
.bh-dot { fill: var(--color-bg); stroke: var(--color-text); stroke-width: 2; }
.bh-chart .bh-lab { font-size: 14px; font-weight: 800; }
.bh-chart .bh-big { font-size: 22px; font-weight: 900; letter-spacing: -0.01em; }
.bh-chart .bh-sub { font-family: var(--mono); font-size: 12px; fill: var(--muted); }
.bh-chart .bh-quote { font-size: 15px; font-weight: 700; font-style: italic; }
.bh-chart .bh-q { font-size: 15px; font-weight: 900; }
.bh-chart .bh-qs, .bh-chart .bh-axt { font-size: 11.5px; fill: var(--muted); }

/* theory beside the chart */
.bh-theory { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 24px 0; }
.bh-theory > div { border-top: 4px solid var(--k, var(--color-text)); padding-top: 10px; }
.bh-theory h3 { font-size: 18px; font-weight: 800; margin: 0 0 6px; }
.bh-theory p { font-size: 15px; color: var(--muted); margin: 0 0 8px; }
.bh-theory .t1 { --k: var(--m3); } .bh-theory .t2 { --k: var(--m2); } .bh-theory .t3 { --k: var(--m1); }
.bh-table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 20px; }
.bh-table th { text-align: left; font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--color-text); }
.bh-table td { padding: 10px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.bh-tablewrap { overflow-x: auto; border-top: 2px solid var(--color-text); }

/* part navigation */
.bh-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2px; background: var(--hair); border-top: 2px solid var(--color-text); border-bottom: 2px solid var(--color-text); margin: 24px 0; }
.bh-parts a { display: block; background: var(--color-bg); padding: 12px 12px 14px 0; color: inherit; text-decoration: none; }
.bh-parts a + a { padding-left: 12px; }
.bh-parts a span { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bh-parts a b { font-weight: 800; }
.bh-parts a:hover b { text-decoration: underline; text-decoration-color: var(--m1); text-underline-offset: 4px; }

/* narrow screens: keep the chart's labels readable; the chart scrolls sideways */
@media (max-width: 720px) { .bh-fig { overflow-x: auto; } .bh-chart { min-width: 760px; } }
