/**
 * SMMS shared design tokens.
 *
 * One source of truth for the values that must be identical on every SMMS
 * surface: the wp-admin screens (admin.css) and the front-end portal
 * (portal.css). Loaded BEFORE either of them (see Admin\Menu and
 * Frontend\PortalPageManager), and defines nothing but custom properties and
 * @font-face rules, so on its own it changes no layout.
 *
 * What lives here, and what does not:
 *
 *   Here        font, type scale, spacing, radii, motion, stacking order,
 *               and the semantic "tone" colours (good / warn / bad / info)
 *               used for status pills and notices.
 *   Not here    each surface's own surface/background/text colours. The
 *               admin follows the WordPress admin colour scheme; the portal
 *               has a dark and a light theme. Those stay in admin.css and
 *               portal.css and are being mapped onto these tokens screen by
 *               screen, not rewritten in one go.
 *
 * Naming: everything is --smms-<group>-<step>. These names are new on
 * purpose, so they can never collide with the older --smms-radius,
 * --smms-bg, --smms-accent and friends, which mean different things in the
 * two stylesheets.
 */

/* ------------------------------------------------------------------ *
 * Typeface: Inter, served from the plugin itself.
 *
 * Latin and Latin Extended-A subsets (covers English, Swahili and most
 * European names). Nothing is fetched from another site. Weights 400-800
 * are what the interface uses. See assets/fonts/LICENSE.txt (SIL OFL 1.1).
 * ------------------------------------------------------------------ */

@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url( '../fonts/inter-latin-400.woff' ) format( 'woff' );
}

@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url( '../fonts/inter-latin-500.woff' ) format( 'woff' );
}

@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url( '../fonts/inter-latin-600.woff' ) format( 'woff' );
}

@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url( '../fonts/inter-latin-700.woff' ) format( 'woff' );
}

@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 800;
	font-display: swap;
	src: url( '../fonts/inter-latin-800.woff' ) format( 'woff' );
}

:root {
	/* --- Type ------------------------------------------------------- */
	--smms-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	--smms-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

	--smms-text-xs: 12px;
	--smms-text-sm: 13px;
	--smms-text-base: 14px;
	--smms-text-md: 15px;
	--smms-text-lg: 17px;
	--smms-text-xl: 20px;
	--smms-text-2xl: 24px;
	--smms-text-3xl: 30px;

	--smms-weight-regular: 400;
	--smms-weight-medium: 500;
	--smms-weight-semibold: 600;
	--smms-weight-bold: 700;

	--smms-leading-tight: 1.25;
	--smms-leading-snug: 1.4;
	--smms-leading-normal: 1.55;

	/* --- Space: a 4px grid ------------------------------------------ */
	--smms-space-1: 4px;
	--smms-space-2: 8px;
	--smms-space-3: 12px;
	--smms-space-4: 16px;
	--smms-space-5: 20px;
	--smms-space-6: 24px;
	--smms-space-8: 32px;
	--smms-space-10: 40px;
	--smms-space-12: 48px;

	/* --- Radii ------------------------------------------------------ */
	--smms-r-sm: 8px;
	--smms-r-md: 12px;
	--smms-r-lg: 16px;
	--smms-r-xl: 20px;
	--smms-r-pill: 999px;

	/* --- Motion ----------------------------------------------------- */
	--smms-ease: cubic-bezier( 0.2, 0, 0, 1 );
	--smms-dur-fast: 120ms;
	--smms-dur: 200ms;
	--smms-dur-slow: 320ms;

	/* --- Stacking order --------------------------------------------- */
	--smms-z-sticky: 60;
	--smms-z-drawer: 200;
	--smms-z-modal: 300;
	--smms-z-toast: 400;

	/* --- Touch and focus -------------------------------------------- */
	--smms-hit-min: 44px;
	--smms-focus-width: 2px;
	--smms-focus-offset: 2px;

	/*
	 * Tone colours for status pills, notices and counters, on a light
	 * surface (wp-admin and the portal's light theme). The portal's dark
	 * theme keeps its own tinted equivalents in portal.css.
	 * Each pair meets 4.5:1 text contrast.
	 */
	--smms-tone-neutral: #50575e;
	--smms-tone-neutral-bg: #f0f0f1;
	--smms-tone-info: #0a4b78;
	--smms-tone-info-bg: #e5f5fa;
	--smms-tone-good: #1a7f37;
	--smms-tone-good-bg: #e8f6ec;
	--smms-tone-warn: #8a5a00;
	--smms-tone-warn-bg: #fff4d6;
	/* Amber for charts and other graphics only (3.7:1 on white, above the 3:1 graphics need). Too light for text; use --smms-tone-warn for that. */
	--smms-tone-warn-graphic: #b9770e;
	--smms-tone-bad: #cf222e;
	--smms-tone-bad-bg: #fde8ea;
	--smms-tone-archive: #6a3a5c;
	--smms-tone-archive-bg: #f6f0f4;
}

/* People who ask their device for less motion get none from us. */
@media ( prefers-reduced-motion: reduce ) {
	:root {
		--smms-dur-fast: 0.01ms;
		--smms-dur: 0.01ms;
		--smms-dur-slow: 0.01ms;
	}
}
