/*
  Perimeter — the Guardry design system.
  Tokens only. Every Guardry product reads its colour, type, space and motion
  from this file; components never hard-code a value.

  Theme is chosen by [data-theme] on <html>, set before first paint by
  /app/theme.js (system preference unless the person picked one).
  No third-party assets: system type stacks, no remote fonts, no images.
*/
:root {
  color-scheme: light;

  /* Surfaces, from the page outward. */
  --canvas: #f3f4ef;
  --surface: #fafbf7;
  --raised: #ffffff;
  --sunken: #e9ebe4;
  --field: #ffffff;
  --scrim: rgb(13 19 16 / 0.5);

  /* Hairlines. Borders carry the structure; shadows are for overlays only.
     --line-control is the edge of anything you type into: 3:1 on every surface. */
  --line: #dcdfd5;
  --line-strong: #bfc5b8;
  --line-control: #838d84;

  /* Ink, strongest to faintest. --ink-3 is the weakest that carries meaning:
     4.5:1 on every surface and wash. --ink-4 is decoration only. */
  --ink: #131b17;
  --ink-2: #3a463f;
  --ink-3: #5e6a61;
  --ink-4: #98a199;

  /* Signal is the brand mark and "live" state. Accent is signal made legible as text. */
  --signal: #c3f463;
  --on-signal: #18240f;
  --accent: #1d6b3c;
  --primary: #131b17;
  --on-primary: #f3f4ef;
  --focus: #1d6b3c;

  /* State. Each has a text colour and a wash to sit behind it. */
  --ok: #1a7a43;
  --ok-wash: #dff2e3;
  --hold: #8f5600;
  --hold-wash: #faedcc;
  --alert: #bf2f17;
  --alert-wash: #fde6df;
  --on-alert: #ffffff;

  /* Actors. An agent is always violet and square; a person is ink and round. */
  --agent: #5843c4;
  --agent-wash: #eae7fb;
  --human: #3a463f;
  --human-wash: #e9ebe4;

  /* The path bar is the perimeter: dark in both themes so the signal always reads. */
  --chrome: #0f1512;
  --chrome-raised: #1a221d;
  --chrome-line: #27312b;
  --chrome-ink: #e8eee8;
  --chrome-ink-2: #97a49b;

  --shadow-overlay: 0 1px 2px rgb(13 19 16 / 0.08), 0 18px 48px rgb(13 19 16 / 0.18);

  /* Type. Sans for prose and controls, mono for anything an engineer would copy. */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --t-micro: 10.5px;
  --t-xs: 12px;
  --t-sm: 13px;
  --t-md: 14px;
  --t-lg: 16px;
  --t-xl: 21px;
  --t-2xl: 30px;
  --track-label: 0.07em;

  /* Space on a 4px grid. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;

  /* Corners stay tight; this is an instrument, not a toy. */
  --r-1: 3px;
  --r-2: 5px;
  --r-3: 8px;

  --control-h: 32px;
  --control-h-sm: 26px;
  --pathbar-h: 48px;
  --sidebar-w: 232px;
  --rail-w: 348px;

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-1: 110ms;
  --dur-2: 190ms;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --canvas: #0a0e0c;
  --surface: #101512;
  --raised: #161c18;
  --sunken: #060908;
  --field: #0c110e;
  --scrim: rgb(0 0 0 / 0.62);

  --line: #222a25;
  --line-strong: #36423b;
  --line-control: #66736a;

  --ink: #e8eee8;
  --ink-2: #b4c0b7;
  --ink-3: #86938a;
  --ink-4: #56615a;

  --accent: #c3f463;
  --primary: #c3f463;
  --on-primary: #18240f;
  --focus: #c3f463;

  --ok: #63d389;
  --ok-wash: #10301e;
  --hold: #f2b94b;
  --hold-wash: #33260a;
  --alert: #ff7b63;
  --alert-wash: #3b1610;
  --on-alert: #2a0c07;

  --agent: #a79aff;
  --agent-wash: #211c45;
  --human: #b4c0b7;
  --human-wash: #1c231f;

  --chrome: #060908;
  --chrome-raised: #131915;
  --chrome-line: #222a25;

  --shadow-overlay: 0 1px 2px rgb(0 0 0 / 0.5), 0 18px 48px rgb(0 0 0 / 0.55);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-1: 0ms;
    --dur-2: 0ms;
  }
}
