/* Who Won It — one stylesheet, no framework. */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --ink: #14212b;
  --ink-soft: #4a5a66;
  --muted: #6b7a86;
  --line: #dfe4e8;
  --brand: #0b3b5c;
  --brand-ink: #ffffff;
  --link: #0a5c8a;
  --link-hover: #06405f;
  --accent: #0e8a7a;
  --warn-bg: #fff4e0;
  --warn-ink: #7a4b00;
  --warn-line: #f2c46d;
  --sme-bg: #e3f4ee;
  --sme-ink: #11674d;
  --bar: #3a82b5;
  --focus: #f0a800;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 33, 43, 0.06), 0 1px 1px rgba(20, 33, 43, 0.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1b24;
    --surface: #13242f;
    --ink: #e7eef3;
    --ink-soft: #b8c7d2;
    --muted: #8fa3b1;
    --line: #243947;
    --brand: #7cc4f0;
    --brand-ink: #0d1b24;
    --link: #8ccdf5;
    --link-hover: #b9e2fa;
    --accent: #5fd0bf;
    --warn-bg: #3a2a0c;
    --warn-ink: #ffd48a;
    --warn-line: #7a5a1a;
    --sme-bg: #10382c;
    --sme-ink: #8fe3c4;
    --bar: #6fb3e3;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); margin: 0.2em 0 0.35em; }
h2 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 8px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.brand-mark { color: var(--brand); flex: none; }
.header-search { margin-left: auto; display: flex; gap: 6px; flex: 1 1 280px; max-width: 420px; }
.header-search input, .hero-search input {
  flex: 1; min-width: 0; font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink);
}
button {
  font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 8px; border: 0; cursor: pointer;
  background: var(--brand); color: var(--brand-ink);
}
.site-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; padding-bottom: 10px; font-size: 0.95rem; }
.site-nav a { color: var(--ink-soft); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

main { padding-top: 20px; padding-bottom: 48px; min-height: 60vh; }

/* Hero */
.hero { padding: 16px 0 8px; max-width: 760px; }
.hero h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); }
.lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 70ch; }
.hero-search { display: flex; gap: 8px; margin: 18px 0 8px; }
.hero-search input { padding: 12px 14px; font-size: 1.05rem; background: var(--surface); }
.hero-search button { padding: 12px 20px; }

/* Page head */
.page-head { margin-bottom: 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; font-weight: 700; color: var(--accent); margin: 0; }
.meta { color: var(--muted); font-size: 0.95rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 12px; font-size: 0.9rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin: 0 6px 0 2px; }
.breadcrumbs a { color: var(--muted); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 16px 0 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat dt { font-size: 0.85rem; color: var(--muted); }
.stat dd { margin: 4px 0 0; display: flex; flex-direction: column; }
.stat-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 0.8rem; color: var(--muted); }

/* Sections */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head h2 { margin-bottom: 0.5rem; }
.section-note { color: var(--muted); font-size: 0.9rem; margin-top: -0.25rem; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 8px 32px; }
.empty { color: var(--muted); font-style: italic; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.awards { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.awards th { text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.awards th.num { text-align: right; }
table.awards td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.awards tr:last-child td { border-bottom: 0; }
.title-cell a { font-weight: 600; }
@media (max-width: 720px) {
  table.awards thead { display: none; }
  table.awards, table.awards tbody, table.awards tr, table.awards td { display: block; width: 100%; }
  table.awards tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.awards tr:last-child { border-bottom: 0; }
  table.awards td { padding: 2px 0; border: 0; text-align: left; }
  table.awards td.num { text-align: left; }
  table.awards td[data-label]:not(.title-cell)::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.85rem; }
  table.awards td.title-cell { font-size: 1rem; margin-bottom: 2px; }
}

/* Badges */
.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; vertical-align: 1px; white-space: nowrap; }
.badge-nocomp { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.badge-sme { background: var(--sme-bg); color: var(--sme-ink); }

/* Ranked lists */
ol.ranked { list-style: none; padding: 0; margin: 0; counter-reset: rank; }
ol.ranked li { counter-increment: rank; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ranked-row { display: flex; gap: 8px; align-items: baseline; }
.ranked-row::before { content: counter(rank); color: var(--muted); font-size: 0.85rem; min-width: 1.6em; font-variant-numeric: tabular-nums; }
.ranked-row a { font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ranked-figures { color: var(--muted); font-size: 0.88rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ranked-bar { display: block; height: 4px; margin: 6px 0 0 calc(1.6em + 8px); border-radius: 2px; background: linear-gradient(90deg, var(--bar) var(--w), transparent var(--w)); opacity: 0.55; }

/* Chips */
.chip-grid { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-grid a { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: 0.92rem; }
.chip-grid a:hover { border-color: var(--link); }

/* Chart */
.chart { margin: 20px 0 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 6px; box-shadow: var(--shadow); }
.chart figcaption { font-size: 0.9rem; color: var(--muted); margin-bottom: 6px; }
.chart svg { width: 100%; height: 180px; display: block; }
.chart .bar { fill: var(--bar); }
.chart .bar:hover { fill: var(--accent); }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .baseline { stroke: var(--line); }

/* Contract page */
.facts { display: grid; grid-template-columns: 1fr; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 16px 0; box-shadow: var(--shadow); }
.facts > div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: 0.92rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .facts > div { grid-template-columns: 1fr; gap: 2px; } }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; }
.callout p:last-child { margin-bottom: 0; }
.callout-warn { background: var(--warn-bg); border-color: var(--warn-line); border-left-color: var(--warn-line); color: var(--warn-ink); }
.description { white-space: pre-line; max-width: 75ch; }
ul.plain { padding-left: 1.2em; }

/* Featured / sponsors */
.featured { margin: 24px 0; padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.featured-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin: 0 0 6px; }
.featured-item a { font-weight: 700; }
.featured-item p { margin: 2px 0 10px; color: var(--ink-soft); }
.featured-empty p:last-child { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* Ads: reserve space so nothing jumps when ads load */
.ad-slot { margin: 24px 0; min-height: 100px; }
.ad-placeholder { display: flex; align-items: center; justify-content: center; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); font-size: 0.85rem; }

/* Pagination & search results */
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); }
.result-list { list-style: none; padding: 0; }
.result-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.result-list a { font-weight: 600; }

/* Prose */
.prose { max-width: 75ch; }
.static h2 { margin-top: 1.8rem; }
.static li { margin-bottom: 0.4em; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-size: 0.9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-top: 24px; padding-bottom: 32px; }
.footer-inner > div { max-width: 560px; }
.footer-brand { font-weight: 700; color: var(--ink); }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.licence { font-size: 0.85rem; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
