/* Harness tool study — Hugging Face palette.
   Layout: a single reading column, with the wide matrices allowed to break out
   of it into their own horizontally scrollable strips. */

:root {
	color-scheme: light;

	--plane: #f7f6f2;
	--surface: #fffdf7;
	--sunken: #fbf6e8;
	--ink: #17150f;
	--ink-2: #5c564a;
	--ink-3: #8f8878;
	--rule: #e9e3d3;
	--rule-2: #d8d0ba;
	--accent: #a33f0c;
	--accent-soft: #fdeec2;

	/* sequential ramp, pale -> HF yellow -> HF orange -> ember */
	--s0: #fbf7ec;
	--s1: #fdeec2;
	--s2: #ffe08c;
	--s3: #ffd21e;
	--s4: #ffb20a;
	--s5: #ff8f1f;
	--s6: #e06414;
	--s7: #a33f0c;
	--on-deep: #fffdf7;

	--sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--plane: #100f0c;
		--surface: #1b1914;
		--sunken: #15140f;
		--ink: #ffffff;
		--ink-2: #c9c3b5;
		--ink-3: #8f8878;
		--rule: #2b2823;
		--rule-2: #3a362e;
		--accent: #ffb20a;
		--accent-soft: #3a2a08;
		--s0: #201f1a;
		--s1: #3d2f0c;
		--s2: #5c4406;
		--s3: #8a6300;
		--s4: #b57f00;
		--s5: #e09200;
		--s6: #ffb20a;
		--s7: #ffd21e;
		--on-deep: #17150f;
	}
}

:root[data-theme="dark"] {
	color-scheme: dark;
	--plane: #100f0c;
	--surface: #1b1914;
	--sunken: #15140f;
	--ink: #ffffff;
	--ink-2: #c9c3b5;
	--ink-3: #8f8878;
	--rule: #2b2823;
	--rule-2: #3a362e;
	--accent: #ffb20a;
	--accent-soft: #3a2a08;
	--s0: #201f1a;
	--s1: #3d2f0c;
	--s2: #5c4406;
	--s3: #8a6300;
	--s4: #b57f00;
	--s5: #e09200;
	--s6: #ffb20a;
	--s7: #ffd21e;
	--on-deep: #17150f;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding-inline: 20px;
	padding-block: 0 80px;
	background: var(--plane);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

.col {
	max-width: 760px;
	margin: 0 auto;
}

/* wide elements break out of the reading column */
.wide {
	max-width: 1180px;
	margin-inline: auto;
}

a {
	color: var(--accent);
}

h1,
h2,
h3 {
	text-wrap: balance;
	margin: 0;
	letter-spacing: -0.02em;
}

/* ---------- masthead ---------- */

header {
	padding-block: 56px 36px;
}

.eyebrow {
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ink-3);
}

h1 {
	font-size: clamp(32px, 6vw, 50px);
	font-weight: 600;
	line-height: 1.06;
	margin-block: 14px 18px;
}

.standfirst {
	font-size: 19px;
	color: var(--ink-2);
	line-height: 1.5;
}

.byline {
	font-family: var(--mono);
	font-size: 12px;
	color: var(--ink-3);
	margin-top: 22px;
}

.hero {
	margin-block: 32px 8px;
}

.hero video {
	width: 100%;
	max-width: 760px;
	display: block;
	margin-inline: auto;
	border-radius: 12px;
	background: var(--surface);
}

.hero figcaption {
	font-size: 13.5px;
	color: var(--ink-3);
	text-align: center;
	margin-top: 12px;
	max-width: 56ch;
	margin-inline: auto;
}

/* ---------- key numbers ---------- */

.stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 1px;
	background: var(--rule);
	border: 1px solid var(--rule);
	border-radius: 10px;
	overflow: hidden;
	margin-block: 36px;
}

.stat {
	background: var(--surface);
	padding: 18px 16px;
}

.stat b {
	display: block;
	font-size: 32px;
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
	color: var(--accent);
}

.stat span {
	display: block;
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-3);
	margin-top: 7px;
}

/* ---------- prose ---------- */

section {
	padding-block: 44px 8px;
}

h2 {
	font-size: 26px;
	font-weight: 600;
}

h3.sub {
	font-size: 16px;
	font-weight: 600;
	margin-top: 34px;
}

p {
	margin: 14px 0 0;
}

