/* "Drafting sheet" theme shared by the *.mkrutzler.com sites: warm paper with a faint grid,
   ink hairlines, yellow highlighter fills, orange markup ink, square corners, no shadows.
   Canonical copy: ~/server/www/shared/sketch.css. The cal and habits apps and the website link it
   through symlinks; Glance's custom.css repeats the palette in its own HSL format (keep in sync).

   Tokens: --accent is a fill (always pair with --accent-text); --accent-ink is for text, rings and
   lines on paper; --border is a construction line, --border-strong an object line, --text is ink. */
:root {
  --bg: #f8f4ea;
  --surface: #fdfbf6;
  --surface-2: #f2ebdb;
  --surface-3: #e9dfc8;
  --text: #26211a;
  --muted: #74685a;
  --border: #e1d5bb;
  --border-strong: #a4937a;
  --accent: #f6c445;
  --accent-text: #26211a;
  --accent-ink: #c2410c;
  --accent-soft: #fbedc2;
  --danger: #b42318;
  --warn: #b45309;
  --today: #ea580c;
  --grid: rgb(194 65 12 / 5.5%);
  --grid-major: rgb(194 65 12 / 9%);
  --backdrop: rgb(38 33 26 / 28%);
  --shadow: none;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14120e;
    --surface: #1b1813;
    --surface-2: #241f18;
    --surface-3: #2e281f;
    --text: #efe7d6;
    --muted: #a99b83;
    --border: #322b21;
    --border-strong: #6c5f4a;
    --accent: #f2b632;
    --accent-text: #1a1408;
    --accent-ink: #fb8c3c;
    --accent-soft: #3a2d12;
    --danger: #f87171;
    --warn: #fdba74;
    --today: #fb8c3c;
    --grid: rgb(251 140 60 / 4.5%);
    --grid-major: rgb(251 140 60 / 8%);
    --backdrop: rgb(0 0 0 / 50%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14120e; --surface: #1b1813; --surface-2: #241f18; --surface-3: #2e281f; --text: #efe7d6;
  --muted: #a99b83; --border: #322b21; --border-strong: #6c5f4a; --accent: #f2b632; --accent-text: #1a1408;
  --accent-ink: #fb8c3c; --accent-soft: #3a2d12; --danger: #f87171; --warn: #fdba74; --today: #fb8c3c;
  --grid: rgb(251 140 60 / 4.5%); --grid-major: rgb(251 140 60 / 8%); --backdrop: rgb(0 0 0 / 50%); color-scheme: dark;
}

*, *::before, *::after { border-radius: 0; }
body {
  background-color: var(--bg);
  /* drafting paper: 8 px minor grid, 40 px major grid */
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 8px 8px, 8px 8px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
}
::selection { background: var(--accent); color: var(--accent-text); }

/* Corner registration ticks, like the crop marks on a drawing sheet. Sets background-image only,
   so the element keeps its own background colour. */
.ticks {
  --tick: 10px;
  --tick-c: var(--accent-ink);
  background-image:
    linear-gradient(var(--tick-c), var(--tick-c)), linear-gradient(var(--tick-c), var(--tick-c)),
    linear-gradient(var(--tick-c), var(--tick-c)), linear-gradient(var(--tick-c), var(--tick-c)),
    linear-gradient(var(--tick-c), var(--tick-c)), linear-gradient(var(--tick-c), var(--tick-c)),
    linear-gradient(var(--tick-c), var(--tick-c)), linear-gradient(var(--tick-c), var(--tick-c));
  background-repeat: no-repeat;
  background-size:
    var(--tick) 1px, 1px var(--tick), var(--tick) 1px, 1px var(--tick),
    var(--tick) 1px, 1px var(--tick), var(--tick) 1px, 1px var(--tick);
  background-position:
    top left, top left, top right, top right,
    bottom left, bottom left, bottom right, bottom right;
}

/* Small uppercase annotation text, as lettered on drawings. */
.annot {
  font: 500 11px/1.3 var(--mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}
