/*
 * rahmed_dev design tokens (contract C-1, version 1). Three blocks: :root, then the two dark blocks.
 * Extracted (D-2) from the live rahmed.dev on 2026-10-22: the five routes (/, /work,
 * /about, /blog, /contact), /builder_assets/tokens.css and
 * /files/page_styles/builder-asset-style.css (Builder emits no other styles).
 * No Builder record was changed.
 *
 * source value                      | where seen                       | token                           | gap fix
 * ----------------------------------|----------------------------------|---------------------------------|---------------------------
 * #FBFAF8                           | page bg (--rz-paper)             | --rz-color-bg                   | -
 * #F3F0EA                           | cards, code, hover row           | --rz-color-surface              | -
 * #F1ECE1                           | Builder token, unused in styles  | --rz-color-surface-alt          | -
 * #4A443D                           | body text (--rz-body)            | --rz-color-text                 | -
 * #17140F                           | headings, ink (--rz-ink)         | --rz-color-heading (added)      | -
 * #6F685F                           | muted text                       | --rz-color-text-muted           | -
 * #D6CFC3                           | dividers, 1.48:1 on bg           | --rz-color-border-subtle (add.) | kept for decoration only
 * #938A7D                           | control borders (--rz-field)     | --rz-color-border #8F8679       | UI boundary 3:1 on surface; darkened
 * #6B3FA0                           | accent, links, focus ring        | --rz-color-accent/-link/-focus  | -
 * #17140F                           | link hover                       | --rz-color-link-hover           | -
 * #FBFAF8                           | text on ink button               | --rz-color-on-accent            | -
 * (none)                            | button hover used accent         | --rz-color-accent-hover #5A3388 | added state
 * #E3311D                           | Builder token, error             | --rz-color-danger #C42A18       | 4.26:1 fails; darkened
 * (none)                            | -                                | --rz-color-success #2D763B      | added state; 4.5:1 on surface-alt
 * (none)                            | -                                | --rz-color-warning #8A5A00      | added state
 * #FFFFFF                           | form field bg                    | --rz-color-field (added)        | -
 * 'Inter' 400/500/600               | sans, body                       | --rz-font-sans, weights         | 600 named bold
 * 'Instrument Serif' 400            | headings, brand                  | --rz-font-display               | -
 * 'JetBrains Mono' 400/500          | labels, meta, links              | --rz-font-mono                  | -
 * 11.5 12 12.5 13 13.5 14 15 15.5   | labels, meta, small              | --rz-font-size-xs/-sm           | 11.5 up to 12 (0.75rem)
 * 16 16.5 17 18                     | body 16.5, prose 17, lead 18     | --rz-font-size-md/-lg           | md = 17px, one size for body and prose (+0.5px)
 * 20 21 25 26 30 32 36 38 48 56     | brand, titles, h2, h1, display   | --rz-font-size-xl .. -4xl       | filled on the same ratio
 * line-height 1.07 1.1 1.2 1.25     | display, h1, h2, small titles    | --rz-line-height-tight/-snug    | -
 * line-height 1.6 1.65 1.7 1.75     | text blocks                      | --rz-line-height-normal/-relaxed| -
 * letter-spacing .03 .04 .06 .08em  | meta, nav, pills                 | --rz-letter-spacing-wide (.08)  | -
 * letter-spacing .14em              | section label                    | --rz-letter-spacing-wider (add.)| -
 * (none)                            | headings                         | --rz-letter-spacing-tight       | added
 * 4 8 12 16 18 20 22 24 28 32 ...   | gaps, paddings, margins          | --rz-space-1 .. -9              | 4 px scale: 18 to 20, 22 to 24, 28 to 32
 * 44 64 88                          | section spacing                  | --rz-space-7/-8/-9              | 44 to 48, 88 to 96
 * radius 2 3 4 999px                | images, cards, pills             | --rz-radius-sm/-md/-pill        | -
 * (none)                            | -                                | --rz-radius-lg, --rz-shadow-*   | added; no shadow in current look
 * border 1px, 2px                   | rules, focus                     | --rz-border-width(-strong)      | -
 * max-width 620 660 768             | header, prose, container         | --rz-container-narrow/-default  | narrow = 660 (prose)
 * gutter 24px, 18px below 768       | container padding                | --rz-gutter                     | 18 to 20 on small screens
 * transition .15s ease-out          | hover states                     | --rz-duration-fast, --rz-ease-standard |
 * outline 2px, offset 3px           | :focus-visible                   | --rz-focus-ring-*               | -
 * 19px, 22px (below 768)           | .rz-prose h3, .rz-item__title    | --rz-font-size-lg (18), -xl (24)| nearest step
 * line-height 1.4                  | .rz-prose h3                     | --rz-line-height-snug (1.25)    | nearest step
 * outline-offset 4px               | .rz-item focus ring              | --rz-focus-ring-offset (3px)    | recorded exception, 1px less
 * #181410, #6F6A61, #F7E14A, #E8D8A6 | Builder /builder_assets/tokens.css | unused, not mapped         | not used in any style
 * breakpoints 640 767 900           | media queries                    | --rz-bp-sm/-md/-lg              | to 640, 768, 1024 px
 *
 * Dark theme (D-14): copied from the live site's mechanism. No data-theme attribute: the OS
 * setting decides until a choice is saved. data-theme="dark" or "light" on <html> forces a theme;
 * the header toggle (rz-theme.js, f002 R-11) sets it and saves it in localStorage rz-theme.
 * The two dark blocks hold the same declarations and override colour tokens only.
 *
 * Contrast, light (WCAG 2.2, computed 2026-10-22):
 * text on bg 9.21 | text-muted on bg 5.27 | text on surface 8.45 | text-muted on surface 4.83
 * link on bg 7.08 | on-accent on accent 7.08 | on-accent on accent-hover 8.89
 * border on bg 3.44 (on surface 3.15, field 3.59, surface-alt 3.05) | focus on bg 7.08 | heading on bg 17.61 | danger on bg 5.45
 * success on bg 5.35 (on surface 4.90, surface-alt 4.73) | warning on bg 5.68 (on surface 5.21)
 *
 * Contrast, dark (computed 2026-10-22):
 * text on bg 11.05, on surface 9.88, on field 10.43, on surface-alt 9.06
 * text-muted on bg 6.43, on surface 5.75, on surface-alt 5.27 | heading on bg 15.88
 * link on bg 7.92, on surface 7.09 | on-accent on accent 7.92, on accent-hover 10.06
 * border on bg 3.48, on field 3.29 | focus on bg 7.92
 * success on bg 8.42 (on surface 7.53) | danger on bg 7.73 (on surface 6.91)
 * warning on bg 9.26 (on surface 8.29)
 * Dark danger #f28b7d: Builder #E3311D is 4.17:1 on the dark bg and fails. Dark surface-alt,
 * accent-hover, success and warning are added states. *
 * Fonts: Inter, Instrument Serif and JetBrains Mono, all SIL OFL 1.1, from Fontsource
 * (D-13), latin subset, in public/fonts/. No family was swapped.
 */
