/* Design tokens: every other stylesheet uses these and nothing else. */
:root {
	/* Colour: a neutral grey look, until a child theme's own assets/css/tokens.css (loaded after this file) sets the
	   brand's. Contrast: ink on bg 16.97:1, ink-soft 7.41:1, accent-text 10.01:1, accent-deep 14.27:1, error 6.20:1.
	   line-strong (3.24:1) is for borders and icons only. sand is a surface for ink text only. A child that changes
	   them keeps these roles and checks the same contrasts. */
	--color-bg: #FAFAFA;
	--color-surface: #FFFFFF;
	--color-sand: #E4E4E7;
	--color-line-strong: #8B8B94;
	--color-accent: #3F3F46;
	--color-accent-text: #3F3F46;
	--color-accent-deep: #27272A;
	--color-accent-tint: #F4F4F5;
	--color-accent-on-plum: var(--color-on-plum-soft);
	--color-plum: #18181B;
	--color-on-plum: #F4F4F5;
	--color-on-plum-soft: #D4D4D8;
	--color-ink: #18181B;
	--color-ink-soft: #52525B;
	--color-error: #B91C1C;
	--color-error-tint: #FEF2F2;
	--color-success: #15803D;
	--color-on-success: #FFFFFF;
	--color-on-accent: #FFFFFF;

	/* Tints: see-through versions of the colours above, for borders, overlays and shadows. Plain rgb() first, the
	   neutral palette's values, because phones without CSS colour mixing (iOS 15, Chrome < 111) drop a property
	   whose mix holds a var() instead of falling back; the @supports block below then derives them from the
	   colours. A child theme that changes the colours sets these too, as plain rgb(). */
	--tint-ink-5: rgb(24 24 27 / 0.05);
	--tint-ink-8: rgb(24 24 27 / 0.08);
	--tint-ink-12: rgb(24 24 27 / 0.12);
	--tint-ink-18: rgb(24 24 27 / 0.18);
	--tint-ink-22: rgb(24 24 27 / 0.22);
	--tint-ink-32: rgb(24 24 27 / 0.32);
	--tint-ink-40: rgb(24 24 27 / 0.4);
	--tint-ink-55: rgb(24 24 27 / 0.55);
	--tint-bg-88: rgb(250 250 250 / 0.88);
	--tint-surface-92: rgb(255 255 255 / 0.92);
	--tint-surface-94: rgb(255 255 255 / 0.94);
	--tint-on-plum-20: rgb(244 244 245 / 0.2);
	--color-bar: rgb(255 255 255 / 0.96);
	--color-focus-glow: rgb(63 63 70 / 0.25);

	/* Type: system fonts for Latin text; a child theme names its own fonts here and ships them. */
	--font-heading: Georgia, "Times New Roman", serif;
	/* No system-ui first: its wider glyphs on some systems made buttons wrap (layout.spec). */
	--font-body: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
	--font-heading-ar: "Noto Kufi Arabic", "Tajawal", sans-serif;
	--font-body-ar: "Tajawal", "Noto Kufi Arabic", system-ui, sans-serif;
	--font-tfng: "Noto Sans Tifinagh", sans-serif;

	/* Scale ratio 1.25 from 16px; the three largest steps are fluid, sized for a 360px phone up to a wide screen. */
	--step--1: 0.875rem;
	--step-0: 1rem;
	--step-1: 1.25rem;
	--step-2: 1.5625rem;
	--step-3: clamp(1.5rem, 1.2rem + 1.6vw, 2.4rem);
	--step-4: clamp(1.85rem, 1.3rem + 3vw, 3.6rem);
	--step-5: clamp(2.1rem, 1.2rem + 4.6vw, 5.2rem);
	--leading-tight: 1.15;
	--leading-body: 1.6;
	--weight-light: 350;
	--weight-regular: 400;
	--weight-medium: 500;
	--weight-semibold: 600;

	/* Space, 4-pt grid. The large steps are fluid: about half their size on a phone, full size from ~1100px,
	   so phones get no dead bands between sections. */
	--space-1: 0.25rem;
	--space-2: 0.5rem;
	--space-3: 0.75rem;
	--space-4: 1rem;
	--space-5: 1.5rem;
	--space-6: clamp(1.5rem, 1.1rem + 1.6vw, 2rem);
	--space-7: clamp(1.75rem, 0.9rem + 3.4vw, 3rem);
	--space-8: clamp(2rem, 0.6rem + 5.6vw, 4rem);
	--space-9: clamp(3rem, 1rem + 8vw, 6rem);

	/* Shape and depth. */
	--radius: 18px;
	--radius-sm: 10px;
	--radius-arch: 999px 999px 18px 18px;
	--radius-pill: 999px;
	/* A product card: one fixed corner at every width, the photo flush under it. */
	--radius-card: 16px;
	--border: 1px solid var(--color-sand);
	--shadow-soft: 0 1px 2px var(--tint-ink-5), 0 10px 28px var(--tint-ink-8);
	/* Tighter than --shadow-soft: a grid of cards each casting a wide shadow reads as a smudge between them. */
	--shadow-card: 0 1px 2px var(--tint-ink-5), 0 4px 14px -6px var(--tint-ink-12);
	--shadow-card-hover: 0 2px 4px var(--tint-ink-5), 0 12px 28px -10px var(--tint-ink-22);
	--focus-ring: 0 0 0 3px var(--color-bg), 0 0 0 5px var(--color-accent-text);

	/* Motion. */
	--duration-fast: 150ms;
	--duration-base: 250ms;
	--duration-panel: 320ms;
	--ease-out: cubic-bezier(0.22, 1, 0.36, 1);
	--ease-in: cubic-bezier(0.4, 0, 1, 1);

	/* Layout. */
	--container: 80rem;
	--gutter: var(--space-4);
	--measure: 65ch;
	--tap: 44px;
	--header-height: 64px;
}

