/* ─────────────────────────────────────────────────────────────────────────
 * design-systems/decant/tokens.css
 *
 * Decant — a context compiler for language models. Pour off the clear
 * part, leave the sediment behind.
 *
 * Brand identity in three sentences:
 *   1. Bench paper and laboratory glassware: a cool mineral pale-green
 *      ground (#EDF0EC), near-white glass panes, and a deep bottle-green
 *      ink (#1E2622) for text, structure and every primary action.
 *   2. Colour is a signal, never a mood. Reagent violet (#7A3FA8) means
 *      "something was found and needs your review"; clear green (#3E8C7A)
 *      means "verified". A screen with no findings has no violet on it.
 *   3. Bricolage Grotesque for everything read, Commit Mono for everything
 *      counted (tabular figures, always), Source Serif 4 for marketing prose.
 *
 * Schema decisions:
 *   - --accent is the ink (#1E2622): primary buttons are dark-on-bench.
 *   - --warn aliases --reagent: over-budget is "needs review", not amber.
 *   - --success aliases --clear.
 *   - --muted (#6A6E67) and --clear-ink (#357869) are darkened so text in
 *     those roles reaches ≥4.5:1 on --bg and --surface. The raw hues
 *     (--residue, --clear) are for fills, bars and 3:1 indicators only.
 *   - Radius is small (4 / 6 / 10): glassware, not a SaaS card kit.
 *   - Elevation is ring + whisper. No soft grey drop shadows.
 *   - Two motion durations; the single orchestrated moment is
 *     --motion-sweep (2000ms) for the redaction sweep.
 *   - A dark theme is provided under [data-theme="dark"] and
 *     prefers-color-scheme; token names do not change.
 * ─────────────────────────────────────────────────────────────────── */

:root {
  /* Accepted editorial workspace, scoped by the application shell. */
  --workspace-canvas: #F5F4F0;
  --workspace-paper: #FFFFFF;
  --workspace-ink: #25332C;
  --workspace-muted: #657069;
  --workspace-border: #D7DDD5;
  --sidebar-bg: #1D2C25;
  --sidebar-fg: #F0F3EE;
  --sidebar-muted: #B3C3B8;
  --sidebar-border: #526258;
  --sidebar-selected: #3C5144;
  --font-reading: "Decant Reading", Georgia, "Times New Roman", serif;

  /* ─── Surface ──────────────────────────────────────────────────── */
  --bg:           #EDF0EC;              /* bench — page ground, never white */
  --surface:      #FBFCFA;              /* glass — panes, cards, rails */
  --surface-warm: var(--surface);       /* no warm tier in a mineral system */

  /* ─── Foreground ───────────────────────────────────────────────── */
  --fg:    #1E2622;                     /* sediment — text, structure, 13.5:1 */
  --fg-2:  #3F4A44;                     /* secondary text, 8.0:1 */
  --muted: #6A6E67;                     /* residue-ink — captions, 4.5:1 */
  --meta:  #868B82;                     /* non-essential metadata, 3.0:1 */

  /* ─── Border ───────────────────────────────────────────────────── */
  --border:      #CCD0CC;               /* hairlines, rails, inputs */
  --border-soft: #DADEDA;               /* row dividers inside panes */

  /* ─── Accent (ink) ─────────────────────────────────────────────── */
  --accent:        #1E2622;             /* primary action — ink on bench */
  --accent-on:     #FBFCFA;             /* glass text on ink, 15:1 */
  --accent-hover:  #2B3530;
  --accent-active: #141A17;

  /* ─── Semantic state ───────────────────────────────────────────── */
  --success: var(--clear);              /* verified: zero network, budget met */
  --warn:    var(--reagent);            /* over budget = needs review */
  --danger:  #A83F3F;                   /* destructive confirmations, and a drag the app refuses */

  /* ─── Type ─────────────────────────────────────────────────────── */
  --font-display: "Bricolage Grotesque", "Bricolage Grotesque Variable", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-body:    "Bricolage Grotesque", "Bricolage Grotesque Variable", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "Commit Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --text-xs:   12px;                    /* labels, kbd hints */
  --text-sm:   13px;                    /* captions, file paths (mono) */
  --text-base: 15px;                    /* UI body */
  --text-lg:   17px;                    /* lead paragraphs, prose */
  --text-xl:   22px;                    /* pane titles */
  --text-2xl:  28px;                    /* page headings, the budget total */
  --text-3xl:  40px;                    /* section display */
  --text-4xl:  56px;                    /* hero display (site only) */

  --leading-body:     1.5;
  --leading-tight:    1.1;
  --tracking-display: -0.015em;

  /* ─── Space (4px grid) ─────────────────────────────────────────── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-12: 48px;

  --section-y-desktop: 72px;
  --section-y-tablet:  48px;
  --section-y-phone:   32px;

  /* ─── Radius (glassware, not cards) ────────────────────────────── */
  --radius-sm:   4px;                   /* buttons, inputs, chips */
  --radius-md:   6px;                   /* panes, rows, popovers */
  --radius-lg:   10px;                  /* the drop zone, media */
  --radius-pill: 9999px;

  /* ─── Elevation ────────────────────────────────────────────────── */
  --elev-flat:   none;
  --elev-ring:   0 0 0 1px var(--border);
  --elev-raised: 0 1px 2px rgba(30, 38, 34, 0.06), 0 0 0 1px var(--border-soft);

  /* ─── Focus (ink ring, no blue glow) ───────────────────────────── */
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg);

  /* ─── Motion ───────────────────────────────────────────────────── */
  --motion-fast:   120ms;
  --motion-base:   180ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);

  /* ─── Container ────────────────────────────────────────────────── */
  --container-max:            1200px;
  --container-gutter-desktop: 24px;
  --container-gutter-tablet:  16px;
  --container-gutter-phone:   12px;

  /* ─── C-extensions: Decant brand vocabulary ────────────────────── */
  --bench:    #EDF0EC;
  --glass:    #FBFCFA;
  --sediment: #1E2622;
  --residue:  #8A8F86;                  /* excluded / deduplicated content, fills only */

  --reagent:      #7A3FA8;              /* found — needs review; 5.9:1 as text */
  --reagent-ink:  #7A3FA8;
  --reagent-soft: #DDD7E2;              /* finding backgrounds, highlight wash */

  --clear:      #3E8C7A;                /* verified — fills, bars, dots (3.5:1) */
  --clear-ink:  #357869;                /* verified — as text, 4.5:1 */
  --clear-soft: #E8F1EF;

  --font-serif: "Source Serif 4", "Source Serif 4 Variable", Charter, Georgia, serif;

  --motion-sweep: 2000ms;               /* the one orchestrated moment */
  --accent-soft: color-mix(in oklab, var(--accent) 10%, transparent);
  --fg-soft:     color-mix(in oklab, var(--fg) 6%, transparent);
}

