
:root {
  --c-navy-900: #000321;
  --c-navy-800: #202371;
  --c-navy-700: #264c64;
  --c-blue-600: #3c52a3;
  --c-cyan-400: #66cccc;
  --c-cyan-500: #6dcddc;
  --c-teal-700: #376d6d;
  --c-slate-500: #72738d;
  --c-bg: #ffffff;
  --c-bg-alt: #f7f8fb;
  --c-bg-banner: #f1f3f8;
  --c-border: #e6e8ef;
  --c-border-strong: #d4d7e1;
  --c-text: #1a1d3a;
  --c-text-muted: #5d6080;
  --c-link: var(--c-blue-600);
  --c-link-hover: var(--c-navy-800);
  --c-active-bg: rgba(60, 82, 163, 0.08);
  --c-code-bg: #f4f5fa;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 16px rgba(32, 35, 113, 0.08);
  --grad-hero: linear-gradient(135deg, #6dcddc 0%, #3c52a3 100%);
  --grad-cta: linear-gradient(90deg, #3c52a3 0%, #202371 100%);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --content-max: 760px;
  --sidebar-w: 280px;
  --toc-w: 240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--c-link); text-decoration: none; }
a:hover { color: var(--c-link-hover); text-decoration: underline; }

/* ---------- Top banner ---------- */
.top-banner {
  background: var(--c-bg-banner);
  border-bottom: 1px solid var(--c-border);
  text-align: center;
  font-size: 13px;
  padding: 8px 16px;
  color: var(--c-navy-800);
}
.top-banner a { color: var(--c-navy-800); font-weight: 600; }

/* ---------- Header ---------- */
.site-header {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 32px;
}
.site-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.site-logo img { height: 32px; width: auto; }
.site-logo-text {
  font-weight: 700;
  font-size: 18px;
  color: var(--c-navy-800);
  letter-spacing: -0.01em;
}
.site-logo-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  background: var(--c-cyan-400);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Top nav */
.top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.top-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--c-text);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.top-nav a:hover {
  background: var(--c-active-bg);
  color: var(--c-navy-800);
  text-decoration: none;
}
.top-nav a.active {
  color: var(--c-navy-800);
  font-weight: 600;
  background: var(--c-active-bg);
}

/* Search */
.search-box {
  flex: 0 1 320px;
  position: relative;
}
.search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1px solid var(--c-border-strong);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--c-bg-alt);
  color: var(--c-text);
  transition: border-color 0.15s, background 0.15s;
}
.search-input:focus {
  outline: none;
  border-color: var(--c-blue-600);
  background: white;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-slate-500);
  pointer-events: none;
  width: 16px;
  height: 16px;
}
.search-shortcut {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--c-slate-500);
  background: white;
  border: 1px solid var(--c-border-strong);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  background: var(--c-cyan-400);
  color: white;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  flex-shrink: 0;
}
.cta-button:hover { background: var(--c-teal-700); color: white; text-decoration: none; }

/* ---------- Layout ---------- */
.layout {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--toc-w);
  gap: 0;
  padding: 0 32px;
}
.layout--no-toc { grid-template-columns: var(--sidebar-w) 1fr; }
.layout--home { display: block; padding: 0; max-width: none; }

/* Sidebar */
.sidebar {
  border-right: 1px solid var(--c-border);
  padding: 32px 24px 64px 0;
  position: sticky;
  top: 65px;
  align-self: start;
  height: calc(100vh - 65px);
  overflow-y: auto;
}
.sidebar-group { margin-bottom: 28px; }
.sidebar-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-slate-500);
  margin: 0 0 8px 12px;
}
.sidebar-item {
  display: block;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--c-text);
  border-radius: 6px;
  line-height: 1.45;
  margin-bottom: 1px;
}
.sidebar-item:hover {
  background: var(--c-bg-alt);
  color: var(--c-navy-800);
  text-decoration: none;
}
.sidebar-item.active {
  background: var(--c-active-bg);
  color: var(--c-navy-800);
  font-weight: 600;
}

/* Content */
.content {
  padding: 32px 48px 96px;
  min-width: 0;
  max-width: var(--content-max);
}
.content h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-navy-800);
  margin: 0 0 8px;
  line-height: 1.2;
}
.content h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--c-navy-800);
  margin: 40px 0 12px;
  line-height: 1.3;
  scroll-margin-top: 80px;
}
.content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-navy-800);
  margin: 28px 0 10px;
  scroll-margin-top: 80px;
}
.content h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-navy-700);
  margin: 24px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.content p { margin: 0 0 16px; }
