/* foot.io v2 — marketing system
 * Cream + ink + 3 accents. Sharp corners, 1px rules, no gradients/shadows.
 * Density-first. Designed for marketing pages that demo the API. */

:root {
  --cream: #F4F5D9;
  --ink: #0E0E0E;
  --acc-lime: #D6F23A;
  --acc-cyan: #3FB8E6;
  --acc-pink: #E91E78;
  --acc: var(--acc-lime); /* default; tweaks panel can swap */
  --sub: #555;
  --rule: #0E0E0E;
  --bg-elev: #FBFBE5;
  --warn: #E91E78;
  --ok: #2d8f5f;

  --radius: 3px;
  --gap: 14px;
  --pad: 24px;
}

/* density modifiers (Tweaks panel) */
[data-density="compact"] { --gap: 8px; --pad: 14px; }
[data-density="cozy"]    { --gap: 14px; --pad: 24px; }
[data-density="comfy"]   { --gap: 22px; --pad: 36px; }

/* accent swap */
[data-accent="cyan"] { --acc: var(--acc-cyan); }
[data-accent="pink"] { --acc: var(--acc-pink); }
[data-accent="lime"] { --acc: var(--acc-lime); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--cream); color: var(--ink); }
body {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono, code, pre { font-family: "JetBrains Mono", ui-monospace, "SF Mono", monospace; }

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--acc-pink); }

h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.02em; line-height: 1.05; margin: 0; }
h1 em, h2 em, h3 em { font-style: normal; color: var(--acc); }

