/* =========================================================
   Zeros in the Dark — Design System
   Midnight Observatory Aesthetic (Deep Indigo, Neon Cyan, Gold)
   ========================================================= */

:root {
  --bg-deep: #030712;
  --bg-surface: #070d1e;
  --bg-surface-elevated: #0d1733;
  --border-subtle: #1a274c;
  --border-bright: #00ffe1;
  --text-primary: #f0f4fc;
  --text-muted: #8fa0c0;
  --text-dim: #54658a;
  
  --cyan-glow: #00ffe1;
  --gold-glow: #ffdf6d;
  --magenta-accent: #f43f5e;
  --purple-subtle: #8b5cf6;
  
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(0, 255, 225, 0.04) 0%, transparent 60%),
    radial-gradient(circle at 10% 30%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
  min-height: 100vh;
}

.inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
}

.brand .symbol {
  font-family: var(--font-mono);
  color: var(--cyan-glow);
  background: rgba(0, 255, 225, 0.1);
  border: 1px solid rgba(0, 255, 225, 0.3);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.95rem;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

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

.header-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.club-tag {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: #121e3d;
  color: #7dd3fc;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.2);
}

.author-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
}
.author-link:hover {
  color: #fff;
}

/* Hero Section */
.hero {
  padding: 4.5rem 0 3.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cyan-glow);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-size: 2.75rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  background: linear-gradient(180deg, #ffffff 40%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lede {
  font-size: 1.15rem;
  color: #d1d5db;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.sub-lede {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--cyan-glow);
  color: #030712;
  box-shadow: 0 0 16px rgba(0, 255, 225, 0.3);
}

.btn-primary:hover {
  background: #38ffea;
  box-shadow: 0 0 24px rgba(0, 255, 225, 0.5);
}

.btn-ghost {
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  background: rgba(13, 23, 51, 0.5);
}

.btn-ghost:hover {
  border-color: var(--text-muted);
  background: rgba(13, 23, 51, 0.9);
}

/* Image styling */
.img-frame {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.img-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.img-caption {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #050a18;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
}

/* Section Shared */
.section {
  padding: 4.5rem 0;
  border-top: 1px solid var(--border-subtle);
}

.section-heading {
  margin-bottom: 2.5rem;
}

.section-heading h2 {
  font-size: 2rem;
  letter-spacing: -0.01em;
  margin: 0.5rem 0;
}

.section-heading p {
  color: var(--text-muted);
  max-width: 680px;
}

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gold-glow);
  background: rgba(255, 223, 109, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 223, 109, 0.25);
  text-transform: uppercase;
}

/* Observatory / Interactive Panel */
.telescope-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.control-group label {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.control-group input[type="range"] {
  appearance: none;
  background: #162447;
  height: 6px;
  border-radius: 3px;
  outline: none;
  width: 180px;
}

.control-group input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cyan-glow);
  cursor: pointer;
  box-shadow: 0 0 10px var(--cyan-glow);
}

.toggle-group {
  display: flex;
  gap: 0.5rem;
}

.chip {
  background: #0e1a38;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip.active {
  background: rgba(0, 255, 225, 0.15);
  border-color: var(--cyan-glow);
  color: var(--cyan-glow);
}

.svg-stage {
  background: #02050e;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.svg-stage svg {
  display: block;
  width: 100%;
  height: 100%;
}

.readout-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.25rem;
}

.readout .label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.readout .value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cyan-glow);
  font-family: var(--font-mono);
  margin: 0.35rem 0;
}

.readout .sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Chapter Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.chapter-card {
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.chapter-card:hover {
  transform: translateY(-3px);
  border-color: var(--cyan-glow);
}

.chapter-number {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--border-subtle);
  margin-bottom: 0.75rem;
}

.chapter-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.chapter-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.chapter-card .link-label {
  font-size: 0.85rem;
  color: var(--cyan-glow);
  font-weight: 600;
}

/* Data Table */
.table-wrapper {
  overflow-x: auto;
  padding: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: #09132a;
  color: var(--text-muted);
  padding: 0.85rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(26, 39, 76, 0.4);
  color: #d1d5db;
}

.data-table tr:hover td {
  background: rgba(0, 255, 225, 0.03);
}

.data-table td:nth-child(2),
.data-table td:nth-child(3),
.data-table td:nth-child(4) {
  font-family: var(--font-mono);
  color: var(--gold-glow);
}

/* Prose & Interior Pages */
.page-header {
  padding: 3rem 0 2rem;
}

.page-header h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin: 0.5rem 0 1rem;
}

.panel-diagram {
  margin-bottom: 2rem;
}

.panel-header {
  margin-bottom: 1.25rem;
}

.panel-header h3 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.panel-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.prose-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.prose-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.