﻿/* Design tokens: the only place colour, spacing and type values are defined.
   Risk colours are NOT defined yet (waiting on features.md). */
:root {
  /* Neutral palette */
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-border: #d5dbe1;
  --color-text: #1b2733;          /* 14.6:1 on surface */
  --color-text-muted: #4a5866;    /* 7:1 on surface */
  --color-brand: #0b4f6c;         /* 8.9:1 against white text */
  --color-brand-dark: #083a50;
  --color-brand-tint: #e3f0f6;
  --color-on-brand: #ffffff;
  --color-focus: #b45309;

  /* Risk scale. ASSUMPTION: values pending user confirmation (features.md).
     Contrast against white (--color-surface) text/background, WCAG AA >= 4.5:1.
     Always pair with an icon and label, never colour alone. */
  --color-risk-low: #1b6e3c;       /* ~5.9:1 on white */
  --color-risk-moderate: #8a5a00;  /* ~5.5:1 on white */
  --color-risk-high: #b3261e;      /* ~6.5:1 on white */
  --color-risk-unknown: #5c6670;   /* neutral grey, ~5.8:1 on white */

  /* River water-level status scale (separate from the risk scale above).
     Contrast shown as on white (--color-surface) / on --color-bg, WCAG AA >= 4.5:1.
     Always pair with an icon and label, never colour alone. */
  --color-status-normal: #0e6a85;   /* 6.14:1 on white, 5.67:1 on bg */
  --color-status-alert: #7a6400;    /* 5.75:1 on white, 5.31:1 on bg */
  --color-status-warning: #b34700;  /* 5.50:1 on white, 5.08:1 on bg */
  --color-status-danger: #a3002a;   /* 8.11:1 on white, 7.48:1 on bg */

  /* Historical incident analysis. Hues (purple, indigo, plum, olive) are kept
     apart from the risk (green/amber/red/grey) and status (teal/gold/orange/crimson) scales.
     Contrast shown as on white (--color-surface) / on --color-bg, WCAG AA >= 4.5:1.
     Monsoon colours are always paired with a pattern token, an icon and a label. */
  --color-incident: #5a2d82;             /* 9.85:1 on white, 9.09:1 on bg */
  --color-monsoon-northeast: #2c3e8f;    /* 9.58:1 on white, 8.84:1 on bg */
  --color-monsoon-southwest: #8a2f6b;    /* 7.78:1 on white, 7.18:1 on bg */
  --color-monsoon-inter: #5b6420;        /* 6.39:1 on white, 5.89:1 on bg */

  /* Pattern keywords read by js/chart-adapter.js (canvas pattern) and history.css (gradients). */
  --pattern-monsoon-northeast: diagonal;
  --pattern-monsoon-southwest: dots;
  --pattern-monsoon-inter: cross;

  /* Spacing (4px grid) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  /* Type */
  --font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.75rem;

  /* Shape and layout */
  --radius: 8px;
  --shadow: 0 1px 3px rgba(27, 39, 51, 0.12);
  --header-height: 64px;
  --sidebar-width: 232px;
  --content-max-width: 1280px;
}
