/* Riskernel site v2: design tokens and fonts (SPEC section 2). Fonts: SIL OFL, see /fonts/OFL.txt.
   Source: Fontsource @fontsource/ibm-plex-sans@5.2.8 and @fontsource/jetbrains-mono@5.2.8, latin subset. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url("/fonts/ibm-plex-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600 700;
  font-display: optional;
  src: url("/fonts/ibm-plex-sans-600.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url("/fonts/jetbrains-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 600 700;
  font-display: optional;
  src: url("/fonts/jetbrains-mono-700.woff2") format("woff2");
}
/* Metric-matched fallback: computed from IBM Plex Sans 400 (UPM 1000, typo ascent 1025, descent 275, gap 0)
   against Arial / Liberation Sans (same advance widths), over an English sample string. */
@font-face {
  font-family: "Plex Fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("LiberationSans");
  size-adjust: 101.18%;
  ascent-override: 101.31%;
  descent-override: 27.18%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light;

  /* Brand (must keep) */
  --cf-blue: #1B6FA8;          /* primary: buttons, links, structure */
  --cf-blue-hover: #155A8A;    /* already used on the Week 1 form */
  --cf-blue-deep: #0F4468;     /* pressed, text on blue tint */
  --cf-blue-light: #5AAED6;    /* decorative only: rules, tree strokes, focus halo. Never text (2.4:1 on white) */
  --cf-blue-tint: #E6F1F8;     /* table highlight column, selected states */
  --cf-blue-wash: #F2F8FC;     /* exhibit band background */
  --cf-terminal: #0F172A;      /* terminal and ink */

  /* Neutrals */
  --cf-ink: #0F172A;           /* headings */
  --cf-ink-2: #334155;         /* body */
  --cf-ink-3: #475569;         /* secondary */
  --cf-muted: #5E6E84;         /* captions, fine print. Was #64748B (4.4:1 on blue-wash, 4.3:1 on paper-3); now 4.5:1+ on every surface */
  --cf-line: #E2E8F0;
  --cf-line-strong: #CBD5E1;
  --cf-paper: #FFFFFF;
  --cf-paper-2: #F8FAFC;
  --cf-paper-3: #F1F5F9;       /* inputs */

  /* Evidence (text colour on its own tint; each pair is 4.5:1 or better, re-checked 2026-11-02) */
  --cf-confirmed: #0B6B45;      --cf-confirmed-tint: #E6F4EC;
  --cf-unconfirmed: #8A5300;    --cf-unconfirmed-tint: #FDF3DC;
  --cf-observation: #1B6FA8;    --cf-observation-tint: #E6F1F8;
  --cf-hypothesis: #5B4BA8;     --cf-hypothesis-tint: #EFEDF9;
  --cf-loss-high: #B42318;      --cf-loss-med: #B54708;  --cf-loss-low: #475569;

  /* Type */
  --cf-font-sans: "IBM Plex Sans", "Plex Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cf-font-mono: "JetBrains Mono", "Fira Code", "Courier New", monospace;  /* family name must stay exactly 'JetBrains Mono': live-score.css and the terminal rules reference it */

  --cf-fs-xs: 0.75rem;                                    /* 12: mono labels, tags */
  --cf-fs-sm: 0.875rem;                                   /* 14: fine print, table cells on mobile */
  --cf-fs-base: 1.0625rem;                                /* 17: body */
  --cf-fs-lg: 1.25rem;                                    /* 20: lead paragraphs */
  --cf-fs-xl: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);     /* h3 */
  --cf-fs-2xl: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);      /* h2 */
  --cf-fs-3xl: clamp(2.125rem, 1.5rem + 3.2vw, 3.25rem);  /* h1 */
  --cf-fs-num: clamp(2.5rem, 2rem + 2.5vw, 3.75rem);      /* tile numbers, mono */

  --cf-lh-tight: 1.1;   /* h1 */
  --cf-lh-snug: 1.2;    /* h2, h3 */
  --cf-lh-body: 1.6;
  --cf-lh-prose: 1.65;  /* article */
  --cf-track-h1: -0.02em;
  --cf-track-label: 0.06em;  /* mono uppercase labels */
  --cf-w-regular: 400; --cf-w-semibold: 600; --cf-w-bold: 700;  /* sans ships 400 and 600; bold maps to 600 */

  /* Space (4px base) */
  --cf-s-1: 0.25rem; --cf-s-2: 0.5rem; --cf-s-3: 0.75rem; --cf-s-4: 1rem; --cf-s-5: 1.5rem;
  --cf-s-6: 2rem; --cf-s-7: 3rem; --cf-s-8: 4rem; --cf-s-9: 6rem; --cf-s-10: 8rem;
  --cf-section-y: clamp(3.5rem, 2rem + 6vw, 6rem);
  --cf-gutter: 1rem;              /* 16px at phone width (contract) */
  --cf-container: 72rem;          /* 1152px */
  --cf-measure: 40rem;            /* text and article column */

  /* Radii: a case file has small corners */
  --cf-r-1: 4px;   /* tags */
  --cf-r-2: 8px;   /* buttons, inputs */
  --cf-r-3: 12px;  /* cards, form, table wrapper */

  /* Shadows: two only */
  --cf-shadow-1: 0 1px 2px rgba(15, 23, 42, 0.06);
  --cf-shadow-2: 0 12px 32px -12px rgba(15, 23, 42, 0.18);

  /* Motion (emil-design-eng: custom curves, ease-out for UI, never ease-in) */
  --cf-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --cf-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --cf-d-1: 120ms;  /* colour and border on hover */
  --cf-d-2: 200ms;  /* menus, button press, toggle */
  --cf-d-3: 320ms;  /* one-time reveals */
  --cf-d-draw: 600ms; /* attack-tree connector draw, stagger 60ms per level */
}
@media (min-width: 48rem) { :root { --cf-gutter: 2rem; } }
@media (prefers-reduced-motion: reduce) {
  :root { --cf-d-1: 0ms; --cf-d-2: 0ms; --cf-d-3: 0ms; --cf-d-draw: 0ms; }
}
