/**
 * AVELUNEXA - design tokens.
 *
 * Custom properties only. No selectors that paint anything live in this file,
 * so it can be loaded first and cached independently of the rest of the CSS.
 *
 * Naming: --av-<group>-<role>.
 */

:root {
	/* --- Brand palette --- */
	--av-navy: #0d1b2a;
	--av-gold: #d4af37;
	--av-ivory: #faf7f2;
	--av-blush: #ebc5c2;
	--av-gray: #a7a9ac;

	/* Tints and shades derived from the five brand colours. Defined explicitly
	   rather than with color-mix() so they render identically everywhere. */
	--av-navy-900: #060d15;
	--av-navy-800: #0d1b2a;
	--av-navy-700: #16293c;
	--av-navy-600: #22384e;

	--av-gold-600: #a8862a;
	--av-gold-500: #d4af37;
	--av-gold-400: #e0c467;

	--av-ivory-100: #ffffff;
	--av-ivory-200: #faf7f2;
	--av-ivory-300: #f2ece3;
	--av-ivory-400: #e6ddd0;

	--av-gray-700: #5c5e61;
	--av-gray-500: #a7a9ac;
	--av-gray-300: #d5d6d8;

	/* --- Semantic roles. Components reference these, never the raw palette. --- */
	--av-color-bg: var(--av-ivory-200);
	--av-color-bg-raised: var(--av-ivory-100);
	--av-color-bg-sunken: var(--av-ivory-300);
	--av-color-bg-inverse: var(--av-navy-800);

	--av-color-text: var(--av-navy-800);
	--av-color-text-muted: var(--av-gray-700);
	--av-color-text-inverse: var(--av-ivory-200);
	--av-color-text-on-gold: var(--av-navy-900);

	--av-color-accent: var(--av-gold-500);
	--av-color-accent-hover: var(--av-gold-600);
	--av-color-soft: var(--av-blush);

	--av-color-border: var(--av-ivory-400);
	--av-color-border-strong: var(--av-gray-300);

	/* Feedback colours, all >= 4.5:1 on --av-color-bg. */
	--av-color-success: #2f6d4f;
	--av-color-warning: #8a6410;
	--av-color-danger: #a12d2d;
	--av-color-info: var(--av-navy-600);

	/* Focus ring. Gold on ivory is only ~2.1:1, so focus uses navy with a gold
	   outer ring to stay visible on both light and dark surfaces. */
	--av-color-focus: var(--av-navy-800);
	--av-color-focus-contrast: var(--av-gold-400);

	/* --- Typography --- */
	--av-font-display: 'Cormorant Garamond', 'Times New Roman', Times, Georgia, serif;
	--av-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

	--av-weight-regular: 400;
	--av-weight-medium: 500;
	--av-weight-semibold: 600;

	/* Fluid scale. clamp() keeps headings readable at 360px without a media
	   query and stops them running away past 1440px. */
	--av-text-xs: 0.75rem;
	--av-text-sm: 0.875rem;
	--av-text-base: 1rem;
	--av-text-lg: clamp(1.0625rem, 0.99rem + 0.31vw, 1.1875rem);
	--av-text-xl: clamp(1.25rem, 1.13rem + 0.5vw, 1.5rem);
	--av-text-2xl: clamp(1.5rem, 1.28rem + 0.94vw, 2rem);
	--av-text-3xl: clamp(1.875rem, 1.46rem + 1.72vw, 2.75rem);
	--av-text-4xl: clamp(2.25rem, 1.55rem + 2.97vw, 3.75rem);

	--av-leading-tight: 1.15;
	--av-leading-snug: 1.3;
	--av-leading-normal: 1.6;
	--av-leading-relaxed: 1.75;

	--av-tracking-tight: -0.01em;
	--av-tracking-wide: 0.04em;
	--av-tracking-widest: 0.14em;

	/* --- Space (4px base) --- */
	--av-space-3xs: 0.25rem;
	--av-space-2xs: 0.5rem;
	--av-space-xs: 0.75rem;
	--av-space-sm: 1rem;
	--av-space-md: 1.5rem;
	--av-space-lg: 2rem;
	--av-space-xl: 3rem;
	--av-space-2xl: 4.5rem;
	--av-space-3xl: 6rem;

	--av-section-y: clamp(3rem, 2rem + 4.4vw, 6rem);

	/* --- Layout --- */
	--av-container: 1280px;
	--av-container-narrow: 760px;
	--av-gutter: clamp(1rem, 0.6rem + 1.7vw, 2rem);

	/* --- Radius, shadow, motion --- */
	--av-radius-sm: 2px;
	--av-radius-md: 4px;
	--av-radius-lg: 8px;
	--av-radius-pill: 999px;

	/* Low-contrast, wide shadows: a premium surface should read as lifted,
	   not outlined. */
	--av-shadow-sm: 0 1px 2px rgba(13, 27, 42, 0.06);
	--av-shadow-md: 0 4px 16px rgba(13, 27, 42, 0.08);
	--av-shadow-lg: 0 12px 40px rgba(13, 27, 42, 0.12);

	--av-ease: cubic-bezier(0.4, 0, 0.2, 1);
	--av-duration-fast: 150ms;
	--av-duration-base: 250ms;

	/* WCAG 2.2 AA asks for 24px; 44px is the comfortable thumb target we hold
	   ourselves to on mobile. */
	--av-tap-target: 44px;
}

/* Honour the OS reduced-motion setting everywhere at once. */
@media (prefers-reduced-motion: reduce) {
	:root {
		--av-duration-fast: 0ms;
		--av-duration-base: 0ms;
	}
}
