:root {
  --bg: #0b1020;
  --bg-2: #111827;
  --surface: rgba(15, 23, 42, 0.8);
  --surface-strong: #0f172a;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e5eefc;
  --muted: #95a3bd;
  --accent: #60a5fa;
  --accent-strong: #3b82f6;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --radius-sm: 16px;
  --max: 1180px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, Manrope, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.16), transparent 30%),
    linear-gradient(180deg, #0a0f1d 0%, #0c1223 55%, #090d17 100%);
  color: var(--text);
  line-height: 1.5;
}

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

.page-shell {
  min-height: 100vh;
  padding: 28px 20px 40px;
}

.topbar,
.app {
  width: min(var(--max), calc(100vw - 40px));
  margin: 0 auto;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(96, 165, 250, 0.5));
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.28);
  font-weight: 800;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text strong {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

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

.ghost-link {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.ghost-link:hover {
  color: var(--text);
  border-color: rgba(96, 165, 250, 0.38);
  background: rgba(255, 255, 255, 0.06);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow);
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(96, 165, 250, 0.16), transparent 24%),
    radial-gradient(circle at 20% 15%, rgba(14, 165, 233, 0.08), transparent 20%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  font-size: 0.73rem;
  color: var(--muted);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero p {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.stats {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(4, 10, 24, 0.55);
}

.stat strong {
  display: block;
  font-size: 1.25rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.92rem;
}

.section-title {
  margin: 28px 0 14px;
  font-size: 1.02rem;
  color: #bfd2f5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.26);
  background: rgba(16, 24, 44, 0.92);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  color: #bfdbfe;
  font-size: 0.8rem;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.card h2 {
  margin: 0;
  font-size: 1.22rem;
}

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

.card footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: auto;
  padding-top: 2px;
}

.meta {
  font-size: 0.9rem;
  color: #cbd5e1;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.22), rgba(37, 99, 235, 0.18));
  color: #eff6ff;
  font-weight: 600;
}

.button:hover {
  border-color: rgba(96, 165, 250, 0.45);
}

.layout {
  display: grid;
  gap: 18px;
  grid-template-columns: 270px minmax(0, 1fr);
}

.toc,
.doc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(10, 16, 31, 0.8);
  box-shadow: var(--shadow);
}

.toc {
  position: sticky;
  top: 20px;
  align-self: start;
  padding: 18px;
}

.toc h2,
.doc-head h1 {
  margin: 0;
}

.toc nav {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.toc a {
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted);
}

.toc a:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.doc {
  padding: 24px;
}

.doc-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.doc-head h1 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.08;
}

.doc-body {
  color: #d7e2f2;
  font-size: 1rem;
}

.doc-body section + section {
  margin-top: 24px;
}

.doc-body h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.doc-body p {
  margin: 0 0 12px;
}

.doc-body ul,
.doc-body ol {
  margin: 0 0 14px 20px;
  padding: 0;
}

.doc-body li + li {
  margin-top: 6px;
}

.doc-body .muted {
  color: var(--muted);
}

.empty-state {
  padding: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.back-link {
  display: inline-flex;
  margin-top: 16px;
  color: #bfdbfe;
}

@media (max-width: 960px) {
  .grid,
  .layout,
  .stats {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding-inline: 14px;
  }

  .topbar,
  .app {
    width: min(var(--max), calc(100vw - 28px));
  }

  .hero,
  .doc,
  .toc,
  .card {
    padding: 18px;
  }

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