@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Barlow:wght@300;400;500;600&family=Barlow+Condensed:wght@400;500;600;700&display=swap');

:root {
  --bg-base:       #080c16;
  --bg-card:       #0d1220;
  --bg-card-2:     #111827;
  --bg-hover:      #151e2e;
  --border:        rgba(255,255,255,0.07);
  --border-accent: rgba(74,158,255,0.3);
  --text-primary:  #dce3f0;
  --text-secondary:#8492a8;
  --text-muted:    rgba(255,255,255,0.25);
  --accent-blue:   #4a9eff;
  --accent-purple: #a78fff;
  --accent-amber:  #ffa94d;
  --accent-red:    #ff6b6b;
  --accent-green:  #4aff9e;
  --font-mono:     'Space Mono', monospace;
  --font-body:     'Barlow', sans-serif;
  --font-condensed:'Barlow Condensed', sans-serif;
  /* theme-sensitive tokens */
  --nav-bg:            rgba(8,12,22,0.92);
  --lb-backdrop:       rgba(4,7,14,0.92);
  --progress-track-bg: rgba(255,255,255,0.06);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── STAR FIELD ──────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 60%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 30%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 80%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 50%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 75%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 18% 88%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 63% 45%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 78% 90%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 35% 10%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 90% 35%, rgba(255,255,255,0.6) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ── NAV ──────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 0.5px solid var(--border);
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 0;
}

.nav-logo {
  font-family: var(--font-condensed);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 2.5rem;
}

.nav-logo .logo-mark {
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--accent-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-logo .logo-mark::after {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-blue);
  border-radius: 50%;
}

.nav-links {
  display: flex;
  gap: 0;
  list-style: none;
  flex: 1;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0 1rem;
  height: 52px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

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

.nav-icon {
  margin-right: 5px;
  font-size: 10px;
  opacity: 0.55;
  vertical-align: middle;
  line-height: 1;
}

.nav-links a:hover .nav-icon,
.nav-links a.active .nav-icon {
  opacity: 0.85;
}

.nav-crew {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crew-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  border: 1.5px solid;
  cursor: default;
  title: attr(data-name);
}

.crew-avatar.blue { background: rgba(74,158,255,0.12); color: var(--accent-blue); border-color: rgba(74,158,255,0.35); }
.crew-avatar.green { background: rgba(74,255,158,0.1); color: var(--accent-green); border-color: rgba(74,255,158,0.3); }
.crew-avatar.purple { background: rgba(167,143,255,0.1); color: var(--accent-purple); border-color: rgba(167,143,255,0.3); }

/* ── LAYOUT ───────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── HERO / MASTHEAD ──────────────────────────── */
.masthead {
  padding: 3rem 0 2rem;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 2.5rem;
}

.masthead-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.masthead-title {
  font-family: var(--font-condensed);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--text-primary);
}

.masthead-title span {
  color: var(--accent-blue);
}

.masthead-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 8px;
}

.masthead-flag {
  height: 108px;
  width: auto;
  max-width: 264px;
  flex-shrink: 0;
  align-self: flex-end;
  opacity: 0.9;
}

.masthead-stats {
  display: flex;
  gap: 2rem;
  flex-shrink: 0;
}

.stat-item {
  text-align: right;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── MAIN GRID ────────────────────────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
  padding-bottom: 4rem;
}

/* ── SECTION LABEL ────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 0.5px;
  background: var(--border);
}

/* ── MISSION CARDS ────────────────────────────── */
.mission-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mission-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

.mission-card:first-child {
  border-radius: 10px 10px 0 0;
}
.mission-card:last-child {
  border-radius: 0 0 10px 10px;
}
.mission-card:only-child {
  border-radius: 10px;
}

.mission-card:hover {
  background: var(--bg-hover);
  border-color: rgba(255,255,255,0.12);
}

.mission-card.status-active {
  border-left: 3px solid var(--accent-blue);
}

.mission-card.status-complete {
  border-left: 3px solid rgba(74,255,158,0.5);
}

