/*
 * Plan My Wed: design tokens.
 * Colours are medians sampled from the Instagram carousels (tools/palette.json), not eyeballed.
 * Fonts are self-hosted WOFF2 (OFL, licences sit next to the files). Nothing here loads from a third party.
 */

/* ---------- Fonts ---------- */

/* Display: Instrument Serif, a tall, narrow, high-contrast serif that matches the owner's headlines. */
@font-face {
	font-family: "Instrument Serif";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/instrument-serif-400.woff2") format("woff2");
}
@font-face {
	font-family: "Instrument Serif";
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/instrument-serif-400-italic.woff2") format("woff2");
}

/* Body: Inter Tight, the tight grotesque the slides use for paragraphs. */
@font-face {
	font-family: "Inter Tight";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/inter-tight-400.woff2") format("woff2");
}
@font-face {
	font-family: "Inter Tight";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("../fonts/inter-tight-600.woff2") format("woff2");
}

/*
 * Metric-matched fallbacks: the system serif and sans, scaled and re-spaced to occupy the same
 * space as the web fonts, so the swap moves almost nothing (CLS). Values measured in Chromium:
 * size-adjust = width of a pangram paragraph in the web font / in the fallback;
 * ascent, descent and line-gap = the web font's metrics / (units per em * size-adjust).
 */
@font-face {
	font-family: "Instrument Serif Fallback";
	src: local("Times New Roman"), local("Times"), local("Liberation Serif");
	size-adjust: 83.96%;
	ascent-override: 117.92%;
	descent-override: 36.92%;
	line-gap-override: 0%;
}
@font-face {
	font-family: "Inter Tight Fallback";
	font-weight: 400;
	src: local("Arial"), local("Helvetica"), local("Liberation Sans");
	size-adjust: 96.21%;
	ascent-override: 100.71%;
	descent-override: 25.05%;
	line-gap-override: 0%;
}
@font-face {
	font-family: "Inter Tight Fallback";
	font-weight: 600;
	src: local("Arial Bold"), local("Helvetica Bold"), local("Liberation Sans Bold");
	size-adjust: 93.59%;
	ascent-override: 103.54%;
	descent-override: 25.75%;
	line-gap-override: 0%;
}

