/*
 * Charta design tokens. The one source for colour, type, radius and spacing on every Charta page:
 * the Room, link pages, the desk, the admin portal, the supervisor's approval page, anything new.
 * Taken from what already ships (apps/api/public/room.html, link.html, desk.html).
 * Link this file, or copy these variables exactly. Never hard-code a colour a token already names.
 */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Hanken+Grotesk:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  /* Colour: light (default) */
  --ground: #f6f3ee;     /* page background; in the Room (step 286) the fill of what sits on the surface reading column: Charta's messages, inputs, neutral chips */
  --surface: #fffdf9;    /* cards, sheets, inputs on a card; in the Room (step 286) the rails, the title band and the reading column */
  --ink: #1d1a16;        /* body text; the primary button's fill */
  --ink-2: #5b554c;      /* secondary text */
  --ink-3: #6f695e;      /* labels, timestamps, hints, 13px and up only (owner, 15 Nov: 5.4:1 on surface, 4.9:1 on ground) */
  --line: #e4ddd2;       /* borders and dividers */
  --gold: #a07a2c;       /* "your turn" only: the waiting card's border, the dot when it is the person's turn; never words (3.9:1) */
  --gold-text: #86621f;  /* "your turn" words only: the waiting card's heading (owner, 16 Nov: links go to ink, eyebrows to ink-2) */
  --gold-soft: #f3ead6;  /* "your turn" fill only: the waiting card */
  --gold-fill: #c39a48;  /* the gold button's fill: the person's own action (owner, 15 Nov: ink text on gold; 6.6:1) */
  --on-gold: #1d1a16;    /* text on --gold-fill */
  --ok: #2f6b4f;         /* done (with a tick and the word "Done"), live; the same green as moving */
  --ok-soft: #e3f0e8;
  --warm-soft: #efebe4;  /* the neutral warm fill: the member's own messages, the picked row */

  /* Four piece states (owner, 16 Nov, product direction 79; step 219). Word = status words and chip text,
     mark = the dot, a left rule or the chip dot, soft = the chip or card fill. Words 4.5:1 and marks 3:1 on
     surface, ground and their own soft fill, light and dark. Shapes: moving filled dot, needs you filled dot
     with a soft halo, late filled dot, waiting hollow ring (1.5px). */
  --state-moving: #2f6b4f;         /* moving: on track (= --ok) */
  --state-moving-mark: #2f6b4f;
  --state-moving-soft: #e3f0e8;
  --state-needs-you: #86621f;      /* needs you: the person's turn (= --gold-text) */
  --state-needs-you-mark: #a07a2c;
  --state-needs-you-soft: #f3ead6;
  --state-late: #b5432f;           /* late or blocked: late, refused (owner's value) */
  --state-late-mark: #b5432f;
  --state-late-soft: #f9e9e4;
  --state-waiting: #5b554c;        /* waiting: on someone else, nothing late (= --ink-2) */
  --state-waiting-mark: #6f695e;
  --state-waiting-soft: #efebe4;

  /* Deprecated (step 219): aliases of the late tokens for one release; use --state-late and --state-late-soft. */
  --warn: var(--state-late);
  --warn-soft: var(--state-late-soft);

  /* Type */
  --font-display: "Cormorant Garamond", Georgia, serif;   /* titles only, 22px and up */
  --font-body: "Hanken Grotesk", system-ui, sans-serif;  /* everything else */
  --font-mono: "IBM Plex Mono", ui-monospace, monospace; /* ids, versions, eyebrow labels */
  --text-xs: 12px;   /* chips, eyebrows */
  --text-sm: 13px;   /* muted lines */
  --text-md: 15px;   /* body */
  --text-lg: 22px;   /* card titles (display) */
  --text-xl: 32px;   /* page titles (display) */

  /* Shape and space */
  --radius-sm: 10px;   /* buttons, inputs, list rows */
  --radius-md: 12px;   /* option rows, the action card */
  --radius-lg: 14px;   /* cards, messages */
  --radius-pill: 999px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --page-max: 1040px;  /* the Room and link pages; admin pages may go to 1280px */
  --tap: 44px;         /* smallest touch target */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #15171e; --surface: #1c1f28; --ink: #f4f2ee; --ink-2: #c9c4bb; --ink-3: #8f8a82;
    --line: #2c303b; --gold: #d2a95a; --gold-text: #d2a95a; --gold-soft: #2c2618; --gold-fill: #d2a95a; --on-gold: #15171e; --ok: #8fd0ab; --ok-soft: #1c2c24;
    --warm-soft: #262a33;
    --state-moving: #8fd0ab; --state-moving-mark: #8fd0ab; --state-moving-soft: #1c2c24;
    --state-needs-you: #d2a95a; --state-needs-you-mark: #d2a95a; --state-needs-you-soft: #2c2618;
    --state-late: #ef8f7a; --state-late-mark: #ef8f7a; --state-late-soft: #33201d;
    --state-waiting: #c9c4bb; --state-waiting-mark: #8f8a82; --state-waiting-soft: #262a33;
  }
}
:root[data-theme="dark"] {
  --ground: #15171e; --surface: #1c1f28; --ink: #f4f2ee; --ink-2: #c9c4bb; --ink-3: #8f8a82;
  --line: #2c303b; --gold: #d2a95a; --gold-text: #d2a95a; --gold-soft: #2c2618; --gold-fill: #d2a95a; --on-gold: #15171e; --ok: #8fd0ab; --ok-soft: #1c2c24;
  --warm-soft: #262a33;
  --state-moving: #8fd0ab; --state-moving-mark: #8fd0ab; --state-moving-soft: #1c2c24;
  --state-needs-you: #d2a95a; --state-needs-you-mark: #d2a95a; --state-needs-you-soft: #2c2618;
  --state-late: #ef8f7a; --state-late-mark: #ef8f7a; --state-late-soft: #33201d;
  --state-waiting: #c9c4bb; --state-waiting-mark: #8f8a82; --state-waiting-soft: #262a33;
}

