/* PULSE design tokens. Owner: @pingalaeu/pulse-foundation (src/host/shell/assets/tokens.css).
 * Served as /_pulse/tokens.css by every foundation host and exported as
 * @pingalaeu/pulse-foundation/tokens.css. Vendored copies are generated with
 * scripts/sync-tokens.mjs; never edit a copy.
 *
 * Theme: data-theme on <html>, values auto | light | dark (localStorage key
 * 'pulse-theme'). Light is the default; auto (or no attribute) follows
 * prefers-color-scheme. Dark is neutral graphite; brand green is an accent only.
 * Contrast: every text pair >= 4.5:1, UI borders (border-strong, focus) >= 3:1 on bg and surface
 * (tests/host/shell/tokens.test.ts).
 */
/* DM Sans, self-hosted by every foundation host (OFL 1.1, /_pulse/fonts/; no third-party font call).
 * Latin subset covers æ, ø, å. One variable file for weights 100-1000. */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('/_pulse/fonts/dm-sans-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;

  /* Typography */
  --pulse-font-sans: 'DM Sans', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --pulse-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --pulse-text-xs: 0.75rem;
  --pulse-text-sm: 0.8125rem;
  --pulse-text-base: 0.9375rem;
  --pulse-text-md: 1rem;
  --pulse-text-lg: 1.125rem;
  --pulse-text-xl: 1.35rem;
  --pulse-text-2xl: 1.75rem;
  --pulse-text-3xl: 2.25rem;

  /* Radius and spacing */
  --pulse-radius-xs: 4px;
  --pulse-radius-sm: 6px;
  --pulse-radius: 10px;
  --pulse-radius-lg: 14px;
  --pulse-radius-xl: 20px;
  --pulse-radius-full: 9999px;
  --pulse-space-1: 0.25rem;
  --pulse-space-2: 0.5rem;
  --pulse-space-3: 0.75rem;
  --pulse-space-4: 1rem;
  --pulse-space-5: 1.5rem;
  --pulse-space-6: 2rem;
  --pulse-space-7: 3rem;
  --pulse-space-8: 4rem;

  /* Shell: modules put sticky/fixed elements at top: var(--pulse-shell-h) */
  --pulse-shell-h: 56px;
  --pulse-nav-h: var(--pulse-shell-h);

  /* Brand (same in both themes) */
  --pulse-brand: #006338;
  --pulse-on-brand: #ffffff;
  --pulse-green-50: #eaf4ed;
  --pulse-green-100: #c7e3ce;
  --pulse-green-200: #9dcfaa;
  --pulse-green-300: #6db984;
  --pulse-green-400: #3fa564;
  --pulse-green-500: #1d8f4b;
  --pulse-green-600: #006338;
  --pulse-green-700: #005230;
  --pulse-green-800: #003f24;
  --pulse-green-900: #002c19;
  --pulse-green-950: #001a0f;

  /* System accents (pulse-architecture) */
  --sys-d365fo: #2b5797;
  --sys-d365fo-hover: #3668ab;
  --sys-d365ce: #5b6abf;
  --sys-d365ce-hover: #6d7bd0;
  --sys-power: #7b2d8e;
  --sys-power-hover: #8f3da3;
  --sys-azure: #0078d4;
  --sys-azure-hover: #1a8ae6;
  --sys-fabric: #1b7d62;
  --sys-fabric-hover: #239b7a;
  --sys-external: #8c4a2f;
  --sys-external-hover: #a25a3c;
  --sys-custom: #2d5f6b;
  --sys-custom-hover: #3a7a89;
  --sys-infra: #475569;
  --sys-infra-hover: #5a6b7e;
  --sys-config: #5c6d3f;
  --sys-config-hover: #6f8250;
  --sys-isv: #8b6914;
  --sys-isv-hover: #a37e1e;
  --sys-pingala: #006338;
  --sys-pingala-hover: #1d8f4b;

  /* Semantic colours: LIGHT */
  --pulse-bg: #f6f7f9;
  --pulse-surface: #ffffff;
  --pulse-surface-2: #eef1f4;
  --pulse-surface-elev: #ffffff;
  --pulse-border: #d5dbe1;
  --pulse-border-strong: #838f9c;

  --pulse-text: #16202a;
  --pulse-text-muted: #4a5868;
  --pulse-text-subtle: #5f6b78;

  --pulse-primary: #006338;
  --pulse-primary-hover: #004d2b;
  --pulse-on-primary: #ffffff;
  --pulse-primary-soft: #e3f1e8;
  --pulse-primary-text: #00502d;
  --pulse-focus: #006338;

  --pulse-info: #1f5fae;
  --pulse-success: #1a7f43;
  --pulse-warn: #8a5300;
  --pulse-danger: #b42318;
  --pulse-error: #b42318;
  --pulse-info-soft: #e6eefa;
  --pulse-success-soft: #eef8f1;
  --pulse-warn-soft: #fbf0dc;
  --pulse-danger-soft: #fde8e6;
  --pulse-error-soft: #fde8e6;

  --pulse-score-1: #e3f1e8; --pulse-score-1-text: #16202a;
  --pulse-score-2: #bfe0cb; --pulse-score-2-text: #16202a;
  --pulse-score-3: #7cc39a; --pulse-score-3-text: #0b1a12;
  --pulse-score-4: #24764b; --pulse-score-4-text: #ffffff;
  --pulse-score-5: #006338; --pulse-score-5-text: #ffffff;

  --pulse-shadow-sm: 0 1px 2px rgb(16 24 32 / 4%);
  --pulse-shadow: 0 1px 2px rgb(16 24 32 / 6%), 0 2px 8px rgb(16 24 32 / 6%);
  --pulse-shadow-md: 0 4px 6px -1px rgb(16 24 32 / 7%), 0 2px 4px -2px rgb(16 24 32 / 5%);
  --pulse-shadow-lg: 0 10px 15px -3px rgb(16 24 32 / 8%), 0 4px 6px -4px rgb(16 24 32 / 5%);

  /* C4 tag palette (pulse-diagrams src/renderers/c4-theme.ts), unchanged from the vendored copies */
  --pulse-c4-pulse-surface: #e2f3e7;
  --pulse-c4-pulse-border: #5a9e73;
  --pulse-c4-pulse-border-strong: #006338;
  --pulse-c4-psi-surface: #e3edf9;
  --pulse-c4-psi-border: #7a9cc6;
  --pulse-c4-psi-border-strong: #2f5e9e;
  --pulse-c4-shared-surface: #ece6f7;
  --pulse-c4-shared-border: #a690d1;
  --pulse-c4-shared-border-strong: #6a4bb0;
  --pulse-c4-external-surface: #f1f3f4;
  --pulse-c4-external-border: #9aa3a9;
  --pulse-c4-external-border-strong: #6b747a;
  --pulse-c4-retiring-surface: #fff2d6;
  --pulse-c4-retiring-border: #d9a441;
}

