/* ClimaPlus Design System v1.0.0 — single token source of truth */
:root {
  /* Brand and product ranges */
  --color-primary: #a71738;
  --color-primary-hover: #86122d;
  --color-primary-active: #701026;
  --color-primary-soft: rgba(167, 23, 56, .10);
  --color-primary-border: rgba(167, 23, 56, .24);
  --color-primary-rgb: 167, 23, 56;
  --color-navy: #0f1b2d;
  --color-navy-secondary: #1e3a5f;
  --color-navy-elevated: #1a2b4a;
  --color-range-basic: #a71738;
  --color-range-basic-soft: rgba(167, 23, 56, .10);
  --color-range-inverter: #3b65e0;
  --color-range-inverter-hover: #2f51b8;
  --color-range-inverter-active: #284595;
  --color-range-inverter-soft: rgba(59, 101, 224, .10);
  --color-range-inverter-border: rgba(59, 101, 224, .24);
  --color-range-inverter-rgb: 59, 101, 224;

  /* Surfaces */
  --color-white: #fff;
  --color-canvas: #fff;
  --color-surface-soft: #f5f7fa;
  --color-surface: #f5f5fc;
  --color-surface-strong: #edeff4;
  --color-surface-dark: #0f1b2d;
  --color-surface-dark-elevated: #1a2b4a;

  /* Text and hairlines */
  --color-text: #0f1b2d;
  --color-text-body: #526176;
  --color-text-muted: #68788e;
  --color-text-subtle: #8c98aa;
  --color-text-on-dark: #fff;
  --color-text-on-dark-muted: rgba(255, 255, 255, .68);
  --color-border: rgba(15, 27, 45, .12);
  --color-border-soft: rgba(15, 27, 45, .07);
  --color-border-on-dark: rgba(255, 255, 255, .14);

  /* Semantic */
  --color-success: #168a55;
  --color-success-soft: #e8f6ef;
  --color-warning: #b36b00;
  --color-warning-soft: #fff5df;
  --color-error: #b00020;
  --color-error-soft: #fff0f3;
  --color-focus: #ffbf47;

  /* Overlays */
  --overlay-nav: rgba(10, 16, 28, .64);
  --overlay-nav-strong: rgba(10, 16, 28, .88);
  --overlay-image-soft: rgba(10, 16, 28, .28);
  --overlay-image-strong: rgba(10, 16, 28, .68);

  /* Typography */
  --font-family-primary: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  /* Fluid from ~34px at 375px up to 76px at >=1267px (desktop cap unchanged). */
  --type-display-hero-size: clamp(2.125rem, 1rem + 4.7vw, 4.75rem);
  --type-display-page-size: clamp(2.375rem, 4.6vw, 3.75rem);
  --type-heading-xl-size: clamp(2.125rem, 3.6vw, 3rem);
  --type-heading-lg-size: clamp(1.875rem, 3vw, 2.375rem);
  --type-heading-md-size: clamp(1.625rem, 2.6vw, 2rem);
  --type-heading-sm-size: clamp(1.25rem, 2vw, 1.375rem);
  --type-body-lg-size: clamp(1.0625rem, 1.4vw, 1.125rem);
  --type-body-md-size: 1rem;
  --type-body-sm-size: .875rem;
  --type-caption-size: clamp(.75rem, 1vw, .8125rem);
  --type-eyebrow-size: clamp(.6875rem, .9vw, .75rem);
  --type-button-size: clamp(.875rem, 1.1vw, .9375rem);
  --type-nav-size: clamp(.8125rem, 1vw, .875rem);
  --type-technical-label-size: clamp(.6875rem, .9vw, .75rem);
  --type-technical-value-size: clamp(3.5rem, 7vw, 6rem);
  --type-technical-unit-size: clamp(.8125rem, 1.4vw, 1.125rem);
  --leading-display: .98;
  --leading-heading: 1.1;
  --leading-body: 1.6;
  --leading-compact: 1.3;
  --tracking-display: -.04em;
  --tracking-heading: -.03em;
  --tracking-eyebrow: .14em;

  /* 4px spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-14: 56px;
  --space-16: 64px;
  --space-18: 72px;
  --space-20: 80px;
  --space-24: 80px;
  --space-30: 96px;

  /* Layout */
  --container-main: 1200px;
  --container-wide: 1320px;
  --container-reading: 680px;
  --container-reading-wide: 720px;
  --page-gutter: 24px;
  --page-gutter-mobile: 16px;
  --page-gutter-mobile-wide: 20px;
  --grid-gap-desktop: 24px;
  --grid-gap-tablet: 20px;
  --grid-gap-mobile: 16px;
  --section-space-standard: 80px;
  --section-space-compact: 64px;
  --section-space-mobile: 48px;
  --section-space-mobile-compact: 40px;
  --hero-space-desktop: 120px;
  --hero-space-tablet: 80px;
  --hero-space-mobile: 64px;

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-2xl: 28px;
  --radius-pill: 999px;
  --radius-circle: 50%;

  /* Borders and elevation */
  --border-default: 1px solid var(--color-border);
  --border-subtle: 1px solid var(--color-border-soft);
  --shadow-none: none;
  --shadow-soft: 0 10px 32px rgba(15, 27, 45, .07);
  --shadow-card: 0 16px 48px rgba(15, 27, 45, .11);
  --shadow-elevated: 0 24px 72px rgba(15, 27, 45, .16);
  --shadow-dark: 0 20px 56px rgba(0, 0, 0, .36);

  /* Controls */
  --control-height-sm: 44px;
  --control-height-md: 48px;
  --control-height-lg: 56px;
  --control-padding-inline: 24px;
  --control-padding-inline-lg: 32px;
  --icon-size-sm: 18px;
  --icon-size-md: 20px;
  --card-padding-sm: 20px;
  --card-padding-md: 24px;
  --card-padding-lg: 32px;

  /* Motion */
  --duration-fast: 180ms;
  --duration-base: 280ms;
  --duration-slow: 600ms;
  --duration-hero: 800ms;
  --duration-carousel: 680ms;
  --ease-standard: cubic-bezier(.2, .8, .2, 1);
  --ease-premium: cubic-bezier(.16, 1, .3, 1);

  /* Documented breakpoint values (reference only; use matching literals in media queries) */
  --breakpoint-xs: 360px;
  --breakpoint-sm: 480px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 960px;
  --breakpoint-xl: 1200px;
  --breakpoint-2xl: 1440px;

  /* Migration aliases — do not create new usages */
  --red: var(--color-primary);
  --red-dark: var(--color-primary-hover);
  --red-light: var(--color-primary-soft);
  --dark: var(--color-navy);
  --dark-2: var(--color-navy-elevated);
  --navy: var(--color-navy-secondary);
  --text: var(--color-text);
  --muted: var(--color-text-muted);
  --bg: var(--color-surface);
  --surface: var(--color-surface-soft);
  --white: var(--color-white);
  --border: var(--color-border);
  --line: var(--color-border);
  --focus: var(--color-focus);
}

@media (max-width: 1199px) {
  :root {
    --section-space-standard: 64px;
    --section-space-compact: 52px;
    --grid-gap-desktop: 20px;
  }
}

@media (max-width: 767px) {
  :root {
    --page-gutter: var(--page-gutter-mobile-wide);
    --section-space-standard: var(--section-space-mobile);
    --section-space-compact: var(--section-space-mobile-compact);
    --grid-gap-desktop: var(--grid-gap-mobile);
    --card-padding-lg: 24px;
  }
}

@media (max-width: 390px) {
  :root { --page-gutter: var(--page-gutter-mobile); }
}
