/* BrandMan Cloud tokens (#200). A Carbon-style product system: IBM Plex Sans,
   Gray 10 (light) and Gray 100 (dark) neutrals, a blue interactive color for
   links and focus, and one proof red kept for the brand mark and the
   approval stamp. Source of truth for
   values: the BrandMan Cloud design system (docs/design/system.md links it).
   Light ("Proof") is the default. Dark ("Press room") follows the theme attribute
   set from the cookie, local storage, or the system preference.
   Newsreader, IBM Plex Sans and IBM Plex Mono are self-hosted (SIL Open Font
   License, fonts/OFL.txt). */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/site/fonts/newsreader-variable.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("/site/fonts/plex-sans-variable.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/site/fonts/plex-mono-regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/site/fonts/plex-mono-medium.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #f4f4f4;
  --card: #ffffff;
  --field: #ffffff;
  --ink: #161616;
  --muted: #525252;
  --faint: #6f6f6f;
  --line: #e0e0e0;
  --line-2: #e8e8e8;
  --hover: #e8e8e8;
  --chip: #e0e0e0;
  --code-bg: #f4f4f4;
  --band: #ffffff;
  --accent: #c4321a;
  --accent-hover: #a1270f;
  --accent-ink: #a1270f;
  --accent-soft: #fff1f1;
  --accent-line: #ffb3b8;
  --on-accent: #ffffff;
  --bad: #da1e28;
  --bad-ink: #a2191f;
  --bad-bg: #fff1f1;
  --good: #198038;
  --good-ink: #0e6027;
  --good-bg: #defbe6;
  --warn: #8e6a00;
  --warn-ink: #684e00;
  --warn-bg: #fcf4d6;
  --warn-line: #f1c21b;
  --info: #0f62fe;
  --info-soft: #edf5ff;
  --inverse: #393939;
  --focus: #0f62fe;
  --inverse-ink: #f4f4f4;
  --shadow: none;
  --shadow-pop: 0 2px 6px rgba(0, 0, 0, .2);
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: var(--sans);
  --serif: var(--display);
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", "Liberation Mono", monospace;
  /* Legacy aliases. Older selectors still read these names. */
  --paper: var(--bg);
  --teal: var(--ink);
  --teal-ink: var(--muted);
  --amber: var(--warn);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 28px;
  --text-4xl: 32px;
  /* Carbon-style control sizes and weights (#200). */
  --control-sm: 32px;
  --control-md: 40px;
  --control-lg: 48px;
  --weight-regular: 400;
  --weight-semibold: 600;
  --space-9: 80px;
  --space-10: 96px;
  --content-max: 1200px;
  /* Corners: 2px chips, 4px controls and cards, 8px dialogs and frames. */
  --radius-sm: 2px;
  --radius: 4px;
  --radius-lg: 8px;
  --radius-xl: 8px;
  --sidebar: 240px;
  --topbar: 56px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161616;
  --card: #262626;
  --field: #1c1c1c;
  --ink: #f4f4f4;
  --muted: #c6c6c6;
  --faint: #8d8d8d;
  --line: #393939;
  --line-2: #333333;
  --hover: #333333;
  --chip: #393939;
  --code-bg: #161616;
  --band: #1c1c1c;
  --accent: #ff8389;
  --accent-hover: #ffb3b8;
  --accent-ink: #ffb3b8;
  --accent-soft: #3d1a1c;
  --accent-line: #750e13;
  --on-accent: #161616;
  --bad: #fa4d56;
  --bad-ink: #ff8389;
  --bad-bg: #3a1214;
  --good: #42be65;
  --good-ink: #6fdc8c;
  --good-bg: #0f2e1a;
  --warn: #f1c21b;
  --warn-ink: #f1c21b;
  --warn-bg: #302400;
  --warn-line: #8e6a00;
  --info: #78a9ff;
  --info-soft: #10213e;
  --inverse: #f4f4f4;
  --focus: #ffffff;
  --inverse-ink: #161616;
  --shadow: none;
  --shadow-pop: 0 2px 6px rgba(0, 0, 0, .6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #161616;
    --card: #262626;
    --field: #1c1c1c;
    --ink: #f4f4f4;
    --muted: #c6c6c6;
    --faint: #8d8d8d;
    --line: #393939;
    --line-2: #333333;
    --hover: #333333;
    --chip: #393939;
    --code-bg: #161616;
    --band: #1c1c1c;
    --accent: #ff8389;
    --accent-hover: #ffb3b8;
    --accent-ink: #ffb3b8;
    --accent-soft: #3d1a1c;
    --accent-line: #750e13;
    --on-accent: #161616;
    --bad: #fa4d56;
    --bad-ink: #ff8389;
    --bad-bg: #3a1214;
    --good: #42be65;
    --good-ink: #6fdc8c;
    --good-bg: #0f2e1a;
    --warn: #f1c21b;
    --warn-ink: #f1c21b;
    --warn-bg: #302400;
    --warn-line: #8e6a00;
    --info: #78a9ff;
    --info-soft: #10213e;
    --inverse: #f4f4f4;
    --focus: #ffffff;
    --inverse-ink: #161616;
    --shadow: none;
    --shadow-pop: 0 2px 6px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--ink); }
