:root {
  --bg: #0e1525;
  --surface: #121c31;
  --surface-alt: #192540;
  --surface-strong: #263454;
  --text: #edf3ff;
  --muted: #98a7c4;
  --border: #263454;
  --primary: #ff6b3d;
  --primary-dark: #e24f20;
  --accent: #79d0ff;
  --success-bg: #143627;
  --success-text: #6de7af;
  --warning-bg: #40270f;
  --warning-text: #ffbf6f;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  --font-body: "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
  --font-display: "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
  --page-gradient: radial-gradient(circle at top, #16213b 0%, #0e1525 62%);
  --hero-gradient: linear-gradient(135deg, #1b2746 0%, #121c31 60%, #0f172b 100%);
  --header-bg: rgba(14, 21, 37, 0.86);
  --header-border: rgba(38, 52, 84, 0.9);
  --surface-elevated: rgba(20, 31, 52, 0.86);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  background: var(--page-gradient);
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background-color: var(--bg);
  background: var(--page-gradient);
  color: var(--text);
  overscroll-behavior-y: none;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--page-gradient);
  background-color: var(--bg);
  pointer-events: none;
}

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

button {
  font: inherit;
}

code {
  background: #f0f4fb;
  padding: 0.15rem 0.4rem;
  border-radius: 8px;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-shell {
  flex: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  overscroll-behavior: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 84px;
}

.header-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 0.2rem 0 0.9rem;
  align-items: start;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.brand-badge {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: var(--shadow);
}

.site-nav {
  display: flex;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list > li > a,
.nav-group-trigger > a {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 0.95rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  border: 1px solid transparent;
}

.nav-list a.active,
.nav-list a:hover,
.submenu a:hover {
  background: color-mix(in srgb, var(--surface-alt) 82%, var(--surface));
  border-color: rgba(121, 208, 255, 0.14);
  color: var(--text);
}

.theme-blurb {
  margin: 0;
  max-width: 54ch;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.nav-item-group {
  position: relative;
}

.nav-group-trigger {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.submenu-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0.5rem;
}

.submenu {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 0;
  min-width: 290px;
  padding: 0.6rem;
  margin: 0;
  list-style: none;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  display: none;
}

.submenu.is-visible {
  display: block;
}

.submenu li + li {
  margin-top: 0.2rem;
}

.submenu a {
  display: block;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  color: var(--text);
}

.menu-toggle {
  display: none;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 1.25rem;
  height: 2px;
  margin: 0.26rem auto;
  background: var(--text);
}

.page-content {
  padding: 3rem 0 5rem;
}

.page-content > section + section,
.page-content > article + section,
.page-content > div + article {
  margin-top: 2rem;
}

.page-content > .home-hero + .featured-topics-panel {
  margin-top: 3rem;
}

.hero-card,
.category-card,
.topic-card,
.detail-card,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 2.5rem;
  background: var(--hero-gradient);
}

.hero-card.small {
  margin-bottom: 2rem;
}

.hero-card h1,
.detail-card h1,
.empty-state h1 {
  margin: 0.2rem 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-family: var(--font-display);
}

.lead {
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.hero-actions,
.card-actions,
.footer-inner {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1.1rem;
  border-radius: 14px;
  font-weight: 700;
  border: 1px solid transparent;
}

.button.primary {
  background: var(--primary);
  color: white;
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.secondary {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border);
}

.home-hero {
  display: grid;
  gap: 2rem;
  padding-bottom: 2.75rem;
}

.hero-actions {
  gap: 0.85rem;
}

.hero-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(121, 208, 255, 0.16);
  background: rgba(18, 31, 54, 0.72);
  font-weight: 700;
}

.hero-nav-link:hover {
  background: rgba(26, 44, 76, 0.92);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.section-heading h2 {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.section-copy {
  max-width: 46ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.featured-topics-panel {
  padding-top: 0.25rem;
  margin-bottom: 1.75rem;
}

.featured-topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.featured-topic-card,
.topic-card.unified-card {
  display: grid;
  grid-template-rows: auto auto minmax(5.8rem, 1fr) auto auto;
  gap: 0.95rem;
  padding: 1.35rem;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 86%, var(--surface-alt));
  box-shadow: var(--shadow);
  min-height: 21.5rem;
  align-content: start;
}

.featured-topic-card strong,
.topic-card.unified-card strong {
  font-family: var(--font-display);
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.card-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.featured-topic-meta {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
}

.section-stack {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.category-card,
.topic-card {
  min-height: 100%;
}

.category-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 1rem;
  align-items: end;
}

.category-hero-aside {
  display: grid;
  align-content: end;
  justify-items: start;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 65%, var(--surface-alt));
}

.category-hero-stat {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1;
  font-weight: 800;
}

.category-hero-label {
  margin-top: 0.4rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.category-card-header,
.topic-card-top,
.detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.category-card h2,
.topic-card h2 {
  margin: 0.3rem 0 0.7rem;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  font-family: var(--font-display);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.category-card p,
.topic-card p,
.content-panel p,
.empty-state p {
  color: var(--muted);
  line-height: 1.65;
}

.topic-card p {
  margin-bottom: 0;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.topic-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 1rem;
}

.topic-chip {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0.85rem 1rem;
  background: color-mix(in srgb, var(--surface-alt) 76%, var(--surface));
  border: 1px solid var(--border);
  border-radius: 16px;
  font-weight: 600;
}

.topic-chip:hover {
  background: rgba(33, 49, 84, 0.9);
  transform: translateY(-1px);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.38rem;
  border-radius: 999px;
  font-size: 0.61rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.62;
}

.status-pill.live {
  background: color-mix(in srgb, var(--success-bg) 30%, transparent);
  color: color-mix(in srgb, var(--success-text) 72%, white);
}

.status-pill.muted {
  background: color-mix(in srgb, var(--warning-bg) 24%, transparent);
  color: color-mix(in srgb, var(--warning-text) 70%, white);
}

.status-pill.neutral {
  background: color-mix(in srgb, var(--surface-alt) 75%, transparent);
  color: var(--muted);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.96rem;
  margin-bottom: 1rem;
}

.detail-card {
  padding: 1.6rem;
}

.detail-badges {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.content-blocks {
  display: grid;
  gap: 1rem;
  margin-top: 1.4rem;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) 280px;
  gap: 1rem;
  margin-top: 1.4rem;
}

.article-sidebar {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.sidebar-panel {
  position: sticky;
  top: 9rem;
  background: rgba(18, 30, 51, 0.66);
  border-color: rgba(63, 86, 128, 0.32);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.16);
}

.article-sidebar .sidebar-panel + .sidebar-panel {
  position: static;
}

.content-panel {
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-alt));
}

.card-actions {
  margin-top: auto;
  padding-top: 1.1rem;
  align-items: flex-end;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  opacity: 0.92;
}

.article-meta span {
  position: relative;
  padding: 0.38rem 0.6rem;
  border: 1px solid rgba(121, 208, 255, 0.12);
  border-radius: 999px;
  background: rgba(18, 31, 54, 0.5);
}

.article-meta span + span::before {
  content: none;
}

.article-meta-inline {
  display: flex;
  gap: 0.5rem;
}

.article-meta-inline span {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.article-meta-inline span:first-child {
  font-style: italic;
}

.article-meta-inline span + span::before {
  content: '•';
  margin-right: 0.5rem;
  color: rgba(121, 208, 255, 0.45);
}

.article-meta-stacked {
  display: grid;
  gap: 0.3rem;
}

.article-meta-stacked span {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.article-meta-stacked span:first-child {
  font-style: italic;
}

.content-panel h2 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  font-size: 1.12rem;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.sidebar-panel h2 {
  font-size: 0.96rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.markdown-panel {
  overflow: hidden;
}

.markdown-content {
  color: var(--text);
}

.markdown-content > :first-child {
  margin-top: 0;
}

.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
  margin-top: 1.6rem;
  margin-bottom: 0.8rem;
  letter-spacing: -0.02em;
  font-family: var(--font-display);
}

.markdown-content p,
.markdown-content li {
  line-height: 1.8;
}

.markdown-content ul {
  padding-left: 1.2rem;
}

.markdown-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.6rem 0;
}

.markdown-content a {
  color: var(--primary);
  font-weight: 600;
}

.markdown-code {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 18px;
  background: #111827;
  color: #f8fafc;
}

.markdown-code code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.table-scroll {
  overflow-x: auto;
}

.markdown-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

.markdown-table th,
.markdown-table td {
  padding: 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.markdown-table th {
  background: color-mix(in srgb, var(--surface-strong) 55%, var(--surface));
}

.simple-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text);
}

.signal-facts {
  display: grid;
  gap: 0.9rem;
}

.signal-fact {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(63, 86, 128, 0.28);
  background: rgba(18, 31, 54, 0.48);
}

.signal-fact-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
}

.text-link {
  color: var(--primary);
  font-weight: 700;
}

.empty-state {
  padding: 2rem;
  text-align: center;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.footer-inner {
  justify-content: space-between;
  padding: 1.25rem 0 2rem;
}

body .featured-topic-card,
body .category-card,
body .topic-card,
body .detail-card,
body .content-panel,
body .category-hero-aside,
body .signal-fact {
  background: var(--surface-elevated);
  border-color: rgba(63, 86, 128, 0.55);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}

body .sidebar-panel {
  background: rgba(18, 30, 51, 0.66);
  border-color: rgba(63, 86, 128, 0.32);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.16);
}

body .hero-card {
  position: relative;
  overflow: hidden;
}

body .hero-card::after {
  content: '';
  position: absolute;
  right: -8%;
  bottom: -20%;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 107, 61, 0.24), transparent 65%);
  pointer-events: none;
}

body .hero-copy,
body .detail-top,
body .section-heading {
  position: relative;
  z-index: 1;
}

body .button.secondary {
  background: transparent;
  border-color: rgba(121, 208, 255, 0.25);
}

.card-cta {
  margin-top: auto;
  padding-top: 0.25rem;
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 960px) {
  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-tools,
  .featured-topic-grid,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .theme-blurb {
    max-width: none;
  }

  .page-content {
    padding-top: 2.4rem;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .category-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .menu-toggle {
    display: inline-block;
  }

  .header-inner {
    min-height: 72px;
  }

  .header-tools {
    display: none;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 1rem;
    right: 1rem;
    display: none;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 0.75rem;
    z-index: 30;
  }

  .site-nav.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-group-trigger {
    justify-content: space-between;
  }

  .nav-list > li > a,
  .nav-group-trigger > a {
    width: 100%;
    border-radius: 16px;
  }

  .submenu {
    position: static;
    min-width: 0;
    margin-top: 0.25rem;
    box-shadow: none;
    background: color-mix(in srgb, var(--surface-alt) 76%, var(--surface));
  }
}

@media (max-width: 640px) {
  .container {
    width: min(1120px, calc(100% - 1rem));
  }

  .page-content {
    padding-top: 1rem;
  }

  .page-content > section + section,
  .page-content > article + section,
  .page-content > div + article {
    margin-top: 1.4rem;
  }

  .page-content > .home-hero + .featured-topics-panel {
    margin-top: 2rem;
  }

  .hero-card,
  .detail-card,
  .category-card,
  .topic-card,
  .empty-state {
    padding: 1.2rem;
    border-radius: 20px;
  }

  .topic-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .category-card-header,
  .topic-card-top,
  .detail-top,
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .sidebar-panel {
    position: static;
  }
}
