/* Shared Helmer design tokens. Used by the public site and workspace. */
:root {
  color-scheme: light;
  --bg-canvas: #f8f9fb;
  --bg-rail: #f1f3f6;
  --bg-sidebar: #f5f6f8;
  --bg-elevated: #ffffff;
  --bg-soft: #f0f2f5;
  --bg-hover: rgba(20, 27, 42, 0.055);
  --border-subtle: rgba(20, 27, 42, 0.09);
  --border-hover: rgba(20, 27, 42, 0.16);
  --text-primary: rgba(16, 20, 30, 0.94);
  --text-secondary: rgba(29, 36, 50, 0.66);
  --text-tertiary: rgba(40, 48, 64, 0.47);
  --text-disabled: rgba(40, 48, 64, 0.3);
  --accent: #4f6ee8;
  --accent-hover: #405fd6;
  --accent-soft: rgba(79, 110, 232, 0.1);
  --success: #238567;
  --warning: #a86c18;
  --danger: #c64f4f;
  --background: var(--bg-canvas);
  --surface: var(--bg-elevated);
  --surface-soft: var(--bg-soft);
  --surface-tint: var(--accent-soft);
  --foreground: var(--text-primary);
  --foreground-soft: var(--text-secondary);
  --muted: var(--text-secondary);
  --muted-light: var(--text-tertiary);
  --border: var(--border-subtle);
  --border-strong: var(--border-hover);
  --sidebar: var(--bg-sidebar);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 8px 26px rgba(31, 41, 55, 0.08);
  --shadow-lg: 0 24px 64px rgba(31, 41, 55, 0.14);
  --content: 900px;
  --rail-width: 56px;
  --sidebar-width: 276px;
}

/* Dark is opt-in. The light tokens above and all legacy fallbacks stay exact.
   Theme-* tokens are deliberately undefined in Light so component-specific
   legacy shades remain intact. New components should use the shared tokens. */
:root[data-theme="dark"],
:root.dark,
html.dark {
  color-scheme: dark;
  /* Surface Hierarchy (Pure Black Canvas with Slate Components) */
  --bg-canvas: #000000; /* pure black canvas */
  --bg-rail: #0f172a;   /* bg-slate-900 */
  --bg-sidebar: #0f172a; /* bg-slate-900 */
  --bg-elevated: #0f172a; /* bg-slate-900 */
  --bg-soft: #1e293b;   /* bg-slate-800 */
  --bg-hover: rgba(30, 41, 59, 0.7);
  --border-subtle: #1e293b; /* border-slate-800 */
  --border-hover: #334155;  /* border-slate-700 */
  --text-primary: #f1f5f9;  /* text-slate-100 */
  --text-secondary: #94a3b8; /* text-slate-400 */
  --text-tertiary: #94a3b8;  /* text-slate-400 (WCAG AA compliant) */
  --text-disabled: #475569;  /* text-slate-600 */
  --focus-border: rgba(59, 130, 246, 0.7); /* border-blue-500/70 */
  --focus-ring: rgba(59, 130, 246, 0.2);   /* ring-1 ring-blue-500/20 */
  /* Brand fills remain identical in both modes; small accent text uses ink. */
  --accent: #4f6ee8;
  --accent-hover: #405fd6;
  --accent-soft: rgba(79, 110, 232, 0.14);
  --success: #34d399;
  --warning: #fcd34d;
  --danger: #fca5a5;
  --shadow-sm: 0 8px 26px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.48);
  /* Legacy component aliases: keep their original fallbacks in Light. */
  --brand-primary: var(--theme-blue-ink);
  --surface-secondary: var(--bg-soft);
  --border-default: var(--border-subtle);
  --accent-subtle: var(--accent-soft);
  --primary: var(--accent);

  --theme-canvas: var(--bg-canvas);
  --theme-surface: var(--bg-elevated);
  --theme-surface-soft: var(--bg-soft);
  --theme-surface-muted: #1e293b;
  --theme-surface-rgb: 15, 23, 42;
  --theme-inverse-surface: #334155;
  --theme-wash: rgba(241, 245, 249, 0.04);
  --theme-overlay: rgba(0, 0, 0, 0.75);
  --theme-ink: var(--text-primary);
  --theme-copy: var(--text-secondary);
  --theme-muted: #64748b; /* text-slate-500 */
  --theme-border: var(--border-subtle);
  --theme-border-strong: var(--border-hover);
  --theme-shadow-soft: rgba(0, 0, 0, 0.25);
  --theme-shadow-strong: rgba(0, 0, 0, 0.5);

  --theme-blue-ink: #bfdbfe;
  --theme-blue-surface: rgba(23, 37, 84, 0.4);
  --theme-blue-border: #3b82f6;
  --theme-blue-rgb: 23, 37, 84;
  --theme-purple-ink: #c7d2fe;
  --theme-purple-surface: rgba(30, 27, 75, 0.6);
  --theme-purple-border: rgba(49, 46, 129, 0.5);
  --theme-purple-rgb: 30, 27, 75;
  --theme-success-ink: #34d399;
  --theme-success-surface: rgba(6, 78, 59, 0.5);
  --theme-success-border: rgba(6, 95, 70, 0.6);
  --theme-success-rgb: 6, 78, 59;
  --theme-warning-ink: #fcd34d;
  --theme-warning-surface: rgba(69, 26, 3, 0.5);
  --theme-warning-border: rgba(146, 64, 14, 0.6);
  --theme-warning-rgb: 69, 26, 3;
  --theme-danger-ink: #fca5a5;
  --theme-danger-surface: rgba(69, 10, 10, 0.5);
  --theme-danger-border: rgba(153, 27, 27, 0.6);
  --theme-danger-rgb: 69, 10, 10;
}