/* ── Eyebrows / section markers ─────────── */
.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sub);
  margin-bottom: 14px;
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.eyebrow .marker { color: var(--ink); font-weight: 600; }
.eyebrow .endpoint {
  background: var(--ink);
  color: var(--cream);
  padding: 2px 8px;
  border-radius: var(--radius);
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* ── Layout ─────────────────────────────── */
.shell { max-width: 1400px; margin: 0 auto; padding: 0 var(--pad); }
.section { padding: 48px var(--pad); border-bottom: 1px solid var(--rule); }
.section.tight { padding: 24px var(--pad); }
[data-density="compact"] .section { padding: 28px var(--pad); }
[data-density="comfy"] .section   { padding: 72px var(--pad); }
/* When .section/.hero contains a .shell wrapper (footio v2 pattern),
   shell handles horizontal centring so we zero its padding to avoid doubling. */
.section > .shell, .hero > .shell { padding-left: 0; padding-right: 0; }

.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
[data-layout="stacked"] .split { grid-template-columns: 1fr; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.row { display: flex; gap: var(--gap); align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }

/* ── Top bar ─────────────────────────────── */
.topbar {
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
  position: sticky;
  top: 0;
  background: var(--cream);
  z-index: 100;
}
.topbar .shell { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-size: 22px; font-weight: 500; letter-spacing: -0.04em; font-family: "JetBrains Mono", monospace; }
.brand .dot { color: var(--acc); }
.brand .bracket { color: var(--acc-lime, #D6F23A); font-weight: 400; }
.nav { display: flex; gap: 22px; font-size: 13px; }
.nav a { text-decoration: none; }
.nav a:hover { color: var(--acc-pink); }

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-block;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.btn:hover { background: var(--ink); color: var(--cream); }
.btn.primary { background: var(--ink); color: var(--cream); }
.btn.primary:hover { background: var(--acc-pink); color: var(--cream); border-color: var(--acc-pink); }
.btn.acc { background: var(--acc); border-color: var(--ink); color: var(--ink); }
.btn.acc:hover { background: var(--ink); color: var(--cream); }

/* ── Chips ─────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--ink);
  background: var(--cream);
  border-radius: var(--radius);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.chip.acc { background: var(--acc); }
.chip.ink { background: var(--ink); color: var(--cream); }
.chip.ghost { background: transparent; }

/* ── Hero ─────────────────────────────── */
.hero {
  padding: 64px var(--pad) 48px;
  border-bottom: 1px solid var(--rule);
}
.hero h1 {
  font-size: clamp(48px, 8vw, 120px);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin-bottom: 28px;
}
.hero h1 em { color: var(--acc); }
.hero .lede {
  font-size: clamp(18px, 1.6vw, 22px);
  max-width: 780px;
  color: var(--sub);
  line-height: 1.45;
  margin-bottom: 32px;
}

/* ── Metric strip ─────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--rule);
  background: var(--ink);
  gap: 1px;
  margin: 24px 0;
}
.metric {
  background: var(--cream);
  padding: 22px 18px;
}
.metric .num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
}
.metric .num.acc { color: var(--acc); }
.metric .num.pink { color: var(--acc-pink); }
.metric .num.cyan { color: var(--acc-cyan); }
.metric .label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sub);
  margin-top: 8px;
}
@media (max-width: 1100px) { .metrics { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .metrics { grid-template-columns: repeat(2, 1fr); } }

/* ── Tables ─────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td {
  border-bottom: 1px solid var(--rule);
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}
.table th {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sub);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 6px;
}
.table td.num, .table th.num { text-align: right; font-family: "JetBrains Mono", monospace; }
.table tr:hover td { background: var(--bg-elev); }
[data-density="compact"] .table th, [data-density="compact"] .table td { padding: 4px 8px; font-size: 12px; }
[data-density="comfy"] .table th, [data-density="comfy"] .table td { padding: 12px 14px; font-size: 14px; }

/* ── Cards ─────────────────────────────── */
.card {
  border: 1px solid var(--ink);
  background: var(--cream);
  padding: var(--pad);
  border-radius: var(--radius);
}
.card.ink { background: var(--ink); color: var(--cream); }
.card.acc { background: var(--acc); }

/* ── Code / JSON ─────────────────────────── */
.codeblock {
  background: var(--ink);
  color: var(--cream);
  padding: 16px 18px;
  border-radius: var(--radius);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}
.codeblock .req { color: var(--acc-cyan); }
.codeblock .key { color: var(--acc-lime); }
.codeblock .str { color: #FFE066; }
.codeblock .num { color: var(--acc-pink); }
.codeblock .com { color: #888; font-style: italic; }
.codeblock .punc { color: #999; }

/* ── Sticky on-page nav ─────────────────── */
.sticky-nav {
  position: sticky;
  top: 56px;
  align-self: start;
  border-left: 1px solid var(--rule);
  padding: 10px 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.sticky-nav a {
  display: block;
  padding: 4px 0;
  text-decoration: none;
  color: var(--sub);
  border-left: 2px solid transparent;
  padding-left: 10px;
  margin-left: -16px;
}
.sticky-nav a.active, .sticky-nav a:hover { color: var(--ink); border-left-color: var(--acc); }

/* ── Megagrid (key stats hero) ─────────── */
.megagrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--ink);
  background: var(--ink);
  gap: 1px;
}
.megagrid .cell { background: var(--cream); padding: 14px 14px; }
.megagrid .cell .v { font-family: "Space Grotesk", sans-serif; font-size: 26px; font-weight: 500; letter-spacing: -0.02em; }
.megagrid .cell .l { font-family: "JetBrains Mono", monospace; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sub); margin-top: 4px; }
@media (max-width: 800px) { .megagrid { grid-template-columns: repeat(3, 1fr); } }

/* ── Endpoint badge ─────────────────────── */
.endpoint-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  background: var(--ink);
  color: var(--cream);
  padding: 3px 8px;
  border-radius: var(--radius);
}
.endpoint-tag .verb { color: var(--acc); }

/* ── Tweaks panel ───────────────────────── */
.tweaks {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: var(--cream);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  z-index: 200;
  max-width: 300px;
}
.tweaks summary { cursor: pointer; user-select: none; padding: 4px 0; }
.tweaks summary::marker { color: var(--acc); }
.tweaks .row { gap: 6px; padding: 6px 0; }
.tweaks .seg {
  display: inline-flex;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
}
.tweaks .seg button {
  background: var(--cream);
  border: none;
  border-right: 1px solid var(--ink);
  padding: 3px 8px;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  color: var(--ink);
}
.tweaks .seg button:last-child { border-right: none; }
.tweaks .seg button.on { background: var(--ink); color: var(--cream); }
.tweaks .seg button.on[data-color="lime"] { background: var(--acc-lime); color: var(--ink); }
.tweaks .seg button.on[data-color="cyan"] { background: var(--acc-cyan); color: var(--ink); }
.tweaks .seg button.on[data-color="pink"] { background: var(--acc-pink); color: var(--cream); }

/* ── Coverage bars ──────────────────────── */
.bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.bar-fill { height: 100%; background: var(--acc); }
.bar-fill.cyan { background: var(--acc-cyan); }
.bar-fill.pink { background: var(--acc-pink); }

/* ── Sparkline / heatmap ─────────────────── */
.heatmap {
  display: grid;
  grid-template-columns: repeat(38, 1fr);
  gap: 1px;
  background: var(--ink);
  padding: 1px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
}
.heatmap .cell {
  aspect-ratio: 1;
  background: var(--bg-elev);
  font-size: 0;
}
.heatmap .cell.r { background: var(--acc-cyan); opacity: 0.3; }
.heatmap .cell.r2 { background: var(--acc-cyan); opacity: 0.55; }
.heatmap .cell.r3 { background: var(--acc-cyan); opacity: 0.8; }
.heatmap .cell.r4 { background: var(--acc-cyan); }
.heatmap .cell.win { background: var(--acc-lime); }
.heatmap .cell.draw { background: #d4a64a; }
.heatmap .cell.loss { background: var(--acc-pink); opacity: 0.7; }

/* ── Pitch ──────────────────────────────── */
.pitch {
  position: relative;
  background: #2d6e3a;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  aspect-ratio: 1.5;
  width: 100%;
  max-width: 600px;
}
.pitch svg { display: block; width: 100%; height: 100%; }

/* ── Swimlane ───────────────────────────── */
.swimlane {
  position: relative;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--cream);
  padding: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}
.swimlane .lane {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--bg-elev);
}
.swimlane .lane:last-child { border-bottom: none; }
.swimlane .bar {
  height: 18px;
  background: var(--acc);
  border: 1px solid var(--ink);
  border-radius: 2px;
  position: relative;
}
.swimlane .bar.club2 { background: var(--acc-cyan); }
.swimlane .bar.club3 { background: var(--acc-pink); color: var(--cream); }
.swimlane .bar .label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-size: 10px;
  white-space: nowrap;
}

/* ── Ticker ─────────────────────────────── */
.ticker {
  background: var(--ink);
  color: var(--cream);
  border-bottom: 1px solid var(--ink);
  overflow: hidden;
  white-space: nowrap;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  padding: 8px 0;
  position: relative;
}
.ticker .track {
  display: inline-block;
  animation: scroll 60s linear infinite;
  padding-left: 100%;
}
.ticker .item { display: inline-flex; gap: 8px; padding: 0 22px; }
.ticker .item .acc { color: var(--acc); }
.ticker .item .pink { color: var(--acc-pink); }
.ticker .item .cyan { color: var(--acc-cyan); }
.ticker .sep { color: #555; }
@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* ── Comparison table ──────────────────── */
.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.compare th {
  background: var(--ink);
  color: var(--cream);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 12px;
  border-right: 1px solid var(--cream);
}
.compare th:last-child { border-right: none; }
.compare th.us { background: var(--acc); color: var(--ink); }
.compare td { padding: 10px 12px; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); text-align: center; }
.compare td:first-child { text-align: left; font-weight: 500; }
.compare td:last-child { border-right: none; }
.compare td.us { background: var(--bg-elev); font-weight: 500; }
.compare .yes { color: var(--ok); }
.compare .no { color: var(--sub); }

/* ── Endpoint grid ─────────────────────── */
.endpoint-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--ink);
  background: var(--ink);
  gap: 1px;
}
.endpoint-grid .cell {
  background: var(--cream);
  padding: 18px 18px;
  cursor: pointer;
  transition: background 0.1s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.endpoint-grid .cell:hover { background: var(--bg-elev); }
.endpoint-grid a.cell:focus-visible { outline: 2px solid var(--acc-pink); outline-offset: -2px; }
.endpoint-grid .cell .ep {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  background: var(--ink);
  color: var(--cream);
  padding: 3px 8px;
  border-radius: var(--radius);
  display: inline-block;
  margin-bottom: 10px;
}
.endpoint-grid .cell h3 { font-size: 18px; margin-bottom: 6px; }
.endpoint-grid .cell p { font-size: 13px; color: var(--sub); margin: 0; }
@media (max-width: 1000px) { .endpoint-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .endpoint-grid { grid-template-columns: 1fr; } }

/* ── Footer ─────────────────────────────── */
.footer {
  border-top: 1px solid var(--rule);
  padding: 36px 0;
  font-size: 13px;
  color: var(--sub);
}
.footer .row { justify-content: space-between; }

/* ── Misc ───────────────────────────────── */
.muted { color: var(--sub); }
.small { font-size: 12px; }
.mono-num { font-family: "JetBrains Mono", monospace; }
.divider { height: 1px; background: var(--rule); margin: 24px 0; }
.callout {
  border-left: 3px solid var(--acc);
  padding: 8px 0 8px 14px;
  margin: 16px 0;
  font-size: 14px;
}
.dot-list li { margin: 4px 0; }
.dot-list li::marker { color: var(--acc); }

/* hide API previews if user toggles off */
[data-api-previews="off"] .api-only { display: none !important; }

/* ── Error states (entity / list pages) ─────────────
   Loaded everywhere via chrome.js. Pages call window.footioRenderError()
   into their hero element on fetch failure or 404, and
   window.footioRenderWarning() for partial-data secondary failures. */
.error-state { padding: 48px var(--pad); }
.error-state .eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--acc-pink);
  margin-bottom: 14px;
}
.error-state h1 {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 14px;
  max-width: 780px;
}
.error-state h1 em {
  font-style: normal;
  color: var(--acc-pink);
  font-family: "Space Grotesk", "Inter", ui-sans-serif, sans-serif;
  font-weight: 400;
}
.error-state p {
  font-size: 15px;
  color: var(--sub);
  max-width: 640px;
  margin: 0 0 22px;
  line-height: 1.55;
}
.error-state .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.section-warn {
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--rule);
  background: var(--bg-elev);
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.section-warn .label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--acc-pink);
}
.section-warn .msg { font-size: 13px; color: var(--ink); }
@media (max-width: 768px) { .error-state { padding: 36px 20px; } .section-warn { padding: 14px 20px; } }

