/* Menomentis — what the preferences in src/prefs.js change. */

/* ---------- Document font ---------- */

/*
 * The person's font sets every piece of text on screen: documents, file names
 * and chrome alike. The three faces are captured on :root as --face-*, and the
 * two screen tokens are pointed at the chosen one on body, which is what lets
 * a token be restated without referring to itself. --font-serif is left alone,
 * so printed sheets keep their face whatever is picked.
 */
:root {
  --face-normal: var(--font-sans);
  --face-robotic: var(--font-mono);
  --face-classic: var(--font-serif);
}

:root[data-doc-font="robotic"] body {
  --font-sans: var(--face-robotic);
}

:root[data-doc-font="normal"] body {
  --font-mono: var(--face-normal);
}

:root[data-doc-font="classic"] body {
  --font-sans: var(--face-classic);
  --font-mono: var(--face-classic);
}

/* ---------- Background ---------- */

/*
 * The slider moves every ground together by --ground-shift in OKLCH lightness,
 * so the steps between canvas, surface, sunken and raised stay as designed.
 * The theme's own grounds are captured on :root and the shifted ones defined
 * on body, which is what lets a token be restated in terms of itself.
 */
:root[data-ground] {
  --ground-canvas: var(--bg-canvas);
  --ground-surface: var(--bg-surface);
  --ground-raised: var(--bg-raised);
  --ground-sunken: var(--bg-sunken);
  --ground-hover: var(--bg-hover);
  --ground-selected: var(--bg-selected);
}

:root[data-ground] body {
  --bg-canvas: oklch(from var(--ground-canvas) calc(l + var(--ground-shift)) c h);
  --bg-surface: oklch(from var(--ground-surface) calc(l + var(--ground-shift)) c h);
  --bg-raised: oklch(from var(--ground-raised) calc(l + var(--ground-shift)) c h);
  --bg-sunken: oklch(from var(--ground-sunken) calc(l + var(--ground-shift)) c h);
  --bg-hover: oklch(from var(--ground-hover) calc(l + var(--ground-shift)) c h);
  --bg-selected: oklch(from var(--ground-selected) calc(l + var(--ground-shift)) c h);
}
