/* Site chrome for benchmark sites copied into /ai/<bench>/ by scripts/sync-*.sh.
   The bench keeps its own stylesheet and app; this file adds the site's top bar
   and retunes the bench's tokens to the site palette and type. Class names are
   prefixed ms- so they can't collide with the bench's own. */

:root {
	--ms-bg: #090d12;
	--ms-panel: #0e141b;
	--ms-line: #1d2935;
	--ms-line-2: #2a3a4a;
	--ms-fg: #d8e2ec;
	--ms-dim: #74879b;
	--ms-cyan: #3fd4ff;
	--ms-orange: #ff6b35;
	--ms-cond: "IBM Plex Sans Condensed", "Arial Narrow", system-ui, sans-serif;
	--ms-mono: "IBM Plex Mono", ui-monospace, monospace;

	/* bench tokens, both themes */
	--font: "IBM Plex Sans", system-ui, sans-serif;
	--mono: "IBM Plex Mono", ui-monospace, monospace;
	--display: var(--ms-cond); /* bench hook: headings, card titles, chart labels */
	--radius: 0;
}

/* Dark theme in the site palette. Vendor and status colours are left alone:
   the bench chose and validated those. */
:root[data-theme="dark"] {
	--page: #090d12;
	--surface: #0e141b;
	--ink: #d8e2ec;
	--ink-2: #b9c6d3;
	--muted: #74879b;
	--grid: #1d2935;
	--axis: #2a3a4a;
	--ring: rgba(216, 226, 236, 0.1);
	--wash: rgba(216, 226, 236, 0.045);
	--sel-bg: #123344;
	--sel-ink: #e8f7ff;
	--sel-ring: #2b6f8c;
}
:root[data-theme="dark"] body::before {
	/* the site's map grid, faded out from the top centre like every other page */
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-image:
		linear-gradient(var(--ms-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--ms-line) 1px, transparent 1px);
	background-size: 96px 96px;
	background-position: -1px -1px;
	-webkit-mask-image: radial-gradient(1200px 800px at 50% 20%, #000 0%, transparent 75%);
	mask-image: radial-gradient(1200px 800px at 50% 20%, #000 0%, transparent 75%);
}

/* Bench title set like the site's page titles (the face comes from --display) */
.brand h1 {
	font-weight: 700;
	font-size: clamp(30px, 4vw, 44px);
	text-transform: uppercase;
	letter-spacing: 0;
}

/* ---------- Site top bar ---------- */
.ms-bar {
	position: sticky;
	top: 0;
	z-index: 30;
	background: color-mix(in srgb, var(--ms-bg) 88%, transparent);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--ms-line-2);
	color: var(--ms-fg);
	font-size: 12px;
	font-family: var(--ms-mono);
}
.ms-bar__in {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 20px;
	height: 56px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}
.ms-bar a {
	color: inherit;
	text-decoration: none;
}
.ms-bar__id {
	display: flex;
	align-items: center;
	gap: 12px;
	white-space: nowrap;
}
.ms-bar__id i {
	width: 10px;
	height: 10px;
	background: var(--ms-orange);
	transform: rotate(45deg);
}
.ms-bar__id b {
	font-family: var(--ms-cond);
	font-weight: 700;
	font-size: 16px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.ms-bar__id span {
	color: var(--ms-dim);
}
.ms-bar nav {
	display: flex;
	gap: 2px;
}
.ms-bar nav a {
	padding: 6px 10px;
	color: var(--ms-dim);
	border: 1px solid transparent;
	white-space: nowrap;
}
.ms-bar nav a:hover,
.ms-bar nav a[aria-current] {
	color: var(--ms-fg);
	border-color: var(--ms-line-2);
	background: var(--ms-panel);
}
.ms-bar nav a span {
	color: var(--ms-cyan);
	margin-right: 6px;
}
.ms-bar nav a[aria-current] span {
	color: var(--ms-orange);
}
.ms-crumb {
	max-width: 1240px;
	margin: 0 auto;
	padding: 18px 20px 0;
	display: flex;
	gap: 8px;
	font: 12px var(--ms-mono);
	color: var(--muted);
}
.ms-crumb a {
	color: var(--ms-cyan);
	text-decoration: none;
}
.ms-crumb a:hover {
	text-decoration: underline;
}
:root[data-theme="light"] .ms-crumb a {
	color: #0b6e99;
}
/* The bench's own wrap already pads the top; tighten it under the crumb. */
.ms-crumb + .wrap {
	padding-top: 14px;
}

@media (max-width: 1080px) {
	.ms-bar__id span {
		display: none;
	}
	.ms-bar nav a {
		padding: 6px 7px;
	}
}
@media (max-width: 900px) {
	.ms-bar__in {
		flex-wrap: wrap;
		height: auto;
		padding: 12px 16px 0;
		row-gap: 8px;
	}
	.ms-bar__id span {
		display: inline;
	}
	.ms-bar nav {
		margin: 0 -16px;
		padding: 0 16px 8px;
		overflow-x: auto;
		scrollbar-width: none;
	}
	.ms-bar nav a {
		border-color: var(--ms-line);
		padding: 5px 9px;
	}
	.ms-crumb {
		padding: 14px 16px 0;
	}
}
@media (max-width: 700px) {
	.brand {
		flex-wrap: wrap;
		row-gap: 4px;
	}
	.brand h1 {
		font-size: 30px;
	}
	.brand .tag {
		flex-basis: 100%;
	}
}

/* Bench hook: how far below the viewport top its sticky filter bar stops.
   These are the site bar's exact heights (57px; 82px at 641–900px, where it
   wraps to two rows), so no content shows between the two bars. */
@media (min-width: 901px) {
	:root {
		--controls-top: 57px;
	}
}
@media (min-width: 641px) and (max-width: 900px) {
	:root {
		--controls-top: 82px;
	}
}
