/* paros design tokens (#804 (flat engineering redesign)).
 *
 * This is the only file of the website that defines a colour. The site
 * (website/site) and the playground (website/sandbox) import it. Mermaid `classDef` colours in the book are the one exception.
 *
 * Theme: <html data-theme> is "goyo-light"/"light" or "goyo-dark"/"dark".
 * shared/theme.js writes it from localStorage["theme"] or, without a choice,
 * from prefers-color-scheme; the media query below covers a page without
 * the script. The dark values are written twice (the media
 * query and the explicit choice) because CSS cannot share one block for both.
 */

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --text: 15px;
  --label: 12px;
  --tracking: 0.06em;
  --measure: 72ch;
  --bar: 52px;

  /* Page */
  --bg: #f6f6f3;
  --panel: #ecece7;
  --fg: #1b1d1e;
  --muted: #5d625f;
  --rule: #d2d3cc;
  --rule-strong: #7f837d;
  --accent: #a84f0c;
  --accent-fg: #ffffff;
  --accent-tint: rgba(181, 86, 15, 0.1);
  --button: #e0e0da;
  --shadow: #1b1d1e;

  /* Status: the four diagram colours of website/zola/AGENTS.md. */
  --done: #3b6e47;
  --gap: #7a2f2f;
  --open: #5a5a5a;
  --shared: #93551a;
  --done-tint: rgba(59, 110, 71, 0.12);
  --gap-tint: rgba(122, 47, 47, 0.12);
  --open-tint: rgba(90, 90, 90, 0.12);
  --shared-tint: rgba(201, 122, 43, 0.14);

  /* Syntax: four tints of the page, no rainbow. */
  --syn-keyword: #8a3f0a;
  --syn-string: #3b6e47;
  --syn-comment: #626763;
  --syn-constant: #6b4f8a;
  --syn-name: #1b1d1e;

  /* paros play: strokes of the four status colours, message phases, grid columns. */
  --done-dark: #244730;
  --gap-dark: #4d1f1f;
  --open-dark: #333333;
  --shared-dark: #7a4718;
  --phase-prepare: #2f5d8a;
  --phase-promise: #3f78b3;
  --phase-accept: #3b6e47;
  --phase-accepted: #4f8a62;
  --phase-nack: #7a2f2f;
  --phase-commit: #a6611d;
  --phase-heartbeat: #7a6c52;
  --phase-catchup: #6b4f8a;
  --phase-read: #8f4a8a;
  --phase-handoff: #7a5f28;
  --phase-match: #4a6b8a;
  --phase-gc: #63633f;
  --phase-reconfigure: #9a4c28;
  --phase-other: #5a5a5a;
  --column-0: #2f5d8a;
  --column-1: #a84f0c;
  --column-2: #3b6e47;
  --column-3: #6b4f8a;
  --column-4: #2a706d;
  --column-5: #7a5f28;

  /* The sandbox: one colour per tenant. */
  --tenant-0: #2f5d8a;
  --tenant-1: #8f4a8a;
  --tenant-2: #2a706d;
  --tenant-3: #7a5f28;
  --tenant-4: #6b4f8a;
  --tenant-5: #9a4c28;
  --tenant-internal: #5a5a5a;
  /* Operator blocks (#844 (playground action blocks)): one colour per
     group, and the text on it. */
  --block-fg: #ffffff;
  --block-bootstrap: var(--column-0);
  --block-resources: var(--column-2);
  --block-workloads: var(--column-3);
  --block-machines: var(--column-5);
  --block-faults: var(--phase-nack);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="goyo-light"]):not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0c0d;
    --panel: #16191a;
    --fg: #d9ddd6;
    --muted: #8b918c;
    --rule: #2a2f2f;
    --rule-strong: #646b67;
    --accent: #e8964a;
    --accent-fg: #0b0c0d;
    --accent-tint: rgba(232, 150, 74, 0.12);
    --button: #232829;
    --shadow: #4a5150;
    --done: #5c9a70;
    --gap: #d06a6a;
    --open: #8d8d8d;
    --shared: #dfa05c;
    --done-tint: rgba(92, 154, 112, 0.14);
    --gap-tint: rgba(208, 106, 106, 0.14);
    --open-tint: rgba(141, 141, 141, 0.14);
    --shared-tint: rgba(223, 160, 92, 0.14);
    --syn-keyword: #e8964a;
    --syn-string: #8fc29e;
    --syn-comment: #858b86;
    --syn-constant: #b49ad6;
    --syn-name: #d9ddd6;
    --done-dark: #8fc9a1;
    --gap-dark: #e08a8a;
    --open-dark: #b0b0b0;
    --shared-dark: #f0c48c;
    --phase-prepare: #7aa8d8;
    --phase-promise: #a3c9ec;
    --phase-accept: #6fb388;
    --phase-accepted: #a6d8bb;
    --phase-nack: #d97a7a;
    --phase-commit: #e2a463;
    --phase-heartbeat: #bda986;
    --phase-catchup: #a98ad0;
    --phase-read: #d68fce;
    --phase-handoff: #cfae6a;
    --phase-match: #8fb2d6;
    --phase-gc: #b3b37f;
    --phase-reconfigure: #d68a63;
    --phase-other: #8d8d8d;
    --column-0: #7aa8d8;
    --column-1: #e8964a;
    --column-2: #6fb388;
    --column-3: #a98ad0;
    --column-4: #63bdb9;
    --column-5: #cfae6a;
    --tenant-0: #7aa8d8;
    --tenant-1: #d68fce;
    --tenant-2: #63bdb9;
    --tenant-3: #cfae6a;
    --tenant-4: #a98ad0;
    --tenant-5: #d68a63;
    --tenant-internal: #8d8d8d;
    --block-fg: #0b0c0d;
  }
}

