/* ─────────────────────────────────────────────────────────────────────────
   LifeOS canonical design tokens — v0.2 (2026-08-20)
   SINGLE SOURCE for the identity: cool neutral paper, slate-blue accent, no amber.

   v0.2 moved the BASE off the warm off-white/amber palette. The values are LIFTED,
   not designed — they are the tokens already live in both panels. Changing one
   still changes the whole system: a taste decision, made once, upstream.
   The warm v0.1 palette remains recoverable from git history; no document family
   on operational main selects it implicitly. This file is INLINED into every
   rendered document, so changing it requires regenerating the affected projections.

   Screen-zone geometry (corner ownership, local-exit): LAYOUT-CONTRACTS.md.
   Dark resolves two ways: [data-theme] override, else prefers-color-scheme.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  /* surfaces */
  --bg:             #F7F7F5;
  --bg-rgb:         247,247,245;   /* bg as channel — frost/scrim with alpha */
  --bg-2:           #F1F1EE;       /* portal alias: recessed surface */
  --card:           #FFFFFF;
  --surface:        #FFFFFF;       /* portal alias of --card */
  --line:           #E2E1DC;       /* hairline / border (opaque) */

  /* text */
  --text-primary:   #16161A;
  --text-secondary: #5C5B56;
  --text-hint:      #6F6E68;
  --text:           #16161A;       /* portal alias of --text-primary */
  --text-2:         #5C5B56;       /* portal alias of --text-secondary */
  --hint:           #6F6E68;
  --mark-muted:     #8B8A83;       /* cicha klasyfikacja obok akcentu (panel: etykieta karty) */

  /* brand accents */
  --accent:         #2F5D8C;
  --accent-rgb:     47,93,140;
  --amber:          #2F5D8C;
  --amber-rgb:      47,93,140;
  --green:          #3E7A55;
  --red:            #B4453A;

  /* system */
  --ink-rgb:        0,0,0;         /* hairlines, borders, shadows (black-alpha) */
  --radius:         13px;
  --surface-ease:   cubic-bezier(0.4, 0, 0.2, 1);
  --surface-dur:    580ms;

  /* typography */
  --font-sans:      ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif:     ui-serif, Georgia, "Times New Roman", Times, serif;
  --font-mono:      ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --type--1:        clamp(0.82rem, 0.79rem + 0.12vw, 0.92rem);
  --type-0:         clamp(1rem, 0.96rem + 0.18vw, 1.12rem);
  --type-1:         clamp(1.24rem, 1.11rem + 0.54vw, 1.58rem);
  --type-2:         clamp(1.58rem, 1.28rem + 1.18vw, 2.28rem);
  --type-3:         clamp(2.08rem, 1.48rem + 2.45vw, 3.75rem);
  --type-4:         clamp(2.8rem, 1.78rem + 4.35vw, 6.2rem);
  --type-5:         clamp(3.65rem, 2.02rem + 7.2vw, 9.75rem);
  --leading-body:   1.58;
  --leading-title:  1.16;
  --leading-tight:  1.06;
  --leading-display: 0.92;
  --track-label:    0.14em;
  --track-display:  0.08em;
}

/* Dark theme — the panel's dark, token for token. */
:root[data-theme="dark"] {
  --bg:             #111113;
  --bg-rgb:         17,17,19;
  --bg-2:           #151517;
  --card:           #1B1B1E;
  --surface:        #1F1F23;
  --line:           #2A2A2E;

  --text-primary:   #ECEAE4;
  --text-secondary: #B6B3AC;
  --text-hint:      #85837C;
  --text:           #ECEAE4;
  --text-2:         #B6B3AC;
  --hint:           #85837C;
  --mark-muted:     #7C7A74;

  --accent:         #86A4CC;
  --accent-rgb:     134,164,204;
  --amber:          #86A4CC;
  --amber-rgb:      134,164,204;
  --green:          #7FB08F;
  --red:            #D4796E;

  --ink-rgb:        255,255,255;   /* flips every hairline/shadow to white-alpha */
}

/* OS preference, unless the user explicitly chose light via the toggle. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:             #111113;
    --bg-rgb:         17,17,19;
    --bg-2:           #151517;
    --card:           #1B1B1E;
    --surface:        #1F1F23;
    --line:           #2A2A2E;

    --text-primary:   #ECEAE4;
    --text-secondary: #B6B3AC;
    --text-hint:      #85837C;
    --text:           #ECEAE4;
    --text-2:         #B6B3AC;
    --hint:           #85837C;
    --mark-muted:     #7C7A74;

    --accent:         #86A4CC;
    --accent-rgb:     134,164,204;
    --amber:          #86A4CC;
    --amber-rgb:      134,164,204;
    --green:          #7FB08F;
    --red:            #D4796E;

    --ink-rgb:        255,255,255;
  }
}
