/**
 * Design tokens.
 *
 * Every colour, space, radius and type step the theme uses is declared here.
 * Nothing downstream hardcodes a hex value, so rebranding is a change to this
 * one file.
 */

:root {
	/* ---------- Brand ---------- */
	--munchi-yellow: #ffb914;
	--munchi-yellow-dark: #e0a00a;
	--munchi-yellow-soft: #fff0b9;
	--munchi-navy: #111a24;
	--munchi-navy-soft: #1b2633;
	--munchi-cream: #fffdf7;
	--munchi-cream-dark: #f8f3e8;
	/* The hero photograph's own backdrop, so the photo's edges disappear into the section. */
	--munchi-cream-warm: #fdf8f2;
	--munchi-white: #ffffff;

	/* Category card tints. */
	--munchi-tint-green: #dcebd8;
	--munchi-tint-yellow: #fff0b9;
	--munchi-tint-pink: #f5dfd8;
	/* The deeper end of each category card's gradient. */
	--munchi-tint-green-deep: #c7e0bf;
	--munchi-tint-pink-deep: #f2c3b3;
	/*
	 * Each category photograph's own backdrop at its left edge, so a card with
	 * a photo blends into it instead of meeting it at a seam.
	 */
	--munchi-photo-green: #e8e8bb;
	--munchi-photo-yellow: #fddb7a;
	--munchi-photo-pink: #fdd3bf;

	/* ---------- Semantic colour ---------- */
	--color-bg: var(--munchi-cream);
	--color-surface: var(--munchi-white);
	--color-surface-sunken: var(--munchi-cream-dark);
	--color-text: var(--munchi-navy);

	/*
	 * Muted text sits at 4.6:1 on cream — above the WCAG AA 4.5:1 floor for
	 * body copy. Do not lighten it further.
	 */
	--color-text-muted: #5c6672;
	--color-text-inverse: #ffffff;
	--color-text-inverse-muted: #c2cad4;

	--color-border: #e8e3d8;
	--color-border-strong: #d4cec0;

	--color-accent: var(--munchi-yellow);
	--color-accent-text: var(--munchi-navy);

	--color-sale: #c2410c;
	--color-heart: #ef4444;
	/* WhatsApp's own brand green, for the chat button only. */
	--color-whatsapp: #25d366;
	--color-whatsapp-dark: #1da851;
	--color-success: #15803d;
	--color-error: #b91c1c;

	--color-focus: #0b5cd5;

	/* ---------- Type ---------- */
	--font-body: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-display: "Plus Jakarta Sans", var(--font-body);
	--font-hand: "Caveat", "Comic Sans MS", cursive;

	/*
	 * Fluid type. Each step interpolates between a 360px phone and a 1440px
	 * desktop, so there are no jumps at breakpoints.
	 */
	--text-xs: 0.75rem;
	--text-sm: 0.8125rem;
	--text-base: 1rem;
	--text-md: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
	--text-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
	--text-xl: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
	--text-2xl: clamp(1.5rem, 1.3rem + 0.9vw, 2.125rem);
	--text-3xl: clamp(2rem, 1.5rem + 2.2vw, 3.5rem);
	--text-4xl: clamp(2.5rem, 1.6rem + 4vw, 5.25rem);

	--leading-tight: 1.05;
	--leading-snug: 1.25;
	--leading-normal: 1.6;

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

	--tracking-wide: 0.12em;

	/* ---------- Space ---------- */
	--space-3xs: 0.25rem;
	--space-2xs: 0.5rem;
	--space-xs: 0.75rem;
	--space-sm: 1rem;
	--space-md: 1.5rem;
	--space-lg: 2rem;
	--space-xl: 3rem;
	--space-2xl: 4rem;
	--space-3xl: clamp(3.5rem, 2rem + 6vw, 7rem);

	/* ---------- Layout ---------- */
	--container-max: 1240px;
	--container-narrow: 760px;
	--gutter: clamp(1rem, 0.5rem + 2vw, 1.5rem);

	/* ---------- Radius ---------- */
	--radius-sm: 0.75rem;
	--radius-md: 1.25rem;
	--radius-lg: 1.875rem;
	--radius-pill: 100px;

	/* ---------- Elevation ---------- */
	--shadow-sm: 0 1px 2px rgba(17, 26, 36, 0.06);
	--shadow-md: 0 10px 30px rgba(17, 26, 36, 0.07);
	--shadow-lg: 0 18px 45px rgba(17, 26, 36, 0.1);

	/* ---------- Motion ---------- */
	--ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
	--duration-fast: 150ms;
	--duration-base: 250ms;
	--duration-slow: 500ms;

	/* ---------- Layers ---------- */
	--z-header: 100;
	--z-overlay: 200;
	--z-skip-link: 300;
}

/*
 * Honour the operating system's reduced-motion setting by collapsing every
 * transition and animation to something imperceptible rather than removing
 * the rules, which would break state changes that rely on them.
 */
@media (prefers-reduced-motion: reduce) {
	:root {
		--duration-fast: 0.01ms;
		--duration-base: 0.01ms;
		--duration-slow: 0.01ms;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
