/* Obra shadcn/ui Design System — tokens
   Based on Tailwind v4 raw colors + shadcn/ui theming variables.
   Light mode default; add class="dark" to root for dark mode. */

/* ── Fonts ────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Geist+Mono:wght@100..900&family=Inter:wght@100..900&display=swap');

:root {
  /* Tailwind v4 Neutral ramp (primary grayscale) */
  --neutral-50:  #FAFAFA;
  --neutral-100: #F5F5F5;
  --neutral-200: #E5E5E5;
  --neutral-300: #D4D4D4;
  --neutral-400: #A3A3A3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-900: #171717;
  --neutral-950: #0A0A0A;

  /* Destructive (Red — 5 steps in use) */
  --red-200: #FFE2E2;
  --red-400: #F87171;
  --red-500: #EF4444;
  --red-600: #DC2626;
  --red-700: #B91C1C;

  /* Accent hues (available, not wired by default) */
  --blue-200: #BFDBFE;
  --blue-500: #3F8DFF;
  --blue-600: #2563EB;
  --amber-500: #EAB308;
  --emerald-600: #059669;

  /* ── Semantic shadcn tokens (light mode) ─ */
  --background: #FFFFFF;
  --foreground: #0A0A0A;
  --foreground-alt: #404040;      /* body copy (unofficial) */
  --muted: #F5F5F5;
  --muted-foreground: #737373;
  --popover: #FFFFFF;
  --popover-foreground: #0A0A0A;
  --card: #FFFFFF;
  --card-foreground: #0A0A0A;

  --primary: #171717;
  --primary-foreground: #FAFAFA;
  --secondary: #F5F5F5;
  --secondary-foreground: #171717;
  --accent: #F5F5F5;
  --accent-foreground: #171717;

  --destructive: #DC2626;
  --destructive-foreground: #FAFAFA;

  --border: #E5E5E5;
  --input: #E5E5E5;
  --ring: rgba(10,10,10,0.15);

  /* ── Radii ─────────────────────────────── */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* ── Shadows ───────────────────────────── */
  --shadow-xs: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 2px -1px rgba(0,0,0,0.1), 0 1px 3px 0 rgba(0,0,0,0.1);
  --shadow-md: 0 2px 4px -2px rgba(0,0,0,0.1), 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 6px -4px rgba(0,0,0,0.1), 0 10px 15px -3px rgba(0,0,0,0.1);
  --shadow-xl: 0 8px 10px -6px rgba(0,0,0,0.1), 0 20px 25px -5px rgba(0,0,0,0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.25);

  /* ── Typography ────────────────────────── */
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-sans-alt: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Scale (px) */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 14px;   /* shadcn uses 14 as body default */
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
  --text-4xl: 36px;
  --text-5xl: 48px;
  --text-6xl: 60px;

  /* Spacing (4px base) */
  --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; --space-16: 64px; --space-24: 96px;
}

.dark {
  --background: #0A0A0A;
  --foreground: #FAFAFA;
  --foreground-alt: #A3A3A3;
  --muted: #262626;
  --muted-foreground: #737373;
  --popover: #0A0A0A;
  --popover-foreground: #FAFAFA;
  --card: #0A0A0A;
  --card-foreground: #FAFAFA;

  --primary: #FAFAFA;
  --primary-foreground: #171717;
  --secondary: #262626;
  --secondary-foreground: #FAFAFA;
  --accent: #262626;
  --accent-foreground: #FAFAFA;

  --destructive: #EF4444;
  --destructive-foreground: #FAFAFA;

  --border: #262626;
  --input: #262626;
  --ring: rgba(250,250,250,0.15);
}

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

html, body {
  margin: 0; padding: 0;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--foreground-alt);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Semantic type utilities ─────────────────────────────────────── */
.h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--text-5xl);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--foreground);
}
.h2 {
  font-weight: 700;
  font-size: var(--text-3xl);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--foreground);
}
.h3 {
  font-weight: 600;
  font-size: var(--text-2xl);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--foreground);
}
.h4 {
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--foreground);
}
.p-lg  { font-size: var(--text-lg); line-height: 1.5; color: var(--foreground-alt); }
.p     { font-size: var(--text-sm); line-height: 1.5; color: var(--foreground-alt); }
.p-md  { font-size: var(--text-md); line-height: 1.5; color: var(--foreground-alt); }
.p-sm  { font-size: var(--text-xs); line-height: 1.5; color: var(--muted-foreground); letter-spacing: 0.015em; }
.caption {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* ── Common components ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  height: 36px; padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 500 var(--text-sm) var(--font-sans);
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color .12s ease-out, border-color .12s ease-out, color .12s ease-out;
  white-space: nowrap;
  user-select: none;
}
.btn-primary   { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover   { background: #262626; }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-secondary:hover { background: #E5E5E5; }
.btn-outline   { background: transparent; border-color: var(--border); color: var(--foreground); }
.btn-outline:hover   { background: var(--accent); }
.btn-ghost     { background: transparent; color: var(--foreground); }
.btn-ghost:hover     { background: var(--accent); }
.btn-destructive { background: var(--destructive); color: var(--destructive-foreground); }
.btn-destructive:hover { background: #B91C1C; }
.btn-sm { height: 32px; padding: 0 10px; font-size: var(--text-sm); }
.btn-lg { height: 40px; padding: 0 16px; }
.btn-icon { width: 36px; padding: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--card-foreground);
}
.card-header  { padding: 24px 24px 0; }
.card-content { padding: 24px; }
.card-footer  { padding: 0 24px 24px; display: flex; gap: 8px; }
.card-title { font-weight: 600; font-size: var(--text-xl); letter-spacing: -0.015em; color: var(--foreground); }
.card-desc  { font-size: var(--text-sm); color: var(--muted-foreground); margin-top: 6px; }

.input {
  display: flex; align-items: center;
  height: 36px; padding: 0 12px;
  background: var(--background);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  font: 400 var(--text-sm) var(--font-sans);
  color: var(--foreground);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  width: 100%;
}
.input:focus { border-color: var(--foreground); box-shadow: 0 0 0 3px var(--ring); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 8px;
  border-radius: var(--radius-full);
  font: 500 12px var(--font-sans);
  border: 1px solid transparent;
}
.badge-default  { background: var(--primary); color: var(--primary-foreground); }
.badge-secondary{ background: var(--secondary); color: var(--secondary-foreground); }
.badge-outline  { background: transparent; border-color: var(--border); color: var(--foreground); }
.badge-destructive { background: var(--destructive); color: var(--destructive-foreground); }

.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  font: 500 11px var(--font-mono);
  color: var(--muted-foreground);
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.separator { height: 1px; background: var(--border); border: 0; }
