/**
 * WOISPO design tokens for the journal (OJS) theme: the "chart-room" palette of the public site
 * (woispo/site/DESIGN-RESEARCH.md, values from woispo/site/src/lib/palette.ts). Neutral ink and
 * warm-neutral surfaces carry the page; teal is the accent and the primary button; sea blue is for
 * links only; buoy orange is for focus and warnings only. Dark mode is neutral charcoal, not navy.
 *
 * Plain CSS, not LESS: OJS compiles LESS at runtime with less.php, which is never asked to parse a
 * custom-property declaration this way. styles/woispo.less and styles/variables.less use these
 * tokens only as var(--w-*).
 *
 * Every token exists in both modes. tools/contrast.mjs reads this file and fails if any
 * foreground/background pair the theme draws is below WCAG AA, or if a token shared with the
 * public site differs from palette.ts.
 */
:root {
	color-scheme: light dark;

	/* surfaces */
	--w-paper: #FFFFFF;
	--w-foam: #F6F6F3;
	--w-mist: #ECECE7;
	--w-line: #DCDCD6; /* decorative hairline; never the only edge of a control */
	--w-line-strong: #767A7F;

	/* text */
	--w-ink: #1F2328;
	--w-heading: #16191D;
	--w-muted: #57606A;
	--w-link: #0B5C8A;
	--w-link-hover: #08476B;
	--w-visited: #4E4A8C;
	--w-tide: #0B6E73;
	--w-tide-graphic: #0E8A8F;
	--w-rule: #4A4F55;
	--w-focus: #C2410C;

	/* buttons */
	--w-button-bg: #0B6E73;
	--w-button-fg: #FFFFFF;
	--w-button-hover-bg: #08575B;

	/* header and footer bar: a light surface with a hairline edge */
	--w-bar-bg: #F6F6F3;
	--w-bar-fg: #16191D;
	--w-bar-nav: #3A3F45;
	--w-bar-muted: #57606A;
	--w-bar-link: #1F2328;
	--w-bar-accent: #0B6E73;
	--w-bar-focus: #C2410C;
	--w-bar-line: #DCDCD6;

	/* callouts */
	--w-info-bg: #EAF2F6;
	--w-info-rule: #0B5C8A;
	--w-warn-bg: #FFF4E5;
	--w-warn-ink: #6B3A00;
	--w-warn-rule: #B26A12;
	--w-integrity-bg: #FDF0EA;
	--w-integrity-rule: #C2410C;
	--w-verified-bg: #F6F6F3;
	--w-verified-rule: #0B6E73;

	/* code */
	--w-code-bg: #F1F1EE;
	--w-code-ink: #1F2328;

	/* status (verification levels): text / fill / border */
	--w-built-fg: #0B5A33;
	--w-built-fill: #E2F3E9;
	--w-built-border: #2F8A5B;
	--w-building-fg: #7A4000;
	--w-building-fill: #FDEFD9;
	--w-building-border: #B26A12;
	--w-planned-fg: #3D4380;
	--w-planned-fill: #ECEEF8;
	--w-planned-border: #6A70B0;

	/* journal-only tokens (not on the public site) */
	--w-stamp-bg: #16191D; /* "AI-generated" stamp */
	--w-stamp-fg: #FFFFFF;
	--w-quiet-bg: #57606A; /* "house agent" badge */
	--w-quiet-fg: #FFFFFF;
	--w-error-bg: #B42318; /* form errors */
	--w-error-fg: #FFFFFF;
	--w-error-text: #B42318;
	--w-shadow: 0 2px 6px rgba(22, 25, 29, 0.08), 0 8px 24px rgba(22, 25, 29, 0.06);
}

@media (prefers-color-scheme: dark) {
	:root {
		--w-paper: #111315;
		--w-foam: #1A1D20;
		--w-mist: #202428;
		--w-line: #2E3338;
		--w-line-strong: #6B737B;

		--w-ink: #E6E8EA;
		--w-heading: #F2F3F4;
		--w-muted: #A7ADB3;
		--w-link: #7CC4EC;
		--w-link-hover: #A6D8F3;
		--w-visited: #B4AEF0;
		--w-tide: #5CC6C0;
		--w-tide-graphic: #5CC6C0;
		--w-rule: #6B737B;
		--w-focus: #FBBF24;

		--w-button-bg: #5CC6C0;
		--w-button-fg: #0B0D0F;
		--w-button-hover-bg: #86D8D3;

		--w-bar-bg: #181B1E;
		--w-bar-fg: #F2F3F4;
		--w-bar-nav: #D0D4D8;
		--w-bar-muted: #A7ADB3;
		--w-bar-link: #E6E8EA;
		--w-bar-accent: #5CC6C0;
		--w-bar-focus: #FBBF24;
		--w-bar-line: #2E3338;

		--w-info-bg: #1C2329;
		--w-info-rule: #7CC4EC;
		--w-warn-bg: #2E2210;
		--w-warn-ink: #F5C47C;
		--w-warn-rule: #D99A3E;
		--w-integrity-bg: #2E1B12;
		--w-integrity-rule: #FB923C;
		--w-verified-bg: #1A1D20;
		--w-verified-rule: #5CC6C0;

		--w-code-bg: #1C1F23;
		--w-code-ink: #DADDE0;

		--w-built-fg: #94E0B5;
		--w-built-fill: #12291D;
		--w-built-border: #3FB37A;
		--w-building-fg: #F5C47C;
		--w-building-fill: #2E2210;
		--w-building-border: #D99A3E;
		--w-planned-fg: #BCC1F5;
		--w-planned-fill: #25263A;
		--w-planned-border: #8D93E0;

		--w-stamp-bg: #F2F3F4;
		--w-stamp-fg: #111315;
		--w-quiet-bg: #A7ADB3;
		--w-quiet-fg: #111315;
		--w-error-bg: #B42318; /* kept dark red: the default theme hard-codes white text on it */
		--w-error-fg: #FFFFFF;
		--w-error-text: #F4A097;
		--w-shadow: none; /* dark mode: a lighter surface and a hairline instead of shadows */
	}
}
