/* ==========================================================================
   checkpoint — design tokens for the AI Gatewell console and Palisade
   Direction "Layered" (chosen by the owner on 2026-11-11 from three versions).
   Single source of truth. Components may only use var(--cp-*) for colour,
   type, radius, shadow, duration and easing. See SPEC.md for rationale and
   the measured contrast table.
   ========================================================================== */

/* ---- Fonts (self-hosted, SIL OFL 1.1; licence files sit beside the fonts) ---- */
@font-face {
  font-family: "Hanken Grotesk";
  src: url("prototype/fonts/HankenGrotesk-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("prototype/fonts/BricolageGrotesque-var.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("prototype/fonts/GeistMono-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* ---- 1. Surfaces: a dark frame, and a lighter sheet raised on it ---- */
  --cp-frame: #0A0908;  /* the frame: page edge, sidebar, top bar, evidence wells */
  --cp-bg-0: #161513;   /* the sheet: main content surface, table body          */
  --cp-bg-1: #1C1B18;   /* raised on the sheet: drawer, rail, active nav, inputs */
  --cp-bg-2: #24221F;   /* hover, pane heads inside a drawer                     */
  --cp-bg-3: #2E2B28;   /* selected, pressed                                     */
  --cp-sheen: rgba(255, 255, 255, 0.04); /* 1px top edge highlight on the sheet  */

  --cp-line-1: #292724; /* hairline between rows (decorative)                    */
  --cp-line-2: #383532; /* edges of sheets, panes, buttons, chips (decorative)   */
  --cp-line-3: #6F6A64; /* boundaries that identify a control: inputs, checkboxes, switches (>= 3:1 on bg-0 and bg-1) */

  --cp-ink-1: #EFEAE2;  /* primary text            15.2:1 on bg-0 */
  --cp-ink-2: #BDB7AF;  /* secondary text           9.2:1 on bg-0 */
  --cp-ink-3: #9A948C;  /* labels, meta lines       6.1:1 on bg-0, 4.7:1 on bg-3 */
  --cp-ink-4: #625E58;  /* disabled and unreached ghost only; never information-bearing text */

  /* ---- 2. The one accent: cool, desaturated steel. Interaction only. ---- */
  --cp-accent: #9CC4DD;
  --cp-accent-strong: #BCDDF1;
  --cp-accent-dim: #3A5A6D;
  --cp-accent-wash: #1D2D36;
  --cp-on-accent: #0A0908;

  /* ---- 3. Verdicts: the ONLY saturated colours in the product ---- */
  --cp-block: #FF5A50;       /* 5.9:1 on bg-0 */
  --cp-warn:  #FDBA2F;       /* 10.6:1 on bg-0 */
  --cp-allow: #3ED28C;       /* 9.4:1 on bg-0 */
  --cp-block-wash: #3C1714;
  --cp-warn-wash:  #362607;
  --cp-allow-wash: #0E2B1B;
  --cp-on-block: #1B0A08;
  --cp-on-warn:  #1D1406;
  --cp-on-allow: #05160C;

  /* Overlays: shadows are black and belong only to things that float */
  --cp-scrim: rgba(6, 5, 4, 0.66);
  --cp-shadow-overlay: 0 0 0 1px var(--cp-line-2), -32px 0 80px rgba(0, 0, 0, 0.55);
  --cp-shadow-pop: 0 0 0 1px var(--cp-line-2), 0 16px 48px rgba(0, 0, 0, 0.6);

  /* ---- 4. Type ---- */
  --cp-font-ui: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --cp-font-display: "Bricolage Grotesque", "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --cp-font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --cp-fs-micro: 11px;     /* keycaps, stake captions, tags              */
  --cp-fs-label: 12px;     /* column headers, field labels, nav groups   */
  --cp-fs-meta: 12.5px;    /* second line of a row, verdict words        */
  --cp-fs-dense: 13.5px;   /* default interface text                     */
  --cp-fs-body: 14.5px;    /* prose, form inputs, tabs                   */
  --cp-fs-lead: 15px;      /* first line of a list row                   */
  --cp-fs-title: 18px;     /* section and pane titles                    */
  --cp-fs-drawer: 22px;    /* drawer title (display face)                */
  --cp-fs-page: 30px;      /* page title (display face)                  */

  --cp-fs-mono-s: 12px;    /* mono in tables      */
  --cp-fs-mono-m: 12.5px;  /* mono in drawers, code */
  --cp-fs-mono-l: 14px;    /* mono titles          */

  --cp-lh-dense: 20px;
  --cp-lh-body: 22px;

  --cp-fw-regular: 400;
  --cp-fw-medium: 500;
  --cp-fw-semibold: 600;
  --cp-fw-bold: 700;

  --cp-tracking-tight: -0.02em;   /* display sizes only */
  --cp-tracking-verdict: 0.03em;
  --cp-numeric: tabular-nums lining-nums;

  /* ---- 5. Space (4px base) ---- */
  --cp-s-0: 2px;
  --cp-s-1: 4px;
  --cp-s-2: 8px;
  --cp-s-3: 12px;
  --cp-s-4: 16px;
  --cp-s-5: 20px;
  --cp-s-6: 24px;
  --cp-s-8: 32px;
  --cp-s-12: 48px;

  /* ---- 6. Density grid ---- */
  --cp-row-list: 64px;      /* two-line list rows: the default for any list of objects */
  --cp-row: 44px;           /* single-line rows: reference tables, settings lists       */
  --cp-row-compact: 34px;   /* logs and timelines: session events, findings, audit      */
  --cp-row-head: 40px;      /* column header                                            */
  --cp-nav-h: 34px;         /* sidebar item                                             */
  --cp-control-h: 32px;     /* buttons, inputs, selects, chips                          */
  --cp-control-h-lg: 38px;  /* form fields and dialog buttons                           */
  --cp-bar-h: 52px;         /* top bar, drawer head                                     */
  --cp-toolbar-h: 52px;     /* filter bar, pane head, table foot                        */
  --cp-cell-px: 14px;
  --cp-gutter: 24px;
  --cp-sidebar-w: 236px;
  --cp-sidebar-w-collapsed: 56px;
  --cp-drawer-w: 540px;
  --cp-drawer-w-wide: 680px;
  --cp-detail-rail-w: 340px;

  /* ---- 7. Radius: three steps, by how much a thing stands apart ---- */
  --cp-r-0: 0;       /* rows, rails, flow lines, stakes */
  --cp-r-xs: 4px;    /* checkboxes, keycaps, tags       */
  --cp-r-1: 8px;     /* controls, badges, nav items     */
  --cp-r-2: 14px;    /* dialogs, menus, toasts, evidence wells */
  --cp-r-sheet: 18px;/* the content sheet and the drawer (leading corner only) */

  /* ---- 8. Lines ---- */
  --cp-hair: 1px;
  --cp-rule: 2px;   /* active markers, gate posts, focus ring */

  /* ---- 9. Motion: one curve, three durations, one axis ---- */
  --cp-ease: cubic-bezier(0.2, 0, 0, 1);
  --cp-t-1: 150ms;  /* state of a control or row */
  --cp-t-2: 200ms;  /* content arriving, list changes, toasts */
  --cp-t-3: 250ms;  /* drawer, dialog, sidebar */
  --cp-stagger: 40ms;
  --cp-travel: 12px;
  --cp-sweep: 1400ms;

  /* ---- 10. Flow geometry ---- */
  --cp-gate-post-w: 2px;
  --cp-gate-h: 34px;
  --cp-gate-gap: 8px;
  --cp-flow-line: 1px;
  --cp-stake-w: 6px;
  --cp-stake-gap: 3px;
  --cp-stake-h: 22px;
  --cp-stake-h-lg: 52px;
  --cp-stake-tip: 4px;
  --cp-tile: 34px;           /* verdict tile in list rows */

  /* ---- 11. Layers ---- */
  --cp-z-sticky: 10;
  --cp-z-sidebar: 20;
  --cp-z-drawer: 40;
  --cp-z-dialog: 60;
  --cp-z-toast: 80;

  /* ---- 12. Icons ---- */
  --cp-icon: 16px;
  --cp-icon-stroke: 1.5px;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --cp-t-1: 0.01ms;
    --cp-t-2: 0.01ms;
    --cp-t-3: 0.01ms;
    --cp-stagger: 0ms;
    --cp-travel: 0px;
  }
}

@media (forced-colors: active) {
  :root {
    --cp-block: Mark;
    --cp-warn: Highlight;
    --cp-allow: LinkText;
    --cp-accent: Highlight;
    --cp-line-1: CanvasText;
    --cp-line-2: CanvasText;
    --cp-line-3: CanvasText;
  }
}
