/*
 * IRSC design tokens. Source of truth: irsc-brand/css/irsc-tokens.css.
 * Apps receive a copy through scripts/sync.py; edit here, never in an app.
 *
 * Brand colors come from the IRSC brand guide. Everything under "UI tints"
 * is derived from those colors for interface states; check every text or
 * control pairing with scripts/check_contrast.py before changing a value.
 *
 * Themes: light is the default. <html data-theme="dark"> forces dark, and
 * <html data-theme="auto"> follows the visitor's system setting. Pages ship
 * with data-theme="light"; js/irsc-theme.js swaps in the visitor's saved
 * choice from the theme switch before the first paint. The dark tokens apply
 * on screen only, so every page prints with the light tokens.
 */

/* Metronic Slab Pro is licensed. These faces only use copies installed on the
   visitor's computer; add licensed woff2 files here to serve it to everyone. */
@font-face {
  font-family: "Metronic Slab Pro";
  font-weight: 300;
  src: local("Metronic Slab Pro Light"), local("MetronicSlabPro-Light");
}
@font-face {
  font-family: "Metronic Slab Pro";
  font-weight: 400;
  src: local("Metronic Slab Pro"), local("Metronic Slab Pro Regular"), local("MetronicSlabPro-Regular");
}
@font-face {
  font-family: "Metronic Slab Pro";
  font-weight: 600;
  src: local("Metronic Slab Pro SemiBold"), local("Metronic Slab Pro Semibold"), local("MetronicSlabPro-SemiBold");
}

:root {
  /* Brand palette (IRSC brand guide) */
  --irsc-blue: #003da5;   /* River Blue, PMS 293C (primary) */
  --irsc-yellow: #fedb00; /* Peregrine Yellow, PMS 108C (primary) */
  --irsc-navy: #062551;   /* PMS 655C (secondary) */
  --irsc-gray: #cfd2d3;   /* PMS 427C (secondary) */
  --irsc-black: #000000;
  --irsc-white: #ffffff;

  /* Type. Headings use Metronic Slab Pro; body copy uses the brand's web fonts. */
  --irsc-font-display: "Metronic Slab Pro", Rockwell, "Roboto Slab", "Trebuchet MS", Verdana, Arial, sans-serif;
  --irsc-font-body: "Trebuchet MS", Verdana, Arial, "Liberation Sans", sans-serif;
  --irsc-font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --irsc-weight-light: 300;
  --irsc-weight-regular: 400;
  --irsc-weight-semibold: 600;

  --irsc-text-xs: 0.75rem;
  --irsc-text-sm: 0.875rem;
  --irsc-text-md: 1rem;
  --irsc-text-lg: 1.125rem;
  --irsc-text-xl: 1.375rem;
  --irsc-text-2xl: 1.75rem;
  --irsc-text-3xl: 2.25rem;
  --irsc-leading-tight: 1.2;
  --irsc-leading: 1.55;
  --irsc-measure: 70ch;

  /* Space, shape, depth, motion */
  --irsc-space-1: 0.25rem;
  --irsc-space-2: 0.5rem;
  --irsc-space-3: 0.75rem;
  --irsc-space-4: 1rem;
  --irsc-space-5: 1.5rem;
  --irsc-space-6: 2rem;
  --irsc-space-7: 3rem;
  --irsc-space-8: 4rem;
  --irsc-radius-sm: 4px;
  --irsc-radius-md: 8px;
  --irsc-radius-lg: 12px;
  --irsc-radius-pill: 999px;
  --irsc-control-height: 2.75rem; /* 44px touch target */
  --irsc-header-rule: 4px;        /* Peregrine Yellow rule under the header */
  --irsc-focus-width: 3px;
  --irsc-ease: cubic-bezier(0.2, 0, 0, 1);
  --irsc-duration: 150ms;

  /* UI tints and semantic roles: light theme */
  --irsc-bg: #f5f6f6;              /* page: PMS 427C at 20% */
  --irsc-surface: #ffffff;         /* cards, panels, inputs */
  --irsc-surface-sunken: #ecedee;  /* wells, table headers: PMS 427C at 40% */
  --irsc-text: #000000;
  --irsc-text-muted: #4a5157;
  --irsc-heading: #062551;
  --irsc-border: #cfd2d3;          /* decorative dividers only */
  --irsc-border-strong: #6b7278;   /* input and control outlines (3:1 or better) */
  --irsc-accent: #003da5;          /* primary buttons, selected states */
  --irsc-accent-hover: #062551;
  --irsc-on-accent: #ffffff;
  --irsc-accent-soft: #e6ecf6;     /* River Blue at 10%: selected rows, info */
  --irsc-link: #003da5;
  --irsc-link-hover: #062551;
  --irsc-highlight: #fedb00;       /* never as text or a line on light surfaces */
  --irsc-on-highlight: #000000;
  --irsc-highlight-soft: #fff8cc;  /* Peregrine Yellow at 20%: notices */
  --irsc-focus: #003da5;
  --irsc-focus-halo: #ffffff;
  --irsc-header-bg: #062551;
  --irsc-header-text: #ffffff;
  --irsc-header-muted: #c9d2e0;
  --irsc-header-accent: #fedb00;
  --irsc-header-focus: #fedb00;
  --irsc-danger: #b42318;
  --irsc-danger-soft: #fdecea;
  --irsc-success: #1a6b3a;
  --irsc-success-soft: #e7f4ec;
  --irsc-shadow-1: 0 1px 2px rgb(6 37 81 / 0.08), 0 1px 3px rgb(6 37 81 / 0.06);
  --irsc-shadow-2: 0 4px 12px rgb(6 37 81 / 0.12), 0 2px 4px rgb(6 37 81 / 0.08);
  color-scheme: light;
}

