/*! tailwindcss v4 | MIT License */
@import "tailwindcss" source(none);
@import "katex/dist/katex.min.css";

*, ::after, ::before {
  box-sizing: border-box;
  border: 0 solid hsl(var(--border));
}

:root {
  --background: 225 10% 14%;
  --foreground: 220 12% 94%;
  --card: 225 10% 17%;
  --card-foreground: 220 12% 94%;
  --popover: 225 10% 17%;
  --popover-foreground: 220 12% 94%;
  --primary: 220 12% 94%;
  --primary-foreground: 225 10% 14%;
  --secondary: 223 8% 24%;
  --secondary-foreground: 220 12% 94%;
  --muted: 223 8% 24%;
  --muted-foreground: 220 8% 72%;
  --accent: 223 8% 24%;
  --accent-foreground: 220 12% 94%;
  --destructive: 0 63% 42%;
  --destructive-foreground: 220 12% 94%;
  --border: 223 8% 29%;
  --input: 223 8% 29%;
  --ring: 220 10% 78%;
  --radius: 0.5rem;
}

html { height: 100%; }
body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  scrollbar-gutter: stable;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 100dvh;
  height: 100%;
}
a { color: inherit; text-decoration: none; }
a.underline { text-decoration: underline; }
a.text-primary { color: hsl(var(--primary)); }
a.no-underline { text-decoration: none; }
.btn { text-decoration: none; }
.hover\:text-foreground:hover { color: hsl(var(--foreground)); }
.transition-colors { transition-property: color, background-color, border-color; transition-duration: 150ms; }

.container { width: 100%; max-width: 100%; margin: 0 auto; padding: 0 1rem; overflow-wrap: break-word; }
@media (min-width: 640px) { .container { max-width: 640px; } }
@media (min-width: 768px) { .container { max-width: 768px; } }
@media (min-width: 1024px) { .container { max-width: 1024px; } }
@media (min-width: 1280px) { .container { max-width: 1280px; } }

.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-r { border-right-width: 1px; }
.border-l { border-left-width: 1px; }
.border { border-width: 1px; }
.border-border\/60 { border-color: hsl(var(--border) / 0.6); }
.border-destructive\/40 { border-color: hsl(var(--destructive) / 0.4); }
.border-destructive { border-color: hsl(var(--destructive)); }

