/* ─── Orbital Theme — orbital.css ─────────────────────────────────────── */

/* Design tokens */
:root {
  --black: #000000;
  --space-950: #050508;
  --space-900: #0a0a12;
  --space-800: #0d0d1a;
  --space-700: #12121f;
  --space-600: #1a1a2e;
  --surface: #0f0f1a;
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.15);

  /* Accent — muted steel/silver */
  --accent-primary: #a0a8b8;
  --accent-secondary: #6b7280;
  --accent-glow: rgba(160, 168, 184, 0.08);
  --accent-glow-strong: rgba(160, 168, 184, 0.15);

  /* Text */
  --text-primary: #f0f4ff;
  --text-secondary: #8892a4;
  --text-muted: #4a5568;

  /* Typography */
  --font-ui: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Orbitron', sans-serif;

  /* Spacing */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Layout */
  --container-max: 1200px;
  --header-h: 64px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--black);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #ffffff;
}

img {
  max-width: 100%;
}

code,
pre {
  font-family: var(--font-mono);
}

/* ─── Starfield canvas ─────────────────────────────────────────────────── */
.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, #0a0d2e 0%, #000000 70%);
}

/* ─── Layout helpers ───────────────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

.section {
  padding: 5rem 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 3rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-link {
  color: var(--accent-primary);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.gradient-text {
  background: linear-gradient(90deg, #d1d5db 0%, #6b7280 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Navigation ───────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.logo-icon {
  color: var(--accent-primary);
  font-size: 1.3rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-primary);
  transition: width 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
}

/* ─── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
}

.btn-primary {
  background: #e5e7eb;
  color: #111;
}

.btn-primary:hover {
  background: #ffffff;
  color: #000;
  box-shadow: 0 0 20px rgba(160, 168, 184, 0.2);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-bright);
}

.btn-ghost:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

/* ─── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 4rem 2rem;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #a0a8b8;
  border-radius: 50%;
  animation: pulse 2s infinite;
  box-shadow: 0 0 6px rgba(160, 168, 184, 0.4);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-grid-art {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  opacity: 0.18;
}

.hero-grid-art span {
  width: 6px;
  height: 6px;
  background: var(--text-secondary);
  border-radius: 50%;
  display: block;
}

/* ─── Cards — Posts ────────────────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--space-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.post-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(160, 168, 184, 0.08);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

time {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.post-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
}

.post-card-title a {
  color: var(--text-primary);
}

.post-card-title a:hover {
  color: var(--accent-primary);
}

.post-card-summary {
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex: 1;
}

.post-card-link {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ─── Tags ─────────────────────────────────────────────────────────────── */
.post-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag {
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(160, 168, 184, 0.08);
  color: #9ca3af;
  border: 1px solid rgba(160, 168, 184, 0.15);
}

.tag-math {
  background: rgba(156, 163, 175, 0.08);
  color: #9ca3af;
  border-color: rgba(156, 163, 175, 0.15);
}

