@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";

@custom-variant dark (&:is(.dark *));

@theme inline {
  --color-vermilion-pulse: #ff3b1f;
  --color-cobalt-glow: #5683d2;
  --color-obsidian: #0c0a08;
  --color-paper: #ffffff;
  --color-limestone: #f4f2f0;
  --color-charcoal: #1a1919;
  --color-slate: #4d505d;
  --color-fog: #999ba3;
  --color-bone: #d2cecb;
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-sans);
  --font-mono: var(--font-geist-mono);
  --font-heading: var(--font-sans);
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  /* Ramp's strict dual-radius system: 4px for functional controls, 12px for surfaces */
  --radius-sm: calc(var(--radius) - 8px);
  --radius-md: calc(var(--radius) - 8px);
  --radius-lg: var(--radius);
  --radius-xl: var(--radius);
  --radius-2xl: var(--radius);
  --radius-3xl: var(--radius);
  --radius-4xl: 9999px;
}

:root {
  --background: #ffffff; /* Paper */
  --foreground: #0c0a08; /* Obsidian */
  --card: #f4f2f0; /* Limestone — separates surfaces without drop shadows */
  --card-foreground: #0c0a08;
  --popover: #ffffff;
  --popover-foreground: #0c0a08;
  --primary: #ff3b1f; /* Vermilion Pulse — the single bold ignition accent */
  --primary-foreground: #ffffff; /* white text for contrast on vermilion */
  --secondary: #f4f2f0; /* Limestone */
  --secondary-foreground: #0c0a08;
  --muted: #f4f2f0; /* Limestone */
  --muted-foreground: #999ba3; /* Fog */
  --accent: #f4f2f0; /* Limestone */
  --accent-foreground: #0c0a08;
  --destructive: oklch(0.577 0.245 27.325);
  --border: #d2cecb; /* Bone — hairline borders on light surfaces */
  --input: #d2cecb;
  --ring: #5683d2; /* Cobalt Glow — atmospheric accent reserved for focus rings */
  --chart-1: #5683d2; /* Cobalt Glow */
  --chart-2: #4d505d; /* Slate */
  --chart-3: #999ba3; /* Fog */
  --chart-4: #d2cecb; /* Bone */
  --chart-5: #1a1919; /* Charcoal */
  --radius: 0.75rem; /* 12px surface radius — controls derive 4px via --radius-sm/md */
  --sidebar: #f4f2f0;
  --sidebar-foreground: #0c0a08;
  --sidebar-primary: #0c0a08;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #ffffff;
  --sidebar-accent-foreground: #0c0a08;
  --sidebar-border: #d2cecb;
  --sidebar-ring: #5683d2;
}

.dark {
  --background: #0c0a08; /* Obsidian ground */
  --foreground: #ffffff; /* Paper */
  --card: #1a1919; /* Charcoal — one step lifted from Obsidian */
  --card-foreground: #ffffff;
  --popover: #1a1919;
  --popover-foreground: #ffffff;
  --primary: #ff3b1f; /* Vermilion Pulse stays the only chromatic accent */
  --primary-foreground: #ffffff;
  --secondary: #1a1919;
  --secondary-foreground: #ffffff;
  --muted: #1a1919;
  --muted-foreground: #999ba3; /* Fog */
  --accent: #1a1919;
  --accent-foreground: #ffffff;
  --destructive: oklch(0.704 0.191 22.216);
  --border: #4d505d; /* Slate */
  --input: #4d505d;
  --ring: #5683d2; /* Cobalt Glow */
  --chart-1: #5683d2;
  --chart-2: #999ba3;
  --chart-3: #d2cecb;
  --chart-4: #4d505d;
  --chart-5: #f4f2f0;
  --sidebar: #1a1919;
  --sidebar-foreground: #ffffff;
  --sidebar-primary: #ff3b1f;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #0c0a08;
  --sidebar-accent-foreground: #ffffff;
  --sidebar-border: #4d505d;
  --sidebar-ring: #5683d2;
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
  html {
    @apply font-sans;
  }
}

@media (min-width: 768px) {
  [data-sonner-toaster] {
    transition: left 0.2s ease, right 0.2s ease, transform 0.2s ease !important;
  }
  html:has([data-slot="sidebar"][data-state="expanded"]) [data-sonner-toaster][data-x-position="left"] {
    left: calc(16rem + 16px) !important;
  }
  html:has([data-slot="sidebar"][data-state="collapsed"]) [data-sonner-toaster][data-x-position="left"] {
    left: calc(3rem + 16px) !important;
  }
}

/* Custom glassmorphism utility classes */
.liquid-glass {
  background: rgba(255, 255, 255, 0.01);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
  position: relative;
}
.liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.liquid-glass-strong {
  background: rgba(255, 255, 255, 0.01);
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
}