/* Scrawl's tokens: every color, size, corner and shadow the parts are built from. The Writer side's values
   sit on :root (Reading room: a partners' desk under a banker's lamp, mahogany, green leather, brass and
   cream paper); the Producer side's on body.producer (a production office at night: green-black, call-sheet
   white). Stylesheets ask for a token by its job, so a side changes by changing values here, not rules.
   Materials that are things in the world (the legal pad, cork, index cards, revision colors, strip colors)
   keep their own colors where they're drawn. */
:root {
  /* The room */
  --desk: #21130c;
  --desk-light: #33201a;
  --mahogany: #2c1910;
  --mahogany-deep: #1f120b;
  --leather: #224330;
  --leather-deep: #13291d;
  --brass: #c9a14a;
  --brass-ink: #1d120b;
  --brass-line: rgb(201 161 74 / 0.5);

  /* Words and controls on the dark room and the bars */
  --chrome: #f3ead6;
  --chrome-muted: #c9b893;
  --chrome-rule: rgb(243 234 214 / 0.13);
  --accent: #d6aa4f;
  --accent-ink: #1d120b;
  --danger: #b3261e;
  --danger-on-dark: #ffb4ab;

  /* Sheets: the paper every page that isn't the script is written on */
  --sheet: #f8f1e0;
  --sheet-ink: #241f19;
  --sheet-soft: #61574a;
  --sheet-muted: #745f3f;
  --sheet-rule: #e6dbc2;
  --sheet-line: #cdbf9f;
  --sheet-tint: #f1e8d3;
  --field: #fffbf0;
  --primary-on-paper: #1f4a35;
  --primary-on-paper-ink: #f8f1e0;
  --danger-on-paper: #a3261b;

  /* Notices on paper: "look here", "all good", "this one" */
  --notice: #fbecc8;
  --notice-strong: #f5d58e;
  --notice-ink: #5c4510;
  --ok: #e3efdc;
  --ok-strong: #c9e4c5;
  --ok-ink: #24502a;

  /* The script itself: the legal pad and the typed page, which stays white because it's a printed page */
  --ink: #1f2a44;
  --pencil: #6b6b6b;
  --pad-yellow: #fbf3a4;
  --pad-rule: #a6c6e3;
  --pad-margin: #e07a7a;
  --binding: #8e2a24;
  --typed-paper: #fffffb;
  --typed-ink: #111;
  --page: var(--typed-paper); /* the script page being read or written, which turns down at night */
  --page-ink: var(--typed-ink);
  --paper-scheme: light; /* form controls drawn on paper */

  /* Each font has one job: Nunito Sans every control, label and paragraph; Courier the script's words;
     Kalam what's written by hand on a pad. */
  --font-hand: "Kalam", "Comic Neue", cursive;
  --font-typed: "Courier Prime", "Courier New", Courier, monospace;
  --font-ui: "Nunito Sans", system-ui, sans-serif;

  /* Seven sizes */
  --text-xs: 0.72rem;
  --text-sm: 0.85rem;
  --text-md: 0.95rem;
  --text-base: 1rem;
  --text-lg: 1.2rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.9rem;

  /* Four corners: chips, controls, sheets, pills */
  --radius-chip: 4px;
  --radius-control: 8px;
  --radius-sheet: 12px;
  --radius-pill: 999px;

  /* Three shadows: paper lying on the desk, paper lifted off it, a menu */
  --shadow-paper: 0 1px 2px rgb(0 0 0 / 0.3), 0 22px 46px rgb(0 0 0 / 0.5);
  --shadow-lifted: 0 2px 4px rgb(0 0 0 / 0.25), 0 28px 56px rgb(0 0 0 / 0.55);
  --shadow-menu: 0 8px 24px rgb(0 0 0 / 0.5);

  /* Two sheet widths: narrow for forms, wide for tables */
  --sheet-narrow: 38rem;
  --sheet-wide: 54rem;

  /* One spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  --focus-ring: 2px solid var(--accent);

  color-scheme: dark;
}

body.producer {
  --desk: #111915;
  --desk-light: #18231d;
  --producer-raise: #213029;
  --producer-line: #2f4238;
  --chrome: #e9efea;
  --chrome-muted: #a3b5aa;
  --chrome-rule: rgb(233 239 234 / 0.13);
  --signal: #3ddc84;
  --signal-ink: #05240f;
  --go: #2f9e55;
  --go-ink: #1d6b3e;

  --sheet: #fcfcfa;
  --sheet-ink: #14201a;
  --sheet-soft: #4d5650;
  --sheet-muted: #5f6f66;
  --sheet-rule: #e3e7e2;
  --sheet-line: #c9cfc8;
  --sheet-tint: #f1f3f0;
  --field: #fff;
  --primary-on-paper: #111915;
  --primary-on-paper-ink: #e9efea;

  --font-ui: "IBM Plex Sans", system-ui, sans-serif;

  --radius-sheet: 8px;
}

/* Night: the lamp turned down, for writing in the dark. Picked per device in the account menu
   (AppearancesController), never on its own. Sheets and the script page go dark with warm ink; the legal
   pad and the index cards stay what they are, a shade dimmer. Strip and revision colors don't change,
   since people say them out loud. */
html[data-theme="night"] {
  --sheet: #231b15;
  --sheet-ink: #efe5d0;
  --sheet-soft: #c7b8a0;
  --sheet-muted: #b9a27a;
  --sheet-rule: #3a2e24;
  --sheet-line: #574631;
  --sheet-tint: #2c221a;
  --field: #1a1410;
  --primary-on-paper: #5aa47c;
  --primary-on-paper-ink: #0e1912;
  --danger-on-paper: #ff9e8f;

  --notice: #3a2e13;
  --notice-strong: #5a4519;
  --notice-ink: #f2d690;
  --ok: #1c3122;
  --ok-strong: #2a4a32;
  --ok-ink: #bfe3c2;

  --page: #1f1d1a;
  --page-ink: #e6dfd0;
  --pad-yellow: #e2d78b;
  --paper-scheme: dark;
}

html[data-theme="night"] body.producer {
  --sheet: #17201b;
  --sheet-ink: #e3ebe5;
  --sheet-soft: #aab9af;
  --sheet-muted: #95a89c;
  --sheet-rule: #26332c;
  --sheet-line: #3a4c42;
  --sheet-tint: #1d2822;
  --field: #111915;
  --primary-on-paper: #d9e6dd;
  --primary-on-paper-ink: #111915;
  --go: #3ddc84;
  --go-ink: #74e2a5;
}