/* ─── Dark theme: settled darks, same names ─────────────────────────── */
:root[data-theme="dark"] {
  --bench: #141A17;
  --glass: #1E2622;
  --sediment: #E9EDE8;
  --workspace-canvas: #141A17;
  --workspace-paper: #1E2622;
  --workspace-ink: #E9EDE8;
  --workspace-muted: #B3BDB5;
  --workspace-border: #435248;
  --bg:           #141A17;
  --surface:      #1E2622;
  --surface-warm: var(--surface);

  --fg:    #E9EDE8;
  --fg-2:  #C3CAC4;
  --muted: #8A8F86;
  --meta:  #696F69;

  --border:      #303533;
  --border-soft: #242A27;

  --accent:        #EDF0EC;             /* glass ink on dark */
  --accent-on:     #1E2622;
  --accent-hover:  #FBFCFA;
  --accent-active: #DDE2DD;

  --danger: #D26A6A;

  --elev-raised: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-soft);
  --focus-ring:  0 0 0 2px var(--bg), 0 0 0 4px var(--fg);

  --residue:      #696F69;
  --reagent:      #A37BC3;
  --reagent-ink:  #A37BC3;
  --reagent-soft: #241B2B;
  --clear:        #519887;
  --clear-ink:    #519887;
  --clear-soft:   #12211E;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bench: #141A17;
    --glass: #1E2622;
    --sediment: #E9EDE8;
    --workspace-canvas: #141A17;
    --workspace-paper: #1E2622;
    --workspace-ink: #E9EDE8;
    --workspace-muted: #B3BDB5;
    --workspace-border: #435248;
    --bg:           #141A17;
    --surface:      #1E2622;
    --surface-warm: var(--surface);
    --fg:    #E9EDE8;
    --fg-2:  #C3CAC4;
    --muted: #8A8F86;
    --meta:  #696F69;
    --border:      #303533;
    --border-soft: #242A27;
    --accent:        #EDF0EC;
    --accent-on:     #1E2622;
    --accent-hover:  #FBFCFA;
    --accent-active: #DDE2DD;
    --danger: #D26A6A;
    --elev-raised: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-soft);
    --focus-ring:  0 0 0 2px var(--bg), 0 0 0 4px var(--fg);
    --residue:      #696F69;
    --reagent:      #A37BC3;
    --reagent-ink:  #A37BC3;
    --reagent-soft: #241B2B;
    --clear:        #519887;
    --clear-ink:    #519887;
    --clear-soft:   #12211E;
  }
}
