/*
 * Design tokens, built from the variables in the Figma file: colours, spacing,
 * type, layout. Loaded first, on the site and in the editor's content iframe
 * (see inc/assets.php). Every other stylesheet reads its values from here.
 *
 * 1rem = 10px: the root is 62.5% of the browser's 16px, so a visitor's own
 * font size setting still scales everything, and 24px in Figma is 2.4rem here.
 * Borders stay in px, and so do media queries (rem there is always 16px).
 *
 * Sizes that differ between the mobile frame (402px wide) and the desktop
 * frame (1512px wide) are fluid: clamp() holds the mobile value up to 402px,
 * the desktop value from 1512px, and moves evenly between the two.
 */

html {
	font-size: 62.5%;
}

:root {
	/* Colour: the seven Figma variables. */
	--color-brand-dark-green: #072b0e;
	--color-brand-light-green: #83bb26;
	--color-brand-yellow: #fbbb21;
	--color-surface-beige: #e6e4dd;
	--color-surface-off-white: #f2f2f0;
	--color-neutral-black: #151515;
	--color-neutral-white: #ffffff;

	/* Colour: transparent mixes of the above that the design uses. */
	--color-line: rgb(21 21 21 / 0.2); /* hairlines */
	--color-line-light: rgb(255 255 255 / 0.2); /* hairlines on dark green */
	--color-tint-light-green: rgb(131 187 38 / 0.1); /* boxes on dark green */
	--color-scrim: rgb(0 0 0 / 0.4); /* darkens an image under text */

	/* Colour: what the page itself uses. */
	--color-page: var(--color-surface-beige);
	--color-text: var(--color-neutral-black);
	--color-link: var(--color-brand-dark-green);
	--color-error: #b3261e; /* a form field that is wrong; not in the Figma file */

	/* Spacing: one scale, named by its size in px. */
	--space-2: 0.2rem;
	--space-4: 0.4rem;
	--space-6: 0.6rem;
	--space-8: 0.8rem;
	--space-12: 1.2rem;
	--space-16: 1.6rem;
	--space-24: 2.4rem;
	--space-32: 3.2rem;
	--space-40: 4rem;
	--space-48: 4.8rem;
	--space-56: 5.6rem;
	--space-88: 8.8rem;
	--space-104: 10.4rem;

	/* Space above a section. The default is used everywhere; the smaller ones
	   are there for the exception, as the classes .section-space-s,
	   .section-space-xs and .section-space-none (see style.css). */
	--section-space: clamp(5.6rem, 3.862rem + 4.324vw, 10.4rem); /* 56 to 104 */
	--section-space-s: clamp(4rem, 2.841rem + 2.883vw, 7.2rem); /* 40 to 72 */
	--section-space-xs: clamp(2.4rem, 2.11rem + 0.721vw, 3.2rem); /* 24 to 32 */
	--section-space-none: 0rem;

	/* Layout. */
	--container: 136.8rem; /* content width */
	--gutter: clamp(2.4rem, 0.662rem + 4.324vw, 7.2rem); /* page margin, 24 to 72 */
	--measure: 72rem; /* reading column */
	--header-height: 5.6rem;
	--header-top: var(--space-16); /* space above the floating header */

	/* Radius: l for cards and panels, m for images and boxes inside them, s for
	   chips. */
	--radius-s: 0.4rem;
	--radius-m: 0.6rem;
	--radius-l: 0.8rem;
	--radius-pill: 99.9rem;

	/* Transitions: a time and an easing, after the property's name:
	   transition: opacity var(--transition). The long one is for images and
	   what moves with them. */
	--transition: 0.2s ease-out;
	--transition-long: 0.5s ease-out;

	/* Type: families. */
	--font-serif: "Lora", Georgia, "Times New Roman", serif;
	--font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	/* Type: a size and a line height per Figma text style. Line heights are
	   ratios (Figma's line height / size), so they follow the size. */
	--font-size-h1: clamp(3.6rem, 2.586rem + 2.523vw, 6.4rem); /* 36 to 64 */
	--line-height-h1: 1.12;
	--font-size-h2: clamp(3.2rem, 2.838rem + 0.901vw, 4.2rem); /* 32 to 42 */
	--line-height-h2: 1.17; /* 49 / 42 */
	--font-size-h3: 2.6rem;
	--line-height-h3: 1.23; /* 32 / 26 */
	--font-size-h4: clamp(1.8rem, 1.728rem + 0.18vw, 2rem); /* 18 to 20 */
	--line-height-h4: 1.3; /* 26 / 20 */
	--font-size-h5: 1.6rem;
	--line-height-h5: 1.5; /* 24 / 16 */
	--font-size-quote: clamp(2.6rem, 2.021rem + 1.441vw, 4.2rem); /* 26 to 42 */
	--line-height-quote: 1.2;

	--font-size-text-xl: 2rem;
	--line-height-text-xl: 1.4; /* 28 / 20 */
	--font-size-text-l: 1.8rem;
	--line-height-text-l: 1.556; /* 28 / 18 */
	--font-size-text-m: 1.6rem;
	--line-height-text-m: 1.5; /* 24 / 16 */
	--font-size-text-s: 1.4rem;
	--line-height-text-s: 1.43; /* 20 / 14 */
	--font-size-text-xs: 1.2rem;
	--line-height-text-xs: 1.33; /* 16 / 12 */

	/* Type: each style whole, for the font shorthand: font: var(--type-h4).
	   That is how an element gets another style than its tag's own, such as an
	   h2 set in the h4 size. The classes .h1 to .h5 and .text-xl to .text-xs
	   (components.css) do the same from the markup: <h2 class="h4">. */
	--type-h1: 400 var(--font-size-h1) / var(--line-height-h1) var(--font-serif);
	--type-h2: 400 var(--font-size-h2) / var(--line-height-h2) var(--font-serif);
	--type-h3: 400 var(--font-size-h3) / var(--line-height-h3) var(--font-serif);
	--type-h4: 400 var(--font-size-h4) / var(--line-height-h4) var(--font-serif);
	--type-h5: 400 var(--font-size-h5) / var(--line-height-h5) var(--font-serif);
	--type-quote: 400 var(--font-size-quote) / var(--line-height-quote) var(--font-serif);
	--type-text-xl: 400 var(--font-size-text-xl) / var(--line-height-text-xl) var(--font-sans);
	--type-text-l: 400 var(--font-size-text-l) / var(--line-height-text-l) var(--font-sans);
	--type-text-m: 400 var(--font-size-text-m) / var(--line-height-text-m) var(--font-sans);
	--type-text-s: 400 var(--font-size-text-s) / var(--line-height-text-s) var(--font-sans);
	--type-text-xs: 400 var(--font-size-text-xs) / var(--line-height-text-xs) var(--font-sans);
}
