* {
  box-sizing: border-box;
}

:root {
  --bg: #0b0b12;
  --bg-soft: #12121b;
  --card: #151523;
  --card-2: #1b1b2c;
  --text: #f3f4f6;
  --muted: #b8bdd1;
  --line: rgba(255, 255, 255, 0.08);
  --purple: #8b5cf6;
  --purple-2: #6d28d9;
  --red: #ef4444;
  --yellow: #f59e0b;
  --green: #22c55e;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1220px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(139, 92, 246, 0.16), transparent 30%),
    linear-gradient(180deg, #090910 0%, #0c0c14 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

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

code {
  padding: 0.14rem 0.42rem;
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: #ece9ff;
}

h1,
h2,
h3 {
  margin: 0 0 10px;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.08rem;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 14px 0;
  backdrop-filter: blur(14px);
  background: rgba(10, 10, 16, 0.72);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-size: 1rem;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.84rem;
}

.brand-mark,
.hero-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  box-shadow: var(--shadow);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.hero-mark {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  font-size: 28px;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  transition: 0.2s ease;
}

.topnav a:hover,
.back-row a:hover,
.related-links a:hover {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.35);
  transform: translateY(-1px);
}

.page {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 32px 0 60px;
}

.hero,
.search-panel,
.section-block,
.hub-summary,
.copy-block,
.systems-block,
.related-block,
.detail-card,
.info-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 30px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -20% -35% auto;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.22), transparent 65%);
  pointer-events: none;
}

.hero-main {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 24px;
}

.hero-banner {
  display: grid;
  gap: 20px;
}

.hero-banner-art {
  display: block;
  width: 100%;
  min-height: 300px;
  max-height: 360px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  object-fit: cover;
  object-position: center;
  background: linear-gradient(135deg, #1a1622 0%, #241b1b 42%, #3a2917 100%);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}

.hero-banner-copy {
  position: relative;
  z-index: 1;
}

.hero-copy,
.hub-summary,
.copy-block,
.systems-block,
.related-block {
  position: relative;
  z-index: 1;
}

.lede,
.search-note,
.hub-summary p,
.copy-block p,
.systems-block p,
.related-block p,
.section-intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: #d8c7ff;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.search-panel,
.section-block,
.hub-summary,
.copy-block,
.systems-block,
.related-block {
  margin-top: 20px;
  padding: 26px;
}

.search-label {
  display: block;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.search-panel input {
  width: 100%;
  padding: 16px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 16px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.search-panel input::placeholder {
  color: #9299b1;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2,
.hub-summary h1,
.copy-block h2,
.systems-block h2,
.related-block h2 {
  margin: 0;
}

.card-grid,
.subpage-grid,
.detail-grid,
.split-layout {
  display: grid;
  gap: 14px;
}

.card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.subpage-grid,
.detail-grid,
.split-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wiki-card,
.subpage-card,
.detail-card,
.info-panel {
  min-height: 100%;
}

.wiki-card,
.subpage-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 170px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.28)),
    linear-gradient(135deg, #111827, #374151);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.wiki-card:hover,
.subpage-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
  border-color: rgba(139, 92, 246, 0.35);
}

.wiki-card small,
.subpage-card strong:first-child {
  display: inline-block;
  color: #d8c7ff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wiki-card strong,
.subpage-card strong {
  font-size: 1.12rem;
  line-height: 1.25;
}

.wiki-card span,
.subpage-card span {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.95rem;
  line-height: 1.55;
}

.info-panel,
.detail-card {
  padding: 20px;
}

.info-panel p,
.detail-card p {
  margin: 0;
  color: var(--muted);
}

.back-row {
  margin: 0 0 16px;
}

.back-row a,
.related-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  transition: 0.2s ease;
}

.systems-list,
.related-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}

.systems-list li,
.related-links li {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 600;
}

.related-links li {
  padding: 0;
  background: transparent;
  border: 0;
}

.related-links a {
  width: 100%;
  justify-content: center;
}

@media (max-width: 1100px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    width: min(100% - 24px, var(--max));
  }

  .hero-main,
  .card-grid,
  .systems-list,
  .related-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-banner-art {
    min-height: 220px;
    max-height: 260px;
  }
}

@media (max-width: 800px) {
  .page {
    width: min(100% - 20px, var(--max));
    padding: 24px 0 48px;
  }

  .hero,
  .search-panel,
  .section-block,
  .hub-summary,
  .copy-block,
  .systems-block,
  .related-block {
    padding: 20px;
  }

  .hero-main,
  .card-grid,
  .subpage-grid,
  .detail-grid,
  .split-layout,
  .systems-list,
  .related-links {
    grid-template-columns: 1fr;
  }

  .hero-banner-art {
    min-height: 160px;
    max-height: 180px;
  }

  .topnav {
    width: 100%;
  }

  .topnav a {
    justify-content: center;
    flex: 1 1 auto;
  }
}
