/* ============================================================
   tokens.css — the one vocabulary
   ============================================================

   Loaded by BOTH shells: templates/base.html (the app) and
   apps/website/templates/website/base.html (the public site).

   It exists because those two had entirely separate palettes. The
   marketing site declared --primary, --text-primary and --text-secondary
   in a <style> block with one set of values; theme.css declared the same
   names with different ones. A component authored against one rendered
   wrong in the other, and the app had no carbon yellow at all.

   This file holds the world and the scales. It does NOT hold semantic
   surface tokens (--bg-*, --text-*, --border-*): those are theme
   -dependent and live in theme.css, mapped from the raw values below.
   ============================================================ */

:root {
    /* --------------------------------------------------------
       The paper world. Raw values; nothing here is themed.
       Taken from the job card the trade already fills in by hand.
       -------------------------------------------------------- */
    --paper:     #FCFCFA;   /* top copy */
    --paper-2:   #F4F2EC;   /* second surface */
    --ink:       #16233A;   /* ledger blue-black */
    --ink-2:     #0E1726;   /* deeper, for dark-mode ground */
    --ink-3:     #132034;
    --ink-4:     #1D2D47;
    --ink-soft:  #3B5A82;   /* readable blue on paper */
    --ink-pale:  #9FB0C8;   /* readable blue-grey on ink */
    --rule:      #D6D3CA;   /* printed form rule */
    --carbon:    #F2C94C;   /* canary duplicate — the one bold element */
    --stamp:     #9B2C2C;   /* validation mark */
    --muted:     #6E6A60;   /* warm grey, on paper */
    --muted-2:   #8A867C;

    /* --------------------------------------------------------
       Brand — the organisation's own colour, the one bold element.

       Default is carbon: the same yellow as the sign-up button on
       spexcrm.co.za, so logged-out and logged-in read as one product.
       base.html overrides --brand per tenant from
       Organization.brand_color, and injects --on-brand alongside it
       (computed from the colour's luminance in Python, because CSS
       cannot pick a readable foreground reliably yet).

       --brand is a FILL, never text. An organisation may pick any
       colour, including ones that are illegible as type on their own
       background, so links and interactive text use --link instead
       and stay readable whatever is chosen. Spend boldness once.
       -------------------------------------------------------- */
    --brand:     #F2C94C;
    --on-brand:  #16233A;   /* text that sits ON a --brand fill */

    /* --------------------------------------------------------
       Semantic state. Deliberately NOT the brand: an invoice is
       overdue regardless of what colour the business picked.
       -------------------------------------------------------- */
    --accent-success: #0f9d6e;
    --accent-warning: #b4791a;
    --accent-danger:  #d04545;
    --accent-info:    #3b6fb5;

    /* --------------------------------------------------------
       Space. There was no scale at all before this: padding and
       margin were literals, mixing px and rem freely, with ~30
       distinct component paddings.
       -------------------------------------------------------- */
    --space-1:  4px;
    --space-2:  8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;

    /* --------------------------------------------------------
       Radius. One scale, one spelling.

       Replaces 43 declarations across 16 distinct values written in
       two unit systems in parallel, where 6px and 0.375rem both
       appeared for the same intent. px, not rem: a corner should not
       grow when someone raises their font size.
       -------------------------------------------------------- */
    --radius-xs:   3px;   /* chips, inline code */
    --radius-sm:   5px;   /* inputs, buttons */
    --radius-md:   8px;   /* cards, nav links */
    --radius-lg:  12px;   /* dropdowns, modals */
    --radius-pill: 999px;

    /* --------------------------------------------------------
       Type. The heading scale was coherent; everything under 1rem
       was not — nine distinct sizes, several differing by less than
       half a pixel and used interchangeably. Four now.
       -------------------------------------------------------- */
    --text-xs:   0.75rem;    /* 12px — badges, timestamps */
    --text-sm:   0.8125rem;  /* 13px — table heads, labels, help text */
    --text-base: 0.9375rem;  /* 15px — body */
    --text-lg:   1.0625rem;  /* 17px — card titles */

    --font-display: 'Zilla Slab', Georgia, serif;
    --font-ui:      'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono:    'SF Mono', 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

    /* Motion */
    --transition-speed: 0.15s;
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
}