/* ─── Curriculum cards ─────────────────────────────────────────────────── */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.module-grid-full {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.module-card {
  background: var(--space-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  color: var(--text-primary);
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
}

.module-card:hover,
.module-card.module-unlocked:hover {
  border-color: var(--accent-primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(160, 168, 184, 0.08);
}

.module-card.module-unlocked {
  border-color: rgba(160, 168, 184, 0.2);
}

.module-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.module-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  letter-spacing: 0.1em;
}

.module-number-lg {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--accent-primary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.module-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.module-card-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

.unlock-badge {
  font-size: 0.7rem;
  color: #9ca3af;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.math-badge {
  font-size: 0.7rem;
  color: #6b7280;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ─── Page headers ─────────────────────────────────────────────────────── */
.page-header {
  padding: 5rem 0 3rem;
  background: linear-gradient(180deg, var(--space-800) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.page-subtitle {
  color: var(--text-secondary);
  max-width: 640px;
  font-size: 1.05rem;
  line-height: 1.8;
}

/* ─── Curriculum tracks ────────────────────────────────────────────────── */
.curriculum-tracks {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.track-badge {
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid;
}

.track-math {
  background: rgba(156, 163, 175, 0.08);
  color: #9ca3af;
  border-color: rgba(156, 163, 175, 0.15);
}

.track-cpp {
  background: rgba(156, 163, 175, 0.08);
  color: #9ca3af;
  border-color: rgba(156, 163, 175, 0.15);
}

.track-space {
  background: rgba(156, 163, 175, 0.08);
  color: #9ca3af;
  border-color: rgba(156, 163, 175, 0.15);
}

/* ─── Blog list ─────────────────────────────────────────────────────────── */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.post-list-item {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.post-list-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.post-list-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
}

.post-list-title a {
  color: var(--text-primary);
}

.post-list-title a:hover {
  color: var(--accent-primary);
}

.post-list-summary {
  color: var(--text-secondary);
  max-width: 700px;
}

/* ─── Single post / module body ─────────────────────────────────────────── */
.post-single,
.module-single {
  padding: 4rem 2rem;
  max-width: 760px;
  position: relative;
  z-index: 1;
}

.post-header,
.module-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.post-header-meta,
.module-header-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.post-title,
.module-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.post-subtitle,
.module-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
}

.module-meta-row {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.meta-item {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ─── Prose (markdown body) ─────────────────────────────────────────────── */
.prose {
  color: var(--text-secondary);
  line-height: 1.85;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: var(--text-primary);
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 2.5rem 0 1rem;
  line-height: 1.3;
}

.prose h2 {
  font-size: 1.4rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.prose h3 {
  font-size: 1.1rem;
  color: var(--accent-primary);
}

.prose p {
  margin-bottom: 1.25rem;
}

.prose a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: #fff;
}

.prose strong {
  color: var(--text-primary);
  font-weight: 600;
}

.prose code {
  background: var(--space-700);
  color: var(--accent-primary);
  padding: 0.15em 0.45em;
  border-radius: var(--radius-sm);
  font-size: 0.875em;
  border: 1px solid var(--border);
}

.prose pre {
  background: var(--space-900);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.prose blockquote {
  border-left: 3px solid var(--accent-primary);
  padding-left: 1.25rem;
  color: var(--text-muted);
  margin: 1.5rem 0;
  font-style: italic;
}

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

.prose li {
  margin-bottom: 0.4rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.prose th {
  background: var(--space-700);
  color: var(--text-primary);
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.prose td {
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

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

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ─── Post navigation ───────────────────────────────────────────────────── */
.post-footer,
.module-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 280px;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s;
}

.post-nav-link:hover {
  border-color: var(--accent-primary);
}

.post-nav-link.next {
  text-align: right;
  margin-left: auto;
}

.nav-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.nav-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── Footer ────────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  position: relative;
  z-index: 1;
}

.footer-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--accent-primary);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ─── Empty state ───────────────────────────────────────────────────────── */
.empty-state {
  color: var(--text-muted);
  font-style: italic;
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 0;
}

/* ─── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 3rem 1.5rem;
  }

  .hero-visual {
    display: none;
  }

  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
  }

  .nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
  }

  .section {
    padding: 3rem 0;
  }

  .section-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .post-single,
  .module-single {
    padding: 2rem 1.5rem;
  }

  .post-nav {
    flex-direction: column;
  }

  .post-nav-link.next {
    margin-left: 0;
    text-align: left;
  }
}

/* ─── Documentation Layout ─────────────────────────────────────────────── */
.docs-layout {
  display: flex;
  gap: 3rem;
  padding: 2rem 0;
  min-height: calc(100vh - var(--header-height));
}

.docs-sidebar {
  width: 250px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  height: max-content;
  max-height: calc(100vh - var(--header-height) - 4rem);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding-right: 1.5rem;
}

.docs-sidebar::-webkit-scrollbar {
  width: 4px;
}

.docs-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.sidebar-header {
  margin-bottom: 1.5rem;
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  font-weight: 600;
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 500;
}

.sidebar-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.sidebar-icon {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
}

.sidebar-link.active .sidebar-number,
.sidebar-link.active .sidebar-icon {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.15);
}

.docs-content {
  flex-grow: 1;
  min-width: 0;
  max-width: 800px;
  padding-bottom: 4rem;
}

.docs-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.docs-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.docs-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .docs-layout {
    flex-direction: column;
    gap: 2rem;
  }

  .docs-sidebar {
    width: 100%;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 1.5rem;
    max-height: none;
  }
}