:root {
  --background: 0 0% 100%;
  --foreground: 0 0% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 3.9%;
  --muted: 0 0% 96.1%;
  --muted-foreground: 0 0% 45.1%;
  --primary: 0 0% 9%;
  --primary-foreground: 0 0% 98%;
  --secondary: 0 0% 96.1%;
  --secondary-foreground: 0 0% 9%;
  --accent: 262 83% 58%;
  --accent-foreground: 0 0% 98%;
  --border: 0 0% 89.8%;
  --input: 0 0% 89.8%;
  --destructive: 0 84.2% 60.2%;
  --radius: 0.75rem;
  --site-bg: #ffffff;
}

.dark {
  --background: 0 0% 3.9%;
  --foreground: 0 0% 98%;
  --card: 0 0% 6%;
  --card-foreground: 0 0% 98%;
  --muted: 0 0% 14.9%;
  --muted-foreground: 0 0% 63.9%;
  --primary: 0 0% 98%;
  --primary-foreground: 0 0% 9%;
  --secondary: 0 0% 14.9%;
  --secondary-foreground: 0 0% 98%;
  --accent: 262 83% 65%;
  --accent-foreground: 0 0% 98%;
  --border: 0 0% 14.9%;
  --input: 0 0% 14.9%;
  --destructive: 0 62.8% 30.6%;
  --site-bg: #0a0a0f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--site-bg);
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

.site-bg { background-color: var(--site-bg); }

.text-gradient {
  background: linear-gradient(135deg, #a78bfa 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.bg-gradient-accent {
  background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
}

/* Accessible focus ring */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -2.5rem;
  left: 0;
  background: #7c3aed;
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* Card utility */
.as-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

/* Scrollbar */
.dark ::-webkit-scrollbar { width: 8px; }
.dark ::-webkit-scrollbar-track { background: #0a0a0f; }
.dark ::-webkit-scrollbar-thumb { background: #27272a; border-radius: 4px; }
.dark ::-webkit-scrollbar-thumb:hover { background: #3f3f46; }

/* Hero animated orbs */
@keyframes float-orb {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-40px) scale(1.08); }
}
@keyframes float-orb-alt {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(40px) scale(1.1); }
}
@keyframes float-orb-center {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  50% { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
}
.hero-orb-1 { animation: float-orb 8s ease-in-out infinite; }
.hero-orb-2 { animation: float-orb-alt 7s ease-in-out infinite 2s; }
.hero-orb-3 { animation: float-orb-center 6s ease-in-out infinite 1s; }

/* Override Narrative default paragraph styles to use site font */
.prose p,
.prose li,
.prose td,
.prose th {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
  font-weight: 400 !important;
}

/* Better table styling for articles */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}
.prose th,
.prose td {
  padding: 0.625rem 0.875rem;
  border: 1px solid rgb(229, 231, 235);
  text-align: left;
  vertical-align: top;
  font-size: 0.875rem;
  line-height: 1.5;
}
:is(html.dark) .prose th,
:is(html.dark) .prose td {
  border-color: rgba(255, 255, 255, 0.1);
}
.prose th {
  background: rgb(243, 244, 246);
  font-weight: 600;
}
:is(html.dark) .prose th {
  background: rgba(255, 255, 255, 0.05);
}

/* Better link contrast */
.prose a {
  color: rgb(124, 58, 237);
  text-decoration: none;
}
.prose a:hover {
  text-decoration: underline;
}
:is(html.dark) .prose a {
  color: rgb(167, 139, 250);
}

/* Make sure prose lists look right */
.prose ul,
.prose ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}
.prose ul {
  list-style: disc;
}
.prose ol {
  list-style: decimal;
}
.prose li {
  margin: 0.5rem 0;
}

/* Code blocks */
.prose pre {
  background: rgb(17, 24, 39);
  color: rgb(229, 231, 235);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.875rem;
}
.prose pre code {
  background: transparent !important;
  padding: 0 !important;
  color: inherit !important;
}
.prose code {
  background: rgba(124, 58, 237, 0.1);
  color: rgb(124, 58, 237);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: "Fira Code", ui-monospace, monospace;
}
:is(html.dark) .prose code {
  color: rgb(196, 181, 253);
}

/* Headings */
.prose h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.prose h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.prose h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Blockquote */
.prose blockquote {
  border-left: 3px solid rgb(124, 58, 237);
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: rgb(75, 85, 99);
}
:is(html.dark) .prose blockquote {
  color: rgb(156, 163, 175);
}

/* HR */
.prose hr {
  border: none;
  border-top: 1px solid rgb(229, 231, 235);
  margin: 2rem 0;
}
:is(html.dark) .prose hr {
  border-color: rgba(255, 255, 255, 0.1);
}
