/* ═══════════════════════════════════════════════════════════════
   THE EXOPLANET CODEX  ·  Shared Stylesheet
   assets/css/codex.css  ·  exoplanetcodex.org
   ═══════════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ── */
:root {
  --void:          #04060d;
  --deep:          #080e1a;
  --surface:       #0d1526;
  --rim:           #1a2640;
  --muted:         #3a4f6e;
  --dim:           #3a4f6e;
  --text-dim:      #6b8aad;
  --text-mid:      #a8c0d8;
  --text:          #b8cfe8;
  --text-bright:   #ddeeff;
  --accent:        #4fc3f7;
  --accent-warm:   #e8a24a;
  --accent-green:  #52c78a;
  --accent-purple: #7c6fcf;
  --danger:        #e05c4b;
  --serif:         'Crimson Pro', Georgia, serif;
  --mono:          'Space Mono', 'Courier New', monospace;
  --max-width:     1100px;
}

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

/* ── BASE ── */
html { scroll-behavior: smooth; font-size: 18px; }
body {
  background: var(--void);
  color: var(--text-mid);
  font-family: var(--serif);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── STARFIELD + SCANLINE ── */
#starfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
body::after {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,0.025) 2px, rgba(0,0,0,0.025) 4px
  );
  pointer-events: none; z-index: 1;
}

/* ── LAYOUT ── */
.page {
  position: relative; z-index: 2;
  max-width: var(--max-width); margin: 0 auto; padding: 0 2.5rem;
}
.page-content {
  position: relative; z-index: 2;
  max-width: var(--max-width); margin: 0 auto; padding: 0 2.5rem;
}

/* ── NAV ── */
nav, .codex-nav {
  padding: 2.2rem 0;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap;          /* lets breadcrumb drop to its own row */
  border-bottom: 1px solid var(--rim);
  opacity: 0; animation: fade-in 1s ease 0.2s forwards;
}
.wordmark, .nav-logo {
  font-family: var(--mono); font-size: 0.8rem;
  color: var(--text-bright); letter-spacing: 0.18em;
  text-transform: uppercase; text-decoration: none;
}
.wordmark span { color: var(--accent); }
.logo-text     { color: var(--text-bright); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-dim);
  text-decoration: none; transition: color 0.2s;
}
.nav-links a:hover  { color: var(--accent); }
.nav-links a.active { color: var(--accent-warm); }
.status-pill {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent-warm);
  border: 1px solid rgba(232,162,74,0.35); padding: 0.3em 0.85em; border-radius: 2px;
}
.status-pill::before { content: '● '; font-size: 0.5rem; vertical-align: middle; animation: blink 2s ease-in-out infinite; }
/* Breadcrumb: full-width row below logo + nav-links */
.breadcrumb {
  flex-basis: 100%;
  font-family: var(--mono); font-size: 0.62rem; color: var(--muted); letter-spacing: 0.12em;
  padding-top: 0.6rem; margin-top: 0.35rem; border-top: 1px solid var(--rim);
}
.breadcrumb a { color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--accent-warm); white-space: nowrap; } /* never break mid star name */

/* ── SECTION LABEL ── */
.section-label {
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--text-dim);
  margin-bottom: 1.4rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--rim);
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-block; font-family: var(--mono); font-size: 0.78rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--void);
  background: var(--accent); border: 1px solid var(--accent);
  padding: 0.9em 1.8em; text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.btn-primary:hover { background: transparent; color: var(--accent); }
.btn-ghost {
  display: inline-block; font-family: var(--mono); font-size: 0.78rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-mid);
  background: transparent; border: 1px solid var(--rim);
  padding: 0.9em 1.8em; text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── PAGE HERO (inner pages) ── */
.page-hero {
  padding: 5rem 0 3rem;
  opacity: 0; animation: slide-up 1s ease 0.5s forwards;
  border-bottom: 1px solid var(--rim);
}
.page-eyebrow {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1.4rem;
}
.page-title {
  font-family: var(--serif); font-size: clamp(2.4rem, 4.5vw, 4rem);
  font-weight: 300; line-height: 1.1; color: var(--text-bright);
  letter-spacing: -0.02em; margin-bottom: 0.6rem; max-width: 820px;
}
.page-title em { font-style: italic; color: var(--accent); }
.page-subtitle {
  font-size: clamp(1rem, 1.4vw, 1.15rem); font-weight: 300;
  color: var(--text-mid); max-width: 680px; line-height: 1.8; margin-top: 0.6rem;
}

/* ── FOOTER ── */
footer {
  padding: 2.8rem 0; border-top: 1px solid var(--rim);
  opacity: 0; animation: fade-in 1s ease 2s forwards;
}
blockquote footer { padding: 0; border: none; animation: none; opacity: 1; display: block; }
.footer-left  { font-family: var(--mono); font-size: 0.65rem; color: var(--text-dim); letter-spacing: 0.08em; line-height: 2.1; }
.footer-right { font-family: var(--mono); font-size: 0.65rem; color: var(--muted); text-align: right; line-height: 2.1; }
.footer-right a { color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.footer-right a:hover { color: var(--accent); }

/* Grid footer */
.codex-footer { display: block; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-label {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 0.8rem;
}
.codex-footer p    { font-family: var(--mono); font-size: 0.65rem; color: var(--text-dim); line-height: 1.9; }
.codex-footer a    { display: block; font-family: var(--mono); font-size: 0.65rem; color: var(--muted); text-decoration: none; line-height: 2; transition: color 0.2s; }
.codex-footer a:hover { color: var(--accent); }
.footer-copy {
  font-family: var(--mono); font-size: 0.6rem; color: var(--muted);
  letter-spacing: 0.08em; border-top: 1px solid var(--rim); padding-top: 1.2rem;
}

/* ── KEYFRAMES ── */
@keyframes fade-in    { from { opacity: 0; }                              to { opacity: 1; } }
@keyframes slide-up   { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink      { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
@keyframes glow-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .page, .page-content { padding: 0 1.4rem; }
  nav, .codex-nav { flex-wrap: wrap; gap: 0.8rem; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; width: 100%; gap: 1rem; padding: 1rem 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-right { text-align: left; }

  /* Mobile breadcrumb: collapse to "← Systems" back link only */
  .breadcrumb {
    font-size: 0;         /* hides text-node separators (" / ") */
    border-top: none;
    padding-top: 0.3rem;
    margin-top: 0;
  }
  .breadcrumb a:first-child { display: none; }   /* hide "Home" */
  .breadcrumb a:not(:first-child) {
    font-size: 0.65rem;
    display: inline-block;
  }
  .breadcrumb a:not(:first-child)::before { content: '← '; }
  .breadcrumb span { display: none; }            /* hide star name */
}
