/* Generated by tools/build-css.mjs from assets/css/main.css — do not edit.
 *
 * Edit the part named in the marker above each block, then run: npm run build
 * An edit made here is lost at the next build, and a drift check that rebuilds this file and diffs
 * it fails in the meantime.
 */

/* assets/css/tokens.css */
/* The few values everything else is written in. Dark follows the reader's setting. */

:root {
  color-scheme: light dark;

  --ink: #1d1f24;
  --ink-soft: #545a66;
  --paper: #fbfaf7;
  --rule: #e2dfd7;
  --accent: #7a3cff;
  --code-paper: #f1eee6;

  /* A sample's highlighting: every colour at 4.5:1 or better on --code-paper, the branches of a tree
     aside — they are decoration, and the entry beside them is what is read. */
  --code-keyword: #6528d8;
  --code-type: #0b6b72;
  --code-call: #1f5bb8;
  --code-string: #2a6b1a;
  --code-branch: #aaa598;

  --measure: 48rem;
  --gutter: clamp(1rem, 4vw, 2rem);

  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-code: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6e3dc;
    --ink-soft: #a29f98;
    --paper: #16171b;
    --rule: #2c2e35;
    --accent: #b394ff;
    --code-paper: #202228;

    --code-keyword: #c3a6ff;
    --code-type: #6fd3c9;
    --code-call: #8ab8ff;
    --code-string: #a8d98a;
    --code-branch: #4c4f59;
  }
}

/* The type grows with a wide window — from the reader's own size at 1200px to a fifth larger at
   1800px — and every rem with it, the measure included: a widescreen reads the same page larger,
   rather than a narrow column in an empty field, and a line never gets longer than it reads. */
html {
  font-size: clamp(100%, 62.5% + 0.5vw, 118.75%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.65 var(--font-text);
}

/* assets/css/shell.css */
/* Layout.php's shell: the header with the navigation, the page, the footer — and each page's
   language switch, above what the page says. */

.language-switch {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-block-end: 1.5rem;
  font-size: 0.9rem;
}

.language-switch a {
  color: var(--ink-soft);
}

.language-switch a:hover,
.language-switch a:focus-visible {
  color: var(--accent);
}

/* The language the page is in: said, not offered. */
html[lang="en"] .language-switch a[hreflang="en"],
html[lang="de"] .language-switch a[hreflang="de"] {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.site-header,
main,
.site-footer {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding-block: 1.5rem 1rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
}

main {
  padding-block: 2rem 3rem;
}

.site-footer {
  padding-block: 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.site-footer a {
  color: inherit;
}

/* assets/css/prose.css */
/* The pages themselves: each a markup tree its view builds, through Prose.php, in each language. */

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 {
  margin-block: 0 1rem;
  font-size: 2.1rem;
}

h2 {
  margin-block: 2.5rem 0.75rem;
  font-size: 1.4rem;
}

h3 {
  margin-block: 1.75rem 0.5rem;
  font-size: 1.1rem;
}

a {
  color: var(--accent);
}

/* Every subheading links to its own anchor — see Page.php. It reads as a heading, and shows a mark
   only when pointed at; the mark's empty alternative text keeps it out of the link's name. */
:is(h2, h3) > a[href^="#"] {
  color: inherit;
  text-decoration: none;
}

:is(h2, h3) > a[href^="#"]::after {
  content: "#" / "";
  margin-inline-start: 0.4em;
  color: var(--ink-soft);
  opacity: 0;
}

:is(h2, h3) > a[href^="#"]:is(:hover, :focus-visible)::after {
  opacity: 1;
}

p,
ul,
ol {
  margin-block: 0 1rem;
}

li + li {
  margin-top: 0.35rem;
}

code {
  padding: 0.1em 0.3em;
  border-radius: 0.25rem;
  background: var(--code-paper);
  font: 0.9em var(--font-code);
}

/* A code sample: <code-line>s inside a <code-block>, and the tokens inside them, each named for what
   it is (CodeTag). The block keeps its whitespace the way <pre> would; the lines are inline, with
   the sample's own newlines between them, so copying one copies the sample exactly. */
code-block {
  display: block;
  white-space: pre;
  overflow-x: auto;
  margin-block: 0 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 0.4rem;
  background: var(--code-paper);
  font: 0.88rem/1.5 var(--font-code);

  code-comment {
    color: var(--ink-soft);
    font-style: italic;
  }

  &[language="php"] {
    code-keyword,
    code-variable { color: var(--code-keyword); }

    code-type { color: var(--code-type); }
    code-call { color: var(--code-call); }
    code-string { color: var(--code-string); }
  }

  &[language="shell"] {
    code-command { font-weight: 600; }
    code-flag { color: var(--code-type); }
  }

  &[language="tree"] {
    code-branch { color: var(--code-branch); }
  }
}

.lede {
  color: var(--ink-soft);
  font-size: 1.15rem;
}