.mission-card.status-planned {
  border-left: 3px solid rgba(255,255,255,0.1);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  flex-shrink: 0;
}

.badge-active      { background: rgba(74,158,255,0.15); color: var(--accent-blue); }
.badge-complete    { background: rgba(74,255,158,0.1); color: var(--accent-green); }
.badge-planned     { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.badge-field-note  { background: rgba(210,185,140,0.1); color: rgba(210,185,140,0.85); font-style: italic; border: 0.5px solid rgba(210,185,140,0.25); }
.badge-admin       { background: rgba(74,158,255,0.08); color: rgba(140,190,255,0.8); border: 0.5px solid rgba(74,158,255,0.2); }
.mission-card.status-complete.mission-card--admin,
.mission-card.mission-card--admin { border-left-color: var(--accent-blue); }

.card-title {
  font-family: var(--font-condensed);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.card-meta span {
  margin: 0 6px;
  opacity: 0.4;
}

.card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 0.5px solid var(--border);
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 0.5px solid var(--border);
  padding: 2px 7px;
  border-radius: 3px;
}

.card-author {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.card-author strong {
  color: var(--accent-blue);
  font-weight: 400;
}

/* ── MISSION CARD LINK WRAPPER ────────────────── */
.mission-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.mission-card-link:hover .mission-card {
  background: var(--bg-hover);
  border-color: rgba(255,255,255,0.12);
}

/* override the direct hover on the card itself since the link handles it now */
.mission-card:hover {
  background: var(--bg-card);
  border-color: var(--border);
}

/* ── FIELD NOTE (blurb) CARDS ─────────────────── */
.mission-card--blurb,
.mission-card.status-complete.mission-card--blurb,
.mission-card.status-active.mission-card--blurb,
.mission-card.status-planned.mission-card--blurb {
  padding: 0.7rem 1.5rem;
  background: var(--bg-card);
  border-color: var(--border);
  border-left: 3px dashed rgba(210,185,140,0.55);
  border-radius: 6px;
}
.mission-card-link--blurb:hover .mission-card--blurb {
  background: var(--bg-hover);
  border-color: rgba(255,255,255,0.12);
  border-left-color: rgba(210,185,140,0.75);
}
[data-theme="light"] .mission-card--blurb,
[data-theme="light"] .mission-card.status-complete.mission-card--blurb {
  border-left-color: rgba(160,130,80,0.5);
}
[data-theme="light"] .mission-card-link--blurb:hover .mission-card--blurb {
  border-left-color: rgba(160,130,80,0.8);
}

.blurb-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.blurb-title {
  font-family: var(--font-condensed);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}
.blurb-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.blurb-meta span { margin: 0 5px; opacity: 0.4; }

.blurb-body { display: block; }
.blurb-body--has-thumb {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.blurb-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  object-position: top center;
  border-radius: 3px;
  border: 0.5px solid var(--border);
  flex-shrink: 0;
  opacity: 0.8;
}
.blurb-thumb--detail {
  width: 72px;
  height: 72px;
  border-radius: 4px;
  opacity: 1;
}
.blurb-excerpt {
  font-size: 12px;
  font-style: italic;
  color: rgba(210,185,140,0.75);
  line-height: 1.65;
}
[data-theme="light"] .blurb-excerpt {
  color: rgba(130,100,50,0.85);
}
.blurb-footer {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
}
.blurb-footer strong { color: var(--accent-blue); font-weight: 400; }

/* blurb detail page */
.blurb-detail-title {
  font-size: clamp(18px, 2.5vw, 26px) !important;
  text-transform: none !important;
  letter-spacing: 0.02em !important;
  color: rgba(210,185,140,0.9) !important;
}

.blurb-detail-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 1.5rem 0 2rem;
  max-width: 640px;
}
.blurb-detail-text {
  font-size: 15px;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.85;
}

/* ── MISSION DETAIL PAGE ──────────────────────── */
.detail-back-wrap {
  padding: 2rem 0 0;
}

.detail-back {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.15s;
}

.detail-back:hover {
  color: var(--accent-blue);
}

.detail-header {
  padding: 1.5rem 0 1.5rem;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 2rem;
}

.detail-header-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.detail-title {
  font-family: var(--font-condensed);
  font-size: clamp(22px, 3.5vw, 36px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 12px;
  word-break: break-word;
  overflow-wrap: break-word;
}

.detail-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.detail-meta strong {
  color: var(--accent-blue);
  font-weight: 400;
}

.detail-sep {
  opacity: 0.35;
}

/* phase position strip */
.detail-phase-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 22px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.detail-phase-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.detail-phase-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  padding-top: 3px;
  width: 52px;
  flex-shrink: 0;
}
.detail-phase-sep {
  color: var(--text-muted);
  opacity: 0.35;
  padding-top: 2px;
}
.detail-phase-nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 2px;
}
.phase-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 28px;
}
.phase-node-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
}
.phase-node.phase-node-done .phase-node-dot {
  background: rgba(74,255,158,0.25);
  border-color: rgba(74,255,158,0.5);
}
.phase-node.phase-node-current .phase-node-dot {
  width: 9px;
  height: 9px;
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  box-shadow: 0 0 8px rgba(74,158,255,0.5);
}
.phase-node-lbl {
  font-family: var(--font-mono);
  font-size: 8px;
  color: rgba(255,255,255,0.15);
  text-align: center;
}
.phase-node.phase-node-current .phase-node-lbl { color: var(--accent-blue); }
.phase-node.phase-node-done .phase-node-lbl { color: rgba(74,255,158,0.45); }

