:root {
  --color-page: oklch(97.5% 0.009 128);
  --color-ink-light: oklch(23% 0.02 258 / 12%);
  /* Links and the main action: a blue a step deeper than the palette's, 4.5:1 or more on white and on a tinted ground. */
  --color-link: oklch(52% 0.18 261);

  --color-body: var(--color-page);
  --color-text-subtle: var(--color-ink-dark);
  /* Metadata, the dates, counts and states said beside or under a title, is a quiet warm grey, on a paler pill when it is one. 4.5:1 or more on white, the tinted ground and the pill. */
  --color-meta: oklch(48% 0.024 72);
  --color-meta-fill: oklch(95% 0.008 80);
  /* A name or place chosen in a field: a pill a step off the sheet. */
  --color-chip-fill: oklch(98.1% 0.008 74);
  /* A round control on a popup: the popup's own white, a step off it in the dark theme. */
  --color-canvas-light: var(--color-canvas);
  /* The suggestion Enter takes: a brighter blue than a link's, under the canvas's ink. */
  --color-selected-strong: oklch(56.8% 0.16 254);
  /* A tool's name over its preview: a brick red, soft salmon in the dark theme. */
  --color-heading-accent: oklch(47% 0.13 33);
  /* Callouts, a match in a search and a filter in use: an amber, not the warning's yellow. */
  --color-highlight: oklch(92% 0.08 84);
  /* The Pings pill while something is unread: a pale apricot, a deeper one under the pointer; brown-ambers in the dark theme. */
  --color-pings: oklch(95.5% 0.043 82);
  --color-pings-hover: oklch(92.1% 0.071 79);
  /* The dashed edge of a blank slate on a page: a pale yellow, dimmed in the dark theme. */
  --color-blank-slate-border: oklch(93% 0.116 96);
  --color-text-placeholder: var(--color-ink-medium);

  /* Read by Fizzy's verbatim files under these names. */
  --color-text: var(--color-ink);
  --color-ink-ligher: var(--color-ink-lighter);
  --card-bg-color: var(--color-canvas);
  --color-always-black: var(--color-black);
  --color-border-darker: var(--color-ink-light);
  --font-size-medium: var(--text-medium);

  --tint-ink-2: color-mix(in oklch, var(--color-ink) 2%, transparent);
  --tint-ink-3: color-mix(in oklch, var(--color-ink) 3%, transparent);
  --tint-ink-5: color-mix(in oklch, var(--color-ink) 5%, transparent);
  --tint-ink-10: color-mix(in oklch, var(--color-ink) 10%, transparent);
  --tint-ink-15: color-mix(in oklch, var(--color-ink) 15%, transparent);
  --tint-ink-20: color-mix(in oklch, var(--color-ink) 20%, transparent);
  --tint-ink-25: color-mix(in oklch, var(--color-ink) 25%, transparent);
  --tint-ink-35: color-mix(in oklch, var(--color-ink) 35%, transparent);
  --tint-ink-50: color-mix(in oklch, var(--color-ink) 50%, transparent);
  --tint-ink-75: color-mix(in oklch, var(--color-ink) 75%, transparent);

  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  --leading-snug: 1.35;

  /* The frame and its controls, in pixels as measured. The root is 16px below 800 wide and 19px from 800 up (base.css, at 100ch), so each size is set for both and lands on the same pixels. */
  --top-bar-height: 3rem;          /* 48px */
  --sheet-gutter: 0px;
  --sheet-padding: 1rem;           /* 16px */
  --sheet-padding-end: 9rem;       /* 144px */
  --sheet-size-standard: 100%;     /* the sheet fills the window */
  --sheet-size-narrow: 100%;
  --sheet-size-medium: 100%;
  /* What the strip takes, its hairline included. The scroll padding reads it too. */
  --strip-height: 3rem;            /* 48px */
  --strip-padding: 1rem;           /* 16px: before the crumbs */
  --strip-padding-end: 0.5rem;     /* 8px: after the last action */
  --control-size: 2rem;            /* 32px: a button or a field */
  --control-gap: 0.5rem;           /* 8px: between the controls on a row, and from a title to its row */
  --filter-field-size: 9.375rem;   /* 150px: a list's filter field */
  --text-control: 0.875rem;        /* 14px: a button's words, the strip's crumbs */
  --text-action: 1rem;             /* 16px: a form's main action at its foot */
  --text-section: 1.25rem;         /* 20px: a section's title */
  --text-section-large: 1.25rem;   /* 20px: a settings page's section, no larger than the page's name on a phone */
  --text-note: 1rem;               /* 16px: a note where content would be */
  --text-row: 1rem;                /* 16px: a row on a phone */
  --text-pill: 0.8rem;             /* 12.8px: a metadata pill on a phone */
  --text-page-title: 1.5rem;       /* 24px: a page's name */
  --page-header-space: 2rem;       /* 32px: from a page's heading to its content */

  @media (width >= 640px) {
    --text-row: 1.125rem;            /* 18px */
    --text-pill: 0.9rem;             /* 14.4px */
  }

  @media (min-width: 100ch) {
    --top-bar-height: 3.8rem;          /* 72px */
    --sheet-gutter: 2.5rem;            /* 48px */
    --sheet-padding: 2.1rem;           /* 40px */
    --sheet-padding-end: 7.5rem;       /* 143px */
    --sheet-size-standard: 57.25rem;   /* 1088px */
    --sheet-size-narrow: 49.75rem;     /* 945px */
    --sheet-size-medium: 42rem;        /* 798px */
    --strip-height: 2.5rem;            /* 48px */
    --strip-padding: 0.85rem;          /* 16px */
    --strip-padding-end: 0.42rem;      /* 8px */
    --control-size: 1.6875rem;         /* 32px */
    --control-gap: 0.42rem;            /* 8px */
    --filter-field-size: 7.9rem;       /* 150px */
    --text-control: 0.75rem;           /* 14px */
    --text-action: 0.842rem;           /* 16px */
    --text-section: 1.05rem;           /* 20px */
    --text-section-large: 1.263rem;    /* 24px */
    --text-note: 0.842rem;             /* 16px */
    --text-row: 0.95rem;               /* 18px */
    --text-pill: 0.76rem;              /* 14.4px */
    --text-page-title: 1.9rem;         /* 36px */
    --page-header-space: 1.7rem;       /* 32px */
  }

  --shadow-card: 0 0 0 1px var(--tint-ink-5),
                 0 1px 2px var(--tint-ink-5),
                 0 4px 10px var(--tint-ink-5);
  --shadow-modal: 0 0 0 1px var(--tint-ink-10),
                  0 4px 12px var(--tint-ink-10),
                  0 14px 32px var(--tint-ink-10);
  --shadow-lg: 0 -1px 1px oklch(var(--lch-black) / 2.5%),
               0 1px 2px -0.5px oklch(var(--lch-black) / 5%),
               0 2px 4px -1px oklch(var(--lch-black) / 10%),
               0 4px 8px -2px oklch(var(--lch-black) / 10%),
               0 16px 32px -8px oklch(var(--lch-black) / 10%);

  --duration-fast: 75ms;
  --duration-medium: 150ms;
  --duration-slow: 300ms;
  --duration-slower: 400ms;
}