:root {
	/* colour */
	--rz-color-bg: #fbfaf8;
	--rz-color-surface: #f3f0ea;
	--rz-color-surface-alt: #f1ece1;
	--rz-color-field: #fff;
	--rz-color-text: #4a443d;
	--rz-color-heading: #17140f;
	--rz-color-text-muted: #6f685f;
	--rz-color-border: #8f8679;
	--rz-color-border-subtle: #d6cfc3;
	--rz-color-link: #6b3fa0;
	--rz-color-link-hover: #17140f;
	--rz-color-accent: #6b3fa0;
	--rz-color-accent-hover: #5a3388;
	--rz-color-on-accent: #fbfaf8;
	--rz-color-focus: #6b3fa0;
	--rz-color-success: #2d763b;
	--rz-color-danger: #c42a18;
	--rz-color-warning: #8a5a00;

	/* font families */
	--rz-font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--rz-font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
	--rz-font-display: "Instrument Serif", Georgia, "Times New Roman", serif;

	/* type size */
	--rz-font-size-xs: 0.75rem;
	--rz-font-size-sm: 0.875rem;
	--rz-font-size-md: 1.0625rem;
	--rz-font-size-lg: 1.125rem;
	--rz-font-size-xl: 1.5rem;
	--rz-font-size-2xl: clamp(1.625rem, 1.4rem + 0.9vw, 2rem);
	--rz-font-size-3xl: clamp(2.25rem, 1.9rem + 1.4vw, 3rem);
	--rz-font-size-4xl: clamp(2.375rem, 1.8rem + 2.4vw, 3.5rem);

	/* weight, leading, tracking */
	--rz-font-weight-regular: 400;
	--rz-font-weight-medium: 500;
	--rz-font-weight-bold: 600;
	--rz-line-height-tight: 1.1;
	--rz-line-height-snug: 1.25;
	--rz-line-height-normal: 1.65;
	--rz-line-height-relaxed: 1.75;
	--rz-letter-spacing-tight: -0.01em;
	--rz-letter-spacing-normal: 0;
	--rz-letter-spacing-wide: 0.08em;
	--rz-letter-spacing-wider: 0.14em;

	/* space (4 px scale) */
	--rz-space-0: 0;
	--rz-space-1: 0.25rem;
	--rz-space-2: 0.5rem;
	--rz-space-3: 0.75rem;
	--rz-space-4: 1rem;
	--rz-space-5: 1.5rem;
	--rz-space-6: 2rem;
	--rz-space-7: 3rem;
	--rz-space-8: 4rem;
	--rz-space-9: 6rem;

	/* radius, shadow, border */
	--rz-radius-sm: 0.1875rem;
	--rz-radius-md: 0.25rem;
	--rz-radius-lg: 0.5rem;
	--rz-radius-pill: 999px;
	--rz-shadow-sm: 0 1px 2px rgb(23 20 15 / 0.08);
	--rz-shadow-md: 0 4px 12px rgb(23 20 15 / 0.1);
	--rz-border-width: 1px;
	--rz-border-width-strong: 2px;

	/* layout */
	--rz-container-narrow: 41.25rem;
	--rz-container-default: 48rem;
	--rz-container-wide: 64rem;
	--rz-measure: 65ch;
	--rz-gutter: clamp(1.25rem, 0.5rem + 3vw, 1.5rem);

	/* motion */
	--rz-duration-fast: 150ms;
	--rz-duration-normal: 250ms;
	--rz-ease-standard: ease-out;

	/* focus, targets, layers */
	--rz-focus-ring-width: 2px;
	--rz-focus-ring-offset: 3px;
	--rz-target-min: 2.75rem;
	--rz-target-min-small: 1.5rem;
	--rz-z-header: 100;
	--rz-z-skip-link: 1000;

	/* breakpoints (documentation values; media queries repeat them as literal rem) */
	--rz-bp-sm: 40rem;
	--rz-bp-md: 48rem;
	--rz-bp-lg: 64rem;

	color-scheme: light;
}

