/* ∫ntgr8 Design System v5 — Brand palette */

: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;

  /* Brand palette */
  --brand-white: #ffffff;
  --brand-blue: #4d7593;
  --brand-pink: #f26b8d;
  --brand-navy: #2f3851;

  /* Neutral scale (derived from navy) */
  --gray-100: #f5f7fa;
  --gray-200: #e8ecf2;
  --gray-300: #8b93a8;
  --gray-400: #5c6578;
  --black: var(--brand-navy);

  --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 — white surfaces, blue accent, navy ink */
  --bg: var(--brand-white);
  --bg-elevated: var(--brand-white);
  --sidebar: var(--gray-100);
  --panel: var(--brand-white);
  --ink: var(--brand-navy);
  --muted: var(--gray-400);
  --line: var(--gray-200);
  --line-subtle: var(--gray-100);

  --accent: var(--brand-blue);
  --accent-hover: #3d6278;
  --accent-soft: #e4eaef;
  --accent-deep: var(--brand-blue);
  --accent-glow: rgba(77, 117, 147, 0.18);
  --on-accent: var(--brand-white);

  --solid: var(--brand-navy);
  --solid-hover: #3a4359;
  --on-solid: var(--brand-white);

  --signal: var(--brand-pink);
  --signal-soft: #fde8ee;
  --sage: var(--gray-300);
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --active: rgba(77, 117, 147, 0.06);
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --live: var(--brand-blue);
  --live-soft: var(--accent-soft);

  --tool: var(--gray-100);
  --think: var(--gray-100);
  --think-ink: var(--gray-400);
  --tool-ink: var(--gray-400);

  --shadow-xs: 0 1px 2px rgba(47, 56, 81, 0.05);
  --shadow-sm: 0 2px 8px rgba(47, 56, 81, 0.07);
  --shadow-md: 0 8px 24px rgba(47, 56, 81, 0.08);
  --shadow-lg: 0 16px 40px rgba(47, 56, 81, 0.1);
  --shadow-tight: var(--shadow-xs);
  --shadow: var(--shadow-md);

  --glass: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(47, 56, 81, 0.08);
  --surface-raised: var(--brand-white);
  --surface-input: var(--brand-white);
  --surface-hover: var(--gray-100);

  --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);
}

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"] {
  --gray-100: #ffffff;
  --gray-200: #e8ecf2;
  --gray-300: #a8b0c4;
  --gray-400: #8b93a8;
  --black: var(--brand-navy);

  --bg: #1e2433;
  --bg-elevated: #2f3851;
  --sidebar: #232b3d;
  --panel: #343e54;
  --ink: var(--brand-white);
  --muted: #a8b0c4;
  --line: #3d4860;
  --line-subtle: #323a4d;

  --accent: var(--brand-blue);
  --accent-hover: #5f8aad;
  --accent-soft: rgba(77, 117, 147, 0.15);
  --accent-deep: var(--brand-blue);
  --accent-glow: rgba(77, 117, 147, 0.24);
  --on-accent: var(--brand-white);

  --solid: #ffffff;
  --solid-hover: #e8ecf2;
  --on-solid: var(--brand-navy);

  --signal: var(--brand-pink);
  --signal-soft: rgba(242, 107, 141, 0.15);
  --sage: var(--gray-400);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --active: rgba(77, 117, 147, 0.1);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.1);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.1);
  --live: var(--brand-blue);
  --live-soft: rgba(77, 117, 147, 0.15);

  --tool: #232b3d;
  --think: #232b3d;
  --think-ink: var(--gray-300);
  --tool-ink: var(--gray-300);

  --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(47, 56, 81, 0.92);
  --glass-border: rgba(255, 255, 255, 0.08);
  --surface-raised: #3d4860;
  --surface-input: #2f3851;
  --surface-hover: #3d4860;
}

html[data-theme="dark"] body {
  background-color: var(--bg);
}