.detail-subtitle {
  font-style: italic;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.detail-vehicle-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 8px;
  letter-spacing: 0.03em;
}

.detail-body p + p {
  margin-top: 1.1em;
}

.detail-quote {
  border-left: 3px solid var(--accent-blue);
  margin: 1.5rem 0;
  padding: 12px 20px;
  font-size: 16px;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.7;
  background: var(--bg-card);
  border-radius: 0 4px 4px 0;
}

.detail-addendum {
  margin: 1.5rem 0;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.detail-addendum-title {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 0.5px solid var(--border);
}

.detail-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.detail-stat {
  flex: 1 1 120px;
  padding: 14px 16px;
  border-right: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
}
.detail-stat:last-child {
  border-right: none;
}

.detail-stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.detail-stat-val {
  font-family: var(--font-condensed);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.detail-stat-unit {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 3px;
  font-weight: 400;
}

.detail-addendum-note {
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 16px;
  border-top: 0.5px solid var(--border);
  line-height: 1.6;
  margin: 0;
}

.detail-mission-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 2rem 0 1rem;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.detail-mission-status strong {
  color: var(--accent-green);
}

.detail-filed-by {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  padding-top: 4px;
  line-height: 1.6;
}

.detail-screenshot-hint {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.55);
  padding: 3px 7px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.detail-screenshot:hover .detail-screenshot-hint {
  opacity: 1;
}
.detail-screenshot:hover .gallery-img {
  opacity: 0.85;
}

.detail-inline-img-wrap {
  margin: 1.5rem 0;
}

.detail-inline-img {
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
  display: block;
  border-radius: 4px;
  border: 0.5px solid var(--border);
}

.detail-body {
  max-width: 680px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 2.5rem;
}

.detail-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  margin-bottom: 2rem;
}

.detail-no-images {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 1.5rem;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  text-align: center;
  margin-bottom: 2rem;
  letter-spacing: 0.06em;
}

.detail-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 4rem;
}