.content ul, .content ol { margin: 0 0 16px; padding-left: 24px; }
.content li { margin-bottom: 6px; }
.content code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--c-code-bg);
  color: var(--c-navy-800);
  padding: 2px 6px;
  border-radius: 4px;
}
.content pre {
  background: var(--c-navy-900);
  color: #e8eaf2;
  padding: 16px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  margin: 16px 0 24px;
}
.content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}
.content blockquote {
  border-left: 3px solid var(--c-cyan-400);
  background: var(--c-bg-alt);
  margin: 16px 0;
  padding: 12px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--c-text-muted);
}
.content table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0 24px;
  font-size: 14px;
}
.content th, .content td {
  border: 1px solid var(--c-border);
  padding: 10px 14px;
  text-align: left;
}
.content th {
  background: var(--c-bg-alt);
  font-weight: 600;
  color: var(--c-navy-800);
}
.content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
  margin: 8px 0;
}
.video-embed {
  position: relative;
  width: 100%;
  max-width: 820px;
  aspect-ratio: 16 / 9;
  margin: 24px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--c-navy-900);
  box-shadow: 0 2px 12px rgba(0, 3, 33, 0.10);
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-caption {
  display: block;
  font-size: 14px;
  color: var(--c-text-muted);
  margin: -16px 0 24px;
  max-width: 820px;
}
.content hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 32px 0;
}

/* Article meta */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--c-text-muted);
}
.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--c-text-muted);
  font-weight: 500;
}
.meta-pill--type { background: var(--c-active-bg); color: var(--c-navy-800); border-color: transparent; }
.breadcrumb {
  font-size: 13px;
  color: var(--c-text-muted);
  margin-bottom: 12px;
}
.breadcrumb a { color: var(--c-text-muted); }
.breadcrumb a:hover { color: var(--c-navy-800); }

/* On this page */
.toc {
  padding: 32px 16px 64px 24px;
  position: sticky;
  top: 65px;
  align-self: start;
  height: calc(100vh - 65px);
  overflow-y: auto;
  font-size: 13px;
}
.toc-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-slate-500);
  margin: 0 0 10px;
}
.toc-list { list-style: none; padding: 0; margin: 0 0 24px; border-left: 1px solid var(--c-border); }
.toc-list li { margin: 0; }
.toc-list a {
  display: block;
  padding: 4px 12px;
  color: var(--c-text-muted);
  font-size: 13px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  line-height: 1.45;
}
.toc-list a:hover { color: var(--c-navy-800); text-decoration: none; }
.toc-list a.indent-3 { padding-left: 24px; }
.toc-action-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--c-border);
}
.toc-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--c-text-muted);
  border-radius: 6px;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
  width: 100%;
}
.toc-action:hover { background: var(--c-bg-alt); color: var(--c-navy-800); }
.toc-action svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Related */
.related-block {
  margin-top: 48px;
  padding: 24px;
  background: var(--c-bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
}
.related-block h3 { margin-top: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-slate-500); }
.related-block ul { list-style: none; padding: 0; margin: 0; }
.related-block li { margin-bottom: 6px; }

/* Feedback footer */
.feedback {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--c-text-muted);
}

/* ---------- Home page ---------- */
.home-hero {
  background: linear-gradient(135deg, rgba(109, 205, 220, 0.06) 0%, rgba(60, 82, 163, 0.04) 100%);
  border-bottom: 1px solid var(--c-border);
  padding: 80px 32px 64px;
  text-align: center;
}
.home-hero-inner { max-width: 760px; margin: 0 auto; }
.home-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--c-blue-600);
  margin: 0 0 16px;
}
.home-title {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--c-navy-800);
  margin: 0 0 16px;
  line-height: 1.1;
}
.home-subtitle {
  font-size: 18px;
  color: var(--c-text-muted);
  margin: 0 0 36px;
  line-height: 1.6;
}
.home-search {
  max-width: 560px;
  margin: 0 auto 28px;
  position: relative;
}
.home-search input {
  width: 100%;
  padding: 16px 56px 16px 52px;
  border-radius: 12px;
  border: 1px solid var(--c-border-strong);
  font-size: 16px;
  font-family: inherit;
  background: white;
  color: var(--c-text);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.home-search input:focus {
  outline: none;
  border-color: var(--c-blue-600);
  box-shadow: 0 0 0 4px rgba(60, 82, 163, 0.12);
}
.home-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--c-slate-500);
}
.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}
.topic-chip {
  padding: 8px 16px;
  background: white;
  border: 1px solid var(--c-border-strong);
  border-radius: 999px;
  font-size: 14px;
  color: var(--c-navy-800);
  font-weight: 500;
  transition: all 0.15s;
}
.topic-chip:hover {
  border-color: var(--c-blue-600);
  background: var(--c-active-bg);
  text-decoration: none;
  transform: translateY(-1px);
}

