/* Site chrome: tokens, type and the header. Class selectors only, so it can sit
   above the audio app without touching that app's own styles.

   The look is the "paper" look of the experiment reports: Inter for text, Space
   Grotesk for headings and figures, one warm accent, cream panels, hairline rules. */

@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/inter-latin-400-normal.woff2") format("woff2");
}

@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("../fonts/inter-latin-500-normal.woff2") format("woff2");
}

@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("../fonts/inter-latin-600-normal.woff2") format("woff2");
}

@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/inter-latin-700-normal.woff2") format("woff2");
}

@font-face {
	font-family: "Space Grotesk";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("../fonts/space-grotesk-latin-500-normal.woff2") format("woff2");
}

@font-face {
	font-family: "Space Grotesk";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("../fonts/space-grotesk-latin-600-normal.woff2") format("woff2");
}

@font-face {
	font-family: "Space Grotesk";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2");
}

/* Light is a warm cream page with white cards. Dark is the look of the videos.
   With no choice stored the page follows the system; the switch in the header
   stores a choice (data-theme on <html>, kept in localStorage). */
:root {
	--st-paper: #fbf5ec;
	--st-card: #ffffff;
	--st-cream: #f4e8d8;
	--st-ink: #1c1917;
	--st-body: #3f3833;
	--st-mute: #6b625a;
	--st-rule: #e2d4c0;
	--st-rule-strong: #2a2420;
	--st-edge: #2a2420;
	--st-img-dim: none;
	--st-chart-filter: none;
	--viz-ink: #0b0b0b;
	--viz-ink2: #52514e;
	--viz-muted: #898781;
	--viz-grid: #e1e0d9;
	--viz-axis: #c3c2b7;
	--viz-compare: #b8b6ae;
	--viz-work: #eb6834;
	--viz-tokens: #2a78d6;
	--viz-waiting: #6250d6;
	--viz-alarm: #d03b3b;
	--viz-gain: #008300;
	--viz-good: #1baf7a;
	--viz-focus: #eda100;
	--viz-accent: #9c4a2a;
	--viz-surface: #ffffff;
	--viz-band: #fbf2e7;
	--viz-band2: #f4f3ef;
	--st-accent: #9c4a2a;
	--st-amber: #fbdd9a;
	--st-work: #eb6834;
	--st-tokens: #1f5fae;
	--st-gain: #008300;
	--st-on-ink: #ffffff;
	--st-header-bg: rgba(251, 245, 236, 0.94);
	--st-plate: #ffffff;
	--st-graph-ink: 28, 25, 23;
	--st-graph-accent: 156, 74, 42;
	--st-night: #14161c;
	--st-header-h: 60px;
	--st-wrap: 1120px;
	--st-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--st-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
	--st-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--st-paper: #14161c;
		--st-card: #1a1d25;
		--st-cream: #22252e;
		--st-ink: #ebe7df;
		--st-body: #c2beb5;
		--st-mute: #9a968f;
		--st-rule: rgba(235, 231, 223, 0.11);
		--st-rule-strong: rgba(235, 231, 223, 0.26);
		--st-edge: rgba(235, 231, 223, 0.38);
		--st-img-dim: brightness(0.86);
		--st-accent: #f08a62;
		--st-amber: rgba(255, 179, 71, 0.38);
		--st-work: #ec5f36;
		--st-tokens: #7fd8ff;
		--st-gain: #8fd694;
		--st-on-ink: #14161c;
		--st-header-bg: rgba(20, 22, 28, 0.92);
		--st-plate: #1a1d25;
		--st-chart-filter: invert(0.9) hue-rotate(180deg);
		--viz-ink: #ebe7df;
		--viz-ink2: #c2beb5;
		--viz-muted: #9a968f;
		--viz-grid: rgba(235, 231, 223, 0.1);
		--viz-axis: rgba(235, 231, 223, 0.3);
		--viz-compare: #7a766f;
		--viz-work: #ff6a3d;
		--viz-tokens: #7fd8ff;
		--viz-waiting: #a99cf5;
		--viz-alarm: #ff3b5c;
		--viz-gain: #8fd694;
		--viz-good: #5fd3a6;
		--viz-focus: #ffb347;
		--viz-accent: #f08a62;
		--viz-surface: #1a1d25;
		--viz-band: rgba(235, 231, 223, 0.05);
		--viz-band2: rgba(235, 231, 223, 0.08);
		--st-graph-ink: 235, 231, 223;
		--st-graph-accent: 240, 138, 98;
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--st-paper: #14161c;
	--st-card: #1a1d25;
	--st-cream: #22252e;
	--st-ink: #ebe7df;
	--st-body: #c2beb5;
	--st-mute: #9a968f;
	--st-rule: rgba(235, 231, 223, 0.11);
	--st-rule-strong: rgba(235, 231, 223, 0.26);
	--st-edge: rgba(235, 231, 223, 0.38);
	--st-img-dim: brightness(0.86);
	--st-accent: #f08a62;
	--st-amber: rgba(255, 179, 71, 0.38);
	--st-work: #ec5f36;
	--st-tokens: #7fd8ff;
	--st-gain: #8fd694;
	--st-on-ink: #14161c;
	--st-header-bg: rgba(20, 22, 28, 0.92);
	--st-plate: #1a1d25;
	--st-chart-filter: invert(0.9) hue-rotate(180deg);
	--viz-ink: #ebe7df;
	--viz-ink2: #c2beb5;
	--viz-muted: #9a968f;
	--viz-grid: rgba(235, 231, 223, 0.1);
	--viz-axis: rgba(235, 231, 223, 0.3);
	--viz-compare: #7a766f;
	--viz-work: #ff6a3d;
	--viz-tokens: #7fd8ff;
	--viz-waiting: #a99cf5;
	--viz-alarm: #ff3b5c;
	--viz-gain: #8fd694;
	--viz-good: #5fd3a6;
	--viz-focus: #ffb347;
	--viz-accent: #f08a62;
	--viz-surface: #1a1d25;
	--viz-band: rgba(235, 231, 223, 0.05);
	--viz-band2: rgba(235, 231, 223, 0.08);
	--st-graph-ink: 235, 231, 223;
	--st-graph-accent: 240, 138, 98;
	color-scheme: dark;
}

