/* ==========================================================================
   Design Tokens — Master UI Kit v2.0 (Studio Precision, Zero AI Slop)
   ========================================================================== */

:root {
  color-scheme: light;
  /* Typography */
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --text-2xs: 0.6875rem;   /* 11px */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.8125rem;    /* 13px */
  --text-base: 0.875rem;   /* 14px */
  --text-lg: 1.0625rem;    /* 17px */
  --text-xl: 1.25rem;      /* 20px */

  /* Spacing (4px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* Radius */
  --radius-xs: 5px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Surface & Borders (Fresh Airy Cool Canvas) */
  --bg-canvas: #f4f7fb;
  --bg-canvas-dot: rgba(20, 34, 74, 0.055);
  --bg-surface: #ffffff;
  --bg-subtle: #edf2f8;
  --bg-muted: #e2e9f3;

  --border-subtle: #e8eef6;
  --border-default: #dce4ef;
  --border-strong: #c4d0e0;

  /* Ink */
  --ink-primary: #14224a;
  --ink-secondary: #3b4a6b;
  --ink-muted: #7080a0;
  --ink-inverse: #ffffff;

  /* Default Accent: Editorial Pine */
  --accent: #0f5b48;
  --accent-hover: #0b4738;
  --accent-active: #08382c;
  --accent-fg: #ffffff;
  --accent-subtle: #e6f3ef;
  --accent-border: #afd5c9;

  /* Semantic Status (Fresh Pastel) */
  --success: #1f7a4a;
  --success-bg: #dff6e4;
  --success-border: #b6ebc2;

  --warning: #b45309;
  --warning-bg: #fef3c7;
  --warning-border: #fde68a;

  --danger: #c24444;
  --danger-hover: #a63232;
  --danger-bg: #fde0e0;
  --danger-border: #f8bcbc;

  --info: #2b5fb8;
  --info-bg: #dce9fb;
  --info-border: #b8d2f8;

  /* Flat Elevation (No Drop Shadows) + iOS Liquid Glass Tokens */
  --shadow-xs: none;
  --shadow-sm: none;
  --shadow-lg: none;
  --inset-highlight: none;
  --glass-bg: rgba(255, 255, 255, 0.56);
  --glass-bg-elevated: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.78);
  --glass-border-outer: rgba(21, 21, 19, 0.08);
  --glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  --glass-blur: blur(24px) saturate(190%);
  --glass-blur-sm: blur(18px) saturate(180%);

  /* Focus Ring */
  --focus-ring: 0 0 0 2px var(--bg-surface), 0 0 0 3.5px var(--accent);

  /* Layout */
  --sidebar-width: 210px;
  --topbar-height: 44px;
  --control-h: 30px;
  --transition-fast: 115ms cubic-bezier(0.2, 0, 0, 1);
}

/* Curated Non-Generic Accent Presets */
[data-accent="terracotta"] {
  --accent: #b84a27;
  --accent-hover: #9a3c1e;
  --accent-active: #7f3118;
  --accent-subtle: #fdf0eb;
  --accent-border: #f0c2b2;
}

[data-accent="cobalt"] {
  --accent: #3868dd;
  --accent-hover: #2956c8;
  --accent-active: #1f44a8;
  --accent-subtle: #eaf1fe;
  --accent-border: #bfd4fb;
}

[data-accent="obsidian"] {
  --accent: #000000;
  --accent-hover: #1c1c1c;
  --accent-active: #000000;
  --accent-subtle: rgba(0, 0, 0, 0.065);
  --accent-border: rgba(0, 0, 0, 0.22);
}

/* High-Craft Dark Mode */
[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #0f1114;
  --bg-canvas-dot: rgba(255, 255, 255, 0.045);
  --bg-surface: #171a1f;
  --bg-subtle: #21252c;
  --bg-muted: #2b3039;

  --border-subtle: #252a32;
  --border-default: #323842;
  --border-strong: #474f5d;

  --ink-primary: #f3f5f8;
  --ink-secondary: #b8c0cc;
  --ink-muted: #86909e;
  --ink-inverse: #0f1114;

  --accent: #34c79b;
  --accent-hover: #4cd4ab;
  --accent-active: #26a880;
  --accent-fg: #051b13;
  --accent-subtle: rgba(52, 199, 155, 0.14);
  --accent-border: rgba(52, 199, 155, 0.34);

  --success: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.13);
  --success-border: rgba(74, 222, 128, 0.30);

  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.13);
  --warning-border: rgba(251, 191, 36, 0.30);

  --danger: #f87171;
  --danger-hover: #ef4444;
  --danger-bg: rgba(248, 113, 113, 0.13);
  --danger-border: rgba(248, 113, 113, 0.30);

  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.13);
  --info-border: rgba(96, 165, 250, 0.30);

  --shadow-xs: none;
  --shadow-sm: none;
  --shadow-lg: none;
  --glass-bg: rgba(23, 26, 31, 0.68);
  --glass-bg-elevated: rgba(30, 34, 41, 0.82);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-border-outer: rgba(255, 255, 255, 0.10);
  --glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

[data-theme="dark"][data-accent="terracotta"] {
  --accent: #f07b54;
  --accent-hover: #f59170;
  --accent-active: #d9643d;
  --accent-fg: #1d0903;
  --accent-subtle: rgba(240, 123, 84, 0.15);
  --accent-border: rgba(240, 123, 84, 0.35);
}

[data-theme="dark"][data-accent="cobalt"] {
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-active: #3b82f6;
  --accent-fg: #071324;
  --accent-subtle: rgba(96, 165, 250, 0.15);
  --accent-border: rgba(96, 165, 250, 0.35);
}

[data-theme="dark"][data-accent="obsidian"] {
  --accent: #f1f5f9;
  --accent-hover: #ffffff;
  --accent-active: #dce3ec;
  --accent-fg: #0f172a;
  --accent-subtle: rgba(255, 255, 255, 0.11);
  --accent-border: rgba(255, 255, 255, 0.28);
}

[data-density="comfortable"] {
  --space-3: 14px;
  --space-4: 20px;
  --control-h: 34px;
}
