/* tokens.css — DOCSight Design Tokens (W3C Design Tokens spec) */

/* ── Color Palette: Dark (default) ── */
:root {
  /* Theme core: the tokens a community theme sets (wiki: Themes) */
  --bg: #06080f;
  --surface: #111628;
  --elevated: #181e35;
  --accent: #7c3aed;

  /* Semantic */
  --good: #10b981;
  --warn: #f59e0b;
  --crit: #ef4444;
  --info: #06b6d4;

  /* Text */
  --text: #e8edff;
  --text-secondary: #9ba3c8;
  --muted: #7d85a9;
  --text-on-accent: #fff;

  /* Glass */
  --glass-blur: blur(24px) saturate(1.2);

  /* Tints (theme-aware) */
  --tint-subtle: rgba(255, 255, 255, 0.02);
  --tint-hover: rgba(255, 255, 255, 0.04);
  --tint-active: rgba(255, 255, 255, 0.06);
  --tint-emphasis: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.03);
  --border-tint: rgba(255, 255, 255, 0.05);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 100px;

  /* Shadows */
  --shadow-md: 0 4px 16px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.35);

  /* Easing */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);

  /* Typography */
  --fs-min: 0.75rem; /* 12px: smallest readable UI text */
  --font-sans: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Safe areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Layout */
  --bottom-nav-h: 56px;

  /* Roles derived from the theme core, in dark and light mode alike. A theme that
     only sets the core tokens gets all of them; a theme can still set any itself. */
  --void: var(--bg);
  --void-deep: color-mix(in srgb, var(--bg) 50%, var(--surface));
  --card: var(--surface);
  --hover: color-mix(in srgb, var(--elevated) 85%, var(--text));
  --hover-bg: var(--hover);
  --accent-hover: color-mix(in srgb, var(--accent) 75%, var(--text));
  --accent-muted: color-mix(in srgb, var(--accent) 15%, transparent);
  --amethyst: var(--accent);
  --amethyst-light: var(--accent-hover);
  --amethyst-muted: var(--accent-muted);
  --grad-primary: linear-gradient(135deg, var(--accent) 0%, var(--sapphire) 100%);
  /* Between good and warn, in the theme's own colors */
  --tolerated: color-mix(in srgb, var(--good) 50%, var(--warn));
  /* Status tints follow the theme's status colors */
  --good-muted: color-mix(in srgb, var(--good) 15%, transparent);
  --warn-muted: color-mix(in srgb, var(--warn) 15%, transparent);
  --crit-muted: color-mix(in srgb, var(--crit) 15%, transparent);
  --info-muted: color-mix(in srgb, var(--info) 15%, transparent);
  --tolerated-muted: color-mix(in srgb, var(--tolerated) 15%, transparent);
  /* Red fills under white text. Dark modes use a light red for text, so the fill is
     darkened further than in light modes; hover goes darker there too. */
  --crit-strong: color-mix(in srgb, var(--crit) 55%, #000);
  --crit-strong-hover: color-mix(in srgb, var(--crit) 45%, #000);
  --sapphire: var(--info);
  --glass-bg: color-mix(in srgb, var(--surface) 65%, transparent);
  --glass-border: color-mix(in srgb, var(--text) 12%, transparent);
  --card-border: var(--glass-border);
  --input-border: var(--glass-border);
  --overlay: rgba(0,0,0,0.6);

  /* Deprecated aliases: DOCSight's own styles no longer use them. They stay for
     community styles and themes; a theme that sets one also sets its canonical
     token (app/theme_catalog.py DEPRECATED_ALIASES). */
  --text-primary: var(--text);
  --text-muted: var(--muted);
  --card-bg: var(--card);
  --success: var(--good);
  --warning: var(--warn);
  --danger: var(--crit);
  --primary: var(--accent);
  --border: var(--glass-border);
}

/* ── Color Palette: Light ── */
[data-theme="light"] {
  --good-muted: color-mix(in srgb, var(--good) 12%, transparent);
  --warn-muted: color-mix(in srgb, var(--warn) 12%, transparent);
  --crit-muted: color-mix(in srgb, var(--crit) 12%, transparent);
  --info-muted: color-mix(in srgb, var(--info) 12%, transparent);
  --tolerated-muted: color-mix(in srgb, var(--tolerated) 12%, transparent);
  --crit-strong: color-mix(in srgb, var(--crit) 65%, #000);
  --crit-strong-hover: color-mix(in srgb, var(--crit) 75%, #000);

  --bg: #f8f6f3;
  --surface: #ffffff;
  --elevated: #f0edf5;

  --text: #1a1520;
  --text-secondary: #5e5673;
  --muted: #706788;

  --good: #059669;
  --warn: #d97706;
  --crit: #dc2626;
  --info: #0891b2;

  --tint-subtle: rgba(0, 0, 0, 0.02);
  --tint-hover: rgba(0, 0, 0, 0.04);
  --tint-active: rgba(0, 0, 0, 0.06);
  --tint-emphasis: rgba(0, 0, 0, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-tint: rgba(0, 0, 0, 0.08);

  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
}