html[data-theme="dark"] {
  --color-page: oklch(15% 0.016 248);
  --color-ink-light: oklch(96% 0.0034 260 / 16%);
  --color-link: oklch(78% 0.11 255);
  --color-meta: oklch(79% 0.014 80);
  --color-meta-fill: oklch(29% 0.016 245);
  --color-chip-fill: oklch(27% 0.024 245);
  --color-canvas-light: var(--color-chip-fill);
  --color-selected-strong: oklch(75% 0.13 250);
  --color-heading-accent: oklch(78% 0.09 35);
  --color-highlight: oklch(34% 0.05 80);
  --color-pings: oklch(36.9% 0.032 72);
  --color-pings-hover: oklch(42.9% 0.054 62);
  --color-blank-slate-border: oklch(43% 0.054 82);

  --shadow-card: 0 0 0 1px var(--tint-ink-5),
                 0 1px 2px oklch(var(--lch-black) / 40%),
                 0 4px 12px oklch(var(--lch-black) / 50%);
  --shadow-modal: 0 0 0 1px var(--tint-ink-10),
                  0 8px 24px oklch(var(--lch-black) / 50%),
                  0 24px 64px oklch(var(--lch-black) / 70%);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --color-page: oklch(15% 0.016 248);
    --color-ink-light: oklch(96% 0.0034 260 / 16%);
    --color-link: oklch(78% 0.11 255);
    --color-meta: oklch(79% 0.014 80);
    --color-meta-fill: oklch(29% 0.016 245);
    --color-chip-fill: oklch(27% 0.024 245);
    --color-canvas-light: var(--color-chip-fill);
    --color-selected-strong: oklch(75% 0.13 250);
    --color-heading-accent: oklch(78% 0.09 35);
    --color-highlight: oklch(34% 0.05 80);
    --color-pings: oklch(36.9% 0.032 72);
    --color-pings-hover: oklch(42.9% 0.054 62);
    --color-blank-slate-border: oklch(43% 0.054 82);

    --shadow-card: 0 0 0 1px var(--tint-ink-5),
                   0 1px 2px oklch(var(--lch-black) / 40%),
                   0 4px 12px oklch(var(--lch-black) / 50%);
    --shadow-modal: 0 0 0 1px var(--tint-ink-10),
                    0 8px 24px oklch(var(--lch-black) / 50%),
                    0 24px 64px oklch(var(--lch-black) / 70%);
  }
}
