/* Comic Mono's capitals span -44 to 1463 of 2048 units, but its line metrics
   (ascent 1630, descent 650) leave them 0.11em high in their line box. These
   overrides keep the same total height and centre the capitals in it. */
@font-face {
	font-family: "Comic Mono";
	src: url("../../assets/fonts/ComicMono.woff2") format("woff2");
	font-weight: 400;
	font-display: block;
	ascent-override: 93.75%;
	descent-override: 18.75%;
	line-gap-override: 0%;
}

@font-face {
	font-family: "Comic Mono";
	src: url("../../assets/fonts/ComicMono-Bold.woff2") format("woff2");
	font-weight: 700;
	font-display: block;
	ascent-override: 93.75%;
	descent-override: 18.75%;
	line-gap-override: 0%;
}

:root {
	--bg: #272e33;
	--surface: #2e383c;
	--text: #d3c6aa;
	/* Everforest's grey2: grey1 falls short of WCAG's 4.5:1 for text. */
	--muted: #9da9a0;
	--accent: #a7c080;
	--accent-ink: #272e33;
	--hairline: #374145;
	--border: #414b50;
	--frame: #1e2326;
	--frame-shadow: rgb(0 0 0 / 0.7);
	--selection: #4c3743;
	--popup: #374145;
	/* Everforest's accents, for illustration such as the project covers. */
	--red: #e67e80;
	--orange: #e69875;
	--yellow: #dbbc7f;
	--green: #a7c080;
	--aqua: #83c092;
	--blue: #7fbbb3;
	--purple: #d699b6;

	/* monospace only covers the moment before Comic Mono loads, or a failed load. */
	--font-sans: "Comic Mono", monospace;
	--font-mono: "Comic Mono", monospace;

	--line: 1.55;
	/* Pages use the full width: text keeps its own line-length limits, and
	   grids add columns. Margins grow with the window, from 24px to 72px. */
	--page-pad: clamp(var(--s5), 4vw, var(--s8));

	--s1: 4px;
	--s2: 8px;
	--s3: 12px;
	--s4: 16px;
	--s5: 24px;
	--s6: 32px;
	--s7: 48px;
	--s8: 72px;

	--frame-gap: var(--s3);
	--frame-radius: 28px; /* Material 3 corner-extra-large */

	/* Material 3's easing: default effects for small changes of state,
	   emphasized decelerate for arrivals. */
	--ease-effects: cubic-bezier(0.34, 0.8, 0.34, 1);
	--ease-arrive: cubic-bezier(0.05, 0.7, 0.1, 1);

	color-scheme: dark;
}

/* The theme is chosen before first paint (index.html) from the saved choice
   or the system preference, and switched by the toggle in the status bar.
   Both themes use Everforest's hard backgrounds. Light's background steps
   are much closer together than dark's, so the hairline and border use bg4
   and bg5, which stand off bg0 about as far as dark's bg2 and bg3 do. Grey2
   is light's darkest grey, the nearest to dark's grey1 against the page. */
html[data-theme="light"] {
	--bg: #fffbef;
	--surface: #f8f5e4;
	--text: #5c6a72;
	/* Light Everforest's greys and green reach only 2.5 to 3.2:1 on its
	   backgrounds, short of WCAG's 4.5:1 for text. These are its grey2 and
	   green with hue and chroma kept and OKLCH lightness lowered just
	   enough to reach 4.6:1 on the background, surface, frame and popup
	   (grey2 0.640 to 0.525, green 0.670 to 0.521). */
	--muted: #616f60;
	--hairline: #e8e5d5;
	--border: #bec5b2;
	--accent: #627300;
	--accent-ink: #fffbef;
	--frame: #f2efdf;
	--frame-shadow: rgb(0 0 0 / 0.25);
	--selection: #f0f2d4;
	--popup: #f2efdf;
	--red: #f85552;
	--orange: #f57d26;
	--yellow: #dfa000;
	--green: #8da101;
	--aqua: #35a77c;
	--blue: #3a94c5;
	--purple: #df69ba;
	color-scheme: light;
}

html[data-browser="ladybird"] {
	--bg: #272e33;
	--surface: #2e383c;
	--text: #d3c6aa;
	--muted: #9da9a0;
	--accent: #a7c080;
	--accent-ink: #272e33;
	--hairline: #374145;
	--border: #414b50;
	--frame: #1e2326;
	--frame-shadow: rgb(0 0 0 / 0.7);
	--selection: #4c3743;
	--popup: #374145;
	--red: #e67e80;
	--orange: #e69875;
	--yellow: #dbbc7f;
	--green: #a7c080;
	--aqua: #83c092;
	--blue: #7fbbb3;
	--purple: #d699b6;
}

@media (max-width: 480px) {
	:root {
		--frame-gap: var(--s2);
		--frame-radius: 16px; /* Material 3 corner-large */
	}
}
