:root {
  --bg: #0b0f1f;
  --bg-2: #141a33;
  --panel: rgba(15, 22, 45, 0.85);
  --panel-2: rgba(255, 255, 255, 0.04);
  --text: #e8f1ff;
  --muted: #97a6c7;
  --accent: #3ee7c5;
  --accent-2: #f8b24f;
  --accent-3: #5ea7ff;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 18px 50px rgba(2, 5, 18, 0.55);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 20%, rgba(62, 231, 197, 0.18), transparent 35%),
    radial-gradient(circle at 85% 10%, rgba(248, 178, 79, 0.18), transparent 30%),
    linear-gradient(150deg, #0b0f1f 0%, #111834 50%, #0b0f1f 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(transparent 96%, rgba(255, 255, 255, 0.04) 96%),
    linear-gradient(90deg, transparent 96%, rgba(255, 255, 255, 0.04) 96%);
  background-size: 120px 120px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 32px);
}

header.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: center;
  gap: clamp(20px, 4vw, 46px);
  padding: clamp(24px, 4vw, 50px) 0 10px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
}

h1 {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: clamp(34px, 6vw, 56px);
  margin: 0 0 12px;
  line-height: 1.05;
}

h2 {
  font-family: "Unbounded", system-ui, sans-serif;
  margin: 0 0 10px;
  font-size: clamp(24px, 4vw, 34px);
}

p { margin: 0; color: var(--muted); line-height: 1.7; }

.hero__lead { font-size: 18px; color: var(--text); margin-bottom: 18px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }

.badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.btn {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-3));
  color: #041225;
  border: none;
  box-shadow: var(--shadow);
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.atlas-card {
  position: relative;
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(13, 21, 44, 0.95), rgba(18, 27, 56, 0.9));
  border: 1px solid var(--border);
  padding: 20px;
  min-height: 320px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.atlas-card::before {
  content: "";
  position: absolute;
  inset: -20% auto auto -10%;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(94, 167, 255, 0.35), transparent 55%);
  filter: blur(8px);
}

.orbit {
  position: absolute;
  inset: 20px 20px auto auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  animation: spin 18s linear infinite;
}

.orbit::after {
  content: "";
  position: absolute;
  top: -6px;
  right: 45px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 18px rgba(248, 178, 79, 0.8);
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.atlas-list { margin-top: 12px; display: grid; gap: 10px; }

.atlas-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
}

.panel {
  margin-top: 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.search {
  width: 260px;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
  font-size: 14px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip.active {
  background: linear-gradient(120deg, rgba(62, 231, 197, 0.25), rgba(94, 167, 255, 0.25));
  color: var(--text);
  border-color: rgba(94, 167, 255, 0.6);
}

.stat {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  overflow: hidden;
  animation: rise 0.5s ease both;
}

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.card:hover { transform: translateY(-6px); border-color: rgba(94, 167, 255, 0.6); box-shadow: 0 18px 50px rgba(12, 20, 44, 0.55); }

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(62, 231, 197, 0.08), rgba(94, 167, 255, 0.06));
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 0;
}

.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
  font-size: 12px;
}

.index { color: var(--accent); font-weight: 700; }
.card h3 { margin: 0; font-size: 20px; color: var(--text); }
.card__meta { font-size: 13px; color: var(--muted); }
.card__desc { font-size: 14px; color: var(--muted); line-height: 1.5; }
.card__tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: var(--text);
}

.card__cta { font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }

.card__cta::after {
  content: "\2197";
  display: inline-flex;
  margin-left: 4px;
  transition: transform 0.2s ease;
}

.card:hover .card__cta::after { transform: translateX(2px) translateY(-2px); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.info-item {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-family: "IBM Plex Mono", monospace;
  color: var(--text);
  font-size: 13px;
}

footer {
  margin: 32px 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

@media (max-width: 720px) {
  .hero__actions { flex-direction: column; align-items: flex-start; }
  .atlas-card { min-height: 280px; }
}

body.character-page {
  background:
    radial-gradient(circle at 12% 20%, rgba(62, 231, 197, 0.18), transparent 35%),
    radial-gradient(circle at 85% 10%, rgba(94, 167, 255, 0.18), transparent 30%),
    linear-gradient(150deg, #0b0f1f 0%, #101832 50%, #0b0f1f 100%);
}

.character-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 32px);
  position: relative;
  z-index: 1;
}

.character-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(20px, 4vw, 46px);
  align-items: center;
  padding: clamp(22px, 4vw, 38px);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(13, 21, 44, 0.92), rgba(18, 27, 56, 0.88));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.character-hero__subtitle {
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
  margin: 0 0 10px;
  font-size: 13px;
}

.character-hero__lead {
  color: var(--text);
  font-size: 18px;
  line-height: 1.7;
  margin: 0 0 18px;
}

.character-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.character-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.character-hero__panel {
  display: grid;
  gap: 16px;
}

.hero-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.hero-card__title {
  display: flex;
  justify-content: space-between;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.hero-card__chip {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--accent);
}

.hero-card__lines { display: grid; gap: 8px; }
.code-line {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--text);
}

.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.hero-stat {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
}

.label {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent-3);
  font-size: 12px;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.character-section {
  margin-top: 28px;
  padding: clamp(18px, 3vw, 28px);
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(12, 18, 36, 0.86);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.section-lede { max-width: 70ch; }

.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.fact-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
}

.fact-card h3 { margin: 0 0 6px; }

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.text-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
}

.text-card p { color: var(--muted); }
.text-card h3 { margin: 0; }

.contrib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.contrib-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(62, 231, 197, 0.08), rgba(94, 167, 255, 0.04));
  box-shadow: var(--shadow);
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.timeline li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
}

.timeline__year {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent);
  font-weight: 700;
}

.legacy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.legacy-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
}

.quote {
  margin: 18px 0 0;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(94, 167, 255, 0.4);
  background: rgba(94, 167, 255, 0.12);
  font-size: 16px;
  color: var(--text);
}

.quote span {
  display: block;
  margin-top: 10px;
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
  font-size: 12px;
}

.character-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin: 28px 0 10px;
}

.character-footer {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

@media (max-width: 800px) {
  .character-hero { padding: 20px; }
  .section-head { align-items: flex-start; }
}
