/* Bello, Bello & Associates design tokens
   ------------------------------------------------------------------
   Theme architecture
   - Light is the default (:root and html.theme-light).
   - Dark applies automatically when the visitor's device prefers it,
     unless the page opts out with html.theme-light or data-theme="light".
   - html.theme-dark (or data-theme="dark") forces dark.
   - A new theme is a new class, e.g. html.theme-print { ... }, that
     redefines only the tokens it changes. No component CSS changes.
   No JavaScript is needed to render the correct theme.

   Naming
   - Tokens describe purpose, never a hue: --color-text-secondary,
     not --gray-500. "Brand" tokens are the navy title-block surfaces
     (header, page heroes, bands, footer) that stay dark in every theme;
     "on-brand" tokens are the text and lines drawn on them.
   ------------------------------------------------------------------ */

:root,
html.theme-light {
  color-scheme: light;

  /* Page surfaces and text */
  --color-background: #FFFFFF;
  --color-surface: #F2F4F7;
  --color-surface-elevated: #E7EBF1;
  --color-paper: #FFFFFF;                 /* scanned documents, drawings; white in every theme */
  --color-border: #D3D9E2;                /* decorative hairlines */
  --color-border-control: #7A889D;        /* inputs, toggles, chips you click: 3:1 against the page */
  --color-text-primary: #16202F;
  --color-text-secondary: #56637A;
  --color-link: #145F7D;
  --color-accent: #8B0000;                /* eyebrows, sheet numbers, small emphasis */
  --color-focus: #145F7D;
  --color-chip-background: #E9EEF4;
  --color-chip-text: #1B2A41;

  /* Actions */
  --color-action: #8B0000;
  --color-action-hover: #6E0000;
  --color-on-action: #FFFFFF;
  --color-action-secondary: #1B2A41;      /* store buttons */

  /* Status */
  --color-success: #1E6B45;
  --color-success-surface: #E3F1E9;
  --color-warning: #8A5A00;
  --color-warning-surface: #FBF0DA;
  --color-danger: #8B0000;
  --color-danger-surface: #F6E3E3;

  /* Brand surfaces (stay navy in every theme) */
  --color-brand: #1B2A41;
  --color-brand-deep: #121D2E;
  --color-brand-darkest: #0A111B;
  --color-brand-glow: #24406A;
  --color-brand-secondary: #145F7D;       /* harbor blue: icons, checklist marks */
  --color-brand-rule: #8B0000;            /* the red rule under the header */
  --color-brand-highlight: #C0C0C0;       /* current-page marker */
  --color-band: #1B2A41;
  --color-on-brand: #FFFFFF;
  --color-on-brand-secondary: #DCE3EE;
  --color-on-brand-muted: #AEBACB;
  --color-on-brand-subtle: #93A3B9;
  --color-on-brand-accent: #E8A3A3;
  --color-on-brand-border: rgba(255, 255, 255, .16);
  --color-on-brand-border-strong: rgba(255, 255, 255, .4);
  --color-on-brand-hover: rgba(255, 255, 255, .08);
  --color-focus-on-brand: #F2B8B8;
  --color-scrim: rgba(10, 17, 27, .55);
  --color-scrim-strong: rgba(10, 17, 27, .9);

  /* Typography */
  --font-display: "Montserrat", "Segoe UI", Arial, sans-serif;
  --font-body: "Open Sans", "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
  --font-size-3xs: .66rem;
  --font-size-2xs: .7rem;
  --font-size-xs: .76rem;
  --font-size-sm: .84rem;
  --font-size-md: .92rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.1rem;
  --font-size-xl: 1.2rem;
  --font-size-2xl: 1.3rem;
  --font-size-display-1: clamp(2.1rem, 4.6vw, 3.6rem);
  --font-size-display-2: clamp(1.6rem, 3vw, 2.35rem);
  --line-height-tight: 1.15;
  --line-height-snug: 1.3;
  --line-height-body: 1.65;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-heavy: 800;

  /* Spacing: 4-point scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-14: 56px;
  --space-16: 64px;
  --space-20: 80px;

  /* Radius: square-cornered drawing-set look */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;

  /* Elevation */
  --shadow-sm: 0 2px 14px rgba(0, 0, 0, .18);
  --shadow-md: 0 12px 26px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, .28);
  --shadow-xl: 0 24px 48px rgba(16, 26, 44, .35), 0 3px 8px rgba(16, 26, 44, .25);

  /* Layout */
  --layout-max-width: 1180px;
  --gutter-left: max(16px, env(safe-area-inset-left, 0px));
  --gutter-right: max(16px, env(safe-area-inset-right, 0px));
  --header-offset: 96px;                  /* sticky header height, for anchor jumps */
}

/* Dark: values shared by the automatic and forced variants */
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light):not([data-theme="light"]) {
    color-scheme: dark;
    --color-background: #0D1520;
    --color-surface: #131E2D;
    --color-surface-elevated: #1A2739;
    --color-border: #26364C;
    --color-border-control: #5F7390;
    --color-text-primary: #E5EAF1;
    --color-text-secondary: #9BA9BD;
    --color-link: #7DC0DD;
    --color-accent: #E07070;
    --color-focus: #7DC0DD;
    --color-chip-background: #1C2B40;
    --color-chip-text: #D8E1EC;
    --color-action-secondary: #2A4268;
    --color-success: #7FD0A4;
    --color-success-surface: #15301F;
    --color-warning: #F0C674;
    --color-warning-surface: #33270F;
    --color-danger: #F09A9A;
    --color-danger-surface: #3A1717;
    --color-band: #0A111B;
  }
}
html.theme-dark,
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-background: #0D1520;
  --color-surface: #131E2D;
  --color-surface-elevated: #1A2739;
  --color-border: #26364C;
  --color-border-control: #5F7390;
  --color-text-primary: #E5EAF1;
  --color-text-secondary: #9BA9BD;
  --color-link: #7DC0DD;
  --color-accent: #E07070;
  --color-focus: #7DC0DD;
  --color-chip-background: #1C2B40;
  --color-chip-text: #D8E1EC;
  --color-action-secondary: #2A4268;
  --color-success: #7FD0A4;
  --color-success-surface: #15301F;
  --color-warning: #F0C674;
  --color-warning-surface: #33270F;
  --color-danger: #F09A9A;
  --color-danger-surface: #3A1717;
  --color-band: #0A111B;
}