/* Dark theme, on screen only so pages print light. Keep this block and the
   auto block below identical. */
@media screen {
  :root[data-theme="dark"] {
    --irsc-bg: #031229;
    --irsc-surface: #062551;
    --irsc-surface-sunken: #04193a;
    --irsc-text: #ffffff;
    --irsc-text-muted: #bcc6d6;
    --irsc-heading: #ffffff;
    --irsc-border: #23406d;
    --irsc-border-strong: #8a9ab3;
    --irsc-accent: #fedb00;
    --irsc-accent-hover: #ffe75c;
    --irsc-on-accent: #062551;
    --irsc-accent-soft: #0e3470;
    --irsc-link: #a9c4f5;
    --irsc-link-hover: #fedb00;
    --irsc-highlight: #fedb00;
    --irsc-on-highlight: #000000;
    --irsc-highlight-soft: #3d3400;
    --irsc-focus: #fedb00;
    --irsc-focus-halo: #031229;
    --irsc-header-bg: #000000;
    --irsc-header-text: #ffffff;
    --irsc-header-muted: #c9d2e0;
    --irsc-header-accent: #fedb00;
    --irsc-header-focus: #fedb00;
    --irsc-danger: #ff9b91;
    --irsc-danger-soft: #4a1410;
    --irsc-success: #7fdc9f;
    --irsc-success-soft: #0f3a22;
    --irsc-shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --irsc-shadow-2: 0 4px 12px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}

@media screen and (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --irsc-bg: #031229;
    --irsc-surface: #062551;
    --irsc-surface-sunken: #04193a;
    --irsc-text: #ffffff;
    --irsc-text-muted: #bcc6d6;
    --irsc-heading: #ffffff;
    --irsc-border: #23406d;
    --irsc-border-strong: #8a9ab3;
    --irsc-accent: #fedb00;
    --irsc-accent-hover: #ffe75c;
    --irsc-on-accent: #062551;
    --irsc-accent-soft: #0e3470;
    --irsc-link: #a9c4f5;
    --irsc-link-hover: #fedb00;
    --irsc-highlight: #fedb00;
    --irsc-on-highlight: #000000;
    --irsc-highlight-soft: #3d3400;
    --irsc-focus: #fedb00;
    --irsc-focus-halo: #031229;
    --irsc-header-bg: #000000;
    --irsc-header-text: #ffffff;
    --irsc-header-muted: #c9d2e0;
    --irsc-header-accent: #fedb00;
    --irsc-header-focus: #fedb00;
    --irsc-danger: #ff9b91;
    --irsc-danger-soft: #4a1410;
    --irsc-success: #7fdc9f;
    --irsc-success-soft: #0f3a22;
    --irsc-shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --irsc-shadow-2: 0 4px 12px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}