:root[data-theme="goyo-dark"],
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0c0d;
  --panel: #16191a;
  --fg: #d9ddd6;
  --muted: #8b918c;
  --rule: #2a2f2f;
  --rule-strong: #646b67;
  --accent: #e8964a;
  --accent-fg: #0b0c0d;
  --accent-tint: rgba(232, 150, 74, 0.12);
  --button: #232829;
  --shadow: #4a5150;
  --done: #5c9a70;
  --gap: #d06a6a;
  --open: #8d8d8d;
  --shared: #dfa05c;
  --done-tint: rgba(92, 154, 112, 0.14);
  --gap-tint: rgba(208, 106, 106, 0.14);
  --open-tint: rgba(141, 141, 141, 0.14);
  --shared-tint: rgba(223, 160, 92, 0.14);
  --syn-keyword: #e8964a;
  --syn-string: #8fc29e;
  --syn-comment: #858b86;
  --syn-constant: #b49ad6;
  --syn-name: #d9ddd6;
  --done-dark: #8fc9a1;
  --gap-dark: #e08a8a;
  --open-dark: #b0b0b0;
  --shared-dark: #f0c48c;
  --phase-prepare: #7aa8d8;
  --phase-promise: #a3c9ec;
  --phase-accept: #6fb388;
  --phase-accepted: #a6d8bb;
  --phase-nack: #d97a7a;
  --phase-commit: #e2a463;
  --phase-heartbeat: #bda986;
  --phase-catchup: #a98ad0;
  --phase-read: #d68fce;
  --phase-handoff: #cfae6a;
  --phase-match: #8fb2d6;
  --phase-gc: #b3b37f;
  --phase-reconfigure: #d68a63;
  --phase-other: #8d8d8d;
  --column-0: #7aa8d8;
  --column-1: #e8964a;
  --column-2: #6fb388;
  --column-3: #a98ad0;
  --column-4: #63bdb9;
  --column-5: #cfae6a;
  --tenant-0: #7aa8d8;
  --tenant-1: #d68fce;
  --tenant-2: #63bdb9;
  --tenant-3: #cfae6a;
  --tenant-4: #a98ad0;
  --tenant-5: #d68a63;
  --tenant-internal: #8d8d8d;
  --block-fg: #0b0c0d;
}
