/* Grapim design tokens, shared by the review desk (ui/styles.css) and the
   hub (src/hub/pages/hub.css, which loads this file as /hub/static/tokens.css),
   so the two cannot drift. Colour, type, radius, shadow, focus and motion.
   Light by default, dark from the system or from [data-theme]. */

/* Public Sans (text and display) and IBM Plex Mono (code, paths, agent
   attribution), self-hosted (SIL OFL 1.1, ui/fonts/LICENSE-*). Latin only;
   Chinese and other scripts fall through to the system fonts below.
   design/brand.md is the brand spec these tokens implement. */
@font-face { font-family: "Public Sans"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("fonts/public-sans-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 400;
  src: url("fonts/ibm-plex-mono-400-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 500;
  src: url("fonts/ibm-plex-mono-500-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 600 700;
  src: url("fonts/ibm-plex-mono-600-latin.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --font: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
  /* One type scale, seven steps plus a display size for the headline numbers. */
  --fs-11: 11px; --fs-12: 12px; --fs-13: 13px; --fs-14: 14px; --fs-16: 16px; --fs-20: 20px; --fs-24: 24px; --fs-display: 40px; --fs-display-sm: 32px;
  --font-features: "kern", "liga";

  /* Monochrome neutrals: pure greys, no tint (design/brand.md). */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f2f2f2;
  --border: #ebebeb;
  --border-strong: #d4d4d4;
  --text: #0a0a0a;
  --text-2: #4d4d4d;
  --text-3: #6b6b6b;
  /* The accent is the text colour: black buttons, black links, black focus. */
  --accent: #6d3ce8;
  --accent-hover: #5a2bd0;
  --accent-text: #6131df;
  --accent-bg: #f1ecfe;
  --on-accent: #ffffff;
  --on-danger: #ffffff;
  --backdrop: rgb(0 0 0 / 0.4);
  --focus: #6d3ce8;

  --add-text: #0f6a4f;
  --add-bg: #e6f2ec;
  --add-strong: #c6e3d5;
  --del-text: #6b6b6b;
  --del-bg: #fbedea;
  --del-strong: #f3d0c8;
  /* Warnings are grey, not amber, so nothing competes with the coral. */
  --warn-text: #8a5a00;
  --warn-bg: #fdf3dc;
  --warn-border: #efd38a;
  /* Danger text and fills. The coral itself (--coral) marks a Blocker only. */
  --danger: #c13c25;
  --danger-hover: #a8321e;
  --danger-bg: #fcebe6;
  --ok-text: #0f6a4f;
  --ok-bg: #e1f1ea;

  /* The fixed brand colours, the same in light and dark: the coral of a
     Blocker, and the black band (the hub sidebar, the landing's #where
     section) with its raised surfaces. */
  --coral: #e0533b;
  --band: #0a0a0a;
  --band-raise: #141414;
  --band-head: #1c1c1c;

  /* Agent colours: distinct hues, each at least 3:1 against the surface.
     Data only, never decoration. */
  --a0: #0d8073;
  --a1: #b06400;
  --a2: #8446cc;
  --a3: #c0336f;
  --a4: #1b6fb8;
  --a5: #687a0e;
  --a6: #c4492a;
  --a7: #8b5e34;
  --outside: #a3a3a3;

  /* Quiet syntax: keywords and names in the text colour, strings dark green,
     comments grey. */
  --code-kw: #0a0a0a;
  --code-str: #1a6e3a;
  --code-num: #4d4d4d;
  --code-com: #6b6b6b;
  --code-fn: #0a0a0a;

  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.04);
  --shadow-pop: 0 1px 2px rgb(0 0 0 / 0.05), 0 0 0 1px rgb(0 0 0 / 0.04), 0 12px 32px -8px rgb(0 0 0 / 0.14);
  /* Soft, round shapes; buttons and badges are pills (hub.css, site.css). */
  --radius: 8px;
  --radius-lg: 14px;
  --sidebar: 232px;
}

/* Dark: from [data-theme], from the system, and always inside the black
   band (.side, .sidebar, .where), which reads as dark in both themes. */
:root[data-theme="dark"],
:is(.side, .sidebar, .where) {
  color-scheme: dark;
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-2: #111111;
  --surface-3: #1a1a1a;
  --border: #1f1f1f;
  --border-strong: #2e2e2e;
  --text: #ededed;
  --text-2: #a1a1a1;
  --text-3: #8f8f8f;
  --accent: #9b7cff;
  --accent-hover: #b39cff;
  --accent-text: #b9a3ff;
  --accent-bg: rgb(155 124 255 / 0.14);
  --on-accent: #0a0a0a;
  --on-danger: #160807;
  --backdrop: rgb(0 0 0 / 0.6);
  --focus: #9b7cff;
  --add-text: #6fd0a8;
  --add-bg: rgb(111 208 168 / 0.09);
  --add-strong: rgb(111 208 168 / 0.22);
  --del-text: #a1a1a1;
  --del-bg: rgb(255 122 98 / 0.09);
  --del-strong: rgb(255 122 98 / 0.22);
  --warn-text: #f0c060;
  --warn-bg: rgb(240 192 96 / 0.12);
  --warn-border: rgb(240 192 96 / 0.3);
  --danger: #ff7a62;
  --danger-hover: #ff9480;
  --danger-bg: rgb(255 122 98 / 0.13);
  --ok-text: #6fd0a8;
  --ok-bg: rgb(111 208 168 / 0.12);
  --a0: #3ec9b8;
  --a1: #f0a640;
  --a2: #b993f6;
  --a3: #f27bb0;
  --a4: #62aef0;
  --a5: #b6cc4c;
  --a6: #f58b6c;
  --a7: #d6a878;
  --outside: #737373;
  --code-kw: #ededed;
  --code-str: #8fd6a2;
  --code-num: #a1a1a1;
  --code-com: #8f8f8f;
  --code-fn: #ededed;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.5);
  --shadow-pop: 0 1px 2px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.06), 0 16px 40px -8px rgb(0 0 0 / 0.7);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --surface: #0a0a0a;
    --surface-2: #111111;
    --surface-3: #1a1a1a;
    --border: #1f1f1f;
    --border-strong: #2e2e2e;
    --text: #ededed;
    --text-2: #a1a1a1;
    --text-3: #8f8f8f;
    --accent: #9b7cff;
    --accent-hover: #b39cff;
    --accent-text: #b9a3ff;
    --accent-bg: rgb(155 124 255 / 0.14);
    --on-accent: #0a0a0a;
    --on-danger: #160807;
    --backdrop: rgb(0 0 0 / 0.6);
    --focus: #9b7cff;
    --add-text: #6fd0a8;
    --add-bg: rgb(111 208 168 / 0.09);
    --add-strong: rgb(111 208 168 / 0.22);
    --del-text: #a1a1a1;
    --del-bg: rgb(255 122 98 / 0.09);
    --del-strong: rgb(255 122 98 / 0.22);
    --warn-text: #f0c060;
    --warn-bg: rgb(240 192 96 / 0.12);
    --warn-border: rgb(240 192 96 / 0.3);
    --danger: #ff7a62;
    --danger-hover: #ff9480;
    --danger-bg: rgb(255 122 98 / 0.13);
    --ok-text: #6fd0a8;
    --ok-bg: rgb(111 208 168 / 0.12);
    --a0: #3ec9b8;
    --a1: #f0a640;
    --a2: #b993f6;
    --a3: #f27bb0;
    --a4: #62aef0;
    --a5: #b6cc4c;
    --a6: #f58b6c;
    --a7: #d6a878;
    --outside: #737373;
    --code-kw: #ededed;
    --code-str: #8fd6a2;
    --code-num: #a1a1a1;
    --code-com: #8f8f8f;
    --code-fn: #ededed;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.5);
    --shadow-pop: 0 1px 2px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.06), 0 16px 40px -8px rgb(0 0 0 / 0.7);
  }
}

/* Motion: one vocabulary for the desk and the hub. Operate surfaces move
   little and fast: ease-out, 120 to 240 ms, transform and opacity only. */
:root {
  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-slow: 240ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}
