/*
 * The paper look every public page shares (spec §07A): the landing page, the
 * help pages, the legal pages, the install guide and the handbook. It holds
 * what those pages cannot each restate without drifting — the house fonts,
 * the paper ground with its grain, and the brand mark. The colors are the
 * Paper group in tokens.css. The app never loads this file: its own pages
 * take the same tone flat, with no grain, from styles/paper-tone.css, and a
 * canvas draws the grain only when its dashboard's theme names it
 * (styles/app.css).
 */

/* The fonts have their own file, because the app loads them too. */
@import url('./fonts.css');

html {
  font-family: var(--font-prose);
  -webkit-font-smoothing: antialiased;
}

/* The paper ground: a seamless generated tile (scripts/paper-texture.py),
   fixed to the window. The luminosity blend takes the tile's grain and keeps
   the paper's own colour, so one tile per mode serves the paper tones. A bar
   that has to cover the page as it scrolls repeats the ground with
   `background: inherit; background-blend-mode: inherit`, and its grain lines
   up with the page's because both are fixed to the window. */
body {
  background: url('./paper/paper-light.jpg') 0 0 / 1024px repeat fixed var(--paper);
  background-blend-mode: luminosity;
  color: var(--ink);
}

[data-mode='dark'] body {
  background-image: url('./paper/paper-dark.jpg');
}

/* A system set to more contrast draws the paper flat on every page, as it
   does the canvas grain (spec §08A). The bars that inherit the ground go
   flat with it. */
@media (prefers-contrast: more) {
  body,
  [data-mode='dark'] body {
    background-image: none;
  }
}

/* The mark beside the name is the app's icon (public/favicon.svg), so every
   page carries one mark. It is the small drawing: the cream sheet (аркуш) in
   flag-blue ink with its corner folded. The path is root-absolute because the
   app, the help pages and the install-guide site all serve public/ at the root. */
/* TODO(2026-10-02): the handbook opened as a local file resolves /favicon.svg
   to the filesystem root and shows no mark. A copy beside this stylesheet
   would load everywhere, at the cost of a second copy of the icon. */
.paper-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 600 17px/1 var(--font-prose);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.paper-brand::before {
  content: '';
  flex: none;
  width: 22px;
  height: 22px;
  background: url('/favicon.svg') center / contain no-repeat;
}