.rounded-lg { border-radius: 0.5rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-t-md { border-top-left-radius: 0.375rem; border-top-right-radius: 0.375rem; }

/* Layout */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-x-2 { column-gap: 0.5rem; }
.gap-x-3 { column-gap: 0.75rem; }
.gap-x-4 { column-gap: 1rem; }
.gap-x-6 { column-gap: 1.5rem; }
.gap-y-1 { row-gap: 0.25rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }

.min-h-screen { min-height: 100vh; }
.min-h-\[400px\] { min-height: 400px; }
.min-w-0 { min-width: 0; }
.min-w-\[220px\] { min-width: 220px; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-md { max-width: 28rem; }
.max-w-none { max-width: none; }
.max-w-\[100vw\] { max-width: 100vw; }
.w-full { width: 100%; }
.h-4 { height: 1rem; }
.h-64 { height: 16rem; }
.h-full { height: 100%; }

/* Spacing */
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pr-10 { padding-right: 2.5rem; }
.pl-5 { padding-left: 1.25rem; }
.pl-9 { padding-left: 2.25rem; }
.pt-6 { padding-top: 1.5rem; }
.pb-2 { padding-bottom: 0.5rem; }

.m-0 { margin: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mx-4 { margin-left: 1rem; margin-right: 1rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mr-2 { margin-right: 0.5rem; }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace; }
.leading-7 { line-height: 1.75rem; }
.tracking-tight { letter-spacing: -0.025em; }
.break-words { overflow-wrap: break-word; }
.break-all { word-break: break-all; }
.overflow-wrap-anywhere { overflow-wrap: anywhere; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.whitespace-nowrap { white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Colors */
.text-foreground { color: hsl(var(--foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-destructive { color: hsl(var(--destructive)); }
.text-primary { color: hsl(var(--primary)); }
.text-card-foreground { color: hsl(var(--card-foreground)); }
.bg-background { background: hsl(var(--background)); }
.bg-card { background: hsl(var(--card)); }
.bg-muted { background: hsl(var(--muted)); }
.bg-primary { background: hsl(var(--primary)); }
.bg-destructive\/10 { background: hsl(var(--destructive) / 0.1); }
.bg-foreground { background: hsl(var(--foreground)); }
.bg-background\/80 { background: hsl(var(--background) / 0.8); }
.hover\:bg-transparent:hover { background: transparent; }
.hover\:bg-primary\/90:hover { background: hsl(var(--primary) / 0.9); }
.hover\:bg-destructive\/90:hover { background: hsl(var(--destructive) / 0.9); }
.hover\:text-foreground:hover { color: hsl(var(--foreground)); }
.hover\:opacity-80:hover { opacity: 0.8; }
.transition-colors { transition-property: color, background-color; transition-duration: 150ms; }
.transition-all { transition-property: all; transition-duration: 150ms; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }

/* Shadows */
.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25); }

/* Backdrop blur */
.backdrop-blur-sm { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.backdrop-blur-md { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.backdrop-blur-lg { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.backdrop-blur-xl { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.backdrop-blur-2xl { backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.gap-4 { gap: 1rem; }

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-primary:hover { background: hsl(var(--primary) / 0.9); }
.btn-outline {
  background: transparent;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
}
.btn-outline:hover { background: hsl(var(--accent)); }
.btn-destructive { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.btn-destructive:hover { background: hsl(var(--destructive) / 0.9); }
.btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--accent)); }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-link { background: none; border: none; color: hsl(var(--primary)); text-decoration: underline; padding: 0; font: inherit; cursor: pointer; }

/* Input */
.input {
  display: block;
  width: 100%;
  border-radius: 0.375rem;
  border: 1px solid hsl(var(--input));
  background: transparent;
  color: hsl(var(--foreground));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: hsl(var(--ring)); }
.input::placeholder { color: hsl(var(--muted-foreground)); }

/* Textarea */
.textarea {
  display: block;
  width: 100%;
  border-radius: 0.375rem;
  border: 1px solid hsl(var(--input));
  background: transparent;
  color: hsl(var(--foreground));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s;
}
.textarea:focus { border-color: hsl(var(--ring)); }
.textarea::placeholder { color: hsl(var(--muted-foreground)); }

/* Label */
.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

/* Card */
.card {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border-radius: 0.5rem;
  border: 1px solid hsl(var(--border));
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.card-header { padding: 1.5rem 1.5rem 0; }
.card-title { font-size: 1.25rem; font-weight: 600; }
.card-description { font-size: 0.875rem; color: hsl(var(--muted-foreground)); margin-top: 0.25rem; }
.card-content { padding: 1.5rem; overflow-wrap: break-word; min-width: 0; }

/* Dialog/Modal */
.dialog-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.5);
  display: flex; align-items: center; justify-content: center;
}
.dialog-content {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border-radius: 0.5rem;
  border: 1px solid hsl(var(--border));
  padding: 1.5rem;
  max-width: 28rem;
  width: 90%;
  position: relative;
  z-index: 51;
}
.dialog-header { margin-bottom: 1rem; }
.dialog-title { font-size: 1.125rem; font-weight: 600; }
.dialog-description { font-size: 0.875rem; color: hsl(var(--muted-foreground)); margin-top: 0.25rem; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.5rem; }

/* Tabs */
.tabs-list {
  display: inline-flex;
  background: hsl(var(--muted));
  border-radius: 0.375rem;
  padding: 0.25rem;
  margin-bottom: 0.5rem;
}
.tabs-trigger {
  padding: 0.375rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: hsl(var(--muted-foreground));
  border: none;
}
.tabs-trigger.active { background: hsl(var(--background)); color: hsl(var(--foreground)); }
.tabs-content { display: none; }
.tabs-content.active { display: block; }

/* Prose/Markdown */
.prose {
  color: hsl(var(--foreground));
  max-width: 65ch;
  line-height: 1.75;
}
.prose h1 { font-size: 2.25rem; line-height: 2.5rem; font-weight: 800; margin: 0 0 1rem; }
.prose h2 { font-size: 1.875rem; line-height: 2.25rem; font-weight: 700; margin: 2rem 0 1rem; }
.prose h3 { font-size: 1.5rem; line-height: 2rem; font-weight: 600; margin: 1.5rem 0 0.75rem; }
.prose h4 { font-size: 1.25rem; line-height: 1.75rem; font-weight: 600; margin: 1.5rem 0 0.75rem; }
.prose p { margin: 1rem 0; }
.prose strong { font-weight: 600; color: hsl(var(--foreground)); }
.prose ul { margin: 1rem 0; list-style-type: disc; padding-left: 1.625rem; }
.prose ol { margin: 1rem 0; list-style-type: decimal; padding-left: 1.625rem; }
.prose li { margin: 0.5rem 0; }
.prose code { color: hsl(var(--foreground)); font-weight: 600; font-size: 0.875rem; }
.prose pre {
  background: hsl(var(--muted));
  overflow-x: auto;
  border-radius: 0.375rem;
  padding: 1rem;
  margin: 1.5rem 0;
}
.prose pre code { background: transparent; border: 0; border-radius: 0; padding: 0; font-weight: 400; color: inherit; font-size: inherit; word-break: break-word; }
.prose pre { word-break: break-word; white-space: pre-wrap; }
.prose a { color: hsl(var(--primary)); text-decoration: underline; font-weight: 500; }
.prose blockquote {
  font-weight: 500; font-style: italic; color: hsl(var(--foreground));
  border-left: 0.25rem solid hsl(var(--border));
  margin: 1.5rem 0; padding-left: 1rem;
}
.prose hr { border-color: hsl(var(--border)); margin: 3rem 0; }
.prose table { width: 100%; text-align: left; margin: 2rem 0; font-size: 0.875rem; }
.prose thead { border-bottom: 1px solid hsl(var(--border)); }
.prose thead th { font-weight: 600; vertical-align: bottom; padding: 0 0.5rem 0.5rem; }
.prose tbody tr { border-bottom: 1px solid hsl(var(--border)); }
.prose tbody td { vertical-align: baseline; padding: 0.5rem; }
.prose img { max-width: 100%; height: auto; }
.not-prose { all: initial; display: block; }
.not-prose .btn { display: inline-flex; }

/* Animations */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }

/* Spoiler */
.spoiler {
  background: hsl(var(--foreground));
  color: hsl(var(--foreground));
  cursor: pointer;
  border-radius: 0.25rem;
  padding: 0 0.25rem;
  user-select: none;
  transition: background 0.2s, color 0.2s;
}
.spoiler.revealed { background: transparent; color: inherit; }

/* Chart bar */
.chart-bar { transition: height 0.3s; }

/* Loading state */
.loading { opacity: 0.5; pointer-events: none; }

/* Hidden */
.hidden { display: none; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-x-auto { overflow-x: auto; }
.overflow-x-hidden { overflow-x: hidden; }
.shrink-0 { flex-shrink: 0; }

@media (min-width: 640px) {
  .sm\:flex { display: flex; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:flex-row { flex-direction: row; }
  .sm\:items-start { align-items: flex-start; }
  .sm\:justify-between { justify-content: space-between; }
  .sm\:gap-4 { gap: 1rem; }
  .sm\:gap-6 { gap: 1.5rem; }
  .sm\:p-6 { padding: 1.5rem; }
  .sm\:py-8 { padding-top: 2rem; padding-bottom: 2rem; }
  .sm\:py-12 { padding-top: 3rem; padding-bottom: 3rem; }
  .sm\:py-16 { padding-top: 4rem; padding-bottom: 4rem; }
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:mt-10 { margin-top: 2.5rem; }
  .sm\:mt-16 { margin-top: 4rem; }
  .sm\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
  .sm\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
  .sm\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
  .sm\:text-5xl { font-size: 3rem; line-height: 1; }
  .sm\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
  .sm\:text-base { font-size: 1rem; line-height: 1.5rem; }
  .sm\:leading-8 { line-height: 2rem; }
  .sm\:w-auto { width: auto; }
  .sm\:col-span-1 { grid-column: span 1; }
  .sm\:col-span-2 { grid-column: span 2; }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:flex-row { flex-direction: row; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:col-span-1 { grid-column: span 1; }
  .lg\:col-span-2 { grid-column: span 2; }
  .lg\:col-span-4 { grid-column: span 4; }
  .lg\:py-20 { padding-top: 5rem; padding-bottom: 5rem; }
  .lg\:text-6xl { font-size: 3.75rem; line-height: 1; }
}

@media (max-width: 640px) {
  .prose table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
}

/* ─── Shader-themed landing page ─── */
.shader-hero {
  position: relative;
  overflow: hidden;
}
.shader-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(80,140,255,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(255,80,120,0.10) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(80,255,180,0.06) 0%, transparent 50%);
  animation: shaderAmbient 8s ease-in-out infinite alternate;
}
@keyframes shaderAmbient {
  0%   { opacity: 0.6; transform: scale(1); }
  50%  { opacity: 1;   transform: scale(1.05); }
  100% { opacity: 0.7; transform: scale(0.95); }
}
.shader-hero > * { position: relative; z-index: 1; }

.shader-card {
  position: relative;
}

.shader-glow-text {
  background: linear-gradient(135deg, hsl(var(--foreground)), hsl(var(--muted-foreground)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
