/* Design tokens. Every colour, radius, shadow and motion value in the app comes from
   here, so a theme change is a token swap and never a rewrite of component CSS. */

:root {
  /* --- brand ramp ------------------------------------------------------------- */
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6d5efc;
  --brand-600: #5b4ae0;
  --brand-700: #4a3bc0;
  --cyan-400: #22d3ee;
  --violet-400: #c084fc;

  /* --- semantic ---------------------------------------------------------------- */
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.14);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.14);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --info: #38bdf8;

  /* --- type ------------------------------------------------------------------- */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Consolas, monospace;

  --text-xs: 11px;
  --text-sm: 12.5px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;

  /* --- geometry ---------------------------------------------------------------- */
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  --sidebar-w: 256px;
  --topbar-h: 58px;
  --bottomnav-h: 60px;

  /* --- motion ------------------------------------------------------------------ */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 120ms;
  --t-base: 190ms;
  --t-slow: 320ms;

  --z-sticky: 20;
  --z-drawer: 60;
  --z-overlay: 80;
  --z-toast: 120;
}

/* ---------------------------------------------------------------------- dark (default) */
/* Deliberately not near-black: a dark UI that sits around #15 rather than #05 keeps the
   surfaces distinguishable from one another, so panels, cards and inputs read as layers
   instead of one flat void. Borders and dim text are lifted to match. */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #14161e;
  --bg-mesh-1: rgba(124, 108, 255, 0.10);
  --bg-mesh-2: rgba(56, 189, 248, 0.06);

  --surface: #1b1e28;
  --surface-2: #232734;
  --surface-3: #2d3241;
  --surface-hover: rgba(255, 255, 255, 0.055);
  --surface-active: rgba(255, 255, 255, 0.09);

  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.17);

  --text: #eef0f6;
  --text-dim: #aab2c2;
  --text-faint: #7c8596;
  --text-on-brand: #ffffff;

  --accent: #7c6cff;
  --accent-hover: #9284ff;
  --accent-soft: rgba(124, 108, 255, 0.18);
  --accent-ring: rgba(124, 108, 255, 0.42);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 26px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 26px 60px -16px rgba(0, 0, 0, 0.62);
  --glass: rgba(27, 30, 40, 0.82);
}

/* --------------------------------------------------------------------------- light */
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f4f5fa;
  --bg-mesh-1: rgba(109, 94, 252, 0.11);
  --bg-mesh-2: rgba(34, 211, 238, 0.09);

  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --surface-3: #eef0f7;
  --surface-hover: rgba(15, 23, 42, 0.04);
  --surface-active: rgba(15, 23, 42, 0.07);

  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.16);

  --text: #0f1420;
  --text-dim: #5a6479;
  --text-faint: #8a93a6;
  --text-on-brand: #ffffff;

  --accent: var(--brand-600);
  --accent-hover: var(--brand-500);
  --accent-soft: rgba(109, 94, 252, 0.12);
  --accent-ring: rgba(109, 94, 252, 0.32);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.07);
  --shadow-md: 0 8px 24px -8px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 24px 60px -16px rgba(15, 23, 42, 0.24);
  --glass: rgba(255, 255, 255, 0.82);
}

/* Per-type accents, used by icons, chips and the card rails so a grid of mixed content
   is scannable by colour before a single label is read. */
:root {
  --type-password: #fbbf24;
  --type-note: #a78bfa;
  --type-document: #38bdf8;
  --type-link: #2dd4bf;
  --type-sheet: #22c55e;
  --type-drawing: #f472b6;
  --type-file: #9aa6ba;
  --type-photo: #fb7185;
  --type-video: #818cf8;
  --type-audio: #c084fc;
  --type-license: #eab308;
  --type-contract: #fb923c;
  --type-project_link: #06b6d4;
}
