/*
 * Lempar — the colour scheme, on the site only (T-322).
 *
 * The dark values of WordPress's preset custom properties, for a phone in
 * dark mode and for a reader who chose dark with the toggle. Everything
 * that reads a preset follows them, so this file is the whole of the dark
 * scheme.
 *
 * Kept apart from lempar.css because lempar.css is also the block
 * editor's stylesheet (add_editor_style() in functions.php), and
 * WordPress's editor has no dark mode: with these rules there, a phone in
 * dark mode drew the editor's page near-black, the title white, under the
 * editor's own light toolbar (Aaron, in the editor of a session's plan,
 * 2026-10-14). The editor takes lempar's light scheme always; the site
 * follows the phone, or the toggle.
 *
 * Enqueued on every front-end request with lempar.css, which depends on it.
 */

/*
 * Selectors are one attribute more specific than the `:root` that global
 * styles emits, so these win regardless of stylesheet order.
 *
 * Muted is at least 7:1 on surface (T-380): Aaron found the small grey
 * text hard to read on a phone at #9d97a8, 5.55:1 on surface and 6.41 on
 * base. #b4aebf is 7.28 on surface, 8.42 on base and 6.25 on raised, and
 * still half the page ink's brightness (1.93:1 apart), so it stays quieter.
 */
@media (prefers-color-scheme: dark) {
	html:not([data-lempar-scheme="light"]) {
		color-scheme: dark;

		--wp--preset--color--base: #16151c;
		--wp--preset--color--surface: #23222d;
		--wp--preset--color--contrast: #f7f2ea;
		--wp--preset--color--muted: #b4aebf;
		--wp--preset--color--line: #34323f;
		--wp--preset--color--accent: #ff7d5c;
		--wp--preset--color--accent-contrast: #1a1920;
		--wp--preset--color--highlight: #ffd75a;
		--wp--preset--color--highlight-contrast: #1a1920;
		--wp--preset--color--spirit: #3fcfb0;
		--wp--preset--color--spirit-contrast: #10231e;
		--wp--preset--color--field: #2f8a4c;
		--wp--preset--color--sky: #68b2f3;
		--wp--preset--color--violet: #bd78f0;
		--wp--preset--color--alert: #ff8591;
		--wp--preset--color--alert-contrast: #1a1920;
		--wp--preset--color--surface-raised: #2f2d3b;

		--wp--preset--shadow--card: 0 2px 12px rgba(0, 0, 0, 0.3);
		--wp--preset--shadow--nav: 0 10px 28px rgba(0, 0, 0, 0.45);
	}
}

html[data-lempar-scheme="dark"] {
	color-scheme: dark;

	--wp--preset--color--base: #16151c;
	--wp--preset--color--surface: #23222d;
	--wp--preset--color--contrast: #f7f2ea;
	--wp--preset--color--muted: #b4aebf;
	--wp--preset--color--line: #34323f;
	--wp--preset--color--accent: #ff7d5c;
	--wp--preset--color--accent-contrast: #1a1920;
	--wp--preset--color--highlight: #ffd75a;
	--wp--preset--color--highlight-contrast: #1a1920;
	--wp--preset--color--spirit: #3fcfb0;
	--wp--preset--color--spirit-contrast: #10231e;
	--wp--preset--color--field: #2f8a4c;
	--wp--preset--color--sky: #68b2f3;
	--wp--preset--color--violet: #bd78f0;
	--wp--preset--color--alert: #ff8591;
	--wp--preset--color--alert-contrast: #1a1920;
	--wp--preset--color--surface-raised: #2f2d3b;

	--wp--preset--shadow--card: 0 2px 12px rgba(0, 0, 0, 0.3);
	--wp--preset--shadow--nav: 0 10px 28px rgba(0, 0, 0, 0.45);
}
