/* IMDI design tokens. Every colour is the existing palette (#8B3572 and the theme greys)
   or a tint, shade or alpha of it. Light is the default; [data-theme="dark"] swaps the surfaces. */
:root {
	/* brand: #8B3572 and its existing shade/soft tint from car_search.css */
	--imdi-brand: #8B3572;
	--imdi-brand-600: #6e2a5a;
	--imdi-brand-700: #521f43;
	--imdi-brand-300: #c77fb0;
	--imdi-brand-100: #f6eaf3;
	--imdi-brand-rgb: 139, 53, 114;

	/* neutrals from style.css */
	--imdi-ink: #15181f;
	--imdi-ink-2: #111416;
	--imdi-text: #323232;
	--imdi-text-2: #626262;
	--imdi-muted: #6b6b6b;          /* replaces #999 for text: #999 on white fails AA (2.8:1) */
	--imdi-bg: #ffffff;
	--imdi-surface: #ffffff;
	--imdi-surface-2: #f6f6f6;
	--imdi-surface-3: #fafafa;
	--imdi-line: #e3e3e3;
	--imdi-line-soft: rgba(21, 24, 31, .08);
	--imdi-on-brand: #ffffff;
	--imdi-link: var(--imdi-brand);
	--imdi-glass: rgba(255, 255, 255, .72);
	--imdi-glass-line: rgba(255, 255, 255, .6);
	--imdi-danger: #c0392b;

	/* gradients */
	--imdi-grad-brand: linear-gradient(135deg, #8B3572 0%, #6e2a5a 55%, #521f43 100%);
	--imdi-grad-glow: radial-gradient(60% 60% at 50% 0%, rgba(var(--imdi-brand-rgb), .18) 0%, rgba(var(--imdi-brand-rgb), 0) 70%);
	--imdi-grad-hero: radial-gradient(40% 50% at 15% 20%, rgba(var(--imdi-brand-rgb), .16), transparent 70%),
	                  radial-gradient(35% 45% at 90% 10%, rgba(199, 127, 176, .18), transparent 70%),
	                  linear-gradient(180deg, #fafafa 0%, #ffffff 100%);

	/* type */
	--imdi-font-body: 'Manrope', 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--imdi-font-display: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
	--imdi-fs-xs: .75rem;
	--imdi-fs-sm: .875rem;
	--imdi-fs-md: 1rem;
	--imdi-fs-lg: 1.125rem;
	--imdi-fs-xl: clamp(1.25rem, 1.1rem + .6vw, 1.5rem);
	--imdi-fs-2xl: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
	--imdi-fs-3xl: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);
	--imdi-fs-4xl: clamp(2.25rem, 1.6rem + 3vw, 3.75rem);
	--imdi-lh-tight: 1.15;
	--imdi-lh: 1.65;
	--imdi-tracking-tight: -.02em;
	--imdi-tracking-wide: .12em;

	/* spacing (4px base) */
	--imdi-sp-1: 4px;  --imdi-sp-2: 8px;  --imdi-sp-3: 12px; --imdi-sp-4: 16px;
	--imdi-sp-5: 24px; --imdi-sp-6: 32px; --imdi-sp-7: 48px; --imdi-sp-8: 64px; --imdi-sp-9: 96px;
	--imdi-section: clamp(56px, 4rem + 3vw, 112px);

	/* radii */
	--imdi-r-sm: 8px;
	--imdi-r: 14px;
	--imdi-r-lg: 22px;
	--imdi-r-pill: 999px;

	/* shadows (layered, soft) */
	--imdi-shadow-1: 0 1px 2px rgba(21, 24, 31, .05), 0 2px 8px rgba(21, 24, 31, .05);
	--imdi-shadow-2: 0 2px 4px rgba(21, 24, 31, .04), 0 12px 32px -8px rgba(21, 24, 31, .14);
	--imdi-shadow-3: 0 4px 8px rgba(21, 24, 31, .05), 0 24px 56px -12px rgba(21, 24, 31, .22);
	--imdi-glow: 0 10px 40px -10px rgba(var(--imdi-brand-rgb), .55);
	--imdi-ring: 0 0 0 3px rgba(var(--imdi-brand-rgb), .35);

	/* motion */
	--imdi-ease: cubic-bezier(.22, 1, .36, 1);
	--imdi-ease-in-out: cubic-bezier(.65, 0, .35, 1);
	--imdi-dur-1: 160ms;
	--imdi-dur-2: 280ms;
	--imdi-dur-3: 520ms;
	--imdi-dur-4: 900ms;

	--imdi-header-h: 76px;

	/* legacy theme variables now point at the tokens */
	--cd-primary-color: var(--imdi-brand);
	--cd-secondary-color: var(--imdi-text);
	--title-font: var(--imdi-font-display);
	--body-font: var(--imdi-font-body);
	--cs-theme: var(--imdi-brand);
	--cs-theme-dark: var(--imdi-brand-600);
	--cs-theme-soft: var(--imdi-brand-100);
	--cs-ink: var(--imdi-text);
	--cs-grey: var(--imdi-muted);
	--cs-line: var(--imdi-line);

	color-scheme: light;
}

/* html[...] so it outranks car_search.css's :root, which loads later in <body> */
html[data-theme="dark"] {
	--imdi-text: #f6f6f6;
	--imdi-text-2: #c5c5c5;
	--imdi-muted: #a8a8a8;
	--imdi-bg: #111416;
	--imdi-surface: #15181f;
	--imdi-surface-2: #1b1f28;
	--imdi-surface-3: #13161c;
	--imdi-line: rgba(255, 255, 255, .1);
	--imdi-line-soft: rgba(255, 255, 255, .06);
	--imdi-link: var(--imdi-brand-300);   /* #8B3572 on #15181f is 2.4:1, the tint is 6:1 */
	--imdi-brand-100: rgba(var(--imdi-brand-rgb), .22);
	--imdi-glass: rgba(21, 24, 31, .72);
	--imdi-glass-line: rgba(255, 255, 255, .08);
	--imdi-grad-hero: radial-gradient(40% 50% at 15% 20%, rgba(var(--imdi-brand-rgb), .35), transparent 70%),
	                  radial-gradient(35% 45% at 90% 10%, rgba(199, 127, 176, .18), transparent 70%),
	                  linear-gradient(180deg, #13161c 0%, #111416 100%);
	--imdi-shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .25);
	--imdi-shadow-2: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 32px -8px rgba(0, 0, 0, .5);
	--imdi-shadow-3: 0 4px 8px rgba(0, 0, 0, .3), 0 24px 56px -12px rgba(0, 0, 0, .6);
	--cs-ink: var(--imdi-text);
	color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
	:root { --imdi-dur-1: 1ms; --imdi-dur-2: 1ms; --imdi-dur-3: 1ms; --imdi-dur-4: 1ms; }
}
