:root {
  --bg: #f4f8fb;
  --surface: #ffffff;
  --surface-soft: #eef4fa;
  --text: #14314d;
  --muted: #4f6880;
  --accent: #2f74c0;
  --accent-2: #4aa3d9;
  --border: #d3e1ee;
  --shadow: 0 10px 30px rgba(20, 49, 77, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f7fbff 0%, #f1f6fb 100%);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 2vw, 2rem);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.brand-icon {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #8ed0ff, #2f74c0);
}

.main-nav {
  display: inline-flex;
  gap: 0.5rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--border);
}

.site-main {
  width: min(1600px, calc(100% - 3rem));
  margin: 1.4rem auto 0;
  flex: 1;
}

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding: 1rem;
  text-align: center;
  color: var(--muted);
}

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

.hero {
  background: radial-gradient(circle at top right, #dcefff, #f6fbff 56%);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 2.5vw, 2.4rem);
}

.eyebrow {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #2f74c0;
  font-size: 0.78rem;
  margin: 0;
}

.hero h1 {
  margin: 0.35rem 0 0.8rem;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.hero-copy {
  margin: 0;
  max-width: 70ch;
  color: var(--muted);
}

.hero-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 0.75rem;
  padding: 0.7rem 1rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.cta-primary {
  background: linear-gradient(135deg, #2f74c0, #4aa3d9);
  color: #fff;
}

.cta-secondary {
  background: linear-gradient(135deg, #3d63b8, #6a83d9);
  color: #fff;
}

.section-grid,
.quick-links {
  margin-top: 1.1rem;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
}

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

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

.card a,
.quick-links-grid a,
.breadcrumbs a,
.doc-aside a,
.prose a {
  color: var(--accent);
  text-decoration: none;
}

.quick-links {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
}

.quick-links h2 {
  margin-top: 0;
}

.quick-links-grid {
  display: grid;
  gap: 0.55rem;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.crumb-sep {
  color: #90a6be;
}

.doc-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 290px);
}

.doc-content,
.doc-aside {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
}

.doc-content {
  padding: clamp(1rem, 1.8vw, 2rem);
}

.doc-aside {
  padding: 1rem;
  align-self: start;
  position: sticky;
  top: 5.2rem;
}

.doc-aside h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.doc-aside section + section {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.doc-aside ul {
  margin: 0;
  padding-left: 1rem;
}

.prose :is(h2, h3, h4, h5, h6) {
  scroll-margin-top: 6rem;
}

/* ── Heading hierarchy ──────────────────────────────────────────────────── */

/* H1 – Page title: large gradient text with a tinted underline bar */
.prose h1 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;

  /* Gradient text */
  background: linear-gradient(120deg, #1d3b5f 0%, #2f74c0 55%, #4aa3d9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  /* Decorative underline */
  padding-bottom: 0.6rem;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, #2f74c0 0%, #a8d4f5 60%, transparent 100%) 1;
}

/* H2 – Section heading: accent left border + full-width separator */
.prose h2 {
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 700;
  line-height: 1.3;
  margin: 2.2rem 0 0.75rem;
  padding: 0.45rem 0 0.45rem 0.9rem;
  color: #1a3655;
  border-left: 4px solid #2f74c0;
  position: relative;
  transition: border-color 0.2s ease;
}

.prose h2::after {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--border) 0%, transparent 80%);
}

/* H3 – Subsection: colored accent dot + weight */
.prose h3 {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 700;
  line-height: 1.35;
  margin: 1.6rem 0 0.5rem;
  color: #1e456a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.prose h3::before {
  content: "";
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f74c0, #4aa3d9);
}

/* H4 – Sub-subsection */
.prose h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.2rem 0 0.4rem;
  color: #2a5580;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
}

/* H5, H6 – Minor headings */
.prose h5,
.prose h6 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 1rem 0 0.35rem;
  color: var(--muted);
}

/* ── Heading anchor link (shown on hover) ────────────────────────────────── */

.prose :is(h2, h3, h4, h5, h6)[id] {
  cursor: default;
}

.heading-anchor {
  display: inline-block;
  margin-left: 0.4rem;
  font-weight: 400;
  font-size: 0.85em;
  color: #90b4d8;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.18s ease, color 0.18s ease;
  user-select: none;
  vertical-align: middle;
}

.prose :is(h2, h3, h4, h5, h6):hover .heading-anchor,
.prose :is(h2, h3, h4, h5, h6):focus-within .heading-anchor {
  opacity: 1;
}

.heading-anchor:hover {
  color: var(--accent);
}

.prose p,
.prose li {
  line-height: 1.65;
}

