/*
 * The book's visual system: fonts, colours, the type scale and the sizes that keep text from moving.
 * Every other stylesheet reads these names and defines no colour of its own. DESIGN.md says what each role is for.
 */
@font-face {
  font-family: "Lab Sans";
  src: url("lab-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: optional;
}
@font-face {
  font-family: "Lab Mono";
  src: url("lab-mono.woff2") format("woff2");
  font-weight: 400 700;
  font-display: optional;
}
/* Arial, scaled to Lab Sans's width and line box, so a page that falls back keeps the same line breaks. With synthesis
   off, a family serves only the weights it has faces for, so the bold face is what keeps 600 heavier than 400 when
   the page falls back. It takes the same scale and line box as the regular face, so the two weights sit on one line. */
@font-face {
  font-family: "Lab Sans Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Liberation Sans");
  font-weight: 400;
  size-adjust: 88%;
  ascent-override: 113%;
  descent-override: 37%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Lab Sans Fallback";
  src: local("Arial Bold"), local("Helvetica Neue Bold"), local("Liberation Sans Bold");
  font-weight: 600 700;
  size-adjust: 88%;
  ascent-override: 113%;
  descent-override: 37%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light;
  --sans: "Lab Sans", "Lab Sans Fallback", Arial, sans-serif;
  --mono: "Lab Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Surfaces */
  --paper: #ffffff;
  --surface: #ffffff;
  --sunken: #f1f4f8;
  /* Text */
  --ink: #12171b;
  --muted: #485461;
  --faint: #5e6a78;
  /* Rules */
  --line: #e0e5eb;
  --line-strong: #c3ccd5;
  --wire: #8794a1;
  /* A pointer over something: a neutral wash, so it never reads as selected. */
  --hover: rgb(18 23 27 / 0.06);
  /* Behind a dialog, and the shadow a dialog casts. */
  --scrim: rgb(0 0 0 / 0.5);
  --shadow: rgb(0 0 0 / 0.2);
  /* A tinted region around a system boundary in a figure. */
  --boundary: #354d65;
  /* Action, selection and links */
  --accent: #00669e;
  --accent-ink: #004f7b;
  --accent-pale: #dbeefe;
  --on-accent: #ffffff;
  /* States: each colour means one thing */
  --ok: #006a38;
  --ok-pale: #ddf1e2;
  --warn: #7e4a00;
  --warn-pale: #fae8d7;
  --danger: #91362e;
  --danger-pale: #ffe4e0;
  /* Data series, for marks with a label beside them. Dark text sits on all of these. */
  --series-1: #84beed;
  --series-2: #d9af75;
  --series-3: #9bc58d;
  --series-ink: #12171b;
  --held: #007068; /* tokens reserved but not yet spent, in the budget lab */
  /*
   * Actors in a film: who did each thing in a run. The strong colour marks the actor's dot and tag;
   * the fill colours its part of a bar, with --series-ink on it. Used inside films and, through --fig-*, on the home map.
   */
  --actor-you: #00743e;
  --actor-you-fill: #a6d9b5;
  --actor-model: #00669e;
  --actor-model-fill: #a2d1f6;
  --actor-tool: #904c00;
  --actor-tool-fill: #efc09d;
  --actor-session: #6450a0;
  --actor-session-fill: #ccc2f6;
  --actor-runtime: #546271;
  --actor-runtime-fill: #c9d2db;
  --actor-error: #9b3f36;
  --actor-error-fill: #f6b9b1;

  /* Type scale: every font size is one of these. */
  --text-xs: 13px; /* legends and metadata */
  --text-sm: 15px; /* interface text, buttons, secondary text */
  --text-body: 17px; /* reading text */
  --text-lg: 21px;
  --text-xl: 26px;
  --text-2xl: 34px;
  --text-display: 46px;

  /* The widest a line of running text may get, at any font size: lead texts, section text, notes and takeaways.
     Figures, tables and cards keep the column's width. */
  --measure: 68ch;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-pill: 999px;
  /* A card: a figure that is played or operated, or a block of words. Its edge is a hairline all round, so its left edge
     lines up with the text's; a long soft shadow under it, pulled in at the sides, lifts it off the page without a
     halo. */
  --radius-card: 16px;
  --raise: 0 0 0 1px var(--line), var(--shadow-card);
  /* The shadow under a card: a contact line, then a long soft fall below it. */
  --shadow-card: 0 1px 2px rgb(16 24 40 / 0.04), 0 18px 36px -22px rgb(16 24 40 / 0.28);
  /* A card's header and footer: a band a shade over the surface, as a window's title bar is. */
  --band: color-mix(in srgb, var(--stage) 55%, var(--surface));
  /* A small readout inside a card: a shade under the card. */
  --chip: var(--sunken);
  /* The stage, where a figure runs, drawn as a card is in shadcn/ui: its border, the faintest shadow under it, and
     the muted fill a track of tabs or a slider stands on. The dark theme sets its own. */
  --stage: #eef1f5;
  --stage-edge: #dde3ea;
  --shadow-xs: 0 1px 2px rgb(16 24 40 / 0.06);
  /* Motion: the tokens of figure-motion.mjs, for what a figure's stylesheet moves itself. A thing fades in or out in
     place, a measure grows and a seek settles over `grow`, and a transfer travels. */
  --motion-fade: 200ms;
  --motion-grow: 480ms;
  --motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-travel: 560ms;
  --motion-travel-ease: cubic-bezier(0.32, 0, 0.22, 1);

  --header-height: 64px;
  --sidebar-width: 264px;
  font-family: var(--sans);
  font-synthesis: none;
  font-variant-numeric: tabular-nums;
  /* Fractional advances: a line keeps its width and breaks at any zoom and on any platform. */
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #101419;
  --surface: #171c22;
  --sunken: #0b0f13;
  --ink: #e8ecf0;
  --muted: #abb6c1;
  --faint: #919da9;
  --line: #262c33;
  --line-strong: #3b434c;
  --wire: #788593;
  --hover: rgb(232 236 240 / 0.08);
  --boundary: #a9bdd2;
  --accent: #4fa0db;
  --accent-ink: #a0d5fe;
  --accent-pale: #0c2e46;
  --on-accent: #05101c;
  --ok: #7ad198;
  --ok-pale: #0f341e;
  --warn: #eeab64;
  --warn-pale: #3f2506;
  --danger: #fd9c90;
  --danger-pale: #441f1b;
  --series-1: #76b2e1;
  --series-2: #cda367;
  --series-3: #8eb980;
  --held: #34c3b6;
  --actor-you: #6ac188;
  --actor-you-fill: #78b98d;
  --actor-model: #4fa0db;
  --actor-model-fill: #73afdd;
  --actor-tool: #e2975c;
  --actor-tool-fill: #d4996d;
  --actor-session: #ae9cef;
  --actor-session-fill: #aa9ddd;
  --actor-runtime: #a0acb9;
  --actor-runtime-fill: #96a3b1;
  --actor-error: #ec8d81;
  --actor-error-fill: #dc9187;
  --raise: 0 0 0 1px var(--line), var(--shadow-card);
  --shadow-card: 0 18px 36px -22px rgb(0 0 0 / 0.85);
  /* The sunken fill would read as a hole in a dark card; the paper is the shade under it. */
  --chip: var(--paper);
  /* On the dark page the muted fill stands a step over the surface, as shadcn/ui's dark theme sets it. */
  --stage: #232a33;
  --stage-edge: #2b323b;
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.4);
}
