:root,
[data-theme="light"] {
  color-scheme: light;

  --color-paper: #faf8f4;
  --color-paper-deep: #f1ece4;
  --color-surface: #fffdf9;
  --color-surface-raised: #ffffff;
  --color-ink: #1c1917;
  --color-ink-soft: #403a36;
  --color-muted: #6a5f57;
  --color-faint: #7a6e65;
  --color-line: #d8cec2;
  --color-line-soft: #e8e1d8;
  --color-accent: #874a38;
  --color-accent-strong: #713928;
  --color-accent-soft: #f0ded5;
  --color-on-accent: #fffaf6;
  --color-positive: #3d6b54;
  --color-note: #426c7a;
  --color-caution: #875e13;
  --color-warning: #9a352f;
  --color-focus: #186a8d;
  --color-backdrop: rgb(31 25 21 / 48%);

  --shadow-cover: 0 14px 30px rgb(70 50 34 / 16%), 0 2px 5px rgb(70 50 34 / 10%);
  --shadow-book: 0 1px 1px rgb(40 28 18 / 14%), 0 8px 14px -6px rgb(40 28 18 / 28%), 0 18px 24px -18px rgb(40 28 18 / 30%);
  --shadow-sheet: 0 32px 80px rgb(42 31 23 / 24%);

  --wood-hi: #8a6240;
  --wood: #6a4a2f;
  --wood-lo: #4b3320;
  --wood-edge: #33220f;
  --case-back: #d9cfbd;
  --case-shade: rgb(60 40 20 / 34%);
  --on-wood: #f0e6d6;
  --brass: #b79657;
  --brass-lo: #7d6435;
  --plate: #f4ecd9;
  --plate-ink: #2b2521;
  --shadow-case: 0 14px 22px -14px rgb(40 26 14 / 55%);
}

[data-theme="dark"] {
  color-scheme: dark;

  --color-paper: #16151a;
  --color-paper-deep: #111015;
  --color-surface: #201e24;
  --color-surface-raised: #29262d;
  --color-ink: #e8e4dd;
  --color-ink-soft: #d2ccc3;
  --color-muted: #aaa198;
  --color-faint: #9a9189;
  --color-line: #4b454d;
  --color-line-soft: #363239;
  --color-accent: #d38c73;
  --color-accent-strong: #e2a28a;
  --color-accent-soft: #452d28;
  --color-on-accent: #211512;
  --color-positive: #83b59a;
  --color-note: #8eb9c6;
  --color-caution: #e0b762;
  --color-warning: #ed8b82;
  --color-focus: #76c3e1;
  --color-backdrop: rgb(4 3 6 / 68%);

  --shadow-cover: 0 18px 34px rgb(0 0 0 / 34%), 0 2px 5px rgb(0 0 0 / 30%);
  --shadow-book: 0 1px 1px rgb(0 0 0 / 40%), 0 8px 14px -6px rgb(0 0 0 / 55%), 0 18px 24px -18px rgb(0 0 0 / 60%);
  --shadow-sheet: 0 32px 80px rgb(0 0 0 / 52%);

  --wood-hi: #5a4130;
  --wood: #3f2d20;
  --wood-lo: #2a1d14;
  --wood-edge: #150e09;
  --case-back: #0f0d10;
  --case-shade: rgb(0 0 0 / 60%);
  --on-wood: #f0e6d6;
  --brass: #a88a52;
  --brass-lo: #5f4c28;
  --plate: #e9dfc8;
  --plate-ink: #2b2521;
  --shadow-case: 0 14px 22px -14px rgb(0 0 0 / 70%);
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    color-scheme: dark;

    --color-paper: #16151a;
    --color-paper-deep: #111015;
    --color-surface: #201e24;
    --color-surface-raised: #29262d;
    --color-ink: #e8e4dd;
    --color-ink-soft: #d2ccc3;
    --color-muted: #aaa198;
    --color-faint: #9a9189;
    --color-line: #4b454d;
    --color-line-soft: #363239;
    --color-accent: #d38c73;
    --color-accent-strong: #e2a28a;
    --color-accent-soft: #452d28;
    --color-on-accent: #211512;
    --color-positive: #83b59a;
    --color-note: #8eb9c6;
    --color-caution: #e0b762;
    --color-warning: #ed8b82;
    --color-focus: #76c3e1;
    --color-backdrop: rgb(4 3 6 / 68%);
    --shadow-cover: 0 18px 34px rgb(0 0 0 / 34%), 0 2px 5px rgb(0 0 0 / 30%);
    --shadow-book: 0 1px 1px rgb(0 0 0 / 40%), 0 8px 14px -6px rgb(0 0 0 / 55%), 0 18px 24px -18px rgb(0 0 0 / 60%);
    --shadow-sheet: 0 32px 80px rgb(0 0 0 / 52%);
    --wood-hi: #5a4130;
    --wood: #3f2d20;
    --wood-lo: #2a1d14;
    --wood-edge: #150e09;
    --case-back: #0f0d10;
    --case-shade: rgb(0 0 0 / 60%);
    --on-wood: #f0e6d6;
    --brass: #a88a52;
    --brass-lo: #5f4c28;
    --plate: #e9dfc8;
    --plate-ink: #2b2521;
    --shadow-case: 0 14px 22px -14px rgb(0 0 0 / 70%);
  }
}

:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --font-display: "Fraunces", "Literata", "Iowan Old Style", Georgia, serif;
  --font-reading: "Literata", "New York", Charter, "Iowan Old Style", Georgia, serif;

  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5625rem;
  --text-2xl: 1.9375rem;
  --text-3xl: 2.4375rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem; /* used by the dialog forms; was missing, so their padding was 0 */
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  --radius-xs: 2px;
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-pill: 999px;
  --content-max: 92rem;
  --transition-fast: 140ms ease-out;
  --gutter: var(--space-5);

  --color-action: var(--color-ink);
  --color-action-hover: var(--color-ink-soft);
  --color-on-action: var(--color-paper);

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;
}