p.note {
	color: var(--ink-2);
	font-size: 15px;
}

code {
	font-family: var(--mono);
	font-size: 0.88em;
	background: var(--sunken);
	border: 1px solid var(--rule);
	border-radius: 4px;
	padding: 1px 5px;
}

/* ---------- controls ---------- */

.seg {
	display: inline-flex;
	border: 1px solid var(--rule-2);
	border-radius: 7px;
	overflow: hidden;
	background: var(--surface);
	margin-top: 18px;
}

.seg button {
	font: 500 13px/1 var(--sans);
	padding: 9px 15px;
	background: none;
	border: 0;
	color: var(--ink-2);
	cursor: pointer;
}

.seg button + button {
	border-left: 1px solid var(--rule-2);
}

.seg button[aria-pressed="true"] {
	background: var(--accent);
	color: var(--on-deep);
}

.seg button:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: -2px;
}

.scroller {
	overflow-x: auto;
	margin-top: 22px;
	padding-bottom: 6px;
}

/* ---------- triangle heatmap ---------- */

table.tri {
	border-collapse: separate;
	border-spacing: 3px;
	font-family: var(--mono);
	font-size: 12px;
	margin-inline: auto;
}

table.tri th {
	font-weight: 500;
	white-space: nowrap;
	color: var(--ink-2);
}

table.tri th.rowh {
	text-align: right;
	padding-right: 9px;
	font-size: 13px;
	color: var(--ink);
}

table.tri th.colh {
	height: 92px;
	vertical-align: bottom;
	padding-bottom: 5px;
}

table.tri th.colh span {
	display: block;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	font-size: 13px;
	color: var(--ink);
}

.cell {
	width: 58px;
	height: 38px;
	border-radius: 4px;
	border: 0;
	padding: 0;
	cursor: pointer;
	font-family: var(--mono);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	display: block;
}

.cell.full {
	outline: 2px solid var(--accent);
	outline-offset: -2px;
	font-weight: 600;
}

.cell:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 1px;
}

.cell.sel {
	box-shadow: 0 0 0 2px var(--plane), 0 0 0 4px var(--ink);
}

.legend {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 18px;
	flex-wrap: wrap;
	font-size: 14px;
	color: var(--ink-2);
}

.legend .ramp {
	display: flex;
	gap: 2px;
	flex: 1;
	min-width: 180px;
	max-width: 320px;
}

.legend .ramp i {
	flex: 1;
	height: 12px;
	border-radius: 2px;
}

.legend .ends {
	font-family: var(--mono);
	font-size: 11px;
	color: var(--ink-3);
}

/* ---------- pair drawer ---------- */

.drawer {
	margin-top: 22px;
	background: var(--surface);
	border: 1px solid var(--rule);
	border-radius: 10px;
	padding: 20px;
}

.drawer h3 {
	font-size: 16px;
	font-weight: 600;
}

.pairline {
	font-family: var(--mono);
	font-size: 12.5px;
	color: var(--ink-2);
	margin: 6px 0 16px;
}

.pairline b {
	color: var(--ink);
}

.venn {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 18px;
}

.venn h4 {
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ink-3);
	margin: 0 0 8px;
	font-weight: 500;
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}

.chip {
	font-family: var(--mono);
	font-size: 11px;
	padding: 3px 7px;
	border-radius: 4px;
	background: var(--sunken);
	color: var(--ink-2);
	border: 1px solid var(--rule);
}

.chip.on {
	background: var(--accent-soft);
	color: var(--accent);
	border-color: transparent;
}

.empty {
	font-size: 12px;
	color: var(--ink-3);
	font-style: italic;
}

/* ---------- tools vs jobs ---------- */

table.dup {
	border-collapse: collapse;
	font-size: 13px;
	width: 100%;
	min-width: 620px;
}

table.dup th {
	text-align: left;
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-3);
	font-weight: 500;
	padding: 0 14px 8px 0;
	border-bottom: 1px solid var(--rule-2);
}