.detail-not-found {
  padding: 4rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-not-found-msg {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

/* ── SIDEBAR ──────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-block {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}

/* ── TASK LIST ────────────────────────────────── */
.task-list {
  display: flex;
  flex-direction: column;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border);
}

.task-item:last-child { border-bottom: none; }

.task-pip {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-top: 7px;
  flex-shrink: 0;
  background: var(--accent-blue);
}

.task-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.task-note {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── PROGRESS BARS ────────────────────────────── */
.progress-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.progress-item {}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.progress-name {
  font-size: 12px;
  color: var(--text-secondary);
}

.progress-pct {
  font-family: var(--font-mono);
  font-size: 11px;
}

.progress-track {
  height: 4px;
  background: var(--progress-track-bg);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* ── MISSION TIMELINE ────────────────────────── */
.mission-timeline {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.5rem 0.875rem;
  margin-bottom: 2.5rem;
}

.tl-scroll {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 0;
}

.tl-scroll::-webkit-scrollbar { display: none; }

.tl-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.tl-phase-lbl {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding-left: 2px;
}

/* dots row — horizontal line drawn via ::before */
.tl-dots-row {
  display: flex;
  align-items: center;
  position: relative;
}

.tl-dots-row::before {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  height: 1px;
  background: rgba(255,255,255,0.06);
  z-index: 0;
  top: 50%;
  transform: translateY(-50%);
}

.tl-node {
  width: 28px;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* timeline tooltip popup — positioned via JS as position:fixed */
.tl-tooltip-popup {
  position: fixed;
  display: none;
  pointer-events: none;
  z-index: 9999;
  background: var(--bg-card-2);
  border: 1px solid var(--border-accent);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 5px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  transition: opacity 0.12s;
  opacity: 0;
}
.tl-tooltip-popup.visible { opacity: 1; }

/* arrow */
.tl-tooltip-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border-accent);
}

.tl-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.15s;
}

.tl-node.tl-complete .tl-dot {
  background: rgba(74,255,158,0.25);
  border-color: rgba(74,255,158,0.5);
}

.tl-node.tl-current .tl-dot {
  width: 12px;
  height: 12px;
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  box-shadow: 0 0 10px rgba(74,158,255,0.55);
}

/* label row — matches node widths exactly */
.tl-lbl-row {
  display: flex;
}

.tl-lbl {
  width: 28px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 8px;
  color: rgba(255,255,255,0.15);
  white-space: nowrap;
}

.tl-lbl.tl-lbl-now  { color: var(--accent-blue); }
.tl-lbl.tl-lbl-done { color: rgba(74,255,158,0.45); }

/* gap between phase groups */
.tl-sep {
  width: 20px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tl-sep::before {
  content: '';
  height: 8px; /* matches phase-lbl height */
}

.tl-sep::after {
  content: '';
  height: 7px; /* centers with dots */
  margin-top: 0;
  border-left: 0.5px solid rgba(255,255,255,0.06);
  border-right: 0.5px solid rgba(255,255,255,0.06);
  margin-left: 4px;
  margin-right: 4px;
}

/* ── ROADMAP PAGE ─────────────────────────────── */
.roadmap-phases {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.phase-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  padding: 1.25rem 1.5rem;
}

.phase-card:first-child { border-radius: 10px 10px 0 0; }
.phase-card:last-child  { border-radius: 0 0 10px 10px; }

.phase-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.phase-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  width: 32px;
}

.phase-title {
  font-family: var(--font-condensed);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.phase-status {
  margin-left: auto;
}

.phase-objectives {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 44px;
}

.phase-objectives summary {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  user-select: none;
  transition: color 0.15s;
}

.phase-objectives summary::-webkit-details-marker { display: none; }

.phase-objectives summary::before {
  content: '▶';
  font-size: 7px;
  display: inline-block;
  transition: transform 0.15s;
}

.phase-objectives[open] summary::before {
  transform: rotate(90deg);
}

.phase-objectives summary:hover {
  color: var(--text-secondary);
}

.phase-desc-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 4px;
}

/* ── ROADMAP MISSION LIST ─────────────────────── */
.rm-mission-list {
  margin-top: 10px;
  border-top: 0.5px solid var(--border);
  padding-top: 4px;
}

.rm-mission {
  padding: 8px 0;
  border-bottom: 0.5px solid rgba(255,255,255,0.03);
}

.rm-mission:last-child { border-bottom: none; }

.rm-mission-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rm-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  width: 28px;
  flex-shrink: 0;
}

.rm-title {
  font-size: 13px;
  color: var(--text-secondary);
}

