/*
 * Kalenbook — the tokens the whole product shares.
 *
 * The Kalenbook charter (October 2026): what kalenbook.com shows before a
 * practitioner buys is what she finds once it is installed. The workspace
 * (admin/assets/admin.css), the phone app (public/app/app.css) and the
 * public booking module read their colours, type and radii from here,
 * under their own names.
 *
 * Two layers. The primitives are the charter's values, named for what they
 * are: ink, cloud, cobalt, mint, apricot. The semantic tokens below them
 * keep the names every surface already reads — paper, card, the four
 * states — and say which primitive plays each part. A colour is written
 * once, here; a component never carries a hex of its own.
 *
 * Dark belongs to the phone app only. The workspace lives inside a light
 * WordPress administration, and half a dark screen in a light frame reads
 * worse than none: the dark values apply where the page says it can take
 * them, with the `jdwt-scheme` class on <html> — the app's shell sets it.
 *
 * Lives next to the app so the phone's service worker keeps it, and the
 * font beside it, for offline reading.
 */

/*
 * Bricolage Grotesque (SIL Open Font License, fonts/OFL-bricolage.txt), the
 * variable file of the official repository, unchanged: weights 200 to 800,
 * width and optical size. Served by the site, never by Google.
 */
@font-face {
	font-family: 'Bricolage Grotesque';
	src: url(fonts/BricolageGrotesque-variable.ttf) format('truetype');
	font-weight: 200 800;
	font-stretch: 75% 100%;
	font-style: normal;
	font-display: swap;
}

:root {
	/* Primitives: the charter, light */
	--jdwt-ink-1: #15202B;
	--jdwt-ink-2: #4A5563;
	--jdwt-ink-3: #7B8696;
	--jdwt-white: #FFFFFF;
	--jdwt-cloud: #F1F3F6;
	--jdwt-line: #E1E5EB;
	--jdwt-cobalt: #2D4BE0;
	--jdwt-cobalt-deep: #1F36AE;
	--jdwt-cobalt-soft: #E6EAFB;
	--jdwt-on-cobalt: #FFFFFF;
	--jdwt-mint: #CDF2DF;
	--jdwt-mint-ink: #166A43;
	--jdwt-apricot: #FFDFBF;
	--jdwt-apricot-ink: #8A4A0A;
	/* Not in the charter, kept: a clash must not read as « attention » */
	--jdwt-red: #9A2B2B;
	--jdwt-red-soft: #F9E4E4;

	/* Ground and surfaces */
	--jdwt-paper: var(--jdwt-cloud);
	--jdwt-card: var(--jdwt-white);
	--jdwt-sunken: var(--jdwt-cloud);
	--jdwt-rule: var(--jdwt-line);

	/* Ink */
	--jdwt-ink: var(--jdwt-ink-1);
	--jdwt-muted: var(--jdwt-ink-2);
	--jdwt-muted-deep: var(--jdwt-ink-2);
	--jdwt-faint: var(--jdwt-ink-3);

	/* The one accent: actions, selection */
	--jdwt-accent: var(--jdwt-cobalt);
	--jdwt-accent-hover: var(--jdwt-cobalt-deep);
	--jdwt-accent-soft: var(--jdwt-cobalt-soft);
	--jdwt-accent-ink: var(--jdwt-on-cobalt);

	/*
	 * The four states, said by a word on a tint, never by colour alone. A
	 * request is the site's own booking: cobalt soft, as on kalenbook.com. A
	 * payment, a free slot, a done step: mint. A doubt, a private block, a
	 * busy calendar: apricot. A clash: red.
	 */
	--jdwt-request: var(--jdwt-cobalt-deep);
	--jdwt-request-t: var(--jdwt-cobalt-soft);
	--jdwt-payment: var(--jdwt-mint-ink);
	--jdwt-payment-t: var(--jdwt-mint);
	--jdwt-check: var(--jdwt-apricot-ink);
	--jdwt-check-t: var(--jdwt-apricot);
	--jdwt-conflict: var(--jdwt-red);
	--jdwt-conflict-t: var(--jdwt-red-soft);

	/* Type: one family. Hours line up by tabular figures, not by a mono. */
	--jdwt-font: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
	--jdwt-mono: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
	--jdwt-w-title: 700;
	--jdwt-w-text: 400;
	--jdwt-w-price: 800;
	--jdwt-track-title: -0.02em;

	/* Radii: fields and chips, cards, large blocks, buttons */
	--jdwt-r-sm: 6px;
	--jdwt-r: 12px;
	--jdwt-r-lg: 22px;
	--jdwt-r-pill: 999px;

	/* Elevation: only what floats */
	--jdwt-float: 0 16px 40px -16px rgba(21, 32, 43, 0.35);
}

/* The charter, dark: where the page says it can take it. */
@media (prefers-color-scheme: dark) {
	:root.jdwt-scheme:not([data-theme='light']) {
		--jdwt-ink-1: #F3F5F8;
		--jdwt-ink-2: #B8C0CC;
		--jdwt-ink-3: #86919F;
		--jdwt-white: #161C25;
		--jdwt-cloud: #0F141B;
		--jdwt-line: #273040;
		--jdwt-cobalt: #7C93FF;
		--jdwt-cobalt-deep: #A7B6FF;
		--jdwt-cobalt-soft: #1D2742;
		--jdwt-on-cobalt: #0F141B;
		--jdwt-mint: #173A2B;
		--jdwt-mint-ink: #8FE0B5;
		--jdwt-apricot: #4A2E12;
		--jdwt-apricot-ink: #FFC98A;
		--jdwt-red: #F0A3A3;
		--jdwt-red-soft: #341818;
		--jdwt-float: 0 16px 40px -16px rgba(0, 0, 0, 0.7);
	}
}

:root.jdwt-scheme[data-theme='dark'] {
	--jdwt-ink-1: #F3F5F8;
	--jdwt-ink-2: #B8C0CC;
	--jdwt-ink-3: #86919F;
	--jdwt-white: #161C25;
	--jdwt-cloud: #0F141B;
	--jdwt-line: #273040;
	--jdwt-cobalt: #7C93FF;
	--jdwt-cobalt-deep: #A7B6FF;
	--jdwt-cobalt-soft: #1D2742;
	--jdwt-on-cobalt: #0F141B;
	--jdwt-mint: #173A2B;
	--jdwt-mint-ink: #8FE0B5;
	--jdwt-apricot: #4A2E12;
	--jdwt-apricot-ink: #FFC98A;
	--jdwt-red: #F0A3A3;
	--jdwt-red-soft: #341818;
	--jdwt-float: 0 16px 40px -16px rgba(0, 0, 0, 0.7);
}
