/* Karaoke Club branding — palette and type mirrored from projects/q2-report/site/index.html :root
   Deviation for the traction map: the plot panel is LIGHT (warm off-white) so the chart is easy to
   read, while the page surround stays brand-black and the chart reads as a framed card.
   See brand-spec.md. */
:root {
  --bg: #000000;
  --card: #111111;
  --text: #FFFFFF;
  --muted: #999999;
  --accent: #FFEF9D;
  --coral: #EB6163;
  --teal: #004449;
  --border: #222222;

  /* ---- light chart panel tokens ---- */
  --chart-bg: #FFFFFF;         /* plot panel: pure white */
  --chart-ink: #111111;        /* primary ink on the light panel */
  --chart-meta: #595959;       /* secondary / meta text on the light panel */
  --chart-ink-soft: #444444;   /* company labels inside the plot */
  --chart-grid: #E4E4E4;       /* grid rules, neutral grey */
  --chart-grid-strong: #CFCFCF;/* column separators */
  --chart-band: rgba(17, 17, 17, 0.035);

  /* vintage colours, legible on the light panel */
  --dot-2025: #FFEF9D;         /* 2025 vintage: brand gold (--accent), dark stroke carries it on white */
  --dot-2026: #EB6163;         /* 2026 vintage: coral */
  --dot-stroke: #111111;

  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* ---------- header (on the black surround) ---------- */
header.masthead {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 40px;
  margin-bottom: 28px;
}

.logo {
  height: 28px;
  width: auto;
  display: block;
  margin: 0 0 24px;
  filter: invert(1) brightness(100);
}

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 12px;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 16px;
}

.standfirst {
  margin: 0;
  max-width: 70ch;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

/* ---------- note above the panel (on black) ---------- */
.legend-note {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 18px;
  max-width: 78ch;
  line-height: 1.55;
}

/* ---------- chart panel: LIGHT ---------- */
.chart-panel {
  position: relative;
  background: var(--chart-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 14px 10px;
  color: var(--chart-ink);
}

/* legend sits inside the light panel, so dark ink */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  align-items: center;
  margin: 0 0 10px;
  padding: 0 4px 10px;
  border-bottom: 1px solid var(--chart-grid);
  font-size: 13px;
  font-weight: 600;
  color: var(--chart-ink);
}

.legend-item { display: flex; align-items: center; gap: 8px; }

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
  border: 1.5px solid var(--dot-stroke);
}
.swatch.v25 { background: var(--dot-2025); }
.swatch.v26 { background: var(--dot-2026); }

svg.chart { display: block; width: 100%; height: auto; }

/* chart ink — all dark, on the off-white panel */
.axis-label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  fill: var(--chart-meta);
}
.band-label {
  font-family: var(--sans);
  font-size: 11.5px;
  fill: var(--chart-ink);
}
.stage-label {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  fill: var(--chart-ink);
}
.stage-index {
  font-family: var(--sans);
  font-size: 10px;
  fill: var(--chart-meta);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.band-fill { fill: var(--chart-band); }
.col-sep { stroke: var(--chart-grid-strong); stroke-width: 1; stroke-dasharray: 2 4; }

.dot { cursor: pointer; }
.dot circle { transition: r 90ms ease-out; }
.dot:focus { outline: none; }
.dot:focus circle.hit,
.dot.active circle.hit { stroke: var(--chart-ink); stroke-width: 1.2; stroke-dasharray: 2 2; fill: none; }

/* ---------- tooltip: dark brand card over the light panel ---------- */
.tip {
  position: absolute;
  z-index: 10;
  width: 270px;
  max-width: calc(100vw - 48px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  padding: 13px 15px 14px;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text);
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 100ms ease-out, transform 100ms ease-out;
}
.tip.on { opacity: 1; transform: translateY(0); }

.tip-name {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 3px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tip-name .pip {
  width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto;
}
.tip-vintage {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0 0 9px;
}
.tip dl { margin: 0; display: grid; grid-template-columns: 78px 1fr; gap: 3px 8px; }
.tip dt { color: var(--muted); }
.tip dd { margin: 0; color: var(--text); }
.tip-why {
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  color: #BFBFBF;
}

/* ---------- footnotes (back on the black surround) ---------- */
.footnotes {
  margin-top: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 32px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}
.footnotes h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}
.footnotes h2 + ul { margin-bottom: 22px; }
.footnotes ul { margin: 0; padding-left: 18px; }
.footnotes li { margin-bottom: 6px; }
.footnotes b { color: var(--text); font-weight: 700; }
.tallies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
}
.tallies li {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  background: #0a0a0a;
  font-size: 12px;
  color: var(--muted);
}
.tallies b { color: var(--accent); font-weight: 700; }

.foot-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 0 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.foot-mark img { height: 16px; width: auto; filter: invert(1) brightness(100); opacity: 0.7; }

@media (max-width: 720px) {
  .wrap { padding: 24px 14px 44px; }
  header.masthead { padding: 28px 20px; border-radius: 12px; margin-bottom: 20px; }
  .logo { height: 22px; margin-bottom: 18px; }
  h1 { font-size: 22px; }
  .standfirst { font-size: 14px; }
  .legend { gap: 6px 16px; font-size: 12px; padding: 0 2px 8px; }
  .legend-note { font-size: 12px; }
  .chart-panel { padding: 12px 6px 6px; }
  .tip { width: 236px; font-size: 12px; }
  .tip dl { grid-template-columns: 68px 1fr; }
  .footnotes { padding: 22px 18px; }
}

@media print {
  .tip { display: none !important; }
}
