/* ============================================================
   vix-site design tokens
   Light-first palette; dark theme via [data-theme="dark"] or
   system preference (unless user explicitly chose light).
   ============================================================ */

:root {
  color-scheme: light;

  /* Color — light (default) */
  --bg: #fafbfc;
  --bg-soft: #f3f5f8;
  --surface: #ffffff;
  --surface-hover: #f6f8fb;
  --border: #e4e8ee;
  --border-strong: #d3d9e2;
  --text: #17202a;
  --text-muted: #5c6675;
  --text-faint: #8a93a3;
  --primary: #3b6cf6;
  --primary-hover: #2f5ce8;
  --primary-soft: #edf2ff;
  --primary-glow: rgba(59, 108, 246, 0.28);
  --danger: #d64545;
  --danger-text: #c03636;

  /* Type scale (fluid) */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --text-xs: 0.8125rem;
  --text-sm: 0.9rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-h2: clamp(1.6rem, 3vw, 2rem);
  --text-h1: clamp(2.25rem, 5vw, 3.5rem);

  /* Spacing (4px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 48px;
  --space-9: 72px;

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* Shadows (soft, low-opacity, layered) */
  --shadow-1: 0 1px 2px rgba(23, 32, 42, 0.05);
  --shadow-2: 0 1px 2px rgba(23, 32, 42, 0.04), 0 8px 24px rgba(23, 32, 42, 0.06);
  --shadow-3: 0 2px 4px rgba(23, 32, 42, 0.05), 0 16px 40px rgba(23, 32, 42, 0.1);
  --shadow-primary: 0 4px 14px var(--primary-glow);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.15s;
  --dur-base: 0.25s;
}

/* Dark theme — explicit user choice */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1116;
  --bg-soft: #12161d;
  --surface: #161b22;
  --surface-hover: #1c222b;
  --border: #252b36;
  --border-strong: #333b49;
  --text: #e8ecf1;
  --text-muted: #98a2b3;
  --text-faint: #6b7484;
  --primary: #6b93ff;
  --primary-hover: #82a4ff;
  --primary-soft: #1c2947;
  --primary-glow: rgba(107, 147, 255, 0.3);
  --danger: #f87171;
  --danger-text: #fca5a5;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-3: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* Dark theme — follows system unless user explicitly picked light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1116;
    --bg-soft: #12161d;
    --surface: #161b22;
    --surface-hover: #1c222b;
    --border: #252b36;
    --border-strong: #333b49;
    --text: #e8ecf1;
    --text-muted: #98a2b3;
    --text-faint: #6b7484;
    --primary: #6b93ff;
    --primary-hover: #82a4ff;
    --primary-soft: #1c2947;
    --primary-glow: rgba(107, 147, 255, 0.3);
    --danger: #f87171;
    --danger-text: #fca5a5;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-3: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.5);
  }
}
