/* ============================================================================
   ocellio — design tokens: brand constants and the light theme on :root, the
   dark overrides in the data-theme="dark" block. Custom properties only.
   Loads first; every other sheet (app/auth/graph/entity, layout, components,
   code) reads these via var(). theme.js sets data-theme before first paint.
   ============================================================================ */

:root {
  /* brand constants (theme-independent) */
  --purple: #a05cff; --teal-vivid: #4fd1c5; --navy: #102a43;
  --brand-grad: linear-gradient(135deg, #a05cff 0%, #4fd1c5 100%);

  /* light (default) */
  --ink:    #eceff3;   /* page */
  --panel:  #ffffff;   /* surfaces */
  --raised: #f4f7fb;   /* hover / inputs */
  --line:   #dbe1e9;   /* hairlines */
  --line2:  #eef1f5;   /* quiet table-row dividers */
  --fg:     #102a43;   /* navy ink */
  --muted:  #566679;
  --faint:  #6a7787;   /* 4.56:1 on --panel; #6b7888 was just under 4.5 at 4.4994:1 */
  --faint2: #9aa7b6;   /* breadcrumb chevrons, timestamps */
  --pagebg: #f4f7fb;   /* detail/doc reading background */
  --accent: #7a3df0;   /* brand purple, contrast-tuned on white */
  --accent-hi: #6a2fd6;
  /* Link text and active tabs (review RC): --accent holds 5.6:1 on white, in the
     dark block the lighter purple sits here. Surfaces (buttons, new dot,
     badges) stay on --accent. */
  --link: var(--accent); --link-hover: var(--accent-hi);
  --on-accent: #ffffff;
  --teal:   #168a7f;   /* teal that reads as text on light */
  --danger: #d8453a;
  --ok:     #168a7f;
  --ok-text: #0f766e;   /* --ok as text: 5.5:1 on --panel (--ok only 4.22:1) */
  --glow:   rgba(160,92,255,0.12);

  /* Puls/Shell aliases (S5-A): the component stylesheets (layout.css,
     components.css) reference these; without a definition their light fallback
     literals would win in dark theme (white nav/cards on navy). --surface/--border
     alias the theme-switched --panel/--line (var() resolves lazily, so one alias
     serves both themes; re-stated in the dark block for explicitness).
     --accent-soft/--accent-border are the Inbox/marker tint — per-theme values. */
  --surface: var(--panel); --border: var(--line);
  --accent-soft: #efe7ff; --accent-border: #c9b8ff;

  /* Puls v2.2 — event type colors (dataviz-validated, CVD-safe, per theme):
     band segments, summary bars, legend. Light values here, dark in the block. */
  --ev-created: #2e9e6b; --ev-linked: #4f7fd9; --ev-updated: #b0801f; --ev-other: #8a5bc4;
  /* Puls v3 — event icon surfaces per type (spec §4.3) and calm sparkline bars. */
  --ev-created-soft: #dff3e9; --ev-updated-soft: #fdf3d8; --ev-linked-soft: #e3ecfb;
  --ev-other-soft: #f3e3fb; --ev-pushed-soft: #e3f1f7;
  --spark-idle: #c4cbd6;
  /* S5-F — board status colors (light): edge on the left per task row + blocked surface. */
  --st-open: #6b7684; --st-progress: #4f7fd9; --st-done: #2e9e6b;
  --st-blocked: #c04b3d; --st-blocked-soft: #fbe9e6; --st-closed: #a9a49c;
  /* Project color wheel (theme-invariant, deterministic per project via
     project_color_idx): defined ONLY here, applies identically in both themes. */
  --pj-0: #1f9fb0; --pj-1: #c96a3a; --pj-2: #5b62d6; --pj-3: #96982f; --pj-4: #c75f9b;

  --font-display: "Sora", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Hanken Grotesk", ui-sans-serif, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, monospace;

  --r: 12px; --r-sm: 7px;
  --maxw: 1200px;   /* Puls v3 §4.2 / WP-3 F034: page frame like .shell */
  --shadow: 0 14px 40px -18px rgba(16,42,67,0.28);
}

:root[data-theme="dark"] {
  --ink:    #081320;   /* deep navy-black */
  --panel:  #0f2740;
  --raised: #16344f;
  --line:   #26466a;
  --line2:  #1c3a59;
  --fg:     #e7eef6;
  --muted:  #93a7bd;
  --faint:  #7e98b5;
  --faint2: #6f88a3;
  --pagebg: #0b1b2e;
  --accent: #a05cff;   /* vivid brand purple pops on navy */
  --accent-hi: #b685ff;
  /* --accent only reaches 3.95:1 as text on --panel and 3.34:1 on --raised;
     #b685ff 5.6:1 and 4.75:1 respectively, the hover even lighter. */
  --link: #b685ff; --link-hover: #cfadff;
  --on-accent: #15052e; /* dark ink on the lighter purple = readable button text */
  --teal:   #4fd1c5;
  --danger: #ff6b5c;
  --ok:     #4fd1c5;
  --ok-text: var(--ok);
  --glow:   rgba(160,92,255,0.16);
  --shadow: 0 16px 44px -18px rgba(0,0,0,0.55);

  /* Puls/Shell aliases (dark): --surface/--border track the dark --panel/--line;
     the Inbox reads as a translucent-purple panel on navy (derived from --glow). */
  --surface: var(--panel); --border: var(--line);
  --accent-soft: rgba(160,92,255,0.14); --accent-border: rgba(160,92,255,0.42);

  /* Puls v2.2 — event type colors (dark): variants raised on navy. The
     project color wheel (--pj-*) stays theme-invariant → deliberately NOT redone here. */
  --ev-created: #35a874; --ev-linked: #5b8ce0; --ev-updated: #b08221; --ev-other: #9a6fd0;
  /* Puls v3 (dark): icon surfaces as a tint of the event color on the panel. */
  --ev-created-soft: color-mix(in oklab, #35a874 24%, #0f2740);
  --ev-updated-soft: color-mix(in oklab, #b08221 24%, #0f2740);
  --ev-linked-soft: color-mix(in oklab, #5b8ce0 24%, #0f2740);
  --ev-other-soft: color-mix(in oklab, #9a6fd0 24%, #0f2740);
  --ev-pushed-soft: color-mix(in oklab, #4fb3d9 24%, #0f2740);
  --spark-idle: #557799;   /* 3.2:1 on --panel (graphic contrast, review a41) */
  /* S5-F — board status colors (dark): variants raised on navy. */
  --st-open: #8a93a1; --st-progress: #5b8ce0; --st-done: #35a874;
  --st-blocked: #d0685c; --st-blocked-soft: #3a2320; --st-closed: #7d7972;
}