/* DARK, explicit */
:root[data-theme="dark"] {
  color-scheme: dark;
  --pulse-bg: #111418;
  --pulse-surface: #181c21;
  --pulse-surface-2: #1f242a;
  --pulse-surface-elev: #262c33;
  --pulse-border: #2e353d;
  --pulse-border-strong: #6b7682;
  --pulse-text: #e6e9ed;
  --pulse-text-muted: #a9b2bc;
  --pulse-text-subtle: #8d97a2;
  --pulse-primary: #3fae72;
  --pulse-primary-hover: #5cc08a;
  --pulse-on-primary: #0b1a12;
  --pulse-primary-soft: #1a2e23;
  --pulse-primary-text: #7fd3a3;
  --pulse-focus: #7fd3a3;
  --pulse-info: #7fb2f0;
  --pulse-success: #5cc98a;
  --pulse-warn: #e0a84a;
  --pulse-danger: #f08a7e;
  --pulse-error: #f08a7e;
  --pulse-info-soft: #1b2635;
  --pulse-success-soft: #17291f;
  --pulse-warn-soft: #2d2617;
  --pulse-danger-soft: #331c1a;
  --pulse-error-soft: #331c1a;
  --pulse-score-1: #1f2a24; --pulse-score-1-text: #e6e9ed;
  --pulse-score-2: #1f4431; --pulse-score-2-text: #e6e9ed;
  --pulse-score-3: #2c6b4a; --pulse-score-3-text: #ffffff;
  --pulse-score-4: #3fae72; --pulse-score-4-text: #0b1a12;
  --pulse-score-5: #7fd3a3; --pulse-score-5-text: #0b1a12;
  --pulse-shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
  --pulse-shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 4px 12px rgb(0 0 0 / 30%);
  --pulse-shadow-md: 0 4px 8px rgb(0 0 0 / 40%);
  --pulse-shadow-lg: 0 10px 24px rgb(0 0 0 / 45%);
  --pulse-c4-pulse-surface: #16301f;
  --pulse-c4-pulse-border: #3f7d56;
  --pulse-c4-pulse-border-strong: #7fc99a;
  --pulse-c4-psi-surface: #1b2b42;
  --pulse-c4-psi-border: #4f78ad;
  --pulse-c4-psi-border-strong: #8fb4ea;
  --pulse-c4-shared-surface: #2b2243;
  --pulse-c4-shared-border: #7a62ad;
  --pulse-c4-shared-border-strong: #bba6ee;
  --pulse-c4-external-surface: #252a2d;
  --pulse-c4-external-border: #566066;
  --pulse-c4-external-border-strong: #a0a9af;
  --pulse-c4-retiring-surface: #3f3315;
  --pulse-c4-retiring-border: #b58824;
}