.prose code {
  background: #eff5fb;
  border: 1px solid #d7e3ee;
  border-radius: 0.35rem;
  padding: 0.05rem 0.33rem;
}

.prose pre {
  margin: 1rem 0;
  padding: 1.1rem 1.2rem;
  border-radius: 0.8rem;
  background: #0d1b2e;
  color: #cde0f5;
  overflow: auto;
  position: relative;
  font-size: 0.88rem;
  line-height: 1.6;
}

.prose pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ── Prism token theme (dark, serene-blue palette) ─────────────────────── */

/* Base */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata { color: #6a8caa; font-style: italic; }

.token.punctuation { color: #7fb8d8; }

.token.namespace { opacity: .85; }

/* Selector / tag / attr-name / class / id */
.token.tag,
.token.selector,
.token.attr-name { color: #80d4f7; }

/* Strings and chars */
.token.string,
.token.char,
.token.attr-value,
.token.template-string { color: #98e0a8; }

/* Numbers, booleans, constants */
.token.boolean,
.token.number,
.token.constant,
.token.symbol { color: #f8b98c; }

/* Keywords */
.token.keyword,
.token.atrule,
.token.rule { color: #c792ea; }

/* Functions / method names */
.token.function,
.token.function-name,
.token.method { color: #ffd580; }

/* Class names, types */
.token.class-name,
.token.maybe-class-name,
.token.builtin,
.token.type-hint,
.token.type { color: #82aaff; }

/* Operators */
.token.operator,
.token.entity { color: #89ddff; }

/* Property / key */
.token.property { color: #80d4f7; }

/* Variables / params */
.token.variable,
.token.parameter,
.token.interpolation { color: #f07178; }

/* Regex */
.token.regex { color: #f8b98c; }

/* Inserted / deleted diff */
.token.inserted { color: #98e0a8; background: rgba(152,224,168,.12); }
.token.deleted  { color: #f07178; background: rgba(240,113,120,.12); }

/* Important / bold / italic */
.token.important { color: #c792ea; font-weight: 700; }
.token.bold      { font-weight: 700; }
.token.italic    { font-style: italic; }

/* Markup specifics */
.token.entity { cursor: help; }

/* URL */
.token.url { color: #89ddff; }

/* Shell / bash prompt */
.token.command { color: #ffd580; }

.copy-code {
  position: absolute;
  right: 0.6rem;
  top: 0.6rem;
  border: 1px solid #355173;
  background: #17314d;
  color: #d9e7f4;
  border-radius: 0.45rem;
  font-size: 0.78rem;
  padding: 0.28rem 0.52rem;
  cursor: pointer;
}

.copy-code:hover {
  background: #23466c;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 0.6rem;
  /* No display:block / white-space:nowrap here – those fought each other.
     Scrolling is handled by .table-wrapper injected by JS. */
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  margin: 1rem 0;
}

.prose th,
.prose td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  white-space: normal;
  min-width: 6rem;
  word-break: break-word;
}

.prose th {
  background: var(--surface-soft);
  font-weight: 600;
  color: var(--text);
}

.prose tr:last-child td {
  border-bottom: 0;
}

.prose th:last-child,
.prose td:last-child {
  border-right: 0;
}

.prose details {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.65rem;
  background: #f8fbff;
}

.prose details + details {
  margin-top: 0.6rem;
}


.prose .task-list-item input[type="checkbox"] {
  accent-color: #2f74c0;
}

/* ── FAQ question / answer pairs ───────────────────────────────────────── */

.prose .faq-question {
  margin-top: 1.6rem;
  margin-bottom: 0;
  padding: 0.6rem 0.9rem 0.6rem 1rem;
  background: linear-gradient(90deg, #e4eefc 0%, #f4f9ff 100%);
  border-left: 3px solid var(--accent);
  border-radius: 0 0.5rem 0 0;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
}

.prose .faq-question strong {
  font-weight: inherit;
}

.prose .faq-answer {
  margin-top: 0;
  margin-bottom: 0;
  padding: 0.65rem 0.9rem 0.8rem 1rem;
  background: #f8fbff;
  border-left: 3px solid var(--border);
  border-radius: 0 0 0.5rem 0;
  color: var(--muted);
  line-height: 1.65;
}

/* Extra breathing room before the first FAQ pair */
.prose h2 + .faq-question {
  margin-top: 0.6rem;
}

@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: 1fr;
  }

  .doc-aside {
    position: static;
  }
}

@media (max-width: 700px) {
  .site-main {
    width: calc(100% - 1rem);
  }

  .site-header {
    padding-inline: 0.6rem;
    flex-wrap: wrap;
  }

  .brand {
    font-size: 0.95rem;
  }
}
