/* CODEXIANB design tokens */
:root {
  color-scheme: dark;

  /* Surfaces */
  --bg: #090a0f;
  --panel: #10121a;
  --card: #171a24;
  --card-hover: #1d2130;
  --glass: rgba(16, 18, 26, 0.82);
  --blur: 14px;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  /* Text */
  --text: #eef0f7;
  --text-2: #b9bfd2;
  --muted: #8b92a8;

  /* Accent (crimson by default) */
  --accent: #ff3d5e;
  --accent-ink: #12040a;
  --accent-soft: rgba(255, 61, 94, 0.14);
  --accent-glow: rgba(255, 61, 94, 0.22);

  --success: #34d399;
  --warning: #fbbf24;
  --danger: #ff6b6b;

  /* Typography */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --fs-xs: 0.72rem;
  --fs-sm: 0.84rem;
  --fs-md: 0.95rem;
  --fs-lg: 1.1rem;
  --fs-xl: 1.5rem;
  --lh: 1.65;

  /* Spacing */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-full: 999px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);

  /* Layout */
  --sidebar-w: 272px;
  --sidebar-collapsed: 72px;
  --topbar-h: 56px;
  --touch: 40px;
  --content-w: 860px;

  /* Layers */
  --z-topbar: 20;
  --z-scrim: 40;
  --z-drawer: 50;
  --z-fullscreen: 60;
  --z-modal: 70;
  --z-toast: 80;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 0.22s;
}

:root[data-accent="violet"] {
  --accent: #9d74ff;
  --accent-ink: #0d0620;
  --accent-soft: rgba(157, 116, 255, 0.16);
  --accent-glow: rgba(157, 116, 255, 0.5);
}

:root[data-accent="cyan"] {
  --accent: #22d3ee;
  --accent-ink: #021417;
  --accent-soft: rgba(34, 211, 238, 0.14);
  --accent-glow: rgba(34, 211, 238, 0.45);
}

:root[data-accent="emerald"] {
  --accent: #34d399;
  --accent-ink: #03150e;
  --accent-soft: rgba(52, 211, 153, 0.14);
  --accent-glow: rgba(52, 211, 153, 0.45);
}

:root[data-compact="true"] {
  --s3: 8px;
  --s4: 11px;
  --s5: 16px;
  --fs-md: 0.88rem;
  --fs-sm: 0.79rem;
  --lh: 1.45;
  --touch: 36px;
}

@media (pointer: coarse) {
  :root,
  :root[data-compact="true"] { --touch: 44px; }
}

:root[data-motion="off"] { --dur: 0s; }

:root[data-motion="off"] *,
:root[data-motion="off"] *::before,
:root[data-motion="off"] *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Light theme (opt-in from Settings) */
:root[data-theme="light"] {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --card: #eef0f6;
  --card-hover: #e4e7f0;
  --glass: rgba(255, 255, 255, 0.86);
  --line: rgba(15, 20, 40, 0.1);
  --line-strong: rgba(15, 20, 40, 0.2);
  --text: #14172a;
  --text-2: #3d435c;
  --muted: #646b85;
  --accent-ink: #ffffff;
  --shadow: 0 18px 50px rgba(20, 25, 60, 0.12);
}