.home-grid-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 32px;
}
.section-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-slate-500);
  margin: 0 0 8px;
}
.section-heading {
  font-size: 28px;
  font-weight: 700;
  color: var(--c-navy-800);
  margin: 0 0 32px;
  letter-spacing: -0.015em;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.card-grid--2 { grid-template-columns: repeat(2, 1fr); }
.card-grid--6 { grid-template-columns: repeat(3, 1fr); }
.doc-card {
  display: block;
  padding: 24px;
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  transition: all 0.18s;
  text-decoration: none;
  color: inherit;
}
.doc-card:hover {
  border-color: var(--c-blue-600);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 16px;
}
.card-icon svg { width: 22px; height: 22px; }
.doc-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--c-navy-800);
}
.doc-card p {
  margin: 0;
  font-size: 14px;
  color: var(--c-text-muted);
  line-height: 1.55;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.role-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--c-navy-800);
  transition: all 0.15s;
  font-weight: 600;
}
.role-card:hover {
  border-color: var(--c-cyan-400);
  text-decoration: none;
  background: rgba(102, 204, 204, 0.05);
}
.role-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c-active-bg);
  color: var(--c-blue-600);
  display: flex;
  align-items: center;
  justify-content: center;
}
.role-card-icon svg { width: 18px; height: 18px; }

/* Help footer card */
.home-help-row {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 32px 96px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.help-card {
  background: var(--grad-cta);
  color: white;
  padding: 28px 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.help-card.alt { background: white; color: var(--c-navy-800); border: 1px solid var(--c-border); }
.help-card h3 { margin: 0 0 4px; font-size: 18px; }
.help-card p { margin: 0; font-size: 14px; opacity: 0.85; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--c-border);
  padding: 32px;
  text-align: center;
  color: var(--c-text-muted);
  font-size: 13px;
  background: var(--c-bg-alt);
}

/* ---------- Search modal ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 3, 33, 0.45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 100;
  padding-top: 12vh;
}
.search-overlay.open { display: flex; }
.search-modal {
  width: 600px;
  max-width: 90vw;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 3, 33, 0.35);
  overflow: hidden;
}
.search-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
}
.search-modal-input-wrap svg { color: var(--c-slate-500); flex-shrink: 0; }
.search-modal-input-wrap input {
  border: none;
  outline: none;
  font-size: 16px;
  flex: 1;
  font-family: inherit;
  color: var(--c-text);
  background: transparent;
}
.search-results {
  max-height: 60vh;
  overflow-y: auto;
}
.search-result {
  display: block;
  padding: 12px 20px;
  border-bottom: 1px solid var(--c-bg-alt);
  text-decoration: none;
  color: inherit;
}
.search-result:hover, .search-result.focused {
  background: var(--c-active-bg);
  text-decoration: none;
}
.search-result-title {
  font-weight: 600;
  color: var(--c-navy-800);
  font-size: 14px;
  margin-bottom: 2px;
}
.search-result-meta {
  font-size: 12px;
  color: var(--c-text-muted);
}
.search-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--c-text-muted);
  font-size: 14px;
}

/* ---------- Mobile ---------- */
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 240px 1fr;
    padding: 0 20px;
  }
  .toc { display: none; }
}
@media (max-width: 768px) {
  .site-header-inner { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .top-nav { order: 4; flex-basis: 100%; overflow-x: auto; }
  .search-box { flex: 1; min-width: 180px; }
  .layout { grid-template-columns: 1fr; padding: 0 16px; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    padding: 16px 0;
  }
  .content { padding: 24px 0 64px; }
  .home-title { font-size: 32px; }
  .home-hero { padding: 48px 16px 40px; }
  .card-grid, .card-grid--6, .role-grid { grid-template-columns: 1fr; }
  .home-help-row { grid-template-columns: 1fr; }
  .home-grid-section { padding: 48px 16px; }
}
