/* Design tokens: every colour, size and space of the interface. Other
   stylesheets use these and no raw colour or px size (a test checks). */

/* The colour roles. A palette is one value for each role in the light theme
   and the night theme, in a file under palettes/; a component takes its
   colours from these roles and from nothing else (a test checks both).
   Each role: its token, what it is for, and who uses it.

   The page and the levels of a panel
   --color-page            the page behind the text and the top bar
                           base, topbar, personmenu (its list), thread,
                           composer, blockmark, discussionbox
   --color-panel           a panel beside the text, and a row in it
                           shell (the drawer), gallery
   --color-panel-head      the heading of a group of rows
                           prose (the head of a table)
   --color-raised          a thing that stands on the page or a panel: a quiet
                           button, a code box, a note, an opened menu button
                           button, prose, docheader, personmenu, shell, gallery
   The levels of text
   --color-text            the text; also the text on every background above
                           base, topbar, path, nav, personmenu, button, gallery,
                           prose, discussionbox
   --color-text-muted      secondary text: dates, labels, an empty place
                           nav, path, docheader, emptystate, personmenu,
                           button (disabled), gallery, comment, thread,
                           composer, blockmark, discussionbox
   Borders, hover, focus, links
   --color-border          the lines between and around things
                           shell, topbar, prose, docheader, personmenu,
                           themeswitch, button, gallery, thread, composer,
                           blockmark, discussionbox
   --color-hover           a row under the pointer
                           personmenu, discussionbox
   --color-focus           the ring around the control that has the focus
                           base
   --color-link            a link in text and a link that stands alone
                           base, nav, discussionbox
   The selected thing, strong and quiet
   --color-selected        the mark of the selected or current thing: a bar
                           at the start of a row, the fill of a current state
                           nav, themeswitch, docheader, prose
                           (the blocks of the open discussion)
   --color-on-selected     text on the selected colour
                           themeswitch, docheader
   --color-selected-quiet  the background of a selected row that is not in
                           focus; the row keeps the text colours
                           nav
   The marker for quoted text
   --color-mark            a marker pen over text: a quoted passage, the
                           text selected with the pointer, the bar beside
                           a run of blocks a comment is about, the mark of
                           a block with comments, the quote of the open
                           discussion
                           base, prose, thread, composer, blockmark,
                           discussionbox
   --color-on-mark         text under the marker
                           base, blockmark, prose
   --color-mark-quiet      the marker, faintly: the quoted piece of a
                           discussion that is not open
                           prose
   The primary action
   --color-primary         the one main action on a screen
                           button
   --color-on-primary      its text
                           button
   The states, each as text (also the edge of its notice) and as a tinted
   background that the text and the state's own colour stand on
   --color-danger          an error, a step that cannot be undone
                           notice, button, thread (declined),
                           discussionbox (a card)
   --color-on-danger       text on the danger colour
                           button
   --color-danger-bg       the tint of a danger notice
                           notice, thread (declined), discussionbox (a card)
   --color-success         a step that went well
                           notice, thread (accepted), discussionbox (a card)
   --color-success-bg      the tint of a success notice
                           notice, thread (accepted), discussionbox (a card)
   --color-warning         a thing that needs a look before it goes wrong
                           nobody yet: the board's warnings
   --color-warning-bg      the tint of a warning
                           nobody yet: the board's warnings
   --color-info            a fact worth knowing now
                           notice, comment (the mark of an agent)
   --color-info-bg         the tint of an information notice
                           notice, comment (the mark of an agent)
*/

/* The theme. A browser that knows light-dark() follows the device, or the
   person's choice in data-theme on <html>; color-scheme makes form controls
   and scroll bars follow. An older browser (Safari before 17.5, Chrome
   before 123) shows the light theme: each palette gives every role a plain
   light value before its light-dark() form. */
:root { color-scheme: light; }
@supports (color: light-dark(#000000, #FFFFFF)) {
  :root { color-scheme: light dark; }
  :root[data-theme="light"] { color-scheme: light; }
  :root[data-theme="night"] { color-scheme: dark; }
}
:root {
  --font-sans: "IBM Plex Sans", "IBM Plex Sans Thai Looped", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-xs: 0.8125rem;  /* 13px */
  --text-sm: 0.875rem;   /* 14px */
  --text-md: 1rem;       /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.375rem;   /* 22px */
  --text-2xl: 1.75rem;   /* 28px */
  --weight-normal: 400;
  --weight-strong: 600;
  --leading: 1.55;
  --leading-thai: 1.8;

  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.5rem;     /* 24px */
  --space-6: 2rem;       /* 32px */
  --space-7: 3rem;       /* 48px */
  --radius: 6px;
  --border: 1px;
  --focus-width: 2px;
  --focus-offset: 2px;
  --tap: 2.75rem;        /* 44px, the least height of a tap target */
  --measure: 42rem;      /* longest line of running text */
  --page: 72rem;         /* widest page content */
  --text-column: 68ch;   /* widest column of document text */
  --bar: 3.75rem;        /* 60px, the height of the top bar */
  --nav: 16rem;          /* the navigation column and the drawer */
  --gutter: 2rem;        /* the start padding of the text: the marks of comments hang in it */
  --margin-min: 20rem;   /* the margin column for comments, from 1024 px */
  --margin-max: 26rem;
}