@supports (color: color-mix(in srgb, red 50%, transparent)) {
	:root {
		--tint-ink-5: color-mix(in srgb, var(--color-ink) 5%, transparent);
		--tint-ink-8: color-mix(in srgb, var(--color-ink) 8%, transparent);
		--tint-ink-12: color-mix(in srgb, var(--color-ink) 12%, transparent);
		--tint-ink-18: color-mix(in srgb, var(--color-ink) 18%, transparent);
		--tint-ink-22: color-mix(in srgb, var(--color-ink) 22%, transparent);
		--tint-ink-32: color-mix(in srgb, var(--color-ink) 32%, transparent);
		--tint-ink-40: color-mix(in srgb, var(--color-ink) 40%, transparent);
		--tint-ink-55: color-mix(in srgb, var(--color-ink) 55%, transparent);
		--tint-bg-88: color-mix(in srgb, var(--color-bg) 88%, transparent);
		--tint-surface-92: color-mix(in srgb, var(--color-surface) 92%, transparent);
		--tint-surface-94: color-mix(in srgb, var(--color-surface) 94%, transparent);
		--tint-on-plum-20: color-mix(in srgb, var(--color-on-plum) 20%, transparent);
		--color-bar: color-mix(in srgb, var(--color-surface) 96%, transparent);
		--color-focus-glow: color-mix(in srgb, var(--color-accent) 25%, transparent);
	}
}

/* Phones (up to 767px; most Algerian phones are 360–412px wide): a tighter scale (ratio ~1.15 from 15px), less
   space between blocks and smaller corners, so a screen holds more than one thing. Every stylesheet reads these
   tokens, so all pages follow. Form fields stay at 16px (base.css): iOS zooms into anything smaller. */
@media (max-width: 47.99rem) {
	:root {
		--step--1: 0.8125rem;
		--step-0: 0.9375rem;
		--step-1: 1.0625rem;
		--step-2: 1.0625rem;
		--step-3: 1.375rem;
		--step-4: 1.375rem;
		--step-5: 1.625rem;
		--leading-body: 1.55;

		--space-5: 1.25rem;
		--space-6: 1rem;
		--space-7: 1.5rem;
		--space-8: 1.5rem;
		--space-9: 2.25rem;

		--radius: 14px;
		--radius-sm: 8px;
		--radius-arch: 999px 999px 14px 14px;
		--header-height: 56px;
	}
}

@media (min-width: 48rem) {
	:root {
		--gutter: var(--space-6);
		--header-height: 76px;
	}
}