.rm-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 4px;
  padding-left: 52px; /* indent under badge + id */
}

/* ── GALLERY ──────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  margin-bottom: 4rem;
}

.gallery-item {
  background: var(--bg-card-2);
  border: 0.5px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}

.gallery-item:hover { border-color: rgba(255,255,255,0.18); }

/* image wrapper — placeholder sits behind, img sits on top */
.gallery-img-wrap {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.gallery-img-wrap .gallery-placeholder {
  position: absolute;
  inset: 0;
}

.gallery-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.gallery-item:hover .gallery-img {
  transform: scale(1.03);
}

/* hide img when it fails to load — placeholder shows through */
.gallery-img-wrap.no-img .gallery-img {
  display: none;
}

.gallery-placeholder {
  height: 180px;
  background: linear-gradient(135deg, rgba(74,158,255,0.05) 0%, rgba(167,143,255,0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-placeholder-icon {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.15);
  font-size: 18px;
}

.gallery-caption {
  padding: 10px 14px 12px;
}

.gallery-cap-title {
  font-size: 13px;
  color: var(--text-secondary);
}

.gallery-cap-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── LIGHTBOX ─────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: var(--lb-backdrop);
  backdrop-filter: blur(8px);
}

.lb-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(90vw, 960px);
  max-height: 90vh;
}

.lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 10px;
}

.lb-counter {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.lb-close {
  background: none;
  border: 0.5px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}

.lb-close:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.2);
}

.lb-img-wrap {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  display: block;
}