/* DARK, auto: identical to the block above (tested) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --pulse-bg: #111418;
    --pulse-surface: #181c21;
    --pulse-surface-2: #1f242a;
    --pulse-surface-elev: #262c33;
    --pulse-border: #2e353d;
    --pulse-border-strong: #6b7682;
    --pulse-text: #e6e9ed;
    --pulse-text-muted: #a9b2bc;
    --pulse-text-subtle: #8d97a2;
    --pulse-primary: #3fae72;
    --pulse-primary-hover: #5cc08a;
    --pulse-on-primary: #0b1a12;
    --pulse-primary-soft: #1a2e23;
    --pulse-primary-text: #7fd3a3;
    --pulse-focus: #7fd3a3;
    --pulse-info: #7fb2f0;
    --pulse-success: #5cc98a;
    --pulse-warn: #e0a84a;
    --pulse-danger: #f08a7e;
    --pulse-error: #f08a7e;
    --pulse-info-soft: #1b2635;
    --pulse-success-soft: #17291f;
    --pulse-warn-soft: #2d2617;
    --pulse-danger-soft: #331c1a;
    --pulse-error-soft: #331c1a;
    --pulse-score-1: #1f2a24; --pulse-score-1-text: #e6e9ed;
    --pulse-score-2: #1f4431; --pulse-score-2-text: #e6e9ed;
    --pulse-score-3: #2c6b4a; --pulse-score-3-text: #ffffff;
    --pulse-score-4: #3fae72; --pulse-score-4-text: #0b1a12;
    --pulse-score-5: #7fd3a3; --pulse-score-5-text: #0b1a12;
    --pulse-shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
    --pulse-shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 4px 12px rgb(0 0 0 / 30%);
    --pulse-shadow-md: 0 4px 8px rgb(0 0 0 / 40%);
    --pulse-shadow-lg: 0 10px 24px rgb(0 0 0 / 45%);
    --pulse-c4-pulse-surface: #16301f;
    --pulse-c4-pulse-border: #3f7d56;
    --pulse-c4-pulse-border-strong: #7fc99a;
    --pulse-c4-psi-surface: #1b2b42;
    --pulse-c4-psi-border: #4f78ad;
    --pulse-c4-psi-border-strong: #8fb4ea;
    --pulse-c4-shared-surface: #2b2243;
    --pulse-c4-shared-border: #7a62ad;
    --pulse-c4-shared-border-strong: #bba6ee;
    --pulse-c4-external-surface: #252a2d;
    --pulse-c4-external-border: #566066;
    --pulse-c4-external-border-strong: #a0a9af;
    --pulse-c4-retiring-surface: #3f3315;
    --pulse-c4-retiring-border: #b58824;
  }
}
