/*
 * Design tokens: the "Cuarzo" identity of the landing as a base (proposal §4.3), named by
 * role, plus the extensions a daily-work application needs. Components read the semantic
 * roles (--bg, --card, --fg, ...), so the dark theme only redefines those.
 */
:root {
  /* Inherited from Cuarzo */
  --color-ink: #24123f;
  --color-surface: #f1eefb;
  --color-accent: #6d3ae8;
  --color-accent-soft: #b9a2ff;
  --color-green: #2ea36b;
  --color-ink-muted: #4d3f66;
  --color-line: #8a7daa;
  --color-white: #ffffff;

  /*
   * State colors (SRS §8). Used as text, so each one reaches WCAG AA (4.5:1) against
   * --color-surface: success 5.4, warning 6.0, danger 5.7, info 5.6. --color-green (2.8:1)
   * is kept for fills only, never for text.
   */
  --color-success: #1e6e47;
  --color-warning: #8a4b00;
  --color-danger: #b3261e;
  --color-info: #1f5fa8;

  /* Fonts. Not loaded from a CDN; installed fonts are used when present. */
  --font-heading: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "Fira Code", ui-monospace, monospace;

  /* Compact type scale for tables and forms (11-34 px) */
  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --text-title: 1.5rem;
  --text-xl: 2.125rem;

  /* Radii: badges and nav items / inputs and buttons / cards */
  --radius-sm: 8px;
  --radius-input: 10px;
  --radius-button: 10px;
  --radius-card: 14px;
  --radius-full: 999px;

  /* Density */
  --gutter: 24px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 20px;
  --space-row: 12px;

  /* Shell */
  --sidebar-width: 260px;
  --sidebar-collapsed: 68px;
  --header-height: 64px;

  /* Motion (Proyectos/ui-effects-reference/UI-EFFECTS.md) */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
  --duration-enter: 400ms;

  /* Semantic roles: light theme */
  color-scheme: light;
  --bg: var(--color-surface);
  --card: var(--color-white);
  --fg: var(--color-ink);
  --fg-muted: var(--color-ink-muted);
  --border: #e3ddf3;
  --border-strong: #cfc6e6;
  --muted: #f6f3fd;
  --hover: #f3effc;
  --accent: var(--color-accent);
  --accent-fg: var(--color-white);
  /* Accent used as text (links, avatar initials, counters): AA on cards in both themes. */
  --accent-text: var(--color-accent);
  --ring: color-mix(in srgb, var(--color-accent) 45%, transparent);
  --header-bg: color-mix(in srgb, var(--color-surface) 80%, transparent);
  --sidebar-bg: var(--color-ink);
  --sidebar-fg: #ece7fb;
  --sidebar-muted: color-mix(in srgb, #ece7fb 45%, transparent);
  --sidebar-hover: rgb(255 255 255 / 6%);
  --sidebar-active: color-mix(in srgb, var(--color-accent-soft) 16%, transparent);
  --sidebar-active-fg: var(--color-accent-soft);
  --sidebar-border: rgb(255 255 255 / 8%);
  --shadow-xs: 0 1px 2px rgb(36 18 63 / 5%);
  --shadow-sm: 0 1px 3px rgb(36 18 63 / 8%), 0 1px 2px -1px rgb(36 18 63 / 8%);
  --shadow-md: 0 4px 6px -1px rgb(36 18 63 / 10%), 0 2px 4px -2px rgb(36 18 63 / 10%);
  --shadow-lg: 0 10px 15px -3px rgb(36 18 63 / 12%), 0 4px 6px -4px rgb(36 18 63 / 10%);
}

/* Dark theme: Cuarzo's ink as the base. State colors are lightened to keep AA on dark cards. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0919;
  --card: #1a1129;
  --fg: #eee9fa;
  --fg-muted: #a99cc6;
  --border: #2d2244;
  --border-strong: #3d3059;
  --muted: #21172f;
  --hover: #251a36;
  --accent-text: var(--color-accent-soft);
  --ring: color-mix(in srgb, var(--color-accent-soft) 45%, transparent);
  --header-bg: color-mix(in srgb, #0f0919 80%, transparent);
  --sidebar-bg: #0b0613;
  --color-success: #5fd39b;
  --color-warning: #f0b25c;
  --color-danger: #ff8a80;
  --color-info: #86b6f5;
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 30%);
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 40%), 0 1px 2px -1px rgb(0 0 0 / 40%);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 45%), 0 2px 4px -2px rgb(0 0 0 / 40%);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 50%), 0 4px 6px -4px rgb(0 0 0 / 45%);
}