:root {
	/* ---------- Brand colour ---------- */
	--maroon: #540404;        /* page and surface maroon: header, footer, hero, final CTA */
	--maroon-deep: #440402;   /* the darker maroon: all text on cream, shadows, the sticky bar */
	--cream: #f9e4c7;         /* paper, and text on maroon */
	--gold: #ffebb9;          /* soft gold (owner's colour, replaces the sampled yellow): buttons on maroon, eyebrows, hairlines */
	--crimson: #ec0a09;       /* bright accent: large display type and non-text only (3.7:1 on cream) */

	/* The same three colours as bare RGB triplets, for translucent shades: rgb(var(--maroon-deep-rgb) / 0.5).
	 * A test keeps each triplet equal to its hex above. */
	--maroon-deep-rgb: 68 4 2;
	--cream-rgb: 249 228 199;
	--gold-rgb: 255 235 185;

	/* ---------- Derived colour ---------- */
	--ink: var(--maroon-deep);       /* body and heading text on cream: 13.4:1 */
	--ink-soft: #6e3e36;             /* secondary text on cream: 7.0:1 */
	--cream-soft: #dcc3a6;           /* secondary text on maroon: 8.9:1 */
	--cream-deep: #f1d9b8;           /* the lighter secondary cards on cream: ink 12.2:1, ink-soft 6.4:1 */
	--gold-bright: #fff4d6;          /* gold hover */
	--crimson-deep: #b30d0c;         /* crimson that can carry small text on cream: 5.7:1 */
	--line-dark: rgb(var(--maroon-deep-rgb) / 0.18); /* hairlines on cream */
	--line-light: rgb(var(--cream-rgb) / 0.22); /* hairlines on maroon */
	--focus-ring: var(--maroon-deep);      /* flips to gold on dark surfaces, see base.css */
	--focus-halo: var(--cream);            /* the ring just inside the focus ring: where a control floats over either surface */
	--scrim: rgb(var(--maroon-deep-rgb) / 0.72); /* small controls over photos and video */
	--bar-bg: rgb(var(--maroon-deep-rgb) / 0.94); /* the sticky WhatsApp bar on phones */
	--scrim-deep: rgb(24 2 1 / 0.92);      /* behind the screenshot lightbox */

	/* ---------- Type ---------- */
	--font-display: "Instrument Serif", "Instrument Serif Fallback", "Times New Roman", Georgia, serif;
	--font-body: "Inter Tight", "Inter Tight Fallback", Arial, Helvetica, sans-serif;
	--text-sm: 0.875rem;
	--text-md: 1.0625rem;
	--text-lg: 1.1875rem;
	--display-1: clamp(3.25rem, 15vw, 6.25rem);
	--display-2: clamp(2.5rem, 10vw, 4.75rem);
	--display-3: clamp(1.875rem, 6vw, 2.75rem);
	--tracking-display: -0.015em;
	--tracking-eyebrow: 0.16em;

	/* ---------- Space and shape ---------- */
	--space-1: 0.25rem;
	--space-2: 0.5rem;
	--space-3: 0.75rem;
	--space-4: 1rem;
	--space-5: 1.5rem;
	--space-6: 2rem;
	--space-7: 3rem;
	--space-8: 5rem;
	--section-y: clamp(3.5rem, 11vw, 7rem);
	/* The side margin of every section, the header, the footer and the sticky bar. On a notched phone held sideways
	 * the safe-area insets win, so nothing sits under the notch (the page extends under it: viewport-fit=cover). */
	--gutter: max(clamp(1.25rem, 5vw, 3rem), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
	--wrap: 72rem;
	--radius: 0.875rem;
	--radius-lg: 1.5rem;
	--radius-pill: 999px;
	--shadow-soft: 0 18px 40px -18px rgb(var(--maroon-deep-rgb) / 0.45);
	--shadow-lift: 0 30px 50px -22px rgb(var(--maroon-deep-rgb) / 0.6); /* a card raised by hover or focus */
	--shadow-header: 0 14px 30px -18px rgb(0 0 0 / 0.65); /* the header once the page has scrolled */
	--shadow-pill-drop: 0 16px 34px -10px rgb(var(--maroon-deep-rgb) / 0.7); /* the floating WhatsApp pill's drop shadow */
	--shadow-pill: var(--shadow-pill-drop), 0 0 0 1.5px var(--maroon-deep); /* and its hairline, so it reads on cream */
	--shadow-print: 0 16px 28px -12px rgb(0 0 0 / 0.6), 0 2px 6px rgb(0 0 0 / 0.25); /* a screenshot print resting on maroon */
	--shadow-photo: 0 0 0 0.5rem var(--cream), 0 30px 70px -20px rgb(0 0 0 / 0.7); /* the screenshot in the lightbox: a cream print border, then a drop shadow (neither takes layout space) */
	--glow-gold: 0 18px 44px -14px rgb(var(--gold-rgb) / 0.55); /* the closing WhatsApp button's halo */
	--shadow-motif: drop-shadow(0 10px 18px rgb(0 0 0 / 0.35)); /* lifts the gold peacock off the maroon */
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);

	/* ---------- Chrome sizes (the footer reserves room for the sticky bar; see also the 768 px header below) ---------- */
	--header-h: 4.5rem;
	/* The header also pads for the notch (viewport-fit=cover lets the page run under it): this is its full height. */
	--header-total: calc(var(--header-h) + env(safe-area-inset-top, 0px));
	--bar-h: 4.5rem;

	/* ---------- Motifs ---------- */
	/* The peacock is a currentColor SVG: it only works as a CSS mask. Use the .peacock class. */
	--peacock-mask: url("../img/peacock.svg");

	/* Fine film grain, painted once as a small tile. Light grain sits on maroon, dark on cream. */
	--grain-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .98 0 0 0 0 .89 0 0 0 0 .78 0 0 0 1.1 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	--grain-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .27 0 0 0 0 .016 0 0 0 0 .008 0 0 0 1.1 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

	/* Soft feather swirls, tone on tone, like the slide backgrounds. */
	--swirl-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 900'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23f9e4c7' stop-opacity='.1'/%3E%3Cstop offset='1' stop-color='%23f9e4c7' stop-opacity='0'/%3E%3C/linearGradient%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='7'/%3E%3C/filter%3E%3C/defs%3E%3Cg fill='url(%23g)' filter='url(%23b)'%3E%3Cpath d='M-60 700C110 470 400 330 930 360C640 440 440 570 330 930Z'/%3E%3Cpath d='M40 330C210 150 500 80 940 150C690 220 480 330 370 570Z'/%3E%3Cpath d='M-80 150C40 50 200 20 370 70C230 130 150 220 110 340Z'/%3E%3Cpath d='M520 930C560 700 700 540 960 470C880 640 760 780 700 940Z'/%3E%3C/g%3E%3C/svg%3E");
	--swirl-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 900'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23540404' stop-opacity='.075'/%3E%3Cstop offset='1' stop-color='%23540404' stop-opacity='0'/%3E%3C/linearGradient%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='7'/%3E%3C/filter%3E%3C/defs%3E%3Cg fill='url(%23g)' filter='url(%23b)'%3E%3Cpath d='M-60 700C110 470 400 330 930 360C640 440 440 570 330 930Z'/%3E%3Cpath d='M40 330C210 150 500 80 940 150C690 220 480 330 370 570Z'/%3E%3Cpath d='M-80 150C40 50 200 20 370 70C230 130 150 220 110 340Z'/%3E%3Cpath d='M520 930C560 700 700 540 960 470C880 640 760 780 700 940Z'/%3E%3C/g%3E%3C/svg%3E");
}

/* The header is taller from 768 px up. */
@media (min-width: 768px) {
	:root {
		--header-h: 5.25rem;
	}
}
