:root {
  color-scheme: dark;
  --bg: #09111f;
  --panel: #111d2c;
  --panel-2: #16283a;
  --text: #f4f7fb;
  --muted: #aab7c5;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #77c7d7;
  --accent-2: #f0c36a;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  background:
    radial-gradient(circle at top left, rgba(119, 199, 215, 0.18), transparent 30rem),
    linear-gradient(180deg, #09111f 0%, #0c1524 46%, #101923 100%);
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.narrow {
  width: min(760px, calc(100% - 32px));
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  transform: translateY(-150%);
  padding: 8px 12px;
  color: #07101e;
  background: var(--accent);
  border-radius: 6px;
  z-index: 10;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(9, 17, 31, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav-shell,
.footer-grid,
.section-heading,
.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #07101e;
  background: var(--accent-2);
  border-radius: 50%;
  font-weight: 800;
}

.brand small,
.eyebrow,
.card-meta,
dt,
.section-heading p,
.site-footer {
  color: var(--muted);
}

.brand strong,
.brand small {
  display: block;
}

nav {
  display: flex;
  gap: 16px;
}

nav a,
.back-link {
  color: var(--muted);
  text-decoration: none;
}

nav a:hover,
.back-link:hover,
.constellation-card a:hover,
.source-list a:hover {
  color: var(--accent);
}

.hero,
.detail-hero,
.page-header {
  padding: 72px 0 44px;
}

.hero-grid,
.detail-grid,
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 42px;
  align-items: center;
}

.hero-copy h1,
.detail-hero h1,
.page-header h1 {
  margin: 8px 0 18px;
  font-size: clamp(3rem, 9vw, 6.9rem);
  line-height: 0.9;
}

.page-header h1 {
  font-size: clamp(2.5rem, 8vw, 5.4rem);
}

.lede {
  max-width: 700px;
  color: #d9e3ec;
  font-size: clamp(1.08rem, 2vw, 1.32rem);
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-stats span {
  min-width: 150px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.hero-stats strong {
  color: var(--text);
  font-size: 1.35rem;
}

.sky-panel {
  min-height: 320px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sky-panel img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}

.catalog-section,
.detail-body,
.text-section {
  padding: 36px 0 72px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2,
.detail-body h2,
.text-section h2 {
  margin: 4px 0 0;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.filters {
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.filters label {
  display: grid;
  flex: 1 1 170px;
  gap: 6px;
}

.filters .search-field {
  flex-basis: 270px;
}

label span {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
}

input,
select,
button {
  min-height: 44px;
  color: var(--text);
  background: #0b1422;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0 12px;
}

button {
  padding: 0 18px;
  cursor: pointer;
}

.secondary {
  color: #07101e;
  background: var(--accent);
  border-color: transparent;
  font-weight: 800;
}

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

.constellation-card {
  display: grid;
  gap: 14px;
  min-height: 275px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(22, 40, 58, 0.98), rgba(15, 27, 42, 0.98));
  border: 1px solid var(--line);
  border-radius: 8px;
}

.constellation-card[hidden] {
  display: none;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.constellation-card h3 {
  margin: 0;
  font-size: 1.42rem;
}

.constellation-card h3 a {
  text-decoration: none;
}

.constellation-card p,
.text-section p,
.detail-body p {
  margin: 0;
  color: #cfdae6;
}

.mini-facts,
.fact-panel dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.mini-facts {
  grid-template-columns: 1fr 1fr;
  align-self: end;
}

dt {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 0;
  color: var(--text);
}

.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.fact-panel {
  padding: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.fact-panel dl {
  grid-template-columns: 1fr 1fr;
}

.content-grid {
  align-items: start;
}

.article-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toc a {
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent);
}

.article-content {
  display: grid;
  gap: 34px;
}

.article-content section {
  scroll-margin-top: 100px;
}

.article-content h2 {
  margin: 6px 0 14px;
}

.article-content p + p {
  margin-top: 14px;
}

.compact-grid {
  align-items: stretch;
}

.note-panel,
.prompt-card,
.source-note,
.faq-list details {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.note-panel,
.source-note {
  padding: 18px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.tag-row span,
.related-list li {
  padding: 8px 10px;
  color: #07101e;
  background: var(--accent-2);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;
}

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

.prompt-card {
  padding: 18px;
}

.prompt-card h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
}

.prompt-card p {
  font-size: 0.94rem;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  padding: 14px 16px;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 800;
}

.faq-list p {
  margin-top: 12px;
}

.related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.source-note ul {
  margin-bottom: 0;
}

.highlight-list,
.source-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.highlight-list li,
.source-list li {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.text-section h2 {
  margin-top: 32px;
  font-size: 1.35rem;
}

.text-section code {
  color: var(--accent-2);
}

.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--text);
}

@media (max-width: 760px) {
  .nav-shell,
  .section-heading,
  .footer-grid {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .detail-hero,
  .page-header {
    padding-top: 44px;
  }

  .hero-grid,
  .detail-grid,
  .content-grid,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }

  .sky-panel {
    min-height: 220px;
  }

  .sky-panel img {
    min-height: 220px;
  }

  .filters {
    display: grid;
  }

  .mini-facts,
  .fact-panel dl {
    grid-template-columns: 1fr;
  }
}
