/* ∫ntgr8 Design System v3 — Zinc + Iris (logo-agnostic) */

:root {
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 360ms;

  --rail-width: 240px;
  --rail-width-collapsed: 64px;
  --topbar-height: 52px;
  --content-max: 1240px;

  /* Light — warm zinc base, iris accent */
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --sidebar: #f4f4f5;
  --panel: #ffffff;
  --ink: #18181b;
  --muted: #71717a;
  --line: #e4e4e7;
  --line-subtle: #f4f4f5;

  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.1);
  --accent-deep: #4338ca;
  --accent-glow: rgba(99, 102, 241, 0.22);

  --sage: #a1a1aa;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --active: rgba(99, 102, 241, 0.08);
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;

  --tool: #f4f4f5;
  --think: #eef2ff;
  --think-ink: #4338ca;
  --tool-ink: #6366f1;

  --shadow-xs: 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow-sm: 0 2px 8px rgba(24, 24, 27, 0.06);
  --shadow-md: 0 8px 24px rgba(24, 24, 27, 0.07);
  --shadow-lg: 0 16px 40px rgba(24, 24, 27, 0.1);
  --shadow-tight: var(--shadow-xs);
  --shadow: var(--shadow-md);

  --glass: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.6);
  --surface-raised: #ffffff;
  --surface-input: #ffffff;
  --surface-hover: #f4f4f5;

  --radius-control: var(--radius-md);
  --radius-card: var(--radius-lg);
  --text: var(--ink);
  --text-muted: var(--muted);
  --border: var(--line);
  --surface: var(--panel);
  --surface-2: var(--sidebar);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-normal: 0ms;
    --duration-slow: 0ms;
  }
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  letter-spacing: -0.011em;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 45% at 50% -15%, rgba(99, 102, 241, 0.07), transparent),
    radial-gradient(ellipse 50% 35% at 100% 0%, rgba(139, 92, 246, 0.04), transparent);
  background-attachment: fixed;
}

h1, h2, h3, h4, strong {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 35%, transparent) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 30%, transparent);
  border-radius: var(--radius-full);
}

html[data-theme="dark"] {
  --bg: #09090b;
  --bg-elevated: #141416;
  --sidebar: #0f0f11;
  --panel: #18181b;
  --ink: #fafafa;
  --muted: #a1a1aa;
  --line: #27272a;
  --line-subtle: #1c1c1f;

  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: rgba(129, 140, 248, 0.14);
  --accent-deep: #c7d2fe;
  --accent-glow: rgba(129, 140, 248, 0.18);

  --sage: #71717a;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --active: rgba(129, 140, 248, 0.1);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.1);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.1);

  --tool: #1c1c1f;
  --think: #1e1b4b;
  --think-ink: #c7d2fe;
  --tool-ink: #a5b4fc;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);

  --glass: rgba(15, 15, 17, 0.88);
  --glass-border: rgba(255, 255, 255, 0.06);
  --surface-raised: #1f1f23;
  --surface-input: #141416;
  --surface-hover: #232326;
}

html[data-theme="dark"] body {
  background-image:
    radial-gradient(ellipse 70% 45% at 50% -15%, rgba(99, 102, 241, 0.08), transparent),
    radial-gradient(ellipse 50% 35% at 100% 0%, rgba(139, 92, 246, 0.05), transparent);
}
