/* Clippy portal design tokens (standard §10a): the one place for colour, type, space,
   shape and elevation. Each colour holds its light and its dark value with light-dark():
   the page follows the system theme, and the theme toggle pins one by setting
   color-scheme on the root (data-theme). Every text colour pair meets WCAG 2.2 AA
   (4.5:1); input boundaries, filled buttons and focus outlines reach 3:1 (WCAG 1.4.11);
   buttons named by their text may have a quieter border. Both themes.
   Baseline: browsers with light-dark() (2024 on); passkeys need a current browser anyway,
   and an older one shows default colours, still readable. */

:root {
  color-scheme: light dark;

  /* Type: only fonts already on the device (strict CSP, nothing downloaded). */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    "URW Palladio L", Georgia, serif;
  --font-body: "Seravek", "Gill Sans Nova", "Gill Sans", "Segoe UI Variable Text",
    "Segoe UI", "Noto Sans", "DejaVu Sans", sans-serif;
  --font-mono: "Cascadia Mono", "SF Mono", "JetBrains Mono", Menlo, Consolas,
    "DejaVu Sans Mono", monospace;
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-3: clamp(2.1rem, 1.6rem + 2.4vw, 3.6rem);

  /* Space and shape */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2.25rem;
  --space-7: 3.5rem;
  --radius: 0.375rem;
  --radius-card: 0.75rem;

  /* Colour: paper and ink by day, ink-blue by night; one vermilion accent. */
  --paper: light-dark(#f3eee3, #0e131d);
  --paper-deep: light-dark(#e9e2d2, #0a0e16);
  --card: light-dark(#fbf8f1, #151c2a);
  --ink: light-dark(#1c2230, #ebe5d7);
  --ink-soft: light-dark(#4a5263, #aab1c0);
  --rule: light-dark(#cfc5b1, #2c3547);
  --accent: light-dark(#0e5a4b, #5fd0b5);
  --on-accent: light-dark(#ffffff, #0b1a17);
  --accent-hover: light-dark(#0a473b, #86dec9);
  --clip: light-dark(#a9380a, #f08a5d);
  --focus: light-dark(#a9380a, #f08a5d);
  --danger: light-dark(#a3241a, #ff8f84);
  --ok: light-dark(#0e5a4b, #5fd0b5);
  --grain-a: light-dark(rgba(28, 34, 48, 0.035), rgba(235, 229, 215, 0.025));
  --grain-b: light-dark(rgba(169, 56, 10, 0.03), rgba(240, 138, 93, 0.035));

  /* Elevation */
  --shadow-near: light-dark(rgba(28, 34, 48, 0.06), rgba(0, 0, 0, 0.4));
  --shadow-far: light-dark(rgba(28, 34, 48, 0.28), rgba(0, 0, 0, 0.7));
  --shadow: 0 1px 0 var(--shadow-near), 0 14px 36px -14px var(--shadow-far);
}

/* The theme toggle's choice (theme.js); without it the system theme applies. */
:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}
