/* ==========================================================================
   Covio JSR — design tokens.

   The only source of visual truth. Every colour, type size, space, radius and
   duration in this app comes from a custom property declared here. A view or a
   component stylesheet that writes a raw hex code, a font stack or a pixel
   value is a bug, not a shortcut.

   Covio's language: dark identity surfaces carrying teal signals, light work
   surfaces carrying ink. Teal is the signal colour and belongs on dark; on
   light it is always a deepened teal, never the bare signal colour.
   ========================================================================== */

/* --- Fonts. Self-hosted latin subsets; nothing is fetched from a third
       party, which is also what the CSP allows (font-src 'self'). ---------- */

@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: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2');
}

:root {
  /* --- Brand ------------------------------------------------------------ */
  --covio-dark: #070C16;        /* brand surfaces: auth panel, topbar */
  --covio-ink: #13203A;         /* text on light */
  --covio-paper: #E9EEF7;       /* text on dark */
  --covio-light: #F2F5FA;       /* work background */
  --covio-teal: #3FE0C5;        /* THE signal colour — dark surfaces only */
  --covio-teal-deep: #14B8A0;   /* teal on light: fills, rings, non-text marks */
  --covio-blue: #3E8BFF;        /* secondary accent */

  /* Teal on light where the colour has to carry meaning on its own — link
     text, focus rings, interactive labels. --covio-teal-deep is only 2.5:1
     against white, which fails AA for text (4.5:1) and the non-text minimum
     for a focus indicator (3:1). This is the same value Covio's own site uses
     for links, and it clears both at 4.97:1. */
  --covio-teal-link: #0A7E6F;

  /* --- Semantic --------------------------------------------------------- */
  --success: #14B8A0;
  --danger: #E5484D;
  --warning: #F5A524;
  --info: #3E8BFF;
  /* .65 rather than .62: at .62 this clears AA on white by 0.13 and fails on
     --covio-light, which is the ground under the page and inside the board's
     machine cards. Measured 4.49:1 there. .65 clears both — 5.12:1 on white,
     4.92:1 on the tint — and is a shade a reader would not notice moving. */
  --muted-ink: rgba(19, 32, 58, .65);
  --line: rgba(19, 32, 58, .12);
  --surface: #FFFFFF;

  /* Darker variants of the semantic colours, for text and icons on light,
     where the pure hue does not clear AA.

     Measured against the tinted fill each one is actually printed on, not
     against white: a pill and a notice both set this ink on a 12-14% wash of
     the same hue, and that wash is enough to take a value that clears AA on
     paper below it. Teal and amber were the two that did — 3.81:1 and 4.27:1 —
     and are darkened here to 5.21:1 and 5.32:1 on their own fills. */
  --success-ink: #0B7263;
  --danger-ink: #B3383C;
  --warning-ink: #875C0E;
  --info-ink: #2B62B9;

  /* --- On dark ---------------------------------------------------------- */
  --paper-100: #E9EEF7;
  --paper-62: rgba(233, 238, 247, .62);
  --paper-38: rgba(233, 238, 247, .38);
  --line-dark: rgba(233, 238, 247, .09);
  --surface-dark: #0B1322;      /* one step up from --covio-dark, for insets */

  /* --- Status pills. Fixed pairs; never mix a fill with another ink. -----
     The inks are the semantic ones above rather than second copies of the same
     hex, so darkening one for contrast cannot leave the pill and the notice
     disagreeing about what "done" looks like. */
  --pill-active-fill: rgba(20, 184, 160, .12);
  --pill-active-ink: var(--success-ink);
  --pill-inactive-fill: rgba(229, 72, 77, .12);
  --pill-inactive-ink: var(--danger-ink);
  --pill-pending-fill: rgba(245, 165, 36, .14);
  --pill-pending-ink: var(--warning-ink);
  --pill-neutral-fill: rgba(19, 32, 58, .08);
  --pill-neutral-ink: var(--muted-ink);
  --pill-info-fill: rgba(62, 139, 255, .12);
  --pill-info-ink: var(--info-ink);

  /* --- Type ------------------------------------------------------------- */
  --ff-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --ff-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ff-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  --fs-page-title: 28px;
  --lh-page-title: 34px;
  --fs-section-title: 22px;
  --lh-section-title: 28px;
  --fs-body: 15px;
  --lh-body: 22px;
  --fs-secondary: 13px;
  --lh-secondary: 18px;
  --fs-caption: 12px;
  --lh-caption: 16px;
  --fs-mono: 12px;
  --lh-mono: 16px;
  --ls-mono: .18em;             /* eyebrows, table headers, codes, timestamps */

  /* --- Space. An 8-px rhythm, with 4 for the tight cases. ---------------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* --- Radius ----------------------------------------------------------- */
  --radius-input: 8px;
  --radius-card: 12px;
  --radius-modal: 16px;
  --radius-pill: 999px;

  /* --- Elevation. Borders over shadows on light; a shadow means "this
         floats above the page". ---------------------------------------- */
  --shadow-overlay: 0 12px 32px rgba(7, 12, 22, .16);

  /* --- Motion ----------------------------------------------------------- */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --motion-micro: 150ms;        /* hover, focus, colour */
  --motion-standard: 220ms;     /* in-page state change */
  --motion-overlay: 300ms;      /* drawer, modal, toast */

  /* --- Focus. Visible on everything interactive, no exceptions. --------- */
  --focus-ring: 2px solid var(--covio-teal-link);
  --focus-offset: 2px;
  --focus-ring-dark: 2px solid var(--covio-teal);

  /* --- Hit target ------------------------------------------------------- */
  --hit: 44px;

  /* --- Charts. Six categorical series in a fixed order; a seventh category
         folds into "Other". Each value clears 3:1 on --surface and on
         --covio-light, and every adjacent pair clears ΔE 8 under simulated
         colour-vision deficiency and ΔE 15 unsimulated (checked 16 Sep 2026
         with the data-viz palette validator; re-check if a value changes).
         --covio-teal-deep is 2.5:1 on white and is not a series colour. --- */
  --chart-1: #0F9C88;            /* teal — the brand signal, deepened to 3.4:1 */
  --chart-2: #C97A0C;            /* amber */
  --chart-3: #2F6FE0;            /* blue */
  --chart-4: #C2416B;            /* rose */
  --chart-5: #6D5BD0;            /* violet */
  --chart-6: #5C8A1E;            /* green */
  --chart-1-soft: rgba(15, 156, 136, .14);
  --chart-2-soft: rgba(201, 122, 12, .14);
  --chart-3-soft: rgba(47, 111, 224, .14);
  --chart-4-soft: rgba(194, 65, 107, .14);
  --chart-5-soft: rgba(109, 91, 208, .14);
  --chart-6-soft: rgba(92, 138, 30, .14);
  --chart-other: rgba(19, 32, 58, .22);     /* "Other" and the comparison period */
  --chart-grid: var(--line);                /* hairline, one shade off the surface */
  --chart-axis: rgba(19, 32, 58, .28);
  --chart-hot: var(--covio-ink);            /* the hovered / focused mark */
  --chart-tip-bg: var(--covio-dark);
  --chart-tip-ink: var(--paper-100);
  --delta-up-ink: var(--success-ink);       /* only ever beside a ▲/▼ glyph and words */
  --delta-down-ink: var(--danger-ink);
}

/* Motion is decoration. When the operator has asked the machine to stop
   moving, every animation and transition in the app stops — including the
   route schematic, which keeps its drawn line and loses only the travel. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
