/* ==========================================================================
   XIO bridge — maps the variable names XIO projects were written against
   (--bg, --fg, --ink, --dim, --rule, --hl …) onto the motion kit's per-project
   tokens, so an existing stylesheet picks up its project's colour without a
   rewrite. Load after xio-motion.css; html[data-xio] outranks :root, so the
   order against the project's own stylesheet doesn't matter.
   A project only renames what it needs to on top of this (see DESIGN.md).
   ========================================================================== */

html[data-xio] {
	/* ground + surfaces */
	--bg: var(--x-bg);
	--panel: var(--x-panel);
	--panel-hi: var(--x-panel-2);
	--panel-2: var(--x-panel-2);
	--card: var(--x-panel);
	--tint: var(--x-panel-2);

	/* text: tinted, never pure white */
	--fg: var(--x-text);
	--ink: var(--x-text);
	--text: var(--x-text);
	--dim: var(--x-dim);
	--muted: var(--x-dim);
	--faint: var(--x-faint);

	/* lines: hairlines stay quiet, the "hi" rule (buttons, frames) carries colour */
	--rule: var(--x-rule);
	--rule-hi: color-mix(in oklab, var(--accent) 30%, #262626);
	--line: color-mix(in oklab, var(--accent) 30%, #262626);

	/* highlight = the project's accent (was XIO cyan everywhere) */
	--hl: var(--accent);
	--hl-dim: color-mix(in srgb, var(--accent) 50%, transparent);
	--hl-soft: var(--x-soft);
	--hl-glow: var(--x-glow);

	accent-color: var(--accent);
	caret-color: var(--accent);
	scrollbar-color: color-mix(in oklab, var(--accent) 35%, #222) transparent;
}

html[data-xio] ::selection {
	background: color-mix(in srgb, var(--accent) 32%, transparent);
	color: var(--x-text);
}

html[data-xio] :focus-visible {
	outline-color: var(--accent);
}

/* Headings carry the accent; pages that want white headings opt out. */
html[data-xio]:not([data-xio-headings="plain"]) :is(h1, h2) {
	color: var(--accent);
}
