/* Newsreader (SIL Open Font License, fonts/OFL.txt), self-hosted so the CSP stays 'self'. */
@font-face {
	font-family: "Newsreader";
	font-style: normal;
	font-weight: 300 600;
	font-display: swap;
	src: url(/fonts/newsreader-latin.woff2) format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Newsreader";
	font-style: normal;
	font-weight: 300 600;
	font-display: swap;
	src: url(/fonts/newsreader-latin-ext.woff2) format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
	--bg: #ffffff;
	--fg: #000000;
	--muted: #6f6f6f;
	--line: #d9d9d9;
	--line-soft: #ececec;
	--surface: #f5f5f5;
	--pill: #e7e7e7;
	--accent: #8842fd;
	--accent-ink: #5b1fc4;
	--accent-soft: #f1eaff;
	--serif: "Newsreader", Georgia, Cambria, serif;
	--sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--mono: ui-monospace, "SF Mono", Menlo, monospace;
	color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font: 16px/1.5 var(--sans);
	-webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
code { font: 0.85em var(--mono); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Color keys: square before panel titles, small swatch beside model names */
.sq { display: inline-block; flex: none; width: 16px; height: 16px; background: var(--c); }
.dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--c); }

/* ---------- Header and footer ---------- */
.site-header .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding-block: 16px; }
.brand {
	justify-self: start;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 16px 6px 12px;
	border-radius: 999px;
	background: #000;
	color: #fff;
	font: 400 18px/1.3 var(--serif);
	text-decoration: none;
}
.brand svg { fill: currentColor; }
.nav-pills { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--pill); }
.nav-pills a { padding: 6px 14px; border-radius: 999px; font-size: 14px; text-decoration: none; white-space: nowrap; }
.nav-pills a:hover { background: rgb(0 0 0 / 0.06); }
.nav-pills a[aria-current="page"] { background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.button {
	justify-self: end;
	display: inline-flex;
	align-items: center;
	padding: 8px 14px;
	border-radius: 8px;
	background: #000;
	color: #fff;
	font-size: 14px;
	text-decoration: none;
	white-space: nowrap;
}
.button:hover { background: #262626; }
.site-footer { margin-top: 96px; border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--muted); font-size: 13px; }

/* ---------- Type ---------- */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
h1 { font-size: clamp(38px, 5.6vw, 72px); line-height: 1.02; letter-spacing: -0.02em; margin: 0 0 16px; }
h1 .soft { color: #9a9a9a; }
h2 { font-size: 30px; line-height: 1.2; margin: 56px 0 16px; }
h3 { font-size: 21px; line-height: 1.2; margin: 0; }
h4 { font-size: 16px; margin: 0; }
.lede { font-size: 18px; line-height: 1.55; max-width: 62ch; margin: 0 0 24px; }
.note { color: var(--muted); font-size: 13px; max-width: 80ch; margin: 12px 0 0; }
.crumbs { margin-top: 32px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.page-head { margin: 48px 0 24px; }
.crumbs + .page-head { margin-top: 16px; }
.page-head h1 { font-size: clamp(34px, 4.6vw, 56px); display: flex; align-items: center; gap: 14px; }
.page-head h1 .sq { width: 22px; height: 22px; }
.kicker { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink); }
.visitor-note {
	display: inline-block;
	margin: 0 0 16px;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent-ink);
	font-size: 12px;
	font-weight: 500;
}

/* ---------- Home hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr); gap: 64px; padding: 56px 0 24px; align-items: start; }
.hero-aside { display: flex; flex-direction: column; padding-top: 8px; }
.aside-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 2px 12px;
	padding: 16px 0;
	border-bottom: 1px solid var(--line);
	text-decoration: none;
}
.aside-item:first-child { padding-top: 0; }
.aside-item .kicker { grid-column: 1; }
.aside-title { grid-column: 1; font-size: 16px; line-height: 1.35; }
.aside-meta { grid-column: 1; font-size: 13px; color: var(--muted); }
.aside-item .arrow {
	grid-column: 2;
	grid-row: 1 / span 3;
	align-self: start;
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 6px;
	font-size: 13px;
	transition: background 0.15s, color 0.15s;
}
.aside-item:hover .arrow { background: #000; color: #fff; }
.aside-item:hover .aside-title { text-decoration: underline; text-underline-offset: 3px; }

/* Request form */
#rank-form {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	max-width: 640px;
	margin: 32px 0 0;
	padding: 16px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--bg);
}
#rank-form label { flex-basis: 100%; font: 400 22px/1.2 var(--serif); margin-bottom: 4px; }
#rank-form input {
	flex: 1 1 240px;
	min-width: 0;
	font: 16px var(--sans);
	color: var(--fg);
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 11px 14px;
}
#rank-form input::placeholder { color: #9a9a9a; }
#rank-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
#rank-form button {
	flex: 0 0 auto;
	font: 500 15px var(--sans);
	color: #fff;
	background: #000;
	border: 0;
	border-radius: 8px;
	padding: 11px 20px;
	cursor: pointer;
}
#rank-form button:hover { background: #262626; }
#rank-form button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#rank-form button:disabled { cursor: progress; opacity: 0.6; }
#rank-form .quota, #rank-form .form-error { flex-basis: 100%; margin: 4px 0 0; font-size: 13px; }
#rank-form .quota { color: var(--muted); }
#rank-form .form-error { color: #c4142c; font-weight: 500; }
#rank-form .form-error[hidden] { display: none; }