/* ── Chrome search (⌘K typeahead) ─────────────
   Lives in the topbar. Positions a dropdown of RPC results below the input. */
.chrome-search-wrap {
  position: relative;
  flex: 0 1 360px;
  min-width: 200px;
  margin: 0 auto 0 12px;
}
@media (max-width: 900px) { .chrome-search-wrap { display: none; } }
#chrome-search {
  width: 100%;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  background: var(--bg-elev);
  color: var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.1s, background 0.1s;
}
#chrome-search::placeholder { color: var(--sub); }
#chrome-search:focus { border-color: var(--acc-pink); background: var(--cream); }
#chrome-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-elev);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  max-height: 70vh;
  overflow-y: auto;
  z-index: 200;
}
#chrome-search-results .cs-group { border-bottom: 1px solid var(--rule); }
#chrome-search-results .cs-group:last-child { border-bottom: none; }
#chrome-search-results .cs-group-label {
  padding: 8px 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sub);
  background: var(--cream);
  border-bottom: 1px solid var(--rule);
}
#chrome-search-results .cs-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  border-bottom: 1px dashed var(--rule);
}
#chrome-search-results .cs-item:last-child { border-bottom: none; }
#chrome-search-results .cs-item:hover,
#chrome-search-results .cs-item.active {
  background: var(--acc-lime);
  color: var(--ink);
}
#chrome-search-results .cs-name { flex: 1; font-weight: 500; }
#chrome-search-results .cs-name mark {
  background: transparent;
  color: var(--acc-pink);
  font-weight: 600;
  padding: 0;
}
#chrome-search-results .cs-hint {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--sub);
  white-space: nowrap;
}
#chrome-search-results .cs-empty {
  padding: 18px 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--sub);
  text-align: center;
}

