/*
 * Semantic tokens name a role, not a value. Components use only these.
 * Naming: --color-{role}, with -subtle / -strong / on- qualifiers.
 * Keep the color set small (roughly 15-25): every token is something each
 * theme has to account for.
 */
@layer tokens {
  :root {
    color-scheme: light dark;

    --color-bg:          light-dark(var(--paper-50),  var(--ink-900));
    --color-surface:     light-dark(white,            var(--ink-800));
    --color-text:        light-dark(var(--ink-800),   var(--paper-200));
    --color-text-subtle: light-dark(var(--ink-400),   var(--paper-400));
    --color-border:      light-dark(var(--paper-300), var(--ink-400));   /* decorative: cards, dividers */
    --color-border-strong: var(--slate-500);   /* control boundaries: 3:1 against the surface (WCAG 1.4.11) */

    --color-accent:      light-dark(var(--brand-600), var(--brand-400));
    --color-on-accent:   light-dark(white, var(--ink-800));
    --color-danger:      light-dark(var(--red-600), var(--red-400));
    --color-on-danger:   light-dark(white, var(--ink-900));
    --color-success:     var(--green-700);
    --color-on-success:  white;
    --color-focus:       var(--color-accent);

    --space-gap:      var(--space-4);
    --space-page:     1.333rem;   /* <main>'s padding around every page; off the scale to keep the original design's gutter */
    --measure:        60ch;   /* the longest comfortable line of text */
    --radius-control: var(--radius-md);
    --control-border-width:   2px;
    --control-padding-block:  var(--space-3);
    --control-padding-inline: var(--space-4);
    --radius-card:    var(--radius-md);
    --radius-sheet:   var(--radius-lg);
    --font-body:      system-ui, sans-serif;
    --font-heading:   Georgia, "Times New Roman", serif;   /* bookish headings and quotes */

    /* Elevation: how far something sits above the page */
    --shadow-raised:  var(--shadow-sm);   /* cards */
    --shadow-lifted:  var(--shadow-md);   /* a card under the pointer */
    --shadow-overlay: var(--shadow-lg);   /* floating buttons, toasts, sheets */

    --nav-height: 3.75rem;   /* the fixed bottom navigation bar */
  }
}