:root[data-theme="dark"] {
	--rz-color-bg: #16130f;
	--rz-color-surface: #221e19;
	--rz-color-surface-alt: #2a251f;
	--rz-color-field: #1d1914;
	--rz-color-text: #cfc7ba;
	--rz-color-heading: #f2ede4;
	--rz-color-text-muted: #a0978a;
	--rz-color-border: #736a5e;
	--rz-color-border-subtle: #3a342c;
	--rz-color-link: #b99ce8;
	--rz-color-link-hover: #f2ede4;
	--rz-color-accent: #b99ce8;
	--rz-color-accent-hover: #cbb5f0;
	--rz-color-on-accent: #16130f;
	--rz-color-focus: #b99ce8;
	--rz-color-success: #6bc17d;
	--rz-color-danger: #f28b7d;
	--rz-color-warning: #e0b054;

	color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--rz-color-bg: #16130f;
		--rz-color-surface: #221e19;
		--rz-color-surface-alt: #2a251f;
		--rz-color-field: #1d1914;
		--rz-color-text: #cfc7ba;
		--rz-color-heading: #f2ede4;
		--rz-color-text-muted: #a0978a;
		--rz-color-border: #736a5e;
		--rz-color-border-subtle: #3a342c;
		--rz-color-link: #b99ce8;
		--rz-color-link-hover: #f2ede4;
		--rz-color-accent: #b99ce8;
		--rz-color-accent-hover: #cbb5f0;
		--rz-color-on-accent: #16130f;
		--rz-color-focus: #b99ce8;
		--rz-color-success: #6bc17d;
		--rz-color-danger: #f28b7d;
		--rz-color-warning: #e0b054;

		color-scheme: dark;
	}
}