/* ─── Chart context: explainer paragraph + legend ───────────────────
   Used on team.html (Elo, League positions), player.html (shot map,
   form bar, career totals), match.html (xG flow, team stats), etc.
   Loaded via chrome.js so every chrome-using page gets it for free. */
.chart-explainer {
  font-size: 14px;
  line-height: 1.55;
  color: var(--sub);
  max-width: 760px;
  margin: -8px 0 18px;
  padding: 12px 16px;
  border-left: 3px solid var(--acc);
  background: var(--bg-elev, #FBFBE5);
}
.chart-explainer strong { color: var(--ink); font-weight: 600; }

.chart-frame {
  background: #fdfcf6;
  border: 1px solid var(--ink);
  border-radius: 6px;
  width: 100%;
  max-width: 900px;
}

.chart-axis-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  fill: #7d8a73;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.chart-legend .swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid var(--ink);
  vertical-align: middle;
  margin-right: 5px;
  border-radius: 2px;
}
.chart-legend .swatch.line { height: 2px; border-radius: 0; }
.chart-legend .swatch.dot { border-radius: 50%; }

@media (max-width: 768px) {
  .chart-explainer { font-size: 13px; padding: 10px 14px; }
}

/* ─── Mobile + accessibility polish (added 2026-05-08 SEO+GEO pass) ───
   Lifted from per-page inline styles to a shared layer so every chrome-
   using page gets consistent mobile behaviour. */