.lb-bottom {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.lb-caption {
  font-size: 13px;
  color: var(--text-secondary);
}

.lb-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

.lb-nav {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.lb-prev, .lb-next {
  background: none;
  border: 0.5px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 14px;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}

.lb-prev:hover, .lb-next:hover {
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.lb-prev:disabled, .lb-next:disabled {
  opacity: 0.25;
  cursor: default;
}

.lb-prev:disabled:hover, .lb-next:disabled:hover {
  color: var(--text-secondary);
  border-color: var(--border);
}

/* ── KERBAL ROSTER ───────────────────────────── */
.kerbal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  margin-bottom: 4rem;
}

.kerbal-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.kerbal-card:first-child { border-radius: 10px 10px 0 0; }
.kerbal-card:last-child  { border-radius: 0 0 10px 10px; }
.kerbal-card:only-child  { border-radius: 10px; }

.kerbal-card:hover {
  background: var(--bg-hover);
  border-color: rgba(255,255,255,0.12);
}

.kerbal-card-front {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}

/* ── PORTRAIT ─────────────────────────────────── */
.kerbal-portrait {
  position: relative;
  width: 72px;
  height: 90px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0.5px solid rgba(255,255,255,0.08);
}

/* portrait background is always neutral — role color lives in the card, not the frame */
.kerbal-portrait.role-pilot    { background: var(--bg-card-2); }
.kerbal-portrait.role-engineer { background: var(--bg-card-2); }
.kerbal-portrait.role-scientist{ background: var(--bg-card-2); }

.kerbal-portrait-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.kerbal-portrait-initial {
  font-family: var(--font-condensed);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: rgba(255,255,255,0.15);
}

/* role label is now in the card info — hide it inside the portrait frame */
.kerbal-portrait-role {
  display: none;
}

/* small portrait variant for mission detail crew */
.kerbal-portrait.portrait-sm {
  width: 44px;
  height: 54px;
}
.kerbal-portrait.portrait-sm .kerbal-portrait-initial { font-size: 20px; }
.kerbal-portrait.portrait-sm .kerbal-portrait-role { display: none; }

/* ── KERBAL CARD INFO ─────────────────────────── */
.kerbal-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.kerbal-name {
  font-family: var(--font-condensed);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-primary);
  line-height: 1;
}

.kerbal-role {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.kerbal-role.role-pilot     { color: var(--accent-blue); }
.kerbal-role.role-engineer  { color: var(--accent-amber); }
.kerbal-role.role-scientist { color: var(--accent-purple); }

.kerbal-stars {
  display: flex;
  gap: 2px;
}

.kerbal-star {
  font-size: 11px;
  color: rgba(255,255,255,0.12);
}

.kerbal-star.star-on { color: var(--accent-amber); }

.kerbal-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kerbal-location {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.kerbal-stats {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}

.kerbal-stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kerbal-stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  width: 52px;
  flex-shrink: 0;
}

.kerbal-stat-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.kerbal-stat-bar .progress-track {
  flex: 1;
  min-width: 0;
}
.kerbal-stat-val {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  width: 26px;
  text-align: right;
  flex-shrink: 0;
}

/* ── KERBAL EXPANDED ──────────────────────────── */
.kerbal-card-expanded {
  display: none;
  padding: 0 1.5rem 1.25rem;
  border-top: 0.5px solid var(--border);
  margin-top: 0;
}

.kerbal-card.expanded .kerbal-card-front {
  border-bottom: 0.5px solid var(--border);
  padding-bottom: 1.25rem;
}

.kerbal-card.expanded .kerbal-card-expanded {
  display: block;
  padding-top: 1.25rem;
}

.kerbal-bio {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.75;
}

.kerbal-history {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 0.5rem;
}

.kerbal-mission-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-card-2);
  border: 0.5px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.kerbal-mission-entry:hover {
  background: var(--bg-hover);
  border-color: rgba(255,255,255,0.12);
}

.kerbal-mission-title {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
}

.kerbal-mission-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.kerbal-no-missions {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 10px 0;
}

/* ── MISSION DETAIL — CREW ────────────────────── */
.detail-crew {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 2rem;
}

.detail-crew-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.detail-crew-member:hover {
  background: var(--bg-hover);
  border-color: rgba(255,255,255,0.12);
}

.detail-crew-name {
  font-family: var(--font-condensed);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-crew-role {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── RESOURCES PAGE ──────────────────────────── */
.resource-block {
  margin-bottom: 4rem;
}

.resource-chart-wrap {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.resource-chart {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── GAME DETAILS PAGE ───────────────────────── */
.game-block {
  margin-bottom: 2.5rem;
}

.game-block-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: -8px 0 12px;
  line-height: 1.6;
}

.game-info-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.game-info-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 0.5px solid var(--border);
}
.game-info-row:last-child {
  border-bottom: none;
}

.game-info-key {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  width: 160px;
  flex-shrink: 0;
}

.game-info-val {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
}

.game-val-on {
  color: var(--accent-green);
}

.game-info-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 2px;
}

.game-link {
  color: var(--accent-blue);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  margin-left: 8px;
  opacity: 0.85;
  white-space: nowrap;
}
.game-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.game-lmp-callout {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-left: 3px solid var(--accent-blue);
  border-radius: 6px;
  padding: 20px 24px;
}

.game-lmp-heading {
  font-family: var(--font-condensed);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.game-lmp-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 14px;
}

.game-lmp-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.game-lmp-list li {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding-left: 14px;
  position: relative;
}
.game-lmp-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent-blue);
  opacity: 0.6;
}

/* ── TECH TREE ───────────────────────────────── */
.page-wrapper--wide {
  max-width: none;
  padding: 0 2rem;
}

.tt-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}
.tt-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
}
.tt-legend-dot.tt-unlocked { background: var(--accent-green); }
.tt-legend-dot.tt-locked   { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); }

