:root {
  --primary: #1b00ff;
  --primary-dark: #1502bd;
  --sidebar-bg: #0b132b;
  --page-bg: #ecf0f4;
  --surface: #ffffff;
  --text-primary: #031e23;
  --heading: #202342;
  --text-muted: #6c757d;
  --divider: #e5e7eb;
  --border: #dde2e8;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--page-bg);
  color: var(--text-primary);
  line-height: 1.65;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--sidebar-bg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}

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

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.brand-name {
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.2px;
}

.topbar-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.topbar-nav a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13.5px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.topbar-nav a:hover {
  color: #fff;
  text-decoration: none;
}

/* Layout */
.page {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding: 40px 24px 20px;
  align-items: start;
}

.side-rail {
  position: sticky;
  top: 86px;
}

.side-rail-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

#toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 2px solid var(--divider);
}

#toc li a {
  display: block;
  padding: 4px 0 4px 14px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 500;
}

#toc li a:hover {
  color: var(--heading);
  text-decoration: none;
}

#toc li a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

.content {
  min-width: 0;
}

.hero {
  margin-bottom: 28px;
}

.badge {
  display: inline-block;
  background: rgba(27, 0, 255, 0.1);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 34px;
  font-weight: 700;
  color: var(--heading);
}

.updated {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.lede {
  font-size: 15.5px;
  color: var(--text-primary);
  max-width: 680px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 20px;
  scroll-margin-top: 90px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 700;
  color: var(--heading);
}

.card p {
  margin: 0 0 12px;
  font-size: 14.5px;
}

.card p:last-child {
  margin-bottom: 0;
}

.bullet-list {
  margin: 0 0 12px;
  padding-left: 20px;
  font-size: 14.5px;
}

.bullet-list li {
  margin-bottom: 8px;
}

.bullet-list li:last-child {
  margin-bottom: 0;
}

.bullet-list strong {
  color: var(--heading);
}

.contact-card {
  background: linear-gradient(135deg, var(--sidebar-bg), var(--primary-dark));
  border: none;
}

.contact-card h2,
.contact-card p {
  color: #fff;
}

.contact-email {
  display: inline-block;
  margin-top: 6px;
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 8px;
}

.contact-email:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.9);
}

.footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

#back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(27, 0, 255, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#back-to-top:hover {
  background: var(--primary-dark);
}

@media (max-width: 860px) {
  .page {
    grid-template-columns: 1fr;
  }

  .side-rail {
    display: none;
  }

  .topbar-nav {
    display: none;
  }

  .hero h1 {
    font-size: 28px;
  }
}