/* Tables: allow horizontal scroll on narrow viewports without breaking
   page layout. iOS gets momentum scrolling. */
.table-wrap, .table-wrap-x {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

@media (max-width: 768px) {
  /* On narrow screens give all our common table classes scrolling
     behaviour automatically — saves wrapping every <table> in markup. */
  .table, .tbl, .data-table, .cov-table, .scoreboard-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table thead, .tbl thead, .data-table thead {
    display: table-header-group;
  }
}

/* Touch targets — WCAG 2.5.5 (target size 44x44 minimum). Apply to
   anything tappable on coarse pointers. */
@media (pointer: coarse) {
  button,
  .btn,
  .btn-sm,
  .id-link,
  .info-tip,
  .nav a,
  .nav button,
  .filters select,
  .search-bar input,
  .search-bar button,
  .pagination button {
    min-height: 44px;
  }
  .nav a, .nav button { padding-top: 12px; padding-bottom: 12px; }
  a.result-W, a.result-L, a.result-D {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* Visible FAQ block injected by the prerender — clean accordion that
   matches the rest of the design system. */
.faq-section { padding: 32px 40px; border-top: 1px solid var(--ink); margin-top: 32px; }
.faq-section h2 { margin-bottom: 18px; font-size: 32px; font-weight: 500; letter-spacing: -0.02em; }
.faq-section h2 em { color: var(--acc); font-style: normal; font-weight: 400; }
.faq-item {
  border-top: 1px dashed var(--ink);
  padding: 14px 0;
}
.faq-item:last-of-type { border-bottom: 1px dashed var(--ink); }
.faq-item summary {
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: "JetBrains Mono", monospace;
  font-size: 20px;
  color: var(--acc-pink);
  transition: transform 0.2s;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--sub);
  max-width: 700px;
}
@media (max-width: 768px) {
  .faq-section { padding: 28px 20px; }
  .faq-section h2 { font-size: 24px; }
}

/* Info-tip button — a small lime circle with a serif "i" inside.
   Used next to section headings for inline scope/methodology hover-
   tooltips. The .info-tip span is given a `title` attribute by the
   page; the visible glyph is the "i" inside. */
.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 10px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--acc-lime, #D6F23A);
  color: var(--ink);
  font-family: "Instrument Serif", "Times New Roman", Georgia, serif;
  font-style: italic;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: help;
  vertical-align: 4px;
  user-select: none;
  transition: background-color 0.15s, transform 0.15s;
}
.info-tip:hover, .info-tip:focus-visible {
  background: var(--acc-pink, #E91E78);
  color: #fff;
  outline: none;
  transform: translateY(-1px);
}
.info-tip:focus-visible {
  /* WCAG 2.4.7: a visible focus indicator on top of the colour change */
  box-shadow: 0 0 0 2px var(--ink);
}

/* ── Tooltip popover ───────────────────────────────────────────────
   chrome.js promotes the `title` attribute to `data-tip` so we can
   style the tooltip ourselves (the native title="" attribute is
   inconsistent across browsers and invisible on touch). The popover
   appears on hover, keyboard focus, or — on touch devices — when the
   user taps the tip (chrome.js toggles a `.open` class).
   z-index above the page chrome; max-width so long copy wraps; positioned
   directly under the badge with a small offset.                       */
.info-tip { position: relative; }
.info-tip[data-tip]:hover::after,
.info-tip[data-tip]:focus-visible::after,
.info-tip[data-tip].open::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(340px, 80vw);
  padding: 10px 12px;
  background: var(--ink, #0E0E0E);
  color: var(--cream, #F4F5D9);
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 12.5px;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  pointer-events: none;        /* don't steal hover from underlying buttons */
  white-space: normal;
}
/* Little arrow pointing up to the badge. */
.info-tip[data-tip]:hover::before,
.info-tip[data-tip]:focus-visible::before,
.info-tip[data-tip].open::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: var(--ink, #0E0E0E);
  margin-top: -2px;
  z-index: 1001;
  pointer-events: none;
}
/* When near the right edge, anchor the popover to the right instead so
   it doesn't overflow the viewport. Page authors can opt in via
   class="info-tip end-aligned". */
.info-tip[data-tip].end-aligned:hover::after,
.info-tip[data-tip].end-aligned:focus-visible::after,
.info-tip[data-tip].end-aligned.open::after {
  left: auto;
  right: 0;
  transform: none;
}

/* Slightly smaller within H2 / H3 so it doesn't dominate the heading line. */
h2 .info-tip { width: 22px; height: 22px; font-size: 15px; vertical-align: 8px; }
h3 .info-tip { width: 18px; height: 18px; font-size: 12px; vertical-align: 3px; }

/* WCAG: visually-hidden label for inputs that have their own aria-label.
   Kept in DOM for screen readers, hidden from sighted users. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* WCAG 2.4.1 Bypass Blocks — a skip-link that becomes visible on
   focus so keyboard users can jump past the chrome nav. */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 9999;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--acc-lime, #D6F23A);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  border: 1px solid var(--ink);
  text-decoration: none;
  transition: top 0.15s;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 8px;
  outline: 2px solid var(--acc-lime, #D6F23A);
  outline-offset: 2px;
}

/* WCAG 2.4.7: visible focus indicator on all interactive controls. */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--acc-pink, #E91E78);
  outline-offset: 2px;
}
@media (pointer: coarse) {
  /* On touch devices give a 32px+ target — the 44px WCAG rule applies
     to discrete touch targets but for inline-icon affordances 32 is
     the practical limit before the icon overwhelms the heading. */
  .info-tip { width: 32px; height: 32px; font-size: 17px; }
  h2 .info-tip, h3 .info-tip { width: 32px; height: 32px; font-size: 17px; }
}

/* ── Skeleton loader — replaces the "LOADING…" text flash on data-heavy pages ── */
.skeleton-hero{max-width:840px}
.skeleton-bar{height:14px;border-radius:4px;margin:10px 0;background:linear-gradient(90deg,rgba(14,14,14,.05) 25%,rgba(14,14,14,.12) 37%,rgba(14,14,14,.05) 63%);background-size:400% 100%;animation:skel 1.4s ease infinite}
.skeleton-bar.sk-eyebrow{height:10px;width:150px;margin-bottom:22px}
.skeleton-bar.sk-title{height:clamp(42px,7vw,82px);width:62%;border-radius:6px;margin:0 0 22px}
.skeleton-bar.sk-w70{width:70%}.skeleton-bar.sk-w55{width:55%}.skeleton-bar.sk-w40{width:40%}
.skeleton-tiles{display:flex;gap:1px;margin-top:30px;max-width:900px;background:var(--ink,#0E0E0E);border:1px solid var(--ink,#0E0E0E)}
.skeleton-tiles .sk-tile{flex:1;height:80px;background:linear-gradient(90deg,rgba(14,14,14,.05) 25%,rgba(14,14,14,.12) 37%,rgba(14,14,14,.05) 63%);background-size:400% 100%;animation:skel 1.4s ease infinite}
@keyframes skel{0%{background-position:100% 0}100%{background-position:-100% 0}}
@media(prefers-reduced-motion:reduce){.skeleton-bar,.skeleton-tiles .sk-tile{animation:none}}
