:root {
  --bg-pitch: #030508;
  --bg-surface: #070b12;
  --bg-card: rgba(10, 16, 26, 0.75);
  --border-cyan: rgba(0, 240, 255, 0.18);
  --border-cyan-glow: rgba(0, 240, 255, 0.45);
  
  --text-main: #d1d8e0;
  --text-muted: #798696;
  --text-bright: #ffffff;
  
  --accent-cyan: #00f0ff;
  --accent-blue: #0077ff;
  --accent-glow: 0 0 20px rgba(0, 240, 255, 0.35);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-pitch);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Typography Hierarchy */
h1, h2, h3, h4 {
  color: var(--text-bright);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.15; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-top: 2.5rem; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); color: var(--accent-cyan); }

p { margin-bottom: 1.4rem; }
a { color: var(--accent-cyan); text-decoration: none; transition: all 0.2s ease; }
a:hover { color: var(--text-bright); text-shadow: var(--accent-glow); }

/* --- HERO SECTION: WALLPAPER SCROLL & FADE TO BLACK --- */
.hero-parallax-container {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  overflow: hidden;
}

/* The Gradient Shield that fades the image into Pitch Black */
.hero-parallax-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(3, 5, 8, 0.2) 0%,
    rgba(3, 5, 8, 0.6) 50%,
    rgba(3, 5, 8, 0.95) 85%,
    var(--bg-pitch) 100%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
  text-align: center;
}

/* Glassmorphism Specs and Cards */
.aegis-card {
  background: var(--bg-card);
  border: 1px solid var(--border-cyan);
  border-radius: 8px;
  padding: 2rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.aegis-card:hover {
  border-color: var(--border-cyan-glow);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 240, 255, 0.08);
}

/* Whitepaper Article Layout */
.whitepaper-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3.5rem;
}

.whitepaper-toc-sticky {
  position: sticky;
  top: 6rem;
  height: fit-content;
  background: var(--bg-surface);
  border: 1px solid var(--border-cyan);
  border-radius: 6px;
  padding: 1.5rem;
}

.whitepaper-toc-sticky ul {
  list-style: none;
  font-size: 0.9rem;
}

.whitepaper-toc-sticky li { margin-bottom: 0.75rem; }

.whitepaper-content {
  max-width: 800px;
}

/* Code & Formulas */
pre, code {
  font-family: var(--font-mono);
  background: #020305;
  color: var(--accent-cyan);
  border-radius: 4px;
}

pre {
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  margin: 1.5rem 0;
}

/* GitHub Pill Link */
.github-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--border-cyan);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
}

@media (max-width: 900px) {
  .whitepaper-wrapper {
    grid-template-columns: 1fr;
  }
  .whitepaper-toc-sticky {
    display: none; /* Hide sidebar on mobile */
  }
}