/* Norman AI design tokens v0.2 (2026-11-23)
 * Brand aligned with the Norman marketing site (site-preview/dist/style.css).
 * Source of truth: tokens.json (DTCG). Keep both files in sync.
 *
 * Theme: follows the OS by default. Force one with <html data-theme="light|dark">.
 * Exports (PDF reports, audit packs) always use the light theme.
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;650;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ---- Primitives: pine (brand green) ---- */
  --pine-50: #F1F6F3;
  --pine-100: #E3EDE7;
  --pine-200: #C2D4C9;
  --pine-300: #8FB3A4;
  --pine-400: #5E927F;
  --pine-500: #3B8571;
  --pine-600: #2F7563;
  --pine-700: #235B50;
  --pine-800: #113E39; /* brand */
  --pine-900: #0A2925;

  /* ---- Primitives: lime (Norman's voice) ---- */
  --lime-50: #F8FDEC;
  --lime-100: #EEF9D3;
  --lime-200: #E2F6B1;
  --lime-300: #D3F587; /* brand */
  --lime-400: #BCE061;
  --lime-500: #9FC444;
  --lime-600: #87A957;
  --lime-700: #577C39;
  --lime-800: #3E5A26;
  --lime-900: #2A3D19;

  /* ---- Primitives: sage (neutrals) ---- */
  --sage-0: #FFFFFF;
  --sage-25: #F7FAF8;
  --sage-50: #F1F6F3;
  --sage-100: #D9E3DE;
  --sage-200: #B7C8C1;
  --sage-400: #87978F;
  --sage-500: #5C706C;
  --sage-700: #2F4A45;
  --sage-800: #213F3B;
  --sage-900: #143B36;

  /* ---- Typography ---- */
  --font-display: 'Manrope', Arial, sans-serif;
  --font-body: 'DM Sans', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace; /* records only */

  --type-display: 600 56px/62px var(--font-display);
  --type-h1: 600 36px/44px var(--font-display);
  --type-h2: 600 26px/34px var(--font-display);
  --type-h3: 650 18px/26px var(--font-display);
  --type-body-l: 400 17px/28px var(--font-body);
  --type-body: 400 15px/24px var(--font-body);
  --type-small: 400 13px/20px var(--font-body);
  --type-label: 700 12px/16px var(--font-body); /* uppercase, 0.12em */
  --type-mono: 500 13px/20px var(--font-mono);
  --tracking-display: -0.045em;
  --tracking-h1: -0.035em;
  --tracking-h2: -0.03em;
  --tracking-h3: -0.02em;
  --tracking-label: 0.12em;

  /* ---- Shape and space ---- */
  --radius-xs: 4px;
  --radius-sm: 7px;   /* buttons, inputs */
  --radius-md: 10px;
  --radius-lg: 14px;  /* cards, panels */
  --radius-pill: 999px; /* lifecycle status only */

  --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-16: 64px;

  --control-sm: 32px;
  --control-md: 40px;
  --control-lg: 48px;
  --touch-min: 44px;

  --shadow-sm: 0 1px 2px rgba(17, 62, 57, 0.08);

  /* ---- Audit grades: light ---- */
  --grade-conformant-fg: #0B6B43;  --grade-conformant-bg: #EAF7EF;  --grade-conformant-line: #B7E2C8;
  --grade-observation-fg: #155E75; --grade-observation-bg: #E8F6FA; --grade-observation-line: #B3DEEA;
  --grade-minor-fg: #9A4A05;       --grade-minor-bg: #FFF6E5;       --grade-minor-line: #F6D59B;
  --grade-major-fg: #A3201A;       --grade-major-bg: #FDEEEC;       --grade-major-line: #F3C1BB;

  /* ---- Semantic roles: light (default) ---- */
  color-scheme: light;
  --surface-canvas: var(--sage-25);
  --surface: var(--sage-0);
  --surface-raised: var(--sage-0);
  --surface-sunken: var(--sage-50);
  --border: var(--sage-100);
  --border-strong: var(--sage-200);
  --text-heading: var(--sage-900);
  --text-body: var(--sage-700);
  --text-muted: var(--sage-500);
  --text-disabled: var(--sage-400);
  --accent: var(--pine-800);
  --accent-hover: var(--pine-700);
  --accent-fg: #FFFFFF;
  --accent-text: var(--pine-600);
  --accent-subtle: var(--pine-100);
  --focus-ring: var(--pine-500);
  --ai-bg: var(--lime-100);
  --ai-line: var(--lime-300);
  --ai-fg: var(--lime-800);
  --mark-bg: var(--pine-800);
  --mark-fg: var(--lime-300);
  --nav-bg: var(--pine-800);
  --nav-fg: #D9E3DE;
  --nav-active-bg: var(--pine-700);
}

