/* Grove design tokens. Every colour, size, space and duration the site uses comes from here.
 * The home page and the writing pages both build on these; STYLE.md explains how to use them.
 * Night values are set when light.js decides the visitor's sky is dark. */
:root {
  /* Colour. Ink and paper only; the interface has no accent. */
  --ink: #1f1d1a;
  --muted: color-mix(in srgb, var(--ink) 82%, transparent);   /* the sentence under a heading, abstracts */
  /* quiet and faint are the lightest text that still reads at 4.5:1 on every paper of the day (dusk is the hardest). */
  --quiet: color-mix(in srgb, var(--ink) 70%, transparent);   /* footnotes, dates, metadata: 5.2:1 at worst */
  --faint: color-mix(in srgb, var(--ink) 68%, transparent);   /* controls at rest: 4.9:1 at worst */
  --rule:  color-mix(in srgb, var(--ink) 14%, transparent);   /* hairlines */
  --tint:  color-mix(in srgb, var(--ink) 5%, transparent);    /* code and callout grounds */
  --bg: #f5f0e2;                                               /* replaced by light.js with the day's paper */
  --paper: #f3eee1;                                            /* the primed panel under the painting */
  --card: #f2ebda;                                             /* cards stay paper by day and by night */
  --card-ink: #1f1d1a;

  /* Type. One family, one weight; hierarchy is size and colour. */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --serif-zh: var(--serif), "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --serif-ar: var(--serif), "Geeza Pro", "Noto Naskh Arabic", "Amiri", "Traditional Arabic", serif;
  /* The grotesk: the apparatus of the writing pages (labels, numbers, titles, the grid).
   * The visitor's own system face, so nothing is downloaded. */
  --sans: "Helvetica Neue", Helvetica, "Nimbus Sans", Arial, sans-serif;
  --sans-zh: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --sans-ar: "Helvetica Neue", Helvetica, Arial, "Geeza Pro", "Noto Sans Arabic", Tahoma, sans-serif;
  --light: 300;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --step--2: 0.72rem;                      /* fine print on short screens */
  --step--1: 0.78rem;                      /* footnotes, labels, dates */
  --step-0: 1.125rem;                      /* body */
  --step-1: 1.35rem;                       /* section headings */
  --step-2: clamp(1.6rem, 3vw, 2.1rem);    /* post titles in lists */
  --step-3: clamp(2rem, 4.6vw, 3.4rem);    /* page titles */
  --leading-tight: 1.08;
  --leading-snug: 1.3;
  --leading: 1.6;
  --leading-read: 1.7;                     /* long-form reading */
  --tracking-small: 0.02em;
  --tracking-label: 0.04em;

  /* Space. A short scale; layouts use gap, not margins. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --gutter: clamp(1.25rem, 7vw, 6rem);
  --measure: 36rem;                        /* a comfortable line of reading */
  --wide: 56rem;                           /* figures, code and tables may reach this far */

  /* Shape and motion. */
  --radius: 6px;
  --shadow-card: 0 1px 2px rgba(20, 16, 10, 0.12), 0 14px 34px -10px rgba(20, 16, 10, 0.35);
  --hairline: 1px;
  --ease: ease;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --duration-quick: 0.14s;
  --duration: 0.2s;
  --duration-slow: 0.45s;

  color-scheme: light;
}
:root.night {
  --ink: #ece7db;
  --muted: color-mix(in srgb, var(--ink) 85%, transparent);
  --bg: #2a3350;
  color-scheme: dark;
}