/* Inside pages: palette B (owner, 20 November 2026, product direction 176; step 343).
 * The signed-in app pages (the Room and the operator pages) set data-palette="inside" on <html>; the landing and
 * link pages keep the look above. Charta's fonts stay. Gold stays for "your turn"; the four piece states keep their
 * word and mark colours; --state-waiting follows B's inks. Words 4.5:1 or better on every fill, light and dark
 * (test/text-tokens-contrast.test.ts). The accent is the brand's mark and the send button: never words in light,
 * never a state, never "your turn". --accent, --accent-text, --on-accent, --member, --on-member and --chrome exist only
 * here: they are B's, and only the inside pages use them. */
:root[data-palette="inside"] {
  --ground: #f4f3ef; --surface: #ffffff; --ink: #16161a; --ink-2: #5c5c63; --ink-3: #68686f; --line: #e2e1dc; --warm-soft: #ecebe6;
  --on-gold: #16161a;
  --state-waiting: #5c5c63; --state-waiting-mark: #68686f; --state-waiting-soft: #ecebe6;
  --accent: #d9442b; --accent-text: #b8371f; --on-accent: #ffffff; --member: #16161a; --on-member: #ffffff; --chrome: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="inside"]:not([data-theme="light"]) {
    --ground: #07090f; --surface: #0e1626; --ink: #f2f3f5; --ink-2: #b7bdc9; --ink-3: #8d95a5; --line: #1f2a3d; --warm-soft: #16213a;
    --on-gold: #07090f;
    --state-waiting: #b7bdc9; --state-waiting-mark: #8d95a5; --state-waiting-soft: #16213a;
    --accent: #d9442b; --accent-text: #f07a5f; --on-accent: #ffffff; --member: #1b2740; --on-member: #f2f3f5; --chrome: #0b111e;
  }
}
:root[data-palette="inside"][data-theme="dark"] {
  --ground: #07090f; --surface: #0e1626; --ink: #f2f3f5; --ink-2: #b7bdc9; --ink-3: #8d95a5; --line: #1f2a3d; --warm-soft: #16213a;
  --on-gold: #07090f;
  --state-waiting: #b7bdc9; --state-waiting-mark: #8d95a5; --state-waiting-soft: #16213a;
  --accent: #d9442b; --accent-text: #f07a5f; --on-accent: #ffffff; --member: #1b2740; --on-member: #f2f3f5; --chrome: #0b111e;
}
