/**
 * Greenwood design tokens.
 * The single source of truth for colour, type, spacing, surfaces and motion.
 * Mirrors assets/tokens.json (for designers) and theme.json (for the block editor).
 * Every text/background pair used by the theme is checked to WCAG 2.2 AA (see README).
 */

/* Self-hosted Inter (Latin subset, SIL OFL; see assets/fonts/OFL-Inter.txt) */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter-400.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/inter-500.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter-600.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/inter-700.woff') format('woff'); }

:root {
	/* ---------- Colour: brand ---------- */
	--gw-primary: #214244;          /* crest green */
	--gw-primary-hover: #172E30;
	--gw-primary-raised: #2B5557;
	--gw-secondary: #3E2463;        /* purple */
	--gw-secondary-hover: #2E1A4B;
	--gw-secondary-raised: #4E3277;
	--gw-accent: #FAC912;           /* crest gold */
	--gw-accent-hover: #FFD83D;
	--gw-accent-soft: #F2D27A;
	--gw-accent-ink: #5A4500;
	--gw-accent-tint: #FFF6D6;

	/* ---------- Colour: neutral ---------- */
	--gw-ink: #1E2321;              /* headings, strong text   15.9:1 on white */
	--gw-text: #3A4540;             /* body text               10.0:1 on white */
	--gw-muted: #4D6157;            /* secondary text           6.6:1 on white */
	--gw-line: #E4E9E5;
	--gw-surface: #FFFFFF;
	--gw-surface-alt: #F3F6F3;
	--gw-surface-inverse: #172E30;
	--gw-on-dark: #DDE9E1;          /* body text on green       8.7:1 */
	--gw-on-dark-muted: #C9D6CE;    /* footer text              9.5:1 */
	--gw-on-secondary: #E4DCF0;     /* body text on purple      7.7:1 */
	--gw-border-on-dark: #A9C7B4;   /* ghost button border      6.0:1 */

	/* ---------- Colour: semantic ---------- */
	--gw-success: #1E7B4A;  --gw-success-tint: #E6F4EC;
	--gw-warning: #8A5A00;  --gw-warning-tint: #FFF4DB;
	--gw-error:   #B42318;  --gw-error-tint:   #FDECEA;
	--gw-info:    #1F5FA8;  --gw-info-tint:    #E8F0FA;

	/* ---------- Colour: interaction ---------- */
	--gw-focus: #6B3FA8;            /* focus ring on light surfaces, 7.2:1 */
	--gw-focus-on-dark: #FAC912;    /* focus ring on green/purple, 7.0:1 */
	--gw-disabled-bg: #EEF1EF;
	--gw-disabled-text: #7A8780;

	/* ---------- Typography ---------- */
	--gw-font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--gw-font-serif: 'DM Serif Display', Georgia, 'Times New Roman', serif;
	--gw-font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

	--gw-text-h1: clamp(2.25rem, 1.6rem + 2.8vw, 3.625rem);   /* 36 → 58 */
	--gw-text-h2: clamp(1.875rem, 1.5rem + 1.6vw, 2.5rem);    /* 30 → 40 */
	--gw-text-h3: clamp(1.25rem, 1.15rem + 0.45vw, 1.375rem); /* 20 → 22 */
	--gw-text-h4: 1.125rem;                                    /* 18 */
	--gw-text-h5: 1rem;
	--gw-text-h6: 0.875rem;
	--gw-text-lead: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); /* 17 → 19 */
	--gw-text-body: 1rem;
	--gw-text-small: 0.9375rem;                                /* 15 */
	--gw-text-caption: 0.8125rem;                              /* 13 */
	--gw-leading-tight: 1.12;
	--gw-leading-snug: 1.3;
	--gw-leading-body: 1.65;
	--gw-tracking-label: 0.1em;

	/* ---------- Spacing: 8pt grid ---------- */
	--gw-space-0-5: 4px;
	--gw-space-1: 8px;
	--gw-space-1-5: 12px;
	--gw-space-2: 16px;
	--gw-space-2-5: 20px;           /* half step, used sparingly */
	--gw-space-3: 24px;
	--gw-space-4: 32px;
	--gw-space-5: 40px;
	--gw-space-6: 48px;
	--gw-space-7: 56px;
	--gw-space-8: 64px;
	--gw-space-10: 80px;
	--gw-space-12: 96px;
	--gw-section-y: clamp(64px, 5vw + 40px, 96px);
	--gw-gutter: clamp(16px, 2.5vw, 24px);
	--gw-container: 1200px;
	--gw-container-prose: 760px;
	/* Breakpoints (for reference; media queries cannot read variables):
	   sm 640px · md 768px · lg 1024px · xl 1200px · 2xl 1440px */

	/* ---------- Surfaces ---------- */
	--gw-radius-sm: 8px;
	--gw-radius-md: 14px;
	--gw-radius-lg: 20px;
	--gw-radius-xl: 24px;
	--gw-radius-pill: 999px;
	--gw-shadow-sm: 0 1px 2px rgba(20, 40, 30, 0.08), 0 2px 6px rgba(20, 40, 30, 0.06);
	--gw-shadow-md: 0 8px 24px rgba(20, 40, 30, 0.12);
	--gw-shadow-lg: 0 24px 48px rgba(20, 40, 30, 0.22);
	--gw-shadow-nav: 0 4px 18px rgba(20, 40, 30, 0.10);

	/* ---------- Motion ---------- */
	--gw-duration-fast: 120ms;
	--gw-duration-base: 200ms;
	--gw-duration-slow: 320ms;
	--gw-ease-standard: cubic-bezier(0.2, 0, 0, 1);
	--gw-ease-emphasized: cubic-bezier(0.3, 0, 0, 1);
	--gw-ease-exit: cubic-bezier(0.4, 0, 1, 1);

	/* ---------- Layers ---------- */
	--gw-z-header: 50;
	--gw-z-drawer: 60;
	--gw-z-overlay: 55;
}

@media (prefers-reduced-motion: reduce) {
	:root {
		--gw-duration-fast: 0ms;
		--gw-duration-base: 0ms;
		--gw-duration-slow: 0ms;
	}
}
