/**
 * Design Tokens — single source of truth.
 * Values are the Figma variables from the Palmetto Energy Saver design system
 * and high-fi comps (see docs/figma-spec.md). Do not hardcode hex in components;
 * reference these tokens.
 */

:root {
	/* ---- Colours (Figma variable names in comments) ---- */
	--color-primary: #4A8A64;          /* primary/efficiency-green */
	--color-primary-dark: #1A5C3A;     /* primary/palmetto-green */
	--color-primary-200: #BDDBC9;      /* Primary/Efficiency Green/200 */
	--color-blue: #4C80B0;             /* primary/connectivity-blue */
	--color-blue-300: #8DAFCE;         /* Primary/Connectivity Blue/300 */
	--color-blue-200: #B8CDE0;         /* Primary/Connectivity Blue/200 */
	--color-blue-100: #DFE6EC;         /* Primary/Connectivity Blue/100 */
	--color-blue-50: #F2F5F7;          /* Primary/Connectivity Blue/50 */
	--color-blue-dark: #2A476B;        /* accent/regulatory-blue */
	--color-gold: #D4A153;             /* accent/accountability-gold */
	--color-harvest: #E8C26A;          /* Primary/Energy Harvest */
	--color-cream: #F7F4F0;            /* accent/transparency-white */
	--color-white: #FFFFFF;            /* Grey, Lightest */
	--color-grey-light: #D1D1D1;       /* Grey, Light — dividers */
	--color-grey-medium: #999999;      /* Grey, Medium — disabled text */
	--color-grey-dark: #808080;        /* Grey, Dark */
	--color-grey-surface: #F5F5F5;     /* FAQ / support card bg */
	--color-text: #000000;             /* text/primary */
	--color-text-dark: #333333;        /* text/dark */
	--color-text-medium: #464646;      /* text/medium */
	--color-text-body: #565555;        /* Text/Medium — default paragraph colour */
	--color-green-light: #498B65;      /* Text/Green Light */
	--color-hero-tint: #F3F7F4;

	/* Semantic aliases used across the theme */
	--color-secondary: var(--color-primary-dark);
	--color-accent: var(--color-blue);
	--color-accent-dark: var(--color-blue-dark);
	--color-cta-blue: var(--color-blue-dark);
	--color-background: var(--color-white);
	--color-surface: var(--color-white);
	--color-surface-alt: var(--color-grey-surface);
	--color-surface-dark: var(--color-primary-dark);
	--color-border: var(--color-blue-50);        /* 2px card borders */
	--color-border-input: var(--color-blue-100); /* 1px control borders */
	--color-separator: var(--color-grey-light);  /* 1.5px dividers */
	--color-text-muted: var(--color-text-body);
	--color-text-inverse: var(--color-white);
	--color-text-heading: var(--color-text);
	--color-success: var(--color-primary);
	--color-error: #c62828;

	/* ---- Typography ---- */
	--font-primary: proxima-nova, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--font-secondary: utopia-std, Georgia, 'Times New Roman', serif;
	--font-footer: 'Montserrat', proxima-nova, system-ui, sans-serif;

	/* Type scale — high-fi mobile values. Desktop overrides below. */
	--font-size-h1: 2.5rem;      --line-height-h1: 1;           /* 40 / 100% Utopia Std Italic */
	--font-size-h2: 1.4375rem;   --line-height-h2: 1.625rem;    /* 23 / 26 Proxima Medium */
	--font-size-h3: 1.25rem;     --line-height-h3: 1;           /* 20 / 100% Utopia Std Bold Italic */
	--font-size-h4: 1rem;        --line-height-h4: 1.25rem;     /* 16 / 20 Proxima Bold */
	--font-size-h5: 0.9375rem;   --line-height-h5: 0.9375rem;   /* 15 / 15 Proxima Bold caps, 5% tracking */
	--font-size-h6: 0.875rem;    --line-height-h6: 0.875rem;    /* 14 / 14 Proxima Bold */
	--font-size-intro: 1.125rem; --line-height-intro: 1.5rem;   /* 18 / 24 */
	--font-size-base: 1rem;      --line-height-base: 1.375rem;  /* 16 / 22 */
	--font-size-xs: 0.875rem;    --line-height-xs: 1rem;        /* 14 / 16 Disclosure */
	--font-size-2xs: 0.75rem;    --line-height-2xs: 1rem;       /* 12 / 16 */
	--font-size-sm: var(--font-size-xs);
	--tracking-caps: 0.05em;                                     /* Figma letterSpacing 5% */

	--color-h1: var(--color-primary-dark);
	--color-h2: var(--color-text);
	--color-h3: var(--color-text);
	--color-h4: var(--color-primary-dark);
	--color-h5: var(--color-text-medium);
	--color-h6: var(--color-green-light);
	--color-intro: var(--color-text-body);
	--color-disclosure: var(--color-text-dark);

	--font-weight-light: 300;
	--font-weight-normal: 400;
	--font-weight-medium: 500;
	--font-weight-semibold: 600;
	--font-weight-bold: 700;
	--font-weight-extrabold: 800;
	--font-weight-black: 900;

	/* ---- Spacing ---- */
	--space-xs: 0.25rem;   /* 4px */
	--space-sm: 0.5rem;    /* 8px */
	--space-md: 1rem;      /* 16px */
	--space-lg: 1.5rem;    /* 24px */
	--space-xl: 2.25rem;   /* 36px — desktop card padding */
	--space-2xl: 3rem;     /* 48px */
	--space-3xl: 5rem;     /* 80px — desktop section gap */
	--section-gap: 1.5rem; /* mobile section gap (Figma 24) */
	--card-pad: 1.5rem;                 /* mobile 24 */
	--card-pad-bottom: 2.25rem;         /* mobile 36 */

	/* ---- Layout ---- */
	--container-max: 1312px;   /* Figma desktop content width */
	--container-narrow: 855px; /* Figma wide single card */
	--gutter: 14px;            /* Figma mobile gutter */
	--header-height: 60px;
	--header-offset: 30px;     /* Figma: nav sits 30px from top on mobile */
	--sticky-nav-height: 86px;

	/* ---- Effects ---- */
	--radius-sm: 4px;
	--radius-button: 6px;
	--radius-md: 8px;      /* cards, nav, controls */
	--radius-lg: 12px;     /* sticky nav top corners */
	--radius-pill: 40px;
	--shadow-nav: 0 0 8px rgba(0, 0, 0, 0.1);
	--shadow-dropdown: 0 0 4px rgba(0, 0, 0, 0.1);
	--shadow-drawer: 0 0 36px rgba(0, 0, 0, 0.1);
	--shadow-control: 0 1px 1px rgba(15, 23, 42, 0.02);
	--shadow-sm: var(--shadow-control);
	--shadow-md: var(--shadow-nav);
	--transition-fast: 150ms ease;
	--transition-base: 250ms ease;
}