/* Metric cards */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 32px 0 0; }
.metric { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px 16px; }
.metric dt { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--surface); font-size: 13px; }
.metric dd { margin: 14px 0 0; font: 400 40px/1 var(--serif); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* Segmented jump links */
.segmented {
	display: flex;
	width: fit-content;
	max-width: 100%;
	gap: 2px;
	margin: 48px 0 0;
	padding: 4px;
	border-radius: 999px;
	background: var(--pill);
	overflow-x: auto;
	scrollbar-width: none;
}
.segmented a { padding: 7px 18px; border-radius: 999px; color: #787878; font-size: 14px; text-decoration: none; white-space: nowrap; }
.segmented a:hover { background: #000; color: #fff; }

/* ---------- Category sections and topic cards ---------- */
.category h2 { display: flex; align-items: center; gap: 10px; margin-top: 48px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 16px;
	text-decoration: none;
	transition: border-color 0.15s;
}
.card:hover { border-color: #000; }
.card-sub { margin: 6px 0 14px; font-size: 12px; color: var(--muted); }
.card-meta { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
ol.mini { list-style: none; padding: 0; margin: 0 0 16px; font-size: 15px; }
ol.mini li { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
ol.mini .n {
	flex: none;
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 4px;
	background: var(--surface);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}
ol.mini li:first-child .n { background: var(--c, #000); color: #fff; }
.meter-row { margin-top: auto; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); }
.meter { height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--c, var(--accent)); }

/* ---------- Panels (bordered chart cards) ---------- */
.panel { border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-top: 24px; min-width: 0; }
.panel-head { margin-bottom: 16px; }
.panel-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 26px; }
.panel-sub { margin: 6px 0 0; font-size: 12px; color: var(--muted); max-width: 90ch; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.split .panel { margin-top: 24px; }
ul.plain { list-style: none; padding: 0; margin: 0; font-size: 15px; }
ul.plain li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
ul.plain li:last-child { border-bottom: 0; padding-bottom: 0; }
ul.plain li:first-child { padding-top: 0; }
ul.plain .li-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 6px; font-size: 13px; color: var(--muted); }

.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 2px 10px 2px 8px;
	border-radius: 999px;
	background: var(--surface);
	font-size: 13px;
	text-decoration: none;
	white-space: nowrap;
	vertical-align: 1px;
}
.chip:hover { background: var(--pill); }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); }
th.rot { height: 132px; vertical-align: bottom; padding: 0 0 8px; width: 32px; }
th.rot span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	white-space: nowrap;
	font-size: 12px;
	color: var(--fg);
}

/* Consensus: positions as a violet heat strip; darker = nearer the top of that model's list */
table.consensus { width: 100%; }
table.consensus td, table.consensus th { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); }
table.consensus thead th { border-bottom-color: var(--line); }
table.consensus .rank { width: 2.5em; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
table.consensus tr.row:nth-child(-n + 6) .rank { color: var(--fg); }
table.consensus .name { font-weight: 500; min-width: 180px; }
table.consensus .score { width: 100px; }
table.consensus .bar { display: block; height: 8px; border-radius: 2px; background: var(--accent); }
table.consensus .listed { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.row { cursor: pointer; }
tr.row:hover td, tr.row:focus td { background-color: var(--surface); }
tr.row:focus { outline: none; }
tr.row:focus-visible td.name { box-shadow: inset 2px 0 0 var(--accent); }
td.cell {
	width: 32px;
	text-align: center;
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	padding: 6px 0 !important;
	border-bottom: 1px solid var(--bg) !important;
	border-left: 1px solid var(--bg);
	background: color-mix(in oklab, var(--accent) calc(var(--t) * 100%), #fff) !important;
	/* Black text on light cells, white on dark ones. */
	color: hsl(0 0% clamp(0%, calc((var(--t) - 0.55) * 100000%), 100%));
}
td.cell.empty { background: transparent !important; }
tr.reasons td { background: var(--surface); padding: 12px 16px 14px !important; }
tr.reasons ul { margin: 0; padding: 0; list-style: none; font-size: 14px; }
tr.reasons li { margin: 6px 0; }
tr.reasons .who { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; margin-right: 4px; }

/* Ballots */
.ballots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.ballot { border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 14px; }
.ballot h4 { margin: 0 0 8px; }
.ballot ol { margin: 0; padding-left: 24px; }
.ballot li { padding: 1px 6px; border-radius: 4px; transition: background 0.1s; }
.ballot li::marker { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ballot li.unique { box-shadow: inset 3px 0 0 var(--accent); }
.ballot li.hl, tr.row.hl td:not(.cell) { background: var(--accent-soft); }
.ballot-meta { margin: 10px 0 0; font-size: 12px; color: var(--muted); }

/* Agreement matrix */
table.heat { border-collapse: separate; border-spacing: 2px; }
table.heat th[scope="row"] { font-size: 12px; color: var(--fg); padding-right: 10px; white-space: nowrap; }
table.heat th[scope="row"] .dot { margin-right: 6px; vertical-align: -1px; }
table.heat td {
	width: 38px;
	height: 32px;
	padding: 0;
	border-radius: 3px;
	text-align: center;
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	background: color-mix(in oklab, var(--accent) calc(var(--t) * 100%), #fff);
	color: hsl(0 0% clamp(0%, calc((var(--t) - 0.55) * 100000%), 100%));
}
table.heat th.rot { width: 38px; }

/* Plain data tables (model page, method) */
table.picks { width: 100%; }
table.picks th { padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.picks td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.picks tr:last-child td { border-bottom: 0; }
table.picks td:first-child .dot { margin-right: 8px; vertical-align: -1px; }
table.picks td.differs { color: var(--accent-ink); font-weight: 600; }

/* ---------- The panel page ---------- */
.bc-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
/* Same top offset and plot height as the bars, so tick labels line up with the gridlines. */
.bc-axis { position: relative; height: 240px; margin-top: 18px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bc-axis span { position: absolute; right: 0; transform: translateY(50%); line-height: 1; white-space: nowrap; }
.bc-axis::before { content: "100%"; visibility: hidden; }
.barchart {
	display: grid;
	grid-template-columns: repeat(var(--n), minmax(60px, 1fr));
	gap: 10px;
	overflow-x: auto;
	padding-top: 18px;
}
.bc-col { display: flex; flex-direction: column; gap: 10px; text-decoration: none; min-width: 0; }
.bc-plot {
	height: 240px;
	display: flex;
	align-items: flex-end;
	border-bottom: 1px solid var(--line);
	/* One gridline per tick: --k intervals, each drawn at its tile's top edge. */
	background: linear-gradient(var(--line-soft) 1px, transparent 1px) 0 100% / 100% calc(100% / var(--k, 4));
}
.bc-bar { position: relative; width: 100%; background: var(--c); transition: filter 0.15s; }
.bc-val { position: absolute; left: 0; right: 0; bottom: 100%; padding-bottom: 4px; text-align: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bc-col:hover .bc-bar { filter: brightness(1.12); }
.bc-label { font-size: 12px; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.bc-col:hover .bc-label { text-decoration: underline; text-underline-offset: 2px; }

/* --c is the model's color, the same one its bar uses in the chart above. */
.model-card h3 { display: flex; align-items: center; gap: 8px; }
.model-card:hover { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.model-card .card-sub { margin-bottom: 0; }
.scale { position: relative; height: 6px; margin: 18px 0 6px; border-radius: 3px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 12%, #fff), var(--c)); }
.scale span { position: absolute; top: -5px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.scale-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* ---------- All lists ---------- */
ul.list-rows { list-style: none; margin: 0; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; }
ul.list-rows li {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
	gap: 4px 16px;
	align-items: baseline;
	padding: 12px 0;
	border-bottom: 1px solid var(--line-soft);
}
ul.list-rows li:last-child { border-bottom: 0; }
ul.list-rows a { font-weight: 500; }
.list-top { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.list-count { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Method ---------- */
.prose { max-width: 68ch; }
.prose h2 { font-size: 26px; margin: 36px 0 8px; }
.prose p { margin: 0 0 12px; }

/* ---------- Live (pending) ranking ---------- */
.live-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; margin: 0 0 20px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.live-meta > span + span::before { content: "·"; margin: 0 8px; }
.live-meta [hidden] { display: none; }
.live-state { color: var(--accent-ink); font-weight: 600; }
.live-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.live-model { border: 1px solid var(--line); border-radius: 8px; padding: 14px; font-size: 14px; transition: border-color 0.2s; }
.live-model h3 { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.live-model .card-meta { margin: 2px 0 12px; }
.live-model.finished { border-color: #000; }
.progress { height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--c, var(--accent)); transition: width 0.3s ease; }
.live-progress { margin: 6px 0 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.live-failed { margin-left: 8px; color: #c4142c; }
.live-failed[hidden] { display: none; }
ol.live-items { margin: 0; padding-left: 22px; }
ol.live-items li { padding: 1px 0; overflow-wrap: anywhere; }
ol.live-items li::marker { color: var(--muted); font-size: 12px; }
.waiting { margin: 0; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.live-model:not(.finished) .waiting::before {
	content: "";
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 2px;
	background: var(--c, var(--accent));
	animation: pulse 1.2s ease-in-out infinite;
}
.live[data-status="failed"] .waiting::before { animation: none; opacity: 0.4; }
@keyframes pulse { 50% { opacity: 0.25; transform: scale(0.7); } }
@media (prefers-reduced-motion: reduce) {
	.live-model:not(.finished) .waiting::before { animation: none; }
	.progress span { transition: none; }
}

/* ---------- Notices ---------- */
.notice-box { max-width: 72ch; margin: 0 0 20px; padding: 14px 16px; border-radius: 8px; border: 1px solid #ddd0fb; background: #faf7ff; }
.notice-box[hidden] { display: none; }
.notice { padding: 24px 0 8px; max-width: 70ch; }
.notice .kicker { margin: 32px 0 8px; }
.notice h1 { font-size: clamp(34px, 4.6vw, 56px); }

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
	.hero { grid-template-columns: 1fr; gap: 40px; padding-top: 32px; }
	.hero-aside { padding-top: 0; }
}
@media (max-width: 640px) {
	.wrap { padding: 0 16px; }
	.site-header .wrap { grid-template-columns: 1fr auto; row-gap: 12px; }
	.nav-pills { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
	.button { grid-column: 2; grid-row: 1; }
	h2 { font-size: 26px; }
	.panel { padding: 16px; }
	.panel-head h2 { font-size: 22px; }
	.metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.metric:last-child:nth-child(odd) { grid-column: 1 / -1; }
	.metric dd { font-size: 32px; }
	#rank-form button { flex: 1 1 100%; }
	ul.list-rows li { grid-template-columns: minmax(0, 1fr) auto; }
	.list-top { grid-column: 1; grid-row: 2; }
	.list-count { grid-column: 2; grid-row: 1; }
}