/* ---- Force light on any element (marketing site, exports, embeds) ----
   <div data-theme="light"> keeps the light roles even when the OS is dark. */
[data-theme="light"] {
  color-scheme: light;
  --surface-canvas: var(--sage-25);
  --surface: var(--sage-0);
  --surface-raised: var(--sage-0);
  --surface-sunken: var(--sage-50);
  --border: var(--sage-100);
  --border-strong: var(--sage-200);
  --text-heading: var(--sage-900);
  --text-body: var(--sage-700);
  --text-muted: var(--sage-500);
  --text-disabled: var(--sage-400);
  --accent: var(--pine-800);
  --accent-hover: var(--pine-700);
  --accent-fg: #FFFFFF;
  --accent-text: var(--pine-600);
  --accent-subtle: var(--pine-100);
  --focus-ring: var(--pine-500);
  --ai-bg: var(--lime-100);
  --ai-line: var(--lime-300);
  --ai-fg: var(--lime-800);
  --mark-bg: var(--pine-800);
  --mark-fg: var(--lime-300);
  --nav-bg: var(--pine-800);
  --nav-fg: #D9E3DE;
  --nav-active-bg: var(--pine-700);
  --grade-conformant-fg: #0B6B43;  --grade-conformant-bg: #EAF7EF;  --grade-conformant-line: #B7E2C8;
  --grade-observation-fg: #155E75; --grade-observation-bg: #E8F6FA; --grade-observation-line: #B3DEEA;
  --grade-minor-fg: #9A4A05;       --grade-minor-bg: #FFF6E5;       --grade-minor-line: #F6D59B;
  --grade-major-fg: #A3201A;       --grade-major-bg: #FDEEEC;       --grade-major-line: #F3C1BB;
  --shadow-sm: 0 1px 2px rgba(17, 62, 57, 0.08);
}

/* ---- Semantic roles: dark ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-canvas: #091412;
    --surface: #10201C;
    --surface-raised: #162A25;
    --surface-sunken: #0C1916;
    --border: #223A34;
    --border-strong: #304D46;
    --text-heading: #EEF4F1;
    --text-body: #C4D2CC;
    --text-muted: #8AA099;
    --text-disabled: #566B65;
    --accent: var(--pine-600);
    --accent-hover: #367E6A;
    --accent-fg: #FFFFFF;
    --accent-text: #9FD0BE;
    --accent-subtle: #16332C;
    --focus-ring: #9FD0BE;
    --ai-bg: #1C2A12;
    --ai-line: var(--lime-800);
    --ai-fg: #DCF3A6;
    --mark-bg: var(--lime-300);
    --mark-fg: var(--pine-800);
    --nav-bg: #0C1916;
    --nav-fg: #C4D2CC;
    --nav-active-bg: #16332C;
    --grade-conformant-fg: #5FD39A;  --grade-conformant-bg: #0F2A1F;  --grade-conformant-line: #1E5A3F;
    --grade-observation-fg: #5CC6E0; --grade-observation-bg: #0D2630; --grade-observation-line: #1D5566;
    --grade-minor-fg: #F2B54C;       --grade-minor-bg: #2E2210;       --grade-minor-line: #6B4A14;
    --grade-major-fg: #FF8A7F;       --grade-major-bg: #33161A;       --grade-major-line: #7A2A2A;
    --shadow-sm: none;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-canvas: #091412;
  --surface: #10201C;
  --surface-raised: #162A25;
  --surface-sunken: #0C1916;
  --border: #223A34;
  --border-strong: #304D46;
  --text-heading: #EEF4F1;
  --text-body: #C4D2CC;
  --text-muted: #8AA099;
  --text-disabled: #566B65;
  --accent: var(--pine-600);
  --accent-hover: #367E6A;
  --accent-fg: #FFFFFF;
  --accent-text: #9FD0BE;
  --accent-subtle: #16332C;
  --focus-ring: #9FD0BE;
  --ai-bg: #1C2A12;
  --ai-line: var(--lime-800);
  --ai-fg: #DCF3A6;
  --mark-bg: var(--lime-300);
  --mark-fg: var(--pine-800);
  --nav-bg: #0C1916;
  --nav-fg: #C4D2CC;
  --nav-active-bg: #16332C;
  --grade-conformant-fg: #5FD39A;  --grade-conformant-bg: #0F2A1F;  --grade-conformant-line: #1E5A3F;
  --grade-observation-fg: #5CC6E0; --grade-observation-bg: #0D2630; --grade-observation-line: #1D5566;
  --grade-minor-fg: #F2B54C;       --grade-minor-bg: #2E2210;       --grade-minor-line: #6B4A14;
  --grade-major-fg: #FF8A7F;       --grade-major-bg: #33161A;       --grade-major-line: #7A2A2A;
  --shadow-sm: none;
}

/* Exports and print always render light: export templates set <html data-theme="light">. */
