/* LexBOE design tokens — the one source for the landing (served as /tokens.css)
   and the console (imported by src/index.css, bundled by Vite). Direction A,
   "annotated code", chosen by Hugo in #676: the law on white paper, a highlighter
   on the quoted text and blue-ballpoint margin notes for its provenance.

   Fonts are self-hosted (latin subset, SIL OFL 1.1, licences beside them) so no
   visitor's address reaches a third party just by opening the page. */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/instrument-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/source-serif-4-latin.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  --font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-display: var(--font-sans);
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --paper: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --ink: #1c2430;
  --muted: #4a5462;
  --line: #d5d8de;
  --line-strong: #b9bfc8;

  /* the action colour is the ink itself; blue is the annotator's pen */
  --primary: #1c2430;
  --primary-hover: #33405a;
  --on-primary: #ffffff;
  --note: #2b4fd8;
  --note-hover: #1c2430;
  --note-soft: #e8edfc;
  --mark: #f5e663;
  --on-mark: #1c2430;

  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --ok: #1f7a4d;
  --ok-soft: #e3f1e9;
  --warn: #8a6100;
  --warn-soft: #fbf1d6;

  --focus: #2b4fd8;
  --shadow-sm: none;
  --shadow: 0 1px 2px rgba(28, 36, 48, 0.06), 0 14px 32px -20px rgba(28, 36, 48, 0.28);
  --backdrop: rgba(28, 36, 48, 0.55);

  --radius: 4px;
  --radius-sm: 4px;
}

/* Dark values, applied by the OS preference unless the user forced light, and by an
   explicit data-theme="dark". Written twice because CSS cannot alias a block. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12161d;
    --surface: #181d26;
    --surface-2: #212833;
    --ink: #e7eaef;
    --muted: #a4adba;
    --line: #2a313c;
    --line-strong: #3a4350;
    --primary: #e7eaef;
    --primary-hover: #ffffff;
    --on-primary: #12161d;
    --note: #8ea6ff;
    --note-hover: #e7eaef;
    --note-soft: #1d2540;
    --mark: #4d4615;
    --on-mark: #f6f0c8;
    --danger: #f2867d;
    --danger-soft: #2c1716;
    --ok: #5cc08f;
    --ok-soft: #13241b;
    --warn: #e0b04d;
    --warn-soft: #2a2312;
    --focus: #8ea6ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 34px -18px rgba(0, 0, 0, 0.7);
    --backdrop: rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  --paper: #12161d;
  --surface: #181d26;
  --surface-2: #212833;
  --ink: #e7eaef;
  --muted: #a4adba;
  --line: #2a313c;
  --line-strong: #3a4350;
  --primary: #e7eaef;
  --primary-hover: #ffffff;
  --on-primary: #12161d;
  --note: #8ea6ff;
  --note-hover: #e7eaef;
  --note-soft: #1d2540;
  --mark: #4d4615;
  --on-mark: #f6f0c8;
  --danger: #f2867d;
  --danger-soft: #2c1716;
  --ok: #5cc08f;
  --ok-soft: #13241b;
  --warn: #e0b04d;
  --warn-soft: #2a2312;
  --focus: #8ea6ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 34px -18px rgba(0, 0, 0, 0.7);
  --backdrop: rgba(0, 0, 0, 0.6);
}

/* The highlighter stroke: a band that stops short of the line box, as a real one does. */
mark.hl {
  background: linear-gradient(transparent 12%, var(--mark) 12%, var(--mark) 88%, transparent 88%);
  color: var(--on-mark);
  padding: 0 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
