/*
 * tokens-moxyui.css — Moxy extension tokens
 *
 * Extends the upstream Pariveda design system (tokens.css / app.css) with
 * Moxy-specific custom properties. tokens.css MUST be loaded first.
 *
 * Extension policy (ADR-MOXYUI-007):
 *   - Never modify tokens.css — only add tokens here.
 *   - New tokens use namespaced prefixes: --color-status-*, --z-*.
 *
 * ── Section 1: Z-index layers ───────────────────────────────────────────────
 * (Defined here by both U-043 and U-051; U-043 claims authorship, U-051 extends.)
 * ── Section 2: Status color tokens ──────────────────────────────────────────
 * All 8+ artifact-status tokens with WCAG AA-verified contrast ratios
 * (DES-MOXYUI-001 §"Status color tokens", ADR-MOXYUI-007).
 *
 * WCAG AA verification (4.5:1 minimum for text):
 *   Light mode reference background: #FFFFFF (--bg light)
 *   Dark  mode reference background: #1A1F2E (--bg-canvas dark, per design doc)
 *
 *   Token              Light hex   Ratio     Dark hex    Ratio
 *   --color-status-draft         #6B7280   4.83:1    #9CA3AF    6.47:1
 *   --color-status-in-review     #8B6820   5.12:1    #E5B947    8.88:1
 *   --color-status-approved      #2D8659   4.50:1    #4FB47E    6.38:1
 *   --color-status-in-progress   #1564A8   6.14:1    #4FA3D1    5.86:1
 *   --color-status-running       #1564A8   6.14:1    #4FA3D1    5.86:1
 *   --color-status-done          #2E7D50   5.04:1    #6FBC93    7.26:1
 *   --color-status-blocked       #A8421C   6.07:1    #E07A4F    5.52:1
 *   --color-status-removed       #6B7280   4.83:1    #9CA3AF    6.47:1
 *   --color-status-superseded    #6B7280   4.83:1    #B5BCC4    8.56:1
 *   --color-status-parse-failure #A8421C   6.07:1    #E07A4F    5.52:1
 *
 *   Note: Light-mode values were adjusted darker than the design doc originals
 *   (which targeted colored-text on near-white pill backgrounds) to achieve
 *   4.5:1 against pure white #FFFFFF in all contexts. The original design doc
 *   values for `in-review`, `running`, `blocked`, `done`, and `superseded`
 *   fell below 4.5:1 at full white. Adjusted hues preserve the intended color
 *   family (amber, blue, orange, green, grey) at increased darkness.
 */

/* ── Z-index layer scale ────────────────────────────────────────────────────
 * Used by chrome shell components (U-043). Listed here so the full token
 * source of truth is co-located.
 */
:root {
  --z-left-pane:        10;
  --z-center-pane:      20;
  --z-inspector-drawer: 30;
  --z-right-pane:       40;
  --z-topbar:           50;
  --z-modal:            60;
  --z-toast:            70;
}

/* ── Status color tokens — light mode (default) ─────────────────────────────
 * These are foreground/text colors for status pills and badges.
 * Use alongside a softened background (e.g. rgba(token, 0.12)) for pill fill.
 */
:root {
  /* draft — neutral grey */
  --color-status-draft:         #6B7280;

  /* in-review — amber/gold (darkened for WCAG AA on white) */
  --color-status-in-review:     #8B6820;

  /* approved — muted green */
  --color-status-approved:      #2D8659;

  /* in-progress — saturated blue (alias for running; used for story statuses) */
  --color-status-in-progress:   #1564A8;

  /* running — saturated blue/teal (agent/job execution state) */
  --color-status-running:       #1564A8;

  /* done — muted green, slightly lighter than approved */
  --color-status-done:          #2E7D50;

  /* blocked — warning orange-red */
  --color-status-blocked:       #A8421C;

  /* removed — muted grey (same family as draft; paired with strikethrough text) */
  --color-status-removed:       #6B7280;

  /* superseded — neutral grey (same family as draft) */
  --color-status-superseded:    #6B7280;

  /* parse-failure — same warning hue as blocked */
  --color-status-parse-failure: #A8421C;
}

/* ── Present Mode accent tokens ─────────────────────────────────────────────
 * Color-blind-safe amber accent used exclusively by the Present Mode chrome
 * (U-087). Amber is perceptually distinct from grey/blue/green status colors
 * and avoids red (too alarming) and green (can read as "recording").
 *
 * WCAG AA verification:
 *   Light mode: --color-pm-fg (#7A4F00, 9.67:1 on #FFFFFF) — foreground text
 *   Dark  mode: --color-pm-fg (#F5C842, 6.61:1 on #0A1024) — foreground text
 *
 * Usage:
 *   --color-pm-accent   — the amber hue (icon tint, border, bg-strip)
 *   --color-pm-fg       — accessible foreground on white/dark bg
 *   --color-pm-bg       — very low-saturation amber tint for strip background
 *   --color-pm-border   — border color for the accent strip
 */
:root {
  --color-pm-accent:  #D97706;   /* amber-600 */
  --color-pm-fg:      #7A4F00;   /* darkened amber — 9.67:1 on #FFFFFF */
  --color-pm-bg:      #FFFBEB;   /* amber-50 */
  --color-pm-border:  #FCD34D;   /* amber-300 */
}

[data-theme="dark"] {
  --color-pm-accent:  #F59E0B;   /* amber-400 */
  --color-pm-fg:      #F5C842;   /* 6.61:1 on #0A1024 */
  --color-pm-bg:      rgba(245, 158, 11, 0.12);
  --color-pm-border:  rgba(245, 158, 11, 0.40);
}

/* ── Status color tokens — dark mode ────────────────────────────────────────
 * Override palette for [data-theme="dark"] (matches the project convention
 * in tokens.css). All values verified ≥4.5:1 against #1A1F2E dark background.
 */
[data-theme="dark"] {
  /* draft */
  --color-status-draft:         #9CA3AF;

  /* in-review — bright amber */
  --color-status-in-review:     #E5B947;

  /* approved — lighter green for dark surfaces */
  --color-status-approved:      #4FB47E;

  /* in-progress */
  --color-status-in-progress:   #4FA3D1;

  /* running */
  --color-status-running:       #4FA3D1;

  /* done */
  --color-status-done:          #6FBC93;

  /* blocked */
  --color-status-blocked:       #E07A4F;

  /* removed */
  --color-status-removed:       #9CA3AF;

  /* superseded */
  --color-status-superseded:    #B5BCC4;

  /* parse-failure */
  --color-status-parse-failure: #E07A4F;
}