table.dup th.num,
table.dup td.num {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

table.dup td {
	padding: 8px 14px 8px 0;
	border-bottom: 1px solid var(--rule);
}

table.dup td.h {
	font-weight: 500;
	white-space: nowrap;
}

table.dup td.num,
table.dup td.ratio {
	font-family: var(--mono);
	font-size: 13px;
	color: var(--ink-2);
}

table.dup td.ratio {
	color: var(--ink);
}

table.dup td.bar {
	width: 44%;
	min-width: 140px;
}

table.dup .track {
	/* display:block matters — a bare inline span ignores height and the bars vanish */
	display: block;
	background: var(--sunken);
	border-radius: 3px;
	height: 17px;
	position: relative;
	overflow: hidden;
}

table.dup .f1 {
	display: block;
	height: 100%;
	background: var(--s3);
	border-radius: 0 3px 3px 0;
}

table.dup .f2 {
	display: block;
	height: 100%;
	background: var(--s6);
	border-radius: 0 3px 3px 0;
	position: absolute;
	left: 0;
	top: 0;
}

table.dup tr:hover td {
	background: var(--sunken);
}

/* ---------- job x harness matrix ---------- */

table.red {
	border-collapse: collapse;
	font-size: 11px;
	min-width: 980px;
	width: 100%;
}

table.red thead th.h {
	font-family: var(--mono);
	font-size: 11px;
	font-weight: 500;
	color: var(--ink-2);
	height: 100px;
	vertical-align: bottom;
	padding: 0 4px 10px;
	border-bottom: 1px solid var(--rule-2);
}

table.red thead th.h span {
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	display: inline-block;
}

table.red thead th.jh {
	text-align: left;
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-3);
	font-weight: 500;
	vertical-align: bottom;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--rule-2);
}

table.red td {
	border-bottom: 1px solid var(--rule);
	padding: 5px 4px;
	vertical-align: middle;
}

table.red td.job {
	font-family: var(--mono);
	font-size: 11.5px;
	color: var(--ink);
	white-space: nowrap;
	padding-right: 14px;
	width: 1%;
}

table.red td.job i {
	font-style: normal;
	color: var(--ink-3);
	font-size: 10px;
	margin-left: 8px;
	font-variant-numeric: tabular-nums;
}

table.red td.impl {
	font-family: var(--mono);
	font-size: 10.5px;
	text-align: center;
	color: var(--ink-2);
	overflow-wrap: anywhere;
	line-height: 1.35;
	min-width: 78px;
}

table.red td.impl.on {
	background: var(--accent-soft);
	color: var(--accent);
	border-radius: 3px;
}

table.red td.impl.off {
	color: var(--rule-2);
}

table.red td.impl u {
	text-decoration: none;
	display: block;
	font-size: 9px;
	color: var(--ink-3);
}

table.red tr.core td.job {
	font-weight: 600;
}

table.red tr.jrow:hover td {
	background: var(--sunken);
}

table.red tr.jrow:hover td.impl.on {
	background: var(--accent-soft);
}

/* ---------- capability coverage ---------- */

table.cap {
	border-collapse: collapse;
	font-size: 12px;
	width: 100%;
	min-width: 760px;
}

table.cap th.grp {
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ink-3);
	text-align: left;
	padding: 20px 0 7px;
	border-bottom: 1px solid var(--rule-2);
}

table.cap thead th.h {
	font-family: var(--mono);
	font-size: 11px;
	font-weight: 500;
	color: var(--ink-2);
	height: 100px;
	vertical-align: bottom;
	padding-bottom: 10px;
}

table.cap thead th.h span {
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	display: inline-block;
}

table.cap td {
	border-bottom: 1px solid var(--rule);
	padding: 0;
}

table.cap td.name {
	font-family: var(--mono);
	font-size: 12px;
	color: var(--ink);
	white-space: nowrap;
	padding: 8px 14px 8px 0;
	width: 1%;
}

table.cap td.name small {
	display: block;
	font-family: var(--sans);
	font-size: 11px;
	color: var(--ink-3);
	white-space: normal;
	max-width: 30ch;
}

table.cap td.dot {
	text-align: center;
	width: 52px;
}

.pip {
	width: 15px;
	height: 15px;
	border-radius: 3px;
	display: inline-block;
	background: var(--s6);
}

.pip.off {
	background: none;
	box-shadow: inset 0 0 0 1px var(--rule-2);
}

td.tally {
	font-family: var(--mono);
	font-size: 11px;
	color: var(--ink-3);
	text-align: right;
	padding-left: 12px;
	width: 1%;
	font-variant-numeric: tabular-nums;
}

table.cap tr.row:hover td {
	background: var(--sunken);
}