.tt-wiki-link {
  margin-left: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: color 0.15s, border-color 0.15s;
}
.tt-wiki-link:hover {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

.tt-viewport {
  overflow-x: auto;
  overflow-y: auto;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 3rem;
}
.tt-viewport::-webkit-scrollbar { height: 6px; width: 6px; }
.tt-viewport::-webkit-scrollbar-track { background: transparent; }
.tt-viewport::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.tt-canvas {
  position: relative;
  display: inline-block;
  min-width: 100%;
}

.tt-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

.tt-line {
  fill: none;
  stroke-width: 1.5;
}
.tt-line-unlocked { stroke: rgba(74,255,158,0.5); }
.tt-line-locked   { stroke: rgba(255,255,255,0.06); }

.tt-nodes {
  position: relative;
}

.tt-node {
  position: absolute;
  border-radius: 4px;
  padding: 4px 7px;
  box-sizing: border-box;
  cursor: default;
  transition: filter 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}
.tt-node:hover {
  filter: brightness(1.25);
  z-index: 10;
}

.tt-node-unlocked {
  background: rgba(74,255,158,0.12);
  border: 1px solid rgba(74,255,158,0.6);
}
.tt-node-locked {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.tt-node-name {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tt-node-unlocked .tt-node-name { color: var(--accent-green); }
.tt-node-locked   .tt-node-name { color: rgba(255,255,255,0.25); }

.tt-node-cost {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-muted);
  opacity: 0.6;
}
.tt-node-unlocked .tt-node-cost { opacity: 0.4; }

/* ── FOOTER ───────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  border-top: 0.5px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-wordmark {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 0.06em;
}

/* ── PAGE HEADER ──────────────────────────────── */
.page-header {
  padding: 2.5rem 0 2rem;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 2.5rem;
}

.page-title {
  font-family: var(--font-condensed);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.page-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ── RESPONSIVE ───────────────────────────────── */
@media (max-width: 768px) {
  .main-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .masthead-inner { flex-direction: column; align-items: flex-start; }
  .masthead-stats { gap: 1.5rem; }
  nav { padding: 0 1rem; }
  .page-wrapper { padding: 0 1rem; }
}

/* ── THEME TOGGLE BUTTON ─────────────────────── */
.theme-toggle {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  margin-left: 4px;
}
.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

/* ── LIGHT MODE ──────────────────────────────── */
[data-theme="light"] {
  --bg-base:           #eef0f7;
  --bg-card:           #ffffff;
  --bg-card-2:         #f4f6fb;
  --bg-hover:          #e6eaf4;
  --border:            rgba(0,0,0,0.09);
  --border-accent:     rgba(33,118,214,0.35);
  --text-primary:      #111827;
  --text-secondary:    #374151;
  --text-muted:        rgba(0,0,0,0.40);
  --accent-blue:       #2176d6;
  --accent-purple:     #7c5cfc;
  --accent-amber:      #d97706;
  --accent-red:        #dc2626;
  --accent-green:      #059669;
  --nav-bg:            rgba(238,240,247,0.95);
  --lb-backdrop:       rgba(10,15,30,0.88);
  --progress-track-bg: rgba(0,0,0,0.08);
}

/* hide star field */
[data-theme="light"] body::before { display: none; }

/* mission cards */
[data-theme="light"] .mission-card:hover,
[data-theme="light"] .mission-card-link:hover .mission-card { border-color: rgba(0,0,0,0.16); }
[data-theme="light"] .mission-card.status-complete { border-left-color: rgba(5,150,105,0.6); }
[data-theme="light"] .mission-card.status-planned  { border-left-color: rgba(0,0,0,0.12); }

/* badges */
[data-theme="light"] .badge-active      { background: rgba(33,118,214,0.1); }
[data-theme="light"] .badge-complete    { background: rgba(5,150,105,0.1); }
[data-theme="light"] .badge-planned     { background: rgba(0,0,0,0.06); color: var(--text-muted); }
[data-theme="light"] .badge-field-note  { background: rgba(160,130,80,0.1); color: rgba(130,100,40,0.9); border-color: rgba(160,130,80,0.3); }
[data-theme="light"] .badge-admin       { background: rgba(33,118,214,0.08); color: rgba(33,100,180,0.9); border-color: rgba(33,118,214,0.25); }

/* tags */
[data-theme="light"] .tag { background: rgba(0,0,0,0.04); }

/* timeline */
[data-theme="light"] .tl-dots-row::before              { background: rgba(0,0,0,0.08); }
[data-theme="light"] .tl-sep::after                    { border-left-color: rgba(0,0,0,0.07); border-right-color: rgba(0,0,0,0.07); }
[data-theme="light"] .tl-dot                           { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.14); }
[data-theme="light"] .tl-node.tl-complete .tl-dot      { background: rgba(5,150,105,0.18); border-color: var(--accent-green); }
[data-theme="light"] .tl-node.tl-current .tl-dot       { box-shadow: 0 0 10px rgba(33,118,214,0.4); }
[data-theme="light"] .tl-lbl                           { color: rgba(0,0,0,0.22); }
[data-theme="light"] .tl-lbl.tl-lbl-done               { color: rgba(5,150,105,0.65); }

/* phase nodes (mission detail strip) */
[data-theme="light"] .phase-node-dot                              { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.14); }
[data-theme="light"] .phase-node.phase-node-done .phase-node-dot  { background: rgba(5,150,105,0.18); border-color: var(--accent-green); }
[data-theme="light"] .phase-node.phase-node-current .phase-node-dot { box-shadow: 0 0 8px rgba(33,118,214,0.4); }
[data-theme="light"] .phase-node-lbl                              { color: rgba(0,0,0,0.22); }
[data-theme="light"] .phase-node.phase-node-done .phase-node-lbl  { color: rgba(5,150,105,0.7); }

/* roadmap */
[data-theme="light"] .rm-mission { border-bottom-color: rgba(0,0,0,0.05); }

/* gallery */
[data-theme="light"] .gallery-item:hover                { border-color: rgba(0,0,0,0.18); }
[data-theme="light"] .gallery-placeholder               { background: linear-gradient(135deg, rgba(33,118,214,0.06) 0%, rgba(124,92,252,0.06) 100%); }
[data-theme="light"] .gallery-placeholder-icon          { border-color: rgba(0,0,0,0.12); color: rgba(0,0,0,0.2); }

/* lightbox */
[data-theme="light"] .lb-close:hover                    { border-color: rgba(0,0,0,0.2); }
[data-theme="light"] .lb-prev:hover, [data-theme="light"] .lb-next:hover { border-color: var(--border-accent); }
[data-theme="light"] .lb-prev:disabled:hover, [data-theme="light"] .lb-next:disabled:hover { border-color: var(--border); }

/* kerbal roster */
[data-theme="light"] .kerbal-card:hover                 { border-color: rgba(0,0,0,0.15); }
[data-theme="light"] .kerbal-portrait                   { border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .kerbal-portrait-initial           { color: rgba(0,0,0,0.12); }
[data-theme="light"] .kerbal-star                       { color: rgba(0,0,0,0.1); }
[data-theme="light"] .kerbal-mission-entry:hover        { border-color: rgba(0,0,0,0.14); }
[data-theme="light"] .detail-crew-member:hover          { border-color: rgba(0,0,0,0.14); }

/* screenshot hint overlay (must stay dark regardless of mode) */
[data-theme="light"] .detail-screenshot-hint { background: rgba(0,0,0,0.6); color: rgba(255,255,255,0.9); }

/* crew avatars */
[data-theme="light"] .crew-avatar.blue   { background: rgba(33,118,214,0.1); border-color: rgba(33,118,214,0.3); }
[data-theme="light"] .crew-avatar.green  { background: rgba(5,150,105,0.1);  border-color: rgba(5,150,105,0.3); }
[data-theme="light"] .crew-avatar.purple { background: rgba(124,92,252,0.1); border-color: rgba(124,92,252,0.3); }

/* tech tree */
[data-theme="light"] .tt-legend-dot.tt-locked   { background: rgba(0,0,0,0.07); border-color: rgba(0,0,0,0.14); }
[data-theme="light"] .tt-wiki-link              { border-bottom-color: rgba(0,0,0,0.14); }
[data-theme="light"] .tt-wiki-link:hover        { border-bottom-color: var(--text-primary); }
[data-theme="light"] .tt-viewport::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }
[data-theme="light"] .tt-line-locked            { stroke: rgba(0,0,0,0.1); }
[data-theme="light"] .tt-node-locked            { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .tt-node-locked .tt-node-name { color: rgba(0,0,0,0.3); }