@media (min-width: 1024px) {
	:root {
		/* Type Scale, Desktop (Figma variables "…, Desktop") */
		--font-size-h1: 2.5rem;     --line-height-h1: 1;          /* 40 / 100% — interior heroes; homepage hero uses 60 via .hero--home */
		--font-size-h2: 1.875rem;   --line-height-h2: 2rem;       /* 30 / 32 */
		--font-size-h3: 1.5rem;     --line-height-h3: 1;          /* 24 / 100% */
		--font-size-h4: 1.125rem;   --line-height-h4: 1.375rem;   /* 18 / 22 */
		--font-size-h5: 1.0625rem;  --line-height-h5: 1.3125rem;  /* 17 / 21 */
		--font-size-h6: 1rem;       --line-height-h6: 1.25rem;    /* 16 / 20 */
		--section-gap: 5rem;        /* 80 */
		--card-pad: 2.25rem;        /* 36 */
		--card-pad-bottom: 3rem;    /* 48 */
		--gutter: clamp(40px, calc((100vw - 1312px) / 2), 100px); /* Figma: 100 at 1512+; shrinks with viewport below */
		--header-height: 84px;   /* flush desktop bar: 24 top + 48 logo + 12 bottom */
		--header-offset: 0px;    /* header is flush to top now — unit required for calc() */
	}
}

/*
 * Breakpoint reference (CSS variables can't be used in media queries):
 *   sm: 640px | md: 768px | lg: 1024px | xl: 1280px
 * Always write mobile-first: base styles, then min-width overrides.
 */