.st-skip {
	position: absolute;
	left: -9999px;
	top: 12px;
	z-index: 100;
	padding: 10px 14px;
	border-radius: 6px;
	background: var(--st-ink);
	color: var(--st-on-ink);
	font: 600 15px/1 var(--st-sans);
}

.st-skip:focus {
	left: 12px;
}

.st-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.st-header {
	position: sticky;
	top: 0;
	z-index: 50;
	box-sizing: border-box;
	height: var(--st-header-h);
	border-bottom: 1px solid var(--st-rule);
	background: var(--st-header-bg);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	font-family: var(--st-sans);
}

.st-header__in {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	max-width: var(--st-wrap);
	height: 100%;
	margin: 0 auto;
	padding: 0 20px;
}

.st-brand {
	display: flex;
	align-items: baseline;
	gap: 12px;
	color: var(--st-ink);
	text-decoration: none;
	white-space: nowrap;
}

.st-brand__name {
	font-family: var(--st-display);
	font-size: 19px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.st-brand__name::before {
	content: "";
	display: inline-block;
	width: 9px;
	height: 9px;
	margin-right: 10px;
	background: var(--st-accent);
}

.st-brand__role {
	color: var(--st-mute);
	font-size: 13px;
}

.st-nav {
	display: flex;
	align-items: center;
	gap: 2px;
	margin-left: auto;
}

.st-nav__link {
	padding: 8px 12px;
	border-radius: 6px;
	color: var(--st-body);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
}

.st-nav__link:hover,
.st-nav__link:focus-visible {
	background: var(--st-cream);
	color: var(--st-ink);
}

.st-nav__link[aria-current] {
	color: var(--st-ink);
	background-image: linear-gradient(var(--st-accent), var(--st-accent));
	background-repeat: no-repeat;
	background-position: 50% 100%;
	background-size: calc(100% - 24px) 2px;
}

.st-nav__link--out {
	margin-left: 8px;
	border: 1px solid var(--st-edge);
	color: var(--st-ink);
}

.st-nav__link--out::after {
	content: " ↗";
	color: var(--st-accent);
}

.st-nav__link--out:hover {
	background: var(--st-ink);
	color: var(--st-on-ink);
}

.st-menu__panel .st-nav__link--out {
	margin: 6px 0 0;
}

.st-menu__panel .st-nav__link[aria-current] {
	background-position: 0 50%;
	background-size: 2px 55%;
}

.st-tools {
	display: flex;
	align-items: center;
	gap: 6px;
}

@media (max-width: 860px) {
	.st-tools {
		margin-left: auto;
	}
}

.st-theme {
	display: grid;
	place-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--st-rule);
	border-radius: 6px;
	background: transparent;
	color: var(--st-ink);
	cursor: pointer;
}

.st-theme:hover {
	border-color: var(--st-ink);
}

.st-theme svg {
	display: block;
	width: 18px;
	height: 18px;
}

/* One icon at a time: the moon offers dark, the sun offers light. */
.st-theme .st-theme__sun {
	display: none;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .st-theme .st-theme__sun {
		display: block;
	}

	:root:not([data-theme="light"]) .st-theme .st-theme__moon {
		display: none;
	}
}

:root[data-theme="dark"] .st-theme .st-theme__sun {
	display: block;
}

:root[data-theme="dark"] .st-theme .st-theme__moon {
	display: none;
}

.st-menu {
	display: none;
	position: relative;
}

.st-menu summary {
	display: grid;
	place-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	border-radius: 6px;
	cursor: pointer;
	list-style: none;
}

.st-menu summary::-webkit-details-marker {
	display: none;
}

.st-menu summary span {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--st-ink);
}

.st-menu[open] summary {
	background: var(--st-cream);
}

.st-menu__panel {
	position: absolute;
	top: 52px;
	right: 0;
	display: grid;
	min-width: 210px;
	padding: 8px;
	border: 1px solid var(--st-edge);
	border-radius: 8px;
	background: var(--st-card);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.st-menu__panel .st-nav__link {
	padding: 13px 14px;
	font-size: 16px;
}

@media (max-width: 860px) {
	.st-nav {
		display: none;
	}

	.st-menu {
		display: block;
	}

	.st-brand__role {
		display: none;
	}
}
