/* ============================================================================
   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 auf --panel; #6b7888 lag mit 4,4994:1 knapp unter 4,5 */
  --faint2: #9aa7b6;   /* breadcrumb chevrons, timestamps */
  --pagebg: #f4f7fb;   /* detail/doc reading background */
  --accent: #7a3df0;   /* brand purple, contrast-tuned on white */
  --accent-hi: #6a2fd6;
  /* Linktext und aktive Tabs (Review RC): --accent hält auf Weiß 5,6:1, im
     Dark-Block steht hier das hellere Lila. Flächen (Buttons, Neu-Punkt,
     Badges) bleiben auf --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 als Text: 5,5:1 auf --panel (--ok nur 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 — Ereignis-Typ-Farben (dataviz-validiert, CVD-sicher, je Theme):
     Band-Segmente, Summary-Balken, Legende. Light-Werte hier, Dark im Block. */
  --ev-created: #2e9e6b; --ev-linked: #4f7fd9; --ev-updated: #b0801f; --ev-other: #8a5bc4;
  /* Puls v3 — Event-Icon-Flächen je Typ (Spec §4.3) und ruhige Sparkline-Balken. */
  --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-Statusfarben (Light): Kante links je Task-Zeile + blocked-Fläche. */
  --st-open: #6b7684; --st-progress: #4f7fd9; --st-done: #2e9e6b;
  --st-blocked: #c04b3d; --st-blocked-soft: #fbe9e6; --st-closed: #a9a49c;
  /* Projekt-Farbrad (theme-invariant, deterministisch je Projekt via
     project_color_idx): NUR hier definiert, gilt in beiden Themes gleich. */
  --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: Seitenrahmen wie .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 erreicht als Text nur 3,95:1 auf --panel und 3,34:1 auf --raised;
     #b685ff 5,6:1 bzw. 4,75:1, der Hover noch heller. */
  --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 — Ereignis-Typ-Farben (dark): auf Navy angehobene Varianten. Das
     Projekt-Farbrad (--pj-*) bleibt theme-invariant → hier bewusst NICHT neu. */
  --ev-created: #35a874; --ev-linked: #5b8ce0; --ev-updated: #b08221; --ev-other: #9a6fd0;
  /* Puls v3 (dark): Icon-Flächen als Tönung der Event-Farbe auf dem 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 auf --panel (Grafik-Kontrast, Review a41) */
  /* S5-F — Board-Statusfarben (Dark): auf Navy angehobene Varianten. */
  --st-open: #8a93a1; --st-progress: #5b8ce0; --st-done: #35a874;
  --st-blocked: #d0685c; --st-blocked-soft: #3a2320; --st-closed: #7d7972;
}
