@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg-color: #070709;
  --bg-surface: #0e0e11;
  --bg-surface-hover: #16161a;
  
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --text-subtle: rgba(255, 255, 255, 0.45);
  
  --accent-color: #8b5cf6;
  --accent-light: #a78bfa;
  --accent-glow: rgba(139, 92, 246, 0.15);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;
  
  --grid-pattern: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
                  linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.max-w-prose {
  max-width: 65ch;
  margin: 0 auto;
}

.text-center { text-align: center; }

/* Navigation */
.nav-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 7, 9, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-4) 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.brand-wordmark {
  display: block;
  width: auto;
  height: 2rem;
  object-fit: contain;
  object-position: left center;
}

.footer-logo .brand-wordmark {
  height: 1.75rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  font-size: 0.875rem;
  font-weight: 700;
}

.nav-links a:not(.btn-primary) {
  color: var(--text-muted);
}
.nav-links a:not(.btn-primary):hover {
  color: var(--text-main);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--text-main);
  color: var(--bg-color);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: #e4e4e7;
  transform: translateY(-1px);
}

.btn-large {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 1.75rem;
}

.btn-secondary:hover {
  color: var(--accent-light);
}

/* Hub Hero */
.hub-hero {
  position: relative;
  padding: var(--space-24) 0 var(--space-16);
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-color);
  background-image: radial-gradient(circle at 50% 0%, var(--accent-glow) 0%, transparent 70%),
                    var(--grid-pattern);
  background-size: 100% 100%, 52px 52px;
  background-position: center top;
}

.hub-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, transparent, var(--bg-color));
  pointer-events: none;
}

.hub-hero-content {
  position: relative;
  z-index: 2;
}

.hub-hero h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  margin-bottom: var(--space-6);
  letter-spacing: -0.03em;
}

.title-gradient {
  background: linear-gradient(105deg, #fff 8%, #ddd6fe 54%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hub-hero p {
  color: var(--text-muted);
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.6;
}

.hub-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-12);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* Cluster Grid */
.hub-main {
  padding: var(--space-16) 0;
}

.cluster-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 768px) {
  .cluster-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

/* Cluster Cards */
.cluster-card {
  position: relative;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-8) var(--space-12);
  transition: border-color 0.3s ease, background 0.3s ease;
  overflow: hidden;
}

.cluster-card:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.025);
}

.cluster-number {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.04);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.cluster-header {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 2;
}

.cluster-title {
  font-size: 1.75rem;
  margin-bottom: var(--space-3);
  letter-spacing: -0.02em;
}

.cluster-desc {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  max-width: 90%;
}

.resource-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
  z-index: 2;
}

.resource-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  margin: 0 calc(var(--space-4) * -1);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.resource-list li a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  transform: translateX(4px);
}

.resource-list li a::after {
  content: '→';
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.2s ease;
  color: var(--accent-light);
}

.resource-list li a:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* CTA Section */
.cta-section {
  padding: var(--space-24) 0;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  position: relative;
}

.cta-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: var(--space-6);
}

.cta-desc {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-bottom: var(--space-12);
  line-height: 1.7;
}

.cta-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  justify-content: center;
  align-items: center;
}

@media (min-width: 640px) {
  .cta-actions {
    flex-direction: row;
    gap: var(--space-6);
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: var(--space-12) 0 var(--space-8);
  color: var(--text-subtle);
  font-size: 0.75rem;
}

.site-footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

@media (min-width: 768px) {
  .site-footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--text-muted);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  font-weight: 600;
  font-size: 0.875rem;
}

.footer-nav a:hover {
  color: var(--text-main);
}

/* Mobile Nav Tweak */
@media (max-width: 639px) {
  .nav-links a:not(.btn-primary) {
    display: none;
  }
}

/* Article Styles (Used on child pages) */
.article-layout {
  padding: var(--space-16) 0 var(--space-24);
}

.article-header {
  margin-bottom: var(--space-16);
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--space-16);
}

.article-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: var(--space-6);
  display: block;
}

.article-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: var(--space-6);
  letter-spacing: -0.03em;
}

.article-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

.article-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.article-content p {
  margin-bottom: 1.5em;
}

.article-content h2 {
  font-size: 2.25rem;
  margin: 2.5em 0 1em;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.article-content h3 {
  font-size: 1.5rem;
  margin: 2em 0 1em;
  color: var(--text-main);
}

.article-content ul, 
.article-content ol {
  margin-bottom: 1.5em;
  padding-left: 1.5em;
}

.article-content li {
  margin-bottom: 0.5em;
}

.article-content li::marker {
  color: var(--text-subtle);
}

.article-content blockquote {
  margin: 2.5em 0;
  padding: 2em;
  background: rgba(255, 255, 255, 0.02);
  border-left: 2px solid var(--accent-color);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--text-main);
  line-height: 1.7;
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

.article-content a {
  color: var(--accent-light);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: rgba(167, 139, 250, 0.4);
}

.article-content a:hover {
  color: #fff;
  text-decoration-color: var(--accent-light);
}

.article-content code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  color: #e4e4e7;
}

.article-content pre {
  background: #000;
  border: 1px solid var(--border-color);
  padding: 1.5em;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 2em 0;
}

.article-content pre code {
  background: transparent;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.9em;
}

@media (min-width: 1024px) {
  .article-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-16);
    align-items: start;
  }
  
  .article-sidebar {
    display: block;
    position: sticky;
    top: calc(var(--space-24) + 60px);
  }
}

.toc-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-4);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  font-size: 0.875rem;
}

.toc-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.toc-list a:hover {
  color: var(--text-main);
}
