@import "tailwindcss";

@theme {
  --color-bg: #080c14;
  --color-bg-subtle: #0b1120;
  --color-surface: #0f1623;
  --color-surface-raised: #162032;
  --color-surface-hover: #1c2d45;
  --color-fg: #d4dce8;
  --color-fg-bright: #f1f5f9;
  --color-fg-dim: #94a3b8;
  --color-muted: #5a6b82;
  --color-border: #1c2a3f;
  --color-border-light: #253550;
  --color-accent: #f0a030;
  --color-accent-hover: #fbbf24;
  --color-cyan: #22d3ee;
  --color-red: #ef4444;
  --color-green: #22c55e;
  --color-purple: #a78bfa;

  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body: "SF Pro Text", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, Menlo, monospace;

  --spacing-sidebar: 260px;
  --spacing-sidebar-collapsed: 60px;
  --spacing-topbar: 48px;
  --spacing-content: 1100px;
}

@layer base {
  :root {
    --bg: var(--color-bg);
    --bg-subtle: var(--color-bg-subtle);
    --surface: var(--color-surface);
    --surface-base: var(--color-bg);
    --surface-sunken: var(--color-bg-subtle);
    --surface-raised: var(--color-surface-raised);
    --surface-hover: var(--color-surface-hover);
    --fg: var(--color-fg);
    --fg-bright: var(--color-fg-bright);
    --fg-dim: var(--color-fg-dim);
    --muted: var(--color-muted);
    --border: var(--color-border);
    --border-light: var(--color-border-light);
    --accent: var(--color-accent);
    --amber: var(--color-accent);
    --accent-hover: var(--color-accent-hover);
    --accent-dim: #b47818;
    --accent-bg: rgba(240, 160, 48, 0.08);
    --accent-border: rgba(240, 160, 48, 0.25);
    --cyan: var(--color-cyan);
    --cyan-dim: #0891b2;
    --cyan-bg: rgba(34, 211, 238, 0.08);
    --red: var(--color-red);
    --red-dim: #dc2626;
    --red-bg: rgba(239, 68, 68, 0.08);
    --green: var(--color-green);
    --green-dim: #16a34a;
    --green-bg: rgba(34, 197, 94, 0.08);
    --purple: var(--color-purple);
    --purple-dim: #8b5cf6;
    --purple-bg: rgba(167, 139, 250, 0.08);
    --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-body: "SF Pro Text", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, Menlo, monospace;
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-pill: 9999px;
  }

  *, *::before, *::after {
    box-sizing: border-box;
  }

  html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  body {
    @apply h-screen overflow-hidden bg-bg font-body text-fg;
    line-height: 1.6;
  }

  #root {
    @apply flex h-screen;
  }

  a {
    @apply text-cyan no-underline transition-colors duration-150 hover:text-accent;
  }

  h1, h2, h3, h4, h5, h6 {
    @apply font-display text-fg-bright;
    line-height: 1.25;
    letter-spacing: 0;
  }

  h1 {
    @apply text-[2rem] font-bold;
  }

  h2 {
    @apply mb-4 text-2xl font-semibold;
  }

  h3 {
    @apply mb-3 text-[1.2rem] font-semibold;
  }

  h4 {
    @apply mb-2 text-[1.05rem] font-semibold;
  }

  p {
    @apply mb-4;
  }

  code {
    @apply rounded bg-surface-raised px-1.5 py-0.5 font-mono text-[0.9em] text-accent;
  }

  pre {
    @apply mb-4 overflow-x-auto rounded-lg border border-border bg-surface p-4 font-mono text-[0.85rem];
    line-height: 1.5;
  }

  ul, ol {
    @apply mb-4 pl-6;
  }

  li {
    @apply mb-1;
  }

  button,
  input,
  select,
  textarea {
    font: inherit;
  }

  input,
  select,
  textarea {
    @apply rounded border border-border bg-surface-raised px-3 py-2 text-fg focus:border-cyan focus:outline-none focus:ring-2 focus:ring-cyan/10;
  }

  ::selection {
    @apply bg-accent text-bg;
  }

  * {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-light) transparent;
  }

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

  ::-webkit-scrollbar-track {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    @apply rounded-full bg-border-light;
  }

  ::-webkit-scrollbar-thumb:hover {
    @apply bg-muted;
  }

  @keyframes pulse {
    0%, 100% {
      opacity: 1;
    }

    50% {
      opacity: 0.4;
    }
  }
}