/* ---------- harness registries ---------- */

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 1px;
	background: var(--rule);
	border: 1px solid var(--rule);
	border-radius: 10px;
	overflow: hidden;
	margin-top: 22px;
}

.hcard {
	background: var(--surface);
	padding: 15px 16px 17px;
	text-align: left;
	border: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	min-width: 0;
}

.hcard:hover,
.hcard[aria-pressed="true"] {
	background: var(--sunken);
}

.hcard[aria-pressed="true"] {
	box-shadow: inset 3px 0 0 var(--accent);
}

.hcard:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: -2px;
}

.hcard .nm {
	font-size: 15px;
	font-weight: 600;
}

.hcard .vd {
	font-size: 12px;
	color: var(--ink-3);
	margin-top: 2px;
}

.hcard .bars {
	display: flex;
	gap: 10px;
	margin-top: 12px;
	font-family: var(--mono);
	font-size: 11px;
	color: var(--ink-2);
	font-variant-numeric: tabular-nums;
}

.hcard .bars b {
	color: var(--ink);
	font-weight: 600;
}

.srcflag {
	display: inline-block;
	font-family: var(--mono);
	font-size: 9px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-3);
	border: 1px solid var(--rule-2);
	border-radius: 3px;
	padding: 1px 4px;
	margin-left: 6px;
	vertical-align: 1px;
}

.toollist {
	margin-top: 18px;
	background: var(--surface);
	border: 1px solid var(--rule);
	border-radius: 10px;
	padding: 20px;
}

.toollist .meta {
	font-size: 14px;
	color: var(--ink-2);
	margin: 6px 0 14px;
	max-width: 70ch;
}

.toollist .src {
	font-family: var(--mono);
	font-size: 11px;
	color: var(--ink-3);
	word-break: break-word;
	margin-bottom: 16px;
}

.tgrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 4px 20px;
}

.trow {
	display: flex;
	gap: 8px;
	align-items: baseline;
	font-size: 12px;
	padding: 3px 0;
	border-bottom: 1px solid var(--rule);
	min-width: 0;
}

.trow code {
	font-family: var(--mono);
	font-size: 11.5px;
	color: var(--ink);
	overflow-wrap: anywhere;
	background: none;
	border: 0;
	padding: 0;
}

.trow em {
	font-style: normal;
	font-family: var(--mono);
	font-size: 10px;
	color: var(--ink-3);
	margin-left: auto;
	white-space: nowrap;
}

/* ---------- findings ---------- */

.findings {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 18px;
	margin-top: 24px;
}

.finding {
	background: var(--surface);
	border: 1px solid var(--rule);
	border-radius: 10px;
	padding: 18px;
}

.finding h3 {
	font-size: 15px;
	font-weight: 600;
}

.finding p {
	margin: 8px 0 0;
	font-size: 14px;
	color: var(--ink-2);
}

/* ---------- method ---------- */

.method {
	border-top: 1px solid var(--rule);
	margin-top: 48px;
	padding-top: 24px;
	font-size: 14px;
	color: var(--ink-2);
}

.method h2 {
	font-size: 18px;
}

.method p {
	margin-top: 12px;
}

/* tools per harness: one series, sorted, value at the bar end */
.hbars {
	display: grid;
	gap: 6px;
	margin-top: 16px;
}

.hbar {
	display: grid;
	grid-template-columns: 9.5em 1fr 2.5em;
	align-items: center;
	gap: 12px;
	padding: 2px 0;
	border-radius: 4px;
}

.hbar:hover {
	background: var(--sunken);
}

.hbar .hname {
	font-size: 14px;
	color: var(--ink-2);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.hbar .htrack {
	height: 14px;
	border-left: 1px solid var(--rule-2);
}

.hbar .htrack i {
	display: block;
	height: 100%;
	min-width: 2px;
	background: var(--s5);
	border-radius: 0 4px 4px 0;
}

.hbar:hover .htrack i {
	background: var(--s6);
}

.hbar b {
	font-family: var(--mono);
	font-size: 13px;
	font-weight: 500;
	color: var(--ink);
	text-align: right;
	font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: no-preference) {
	.cell,
	.hcard {
		transition: background-color 0.12s ease;
	}
}

@media (max-width: 560px) {
	.cell {
		width: 44px;
		height: 34px;
		font-size: 11px;
	}
	table.tri th.colh span {
		font-size: 11px;
	}
}
