/* =====================================================================
   Design tokens
   =====================================================================
   Breakpoints are repeated literally inside media queries because custom
   properties cannot be used there. Keep these in sync:
     sm  576px   md  768px   lg  992px   xl 1200px
   The mobile navigation switches at 992px,
   most content layouts switch at 768px. */

:root {
  color-scheme: light;

  /* Brand */
  --color-primary: #149dcc;
  --color-primary-dark: #0d6786;
  --color-primary-darker: #0b566f;
  --color-accent: #0f7699;

  /* Text */
  --color-text: #232323;
  /* Nudged one step darker than the original #767676 so it clears WCAG AA
     (4.5:1) on white, #efefef and #f9f9f9 alike. */
  --color-text-muted: #6c6c6c;
  --color-text-strong: #000000;
  --color-text-inverse: #ffffff;

  /* Surfaces */
  --color-surface: #ffffff;
  --color-surface-muted: #efefef;
  --color-surface-subtle: #f9f9f9;
  --color-surface-header: rgba(0, 0, 0, 0.03);
  --color-border: #dfdfdf;

  /* Interactive chrome */
  --color-control: #1b1b1b;
  --color-control-solid: #000000;
  --color-nav-hover: #c1c1c1;
  --color-scrim: rgba(80, 80, 80, 0.5);
  --color-scrim-soft: rgba(0, 0, 0, 0.1);
  --color-backdrop: rgba(0, 0, 0, 0.8);
  /* Hero fallback while the photo loads: must stay dark behind white text. */
  --color-hero-fallback: #232323;
  --gradient-tile: linear-gradient(to left, #554346, #45505b);

  /* Family-specific: dimming layer between the hero video and its text. */
  --color-hero-overlay: rgba(118, 118, 118, 0.7);

  /* Typography */
  --font-family-base: "Rubik", "Rubik Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Fluid sizes below 768px, fixed above, mirroring the original scale:
     hero 4.25rem, title 3rem, subtitle 1.5rem, base 1rem. */
  --font-size-hero: clamp(2.1375rem, 0.6286rem + 7.5446vw, 4.25rem);
  --font-size-title: clamp(1.7rem, 0.7714rem + 4.6429vw, 3rem);
  --font-size-subtitle: clamp(1.175rem, 0.9429rem + 1.1607vw, 1.5rem);
  --font-size-base: 1rem;
  --font-size-footer-heading: 1.25rem;
  --font-size-quote: 1.09rem;
  --font-size-fineprint: 0.8125rem;

  --line-height-title: 1.2;
  --line-height-subtitle: 1.3;
  --line-height-base: 1.5;
  --line-height-text: 1.6;

  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  --letter-spacing-button: 1px;

  /* Spacing */
  --space-2xs: 0.5rem;
  --space-xs: 0.8rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 2.5rem;
  --space-xl: 3rem;
  --space-2xl: 5rem;

  --section-padding-sm: 30px;
  --section-padding-md: 60px;
  --section-padding-lg: 75px;
  --section-padding-xl: 120px;

  /* Layout */
  --container-max: 1140px;
  --container-gutter: 15px;
  --narrow-width: 66.6667%;
  --navbar-height: 80px;

  /* Decoration */
  --radius-pill: 100px;
  --radius-circle: 50%;
  --border-button: 2px;
  --shadow-button: 0 10px 40px 0 rgba(0, 0, 0, 0.2);
  --shadow-card: 0 7px 20px 0 rgba(0, 0, 0, 0.08);

  /* Motion */
  --duration-fast: 0.2s;
  --duration-base: 0.3s;
  --duration-slow: 0.4s;
  --easing: ease-in-out;

  /* Stacking */
  --z-navbar: 1030;
  --z-menu-backdrop: 1020;
  --z-consent: 1040;
}

/* =====================================================================
   Dark theme
   ===================================================================== */

/* Applied by the inline head script (system preference or stored choice)
   and toggled manually via the navbar button; only color tokens change. */
[data-theme="dark"] {
  color-scheme: dark;

  /* Text */
  --color-text: #d8d8d8;
  --color-text-muted: #a3a3a3;
  --color-text-strong: #ffffff;

  /* Surfaces */
  --color-surface: #121212;
  --color-surface-muted: #1d1d1d;
  --color-surface-subtle: #181818;
  --color-surface-header: rgba(255, 255, 255, 0.06);
  --color-border: #3a3a3a;

  /* Interactive chrome */
  --color-control: #e2e2e2;
  --color-control-solid: #ffffff;
  --color-nav-hover: #4a4a4a;
  --color-scrim: rgba(0, 0, 0, 0.6);
  --color-scrim-soft: rgba(0, 0, 0, 0.4);
  --color-backdrop: rgba(0, 0, 0, 0.85);

  --shadow-button: 0 10px 40px 0 rgba(0, 0, 0, 0.6);
  --shadow-card: 0 7px 20px 0 rgba(0, 0, 0, 0.4);
}
