/* Evenhand design tokens - lift this file straight into the restyle pass.
 * Values come from the design spec. Where a spec colour failed the contrast
 * check for text use, a darker "-ink" or "-fill" partner is added alongside
 * it rather than changing the original (see checks/contrast.txt).
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-latin-700-normal.woff2') format('woff2');
}

:root {
  /* Surfaces and text */
  --page: #F3F8F5;
  --text: #0B3B2E;
  --muted: #5F6F68;
  --faint: #8A9A93;          /* never for body text - strokes and decoration only */
  --muted-haze: #55645E;     /* --muted for text sitting straight on the haze, not on glass:
                                --muted drops to 4.15:1 at the teal corner on narrow screens */

  /* Accent */
  --accent: #047857;
  --accent-2: #059669;       /* decorative only */
  --accent-soft: rgba(4, 120, 87, .10);
  --accent-text: #065F46;
  --warm: #D99A3D;           /* decorative only, never status */

  /* Glass */
  --card: rgba(255, 255, 255, .66);
  --card-strong: rgba(255, 255, 255, .72);   /* hero card */
  --card-border: rgba(255, 255, 255, .9);
  --card-blur: blur(18px) saturate(140%);
  --card-radius: 18px;
  --card-shadow: 0 4px 24px -8px rgba(11, 59, 46, .10);

  /* Floating sidebar */
  --sidebar-bg: rgba(255, 255, 255, .55);
  --sidebar-inset: 14px;
  --sidebar-radius: 20px;
  --sidebar-width: 236px;
  --sidebar-shadow: 0 10px 40px -12px rgba(11, 59, 46, .15);

  /* Primary button - the light end never goes paler than --accent */
  --btn-grad: linear-gradient(135deg, #065F46 0%, #047857 100%);

  /* ET1 risk, low to high. Kept away from the green accent.
   * The base colour is for dots, bars and hover glow. The "-fill" is used
   * behind white text: blue and orange fail 4.5:1 with white at their base
   * value, so their fills are one step darker in the same hue. Critical's fill
   * is darker again so it doesn't merge with High (see checks/colourblind.txt). */
  --risk-low: #64748B;
  --risk-moderate: #3B82F6;
  --risk-high: #EA580C;
  --risk-critical: #DC2626;
  --risk-low-fill: #64748B;
  --risk-moderate-fill: #2563EB;
  --risk-high-fill: #C2410C;
  --risk-critical-fill: #7F1D1D;   /* deeper than the base so High and Critical pills stay apart under deutan and tritan */

  /* Red used as text (overdue, attention count). #DC2626 is too light as
   * text on glass at small sizes, so text uses a deeper red. */
  --danger-text: #B91C1C;
  --danger-dot: #DC2626;

  /* Skeleton shimmer */
  --skel-a: rgba(11, 59, 46, .06);
  --skel-b: rgba(11, 59, 46, .11);

  /* Type */
  --font-body: 'Inter', sans-serif;
  --font-head: 'Plus Jakarta Sans', sans-serif;
  --size-hero: 28px;
  --size-page-title: 22px;
  --size-panel-title: 16px;

  /* Haze on the app shell */
  --haze:
    radial-gradient(1000px 560px at 10% -12%, rgba(52, 211, 153, .20), transparent 62%),
    radial-gradient(820px 520px at 100% 0%, rgba(20, 184, 166, .16), transparent 60%),
    radial-gradient(700px 420px at 92% 105%, rgba(217, 154, 61, .14), transparent 60%),
    radial-gradient(600px 400px at 30% 100%, rgba(6, 78, 59, .07), transparent 60%);
}

/* ---------- Colour roles and categories (update 2) ----------
 * Mirrored in js/palette.js, which anything drawing a chart reads from. */
:root {
  /* Roles */
  --primary: #047857;        /* actions only */
  --secondary: #0E7490;      /* secondary emphasis */
  --secondary-soft: rgba(14, 116, 144, .10);
  --highlight: #D99A3D;      /* sparing highlight: the attention halo, key numbers. Never on buttons */

  /* Category set, fixed order, never cycled. Base for marks and icon tints,
   * ink for text on that colour's tint. Slots 2, 6 and 8 differ from the brief,
   * see js/palette.js and checks/colourblind.txt. */
  --cat-1: #047857; --cat-1-ink: #065F46;   /* emerald */
  --cat-2: #06B6D4; --cat-2-ink: #155E75;   /* cyan (brief: teal-blue #0E7490) */
  --cat-3: #D99A3D; --cat-3-ink: #7A4E0F;   /* honey */
  --cat-4: #7C3AED; --cat-4-ink: #6D28D9;   /* violet */
  --cat-5: #E8613C; --cat-5-ink: #9A3412;   /* coral */
  --cat-6: #7C2E8A; --cat-6-ink: #6B2477;   /* plum (brief: sky #38BDF8, which merged with cyan under tritan) */
  --cat-7: #DB2777; --cat-7-ink: #9D174D;   /* rose */
  --cat-8: #92400E; --cat-8-ink: #7C2D12;   /* bronze. Brief: slate #64748B (is ET1 Low); update 2: stone #78716C (too close to slate and emerald) */
  --cat-other: #94A3B8; --cat-other-ink: #334155;
  --tint-alpha: 14%;         /* tint = category colour mixed at this strength over the surface */
  /* Text never sits on a solid category fill. Tags, chips and icon tiles use the tint with the ink. */

  /* Severity badges (meaning colours, not categories) */
  --sev-urgent: #B91C1C;  --sev-urgent-bg: rgba(220, 38, 38, .12);
  --sev-warning: #9A3412; --sev-warning-bg: rgba(234, 88, 12, .14);
  --sev-info: #334155;    --sev-info-bg: rgba(100, 116, 139, .14);

  /* Tooltip: light glass with a soft green tint */
  --tip-bg: rgba(236, 253, 245, .94);
  --tip-border: rgba(4, 120, 87, .18);
  --tip-radius: 12px;
  --tip-shadow: 0 10px 30px -10px rgba(11, 59, 46, .25);
}
