@import "tailwindcss";
@import "tw-animate-css";

/* Tailwind v4: @source "../components/ui" overrides gitignore for shadcn.
   @source inline() explicitly safelists classes used only in non-gitignored components
   that Tailwind's automatic scanner misses (e.g. InspectorPanel, new top-level components). */
@source "../components/ui";
@source inline("fixed bottom-6 right-6 z-50 w-10 rounded-full bg-card border-border text-card-foreground hover:border-cyan-500/60 hover:text-cyan-400 shadow-lg inset-0 bg-black/20 top-0 right-0 w-[580px] max-w-[95vw] border-l border-border/60 shadow-2xl translate-x-0 translate-x-full duration-300 ease-in-out shrink-0 w-fit overflow-y-auto overflow-x-auto max-h-[35vh] whitespace-pre-wrap animate-pulse italic tracking-widest");

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

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-dm-sans);
  --font-mono: var(--font-jetbrains-mono);
  --font-display: var(--font-dm-serif);

  /* Starry Night / sciknow.io palette — overrides Tailwind built-in colors.
     All skill pages using text-cyan-400, text-indigo-400, etc. pick these up
     automatically without touching any skill files. */
  --color-cyan-400: #5aadaf;
  --color-cyan-500: #4a9aaa;
  --color-blue-400: #4a7ab5;
  --color-blue-500: #3d6aa5;
  --color-indigo-400: #5b8ab8;
  --color-indigo-500: #4a7ab5;
  --color-purple-400: #4d6a9a;
  --color-purple-500: #3d5c8f;
  --color-purple-600: #3a5280;
  --color-amber-400: #b8c84a;
  --color-amber-500: #a0b038;
  --color-amber-600: #8a9a28;
  --color-pink-400: #62c4bc;
  --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);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);
  --radius-3xl: calc(var(--radius) + 12px);
  --radius-4xl: calc(var(--radius) + 16px);
}

:root {
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);
}

.dark {
  /* Starry Night / sciknow.io identity */
  --background: #070d1c;
  --foreground: #c8dde8;
  --card: #0c1628;
  --card-foreground: #c8dde8;
  --popover: #0f1c35;
  --popover-foreground: #c8dde8;
  --primary: #5aadaf;
  --primary-foreground: #070d1c;
  --secondary: rgba(90, 173, 175, 0.12);
  --secondary-foreground: #c8dde8;
  --muted: rgba(255, 255, 255, 0.05);
  --muted-foreground: #8ba4b8;
  --accent: rgba(184, 200, 74, 0.18);
  --accent-foreground: #c8dde8;
  --destructive: oklch(0.704 0.191 22.216);
  --border: rgba(90, 173, 175, 0.15);
  --input: rgba(90, 173, 175, 0.15);
  --ring: #5aadaf;
  --chart-1: #5aadaf;
  --chart-2: #5b8ab8;
  --chart-3: #b8c84a;
  --chart-4: #62c4bc;
  --chart-5: #3d5c8f;
  --sidebar: rgba(12, 22, 40, 0.9);
  --sidebar-foreground: #c8dde8;
  --sidebar-primary: #5aadaf;
  --sidebar-primary-foreground: #070d1c;
  --sidebar-accent: rgba(90, 173, 175, 0.15);
  --sidebar-accent-foreground: #c8dde8;
  --sidebar-border: rgba(90, 173, 175, 0.15);
  --sidebar-ring: #5aadaf;
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply text-foreground;
    background:
      radial-gradient(ellipse at 20% 10%, rgba(61, 92, 143, 0.25) 0%, transparent 50%),
      radial-gradient(ellipse at 80% 90%, rgba(90, 173, 175, 0.1) 0%, transparent 40%),
      #070d1c;
    min-height: 100vh;
  }
  h1 {
    font-family: var(--font-dm-serif), serif;
  }
}

/* Professional markdown/prose styling */
.prose {
  font-size: 0.875rem;
  line-height: 1.7;
  color: inherit;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.prose h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: #a1a1aa;
}

.prose p {
  margin-top: 0.625rem;
  margin-bottom: 0.625rem;
}

.prose strong {
  font-weight: 600;
  color: inherit;
}

.prose ul, .prose ol {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose li {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  padding-left: 0.25rem;
}

.prose li::marker {
  color: #9ca3af;
}

/* Table styling */
.prose table {
  width: 100%;
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-collapse: collapse;
  font-size: 0.8125rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  overflow: hidden;
}

.prose thead {
  background: rgba(255, 255, 255, 0.05);
}

.prose th {
  padding: 0.625rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a1a1aa;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.prose td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  vertical-align: top;
}

.prose tbody tr:last-child td {
  border-bottom: none;
}

.prose tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.prose tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Code styling */
.prose code {
  font-size: 0.8125rem;
  padding: 0.125rem 0.375rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.25rem;
  font-family: ui-monospace, monospace;
}

.prose pre {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-size: 0.8125rem;
}

/* Links */
.prose a {
  color: #5aadaf;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose a:hover {
  color: #7dd4d6;
}

/* Blockquotes */
.prose blockquote {
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  padding-left: 1rem;
  margin: 1rem 0;
  color: #a1a1aa;
  font-style: italic;
}
