/* ============================================================
   styles/tokens.css — THE design tokens (quality program §9.1).
   Single source of truth for colors, surfaces, type ramps, radii
   and per-module folder faces. Loaded BEFORE styles.css.

   History: styles.css used to carry TWO :root blocks — the original
   base palette and the "v3 Quiet Night" layer 3,500 lines later.
   They are merged here verbatim (variable sets were disjoint; the
   cascade is unchanged). New tokens go here, never in styles.css.
   ============================================================ */

/* ---- base palette + surfaces (original :root) ---- */
:root {
  --bg-1: #203539;
  --bg-2: #2c4a51;
  --bg-3: #3f5f63;
  --text-inverse: #f7fbfb;
  --text-soft: #c6d6d8;
  --ink: #26393f;
  --muted: #62757b;
  /* TEXT INK RAMP (owner-locked 2026-07-14). ALL text is grey — one 4-shade ramp,
     never #000, never the module accent. Rule (Option A): the module colour touches
     text ONLY on tappable/active text (active nav-or-tab label, links, inline text
     actions like "Clear all"); every plain title/body/meta/label/amount is grey.
     Replaces ~30 ad-hoc grey hexes + teal that had leaked onto plain text.
       ink-1 primary/headings · ink-2 body · ink-3 secondary/meta · ink-4 muted */
  --ink-1: #253338;
  --ink-2: #45575d;
  --ink-3: #6b7c81;
  --ink-4: #96a3a7;
  --line: rgba(255, 255, 255, 0.14);
  --glass: rgba(255, 255, 255, 0.12);
  --glass-strong: rgba(255, 255, 255, 0.18);
  --accent: #35cabb;
  --accent-dark: #117d74;
  /* Accent derivatives — the soft tint + focus ring. Primitives use these tokens
     (never a hardcoded teal) so a per-module override themes them automatically. */
  --accent-soft: rgba(53, 202, 187, 0.14);
  --accent-ring: rgba(31, 122, 111, 0.14);
  /* Negative = ONE red in every module (never themed): destructive/stop must read
     the same everywhere. Solid = destructive (delete); soft = reversible (can't-do,
     reject). Neutral stays grey. These are fixed — no per-module override. */
  --neg-solid: #c0453a;
  --neg-soft: rgba(192, 69, 58, 0.10);
  --neg-ink: #a3322a;
  --neg-border: rgba(192, 69, 58, 0.38);
  /* Premium translucent folder surfaces. Soft gradient tints at low alpha
     so the dark backdrop reads through and the surface feels glassy. */
  --home:     linear-gradient(155deg, rgba(170, 222, 214, 0.22) 0%, rgba(58, 122, 118, 0.14) 100%);
  --personal: linear-gradient(155deg, rgba(186, 172, 232, 0.22) 0%, rgba(86,  80, 138, 0.14) 100%);
  --family:   linear-gradient(155deg, rgba(226, 180, 208, 0.22) 0%, rgba(132, 78,  112, 0.14) 100%);
  --brain:    linear-gradient(155deg, rgba(230, 198, 158, 0.22) 0%, rgba(130, 92,  56,  0.14) 100%);
  --folder-glass:     rgba(255, 255, 255, 0.06);
  --folder-edge:      rgba(255, 255, 255, 0.18);
  --folder-edge-soft: rgba(255, 255, 255, 0.10);
  --folder-shadow:    0 18px 42px rgba(6, 20, 24, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --homeos-bg: #effaff;
  --homeos-card: rgba(255, 255, 255, 0.76);
  --homeos-line: #d7eef5;
  --radius-xl: 30px;
  --radius-lg: 24px;
  --shadow: 0 18px 42px rgba(8, 27, 32, 0.28);
  --paper-shadow: 0 12px 28px rgba(8, 27, 32, 0.2);
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

/* ---- v3 'Quiet Night' shell + module folder faces ---- */
:root {
  --night-bg-flat: #0e1f1e;
  --night-glass: rgba(255,255,255,0.05);
  --night-glass-strong: rgba(255,255,255,0.09);
  --night-border: rgba(255,255,255,0.10);
  --night-border-soft: rgba(255,255,255,0.06);
  --night-ink: rgba(255,255,255,0.96);
  --night-ink2: rgba(255,255,255,0.74);
  --night-ink3: rgba(255,255,255,0.56);
  --night-ink4: rgba(255,255,255,0.40);
  --mint: #7BE5C9;
  --mint-deep: #34BFA8;
  --mint-glow: rgba(123,229,201,0.18);
  --mint-glow-soft: rgba(123,229,201,0.08);

  /* Manila folder faces — solid, muted, grounded (not bright, not glassy).
     Tab uses the SAME hue as the body so the name label matches the folder. */
  /* Folder faces — lighter, airier pastels harmonised around the brand teal.
     Calmer and more modern than the previous saturated manila tones. */
  /* Folder faces — corporate dark-glass (was pastel/childlike). Each module keeps a
     distinct hue as a subtle tint + accent dot; ink is light for contrast on the dark grid. */
  --f-home-face: linear-gradient(155deg, rgba(34,62,56,0.78) 0%, rgba(18,38,34,0.82) 100%);   --f-home-tab: rgba(30,56,50,0.82);   --f-home-ink: #e9f4f0;   --f-home-hue: #3ad6b0;
  --f-personal-face: linear-gradient(155deg, rgba(40,42,66,0.78) 0%, rgba(24,26,46,0.82) 100%); --f-personal-tab: rgba(36,38,60,0.82); --f-personal-ink: #eceefa;   --f-personal-hue: #8b9bf0;
  --f-family-face: linear-gradient(155deg, rgba(58,38,48,0.78) 0%, rgba(36,22,30,0.82) 100%); --f-family-tab: rgba(52,34,44,0.82); --f-family-ink: #f8eaef;   --f-family-hue: #e58aa6;
  --f-brain-face: linear-gradient(155deg, rgba(58,50,30,0.78) 0%, rgba(36,30,18,0.82) 100%);  --f-brain-tab: rgba(52,44,28,0.82);  --f-brain-ink: #f5eed9;  --f-brain-hue: #e0bd6a;
}

/* ============================================================
   PER-MODULE COLOUR THEME — the single axis of cross-module variation
   (north star, owner 2026-07-14). ONLY colour changes between modules; every
   shared primitive reads --accent / --accent-dark / --accent-soft / --accent-ring,
   so setting them on a module's shell re-themes the whole UI in that colour with
   zero structural change. HomeOS keeps the :root teal default (no override).
   accent-dark values are contrast-checked for white button text.
   ============================================================ */
.personal-shell {
  --accent: #7b6ef0; --accent-dark: #4f43c4;
  --accent-soft: rgba(123, 110, 240, 0.14); --accent-ring: rgba(79, 67, 196, 0.16);
}
.family-shell {
  --accent: #e07a9e; --accent-dark: #b23c66;
  --accent-soft: rgba(224, 122, 158, 0.14); --accent-ring: rgba(178, 60, 102, 0.16);
}
.brain-shell {
  --accent: #d9a441; --accent-dark: #8a5a12;
  --accent-soft: rgba(217, 164, 65, 0.16); --accent-ring: rgba(138, 90, 18, 0.16);
}
/* Xortit PARENT signature (H6, owner handoff Xortit-Home §1/§3.1): the accent for
   the app-level surfaces (Home hub · What's-up/recital · global chrome). Teal
   #54e0c8 — brighter than HomeOS #35cabb; the surface (midnight-liquid dark glass)
   is what distinguishes the zone, not the hue. The full surface treatment lives on
   `.xortit-shell` in styles.css. */
.xortit-shell, body.xortit-canvas {
  --accent: #54e0c8; --accent-dark: #117d74;
  --accent-soft: rgba(84, 224, 200, 0.16); --accent-ring: rgba(84, 224, 200, 0.30);
}
