/* V++ website  -  black + yellow grid, Node.js-inspired layout */

:root {
  --white: #ffffff;
  --black: #000000;
  --bg: #000000;
  --nav-bg: #010409;
  --panel-bg: #0D1117;
  --surface: #0a0a0a;
  --gray-100: #111111;
  --gray-200: #1a1a1a;
  --gray-300: #333333;
  --gray-500: #888888;
  --gray-700: #cccccc;
  --text: #f5f5f5;
  --text-muted: #aaaaaa;
  --yellow: #FBDB5A;
  --yellow-dark: #E5C44E;
  --yellow-light: rgba(251, 219, 90, 0.12);
  --yellow-muted: rgba(251, 219, 90, 0.22);
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --display: "Shrikhand", cursive;
  --mono: "IBM Plex Mono", "Consolas", monospace;
  --header-h: 72px;
  --home-vpad: 1.25rem;
  --home-footer-h: 5.75rem;
  --nav-item-h: 44px;
  --btn-radius: 6px;
  --sidebar-w: 280px;
  --toc-w: 300px;
  --layout-max: 1920px;
  --content-max: 52rem;
  --docs-bg: #0D1117;
  --tree-row-hover: rgba(255, 255, 255, 0.06);
  --tree-row-active: transparent;
  --tree-text: #8b949e;
  --tree-text-hover: #f0f6fc;
  --tree-font: calc(0.8125rem + 3px);
  --radius: 8px;
  --grid-yellow: rgba(251, 219, 90, 0.45);
  --code-bg: #010409;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-muted: #222222;
  --border-accent: rgba(251, 219, 90, 0.35);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { display: none; }

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  min-height: 100vh;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
body::-webkit-scrollbar { display: none; }

body.page-docs {
  background-color: var(--docs-bg);
}

body.page-home {
  background-color: var(--panel-bg);
  position: relative;
  overflow: hidden;
}

.home-grid-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.page-home .site-header,
.page-home .home-main,
.page-home .home-bottom {
  position: relative;
  z-index: 1;
}

a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-accent); text-underline-offset: 3px; }

.docs-article a:hover {
  background: transparent;
  text-decoration-color: var(--yellow);
}

.docs-sidebar a:hover,
.docs-toc a:hover {
  text-decoration: none;
}

.top-nav .nav-link:hover,
.top-nav .nav-link.active {
  color: var(--yellow);
}

code, pre { font-family: var(--mono); font-size: 0.875em; }

/* Inline code only  -  NOT inside pre blocks */
:not(pre) > code {
  background: rgba(255, 255, 255, 0.06);
  color: var(--yellow);
  padding: 0.12em 0.35em;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ─── Header ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--nav-bg);
  border-bottom: 3px solid var(--yellow);
  height: var(--header-h);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover {
  background: none;
  text-decoration: none;
}

.brand-logo {
  height: 56px;
  max-height: 56px;
  width: auto;
  object-fit: contain;
  display: block;
}

.brand-text { display: none; }

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  overflow-x: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--nav-item-h);
  padding: 0 1rem;
  font-size: 0.975rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
  transition: color 0.15s;
}

.nav-link:hover {
  color: var(--yellow);
  background: none;
  text-decoration: none;
}

.nav-link.active {
  color: var(--yellow);
  background: none;
  font-weight: 600;
  text-decoration: none;
}

.header-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--nav-item-h);
  height: var(--nav-item-h);
  border-radius: var(--btn-radius);
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--gray-300);
  background: transparent;
  transition: color 0.15s, border-color 0.15s;
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

.icon-btn:hover {
  background: transparent;
  color: var(--yellow);
  border-color: var(--yellow);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--gray-300);
  padding: 0.45rem 0.65rem;
  min-height: var(--nav-item-h);
  border-radius: var(--btn-radius);
  cursor: pointer;
  font-size: 1.15rem;
}

/* ─── Home (no scroll) ─── */
.page-home {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.page-home .site-header {
  flex-shrink: 0;
  background: var(--nav-bg);
}

.page-docs .site-header {
  background: var(--nav-bg);
}

.home-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1.25rem;
}

.page-home .home-main {
  background: transparent;
  padding: var(--home-vpad) 1.25rem;
  justify-content: center;
}

.home-hero {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 2rem;
  align-items: center;
  padding: 0;
}

.home-hero .code-panel {
  align-self: center;
  justify-self: center;
  width: 100%;
  max-height: calc(100vh - var(--header-h) - var(--home-footer-h) - 2 * var(--home-vpad) - 0.5rem);
  margin: 0;
}

.page-home .code-panel {
  background: #010409;
  border-color: #1a1f2e;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-home .code-panel pre,
.page-home .code-panel pre.home-code-pre {
  min-height: 0;
  flex: 1;
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.page-home .code-panel pre::-webkit-scrollbar {
  display: none;
}

.page-home .code-panel .code-line-row .code-ln,
.page-home .code-panel .code-line-row .code-line-content {
  font-size: 0.875rem;
  line-height: 1.5;
}

.page-home .code-panel .code-tabs,
.page-home .code-panel .code-footer,
.page-home .code-panel .code-panel-header {
  background: transparent;
  border-color: #1a1f2e;
}

.page-home .code-panel .code-panel-header {
  padding: 0 0 0.5rem;
}

.home-copy {
  text-align: left;
  align-self: center;
}

.home-copy h1 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.06;
  margin-bottom: 1rem;
  color: var(--yellow);
}

.home-copy .lead {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 1.75rem;
  max-width: 520px;
  line-height: 1.7;
}

.home-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.75rem;
  max-width: 300px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.9rem 1.25rem;
  border-radius: var(--btn-radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--yellow);
  color: var(--black);
  border-color: var(--yellow-dark);
  box-shadow: none;
}

.btn-primary:hover {
  background: var(--yellow-dark);
  color: var(--black);
  border-color: var(--yellow-dark);
  box-shadow: none;
}

.btn-outline {
  background: var(--bg);
  color: var(--yellow);
  border-color: var(--yellow);
}

.btn-outline:hover {
  background: var(--bg);
  border-color: var(--yellow);
  color: var(--yellow);
}

.home-partners {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text);
}

.home-partners a {
  text-decoration: none;
  font-weight: 600;
  color: var(--text);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.home-partners a:hover { background: var(--yellow-muted); color: var(--text); }

/* Code panel  -  home hero (Prism styling in prism-vpp.css) */
.code-panel {
  display: flex;
  flex-direction: column;
  min-height: 520px;
  height: 100%;
}

.code-panel pre,
.code-panel pre.home-code-pre {
  flex: 1;
  overflow: hidden !important;
  min-height: calc(1rem * 2 + 27 * 1.65 * 0.8125rem);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.code-panel pre::-webkit-scrollbar {
  display: none;
}

.code-footer {
  flex-shrink: 0;
}

.copy-btn {
  background: none;
  border: none;
  color: #8b949e;
  font-family: var(--font);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.copy-btn:hover { color: #e6edf3; }

.code-panel .code-tabs {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.code-panel .code-tabs::-webkit-scrollbar { display: none; }

.page-home .home-bottom {
  flex-shrink: 0;
  width: 100%;
  background: var(--nav-bg);
  border-top: 3px solid var(--yellow);
}

.home-bottom-inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.85rem;
}

.home-bottom-primary {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.home-bottom-legal {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  width: 100%;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-muted);
}

.home-trademark {
  margin: 0;
  flex: 1 1 16rem;
  min-width: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.home-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 auto;
  margin-left: auto;
}

.home-legal-links a {
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.home-legal-links a:hover {
  color: var(--yellow);
  background: transparent;
  text-decoration: underline;
  text-decoration-color: var(--yellow);
}

.home-trademark a {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: var(--border-accent);
}

.home-trademark a:hover {
  color: var(--yellow);
  text-decoration-color: var(--yellow);
}

.version-pills {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.5rem;
  flex-shrink: 0;
}

.version-pill {
  padding: 0.35rem 0.75rem;
  border-radius: var(--btn-radius);
  border: 1px solid var(--gray-300);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
}

.version-pill.yellow { background: var(--yellow); border-color: var(--yellow-dark); color: var(--black); }

.home-social {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
}
.home-social a { text-decoration: none; font-weight: 600; font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; }
.home-social a:hover { color: var(--text); background: var(--yellow-light); }

/* ─── Docs layout ─── */
.page-docs { min-height: 100vh; display: flex; flex-direction: column; }

.docs-layout {
  flex: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  max-width: var(--layout-max);
  margin: 0 auto;
  width: 100%;
  padding-inline: 30px;
  align-items: stretch;
  min-height: calc(100vh - var(--header-h));
}

.docs-sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 0.75rem 0.5rem 2rem;
  border-right: 1px solid var(--border-muted);
  background: var(--docs-bg);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.docs-sidebar::-webkit-scrollbar { display: none; }

/* GitHub-style file tree (sidebar + TOC) */
.tree-search-wrap {
  padding: 0 0.35rem 0.65rem;
}

.tree-search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.tree-search-icon {
  position: absolute;
  left: 0.65rem;
  width: 14px;
  height: 14px;
  color: var(--tree-text);
  pointer-events: none;
  flex-shrink: 0;
}

.tree-search {
  width: 100%;
  padding: 0.4rem 0.65rem 0.4rem 2.1rem;
  font-family: var(--font);
  font-size: var(--tree-font);
  color: var(--tree-text-hover);
  background: var(--panel-bg);
  border: 1px solid var(--border-muted);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
}

.tree-search::placeholder { color: var(--tree-text); }

.tree-search:focus {
  border-color: var(--yellow-muted);
}

.sidebar-tree,
.toc-tree {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tree-folder {
  border: none;
  margin: 0;
}

.tree-folder > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.45rem;
  font-size: var(--tree-font);
  font-weight: 600;
  color: var(--tree-text-hover);
  cursor: pointer;
  border-radius: 6px;
  user-select: none;
  line-height: 1.4;
}

.tree-folder > summary::-webkit-details-marker { display: none; }

.tree-folder > summary:hover {
  background: var(--tree-row-hover);
}

.tree-folder[open] > summary .tree-chevron {
  transform: rotate(90deg);
}

.tree-chevron {
  flex-shrink: 0;
  color: var(--tree-text);
  transition: transform 0.15s ease;
}

.tree-icon {
  flex-shrink: 0;
  color: var(--tree-text);
}

.tree-icon-folder { color: #8b949e; }
.tree-icon-file { color: #6e7681; }

.tree-list {
  list-style: none;
  margin: 0.1rem 0 0.35rem;
  padding: 0 0 0 0.85rem;
  border-left: 1px solid var(--border-muted);
  margin-left: 0.65rem;
}

.tree-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.5rem;
  font-size: var(--tree-font);
  font-weight: 400;
  text-decoration: none;
  color: var(--tree-text);
  border-radius: 6px;
  line-height: 1.4;
  position: relative;
  transition: color 0.15s, background 0.15s;
}

.tree-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.18s ease;
  opacity: 0;
}

.tree-link .tree-icon-file {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: color 0.15s;
}

@media (hover: hover) {
  .tree-link:hover {
    color: var(--tree-text-hover);
    background: var(--tree-row-hover);
    text-decoration: none;
  }
}

.tree-link.sidebar-current,
.tree-link.toc-current {
  color: var(--yellow);
  background: transparent;
  font-weight: 600;
}

.tree-link.sidebar-current::after,
.tree-link.toc-current::after {
  transform: scaleX(1);
  opacity: 1;
}

.tree-link.sidebar-current .tree-icon-file,
.tree-link.toc-current .tree-icon-file {
  color: var(--yellow);
}

.docs-main {
  padding: 2.25rem 2.75rem 3.5rem 2rem;
  min-width: 0;
  background: var(--docs-bg);
  border-right: 1px solid var(--border-muted);
}

.page-docs .docs-main {
  display: flex;
  justify-content: center;
}

.docs-article {
  max-width: none;
  width: 100%;
  font-size: 1.1875rem;
}

.page-docs .docs-article {
  max-width: var(--content-max);
}

.docs-article h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.85rem;
  color: var(--text);
}

.docs-article h1:first-of-type {
  color: var(--yellow);
}

.docs-article h1:not(:first-of-type) {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-muted);
}

.docs-article h1::after {
  display: none;
}

.docs-article h2 {
  font-size: 1.65rem;
  font-weight: 600;
  margin: 2.25rem 0 0.55rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border-muted);
  color: var(--text);
  letter-spacing: -0.02em;
}

.docs-article h1 + h2 {
  margin-top: 1.25rem;
  padding-top: 0;
  border-top: none;
}

.docs-article h3 { font-size: 1.35rem; font-weight: 600; margin: 1.35rem 0 0.45rem; color: var(--text); }
.docs-article h4 { font-size: 1.15rem; font-weight: 600; margin: 1rem 0 0.35rem; color: var(--text); }

/* FAQ  -  collapsible accordion */
.docs-article .faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 1.25rem 0 2rem;
}

.docs-article .faq-item {
  border: 1px solid #1a1f2e;
  border-radius: var(--radius);
  background: #010409;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.docs-article .faq-item[open] {
  border-color: var(--yellow);
  background: #010409;
}

.docs-article .faq-item > summary {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.docs-article .faq-item > summary::-webkit-details-marker {
  display: none;
}

.docs-article .faq-item > summary::after {
  display: none;
}

.docs-article .faq-chevron {
  flex-shrink: 0;
  margin-top: 0.2rem;
  color: var(--text-muted);
  transition: transform 0.18s ease, color 0.15s ease;
}

.docs-article .faq-item[open] .faq-chevron {
  transform: rotate(90deg);
  color: var(--text);
}

.docs-article .faq-question-text {
  flex: 1;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  letter-spacing: -0.01em;
  transition: font-weight 0.15s ease;
}

@media (hover: hover) {
  .docs-article .faq-item > summary:hover .faq-question-text {
    color: var(--text);
    font-weight: 700;
  }

  .docs-article .faq-item > summary:hover .faq-chevron {
    color: var(--text);
  }
}

.docs-article .faq-item[open] .faq-question-text {
  color: var(--text);
  font-weight: 700;
}

.docs-article .faq-answer {
  padding: 0.85rem 1.1rem 1.1rem 2.65rem;
  font-size: 1rem;
  color: var(--text);
  border-top: 1px solid #1a1f2e;
}

.docs-article .faq-answer > *:first-child {
  margin-top: 0;
}

.docs-article .faq-answer > *:last-child {
  margin-bottom: 0;
}

.docs-article .faq-answer .table-wrap {
  margin: 0.5rem 0 0.25rem;
}

.docs-article .faq-answer p,
.docs-article .faq-answer li {
  font-size: 1rem;
  line-height: 1.65;
}

.docs-article p {
  margin-bottom: 0.75rem;
  color: var(--text);
  max-width: none;
  line-height: 1.7;
  font-size: 1.1875rem;
}

.docs-article blockquote {
  margin: 0.75rem 0 0.85rem;
  padding: 0.55rem 0.85rem;
  border-left: 2px solid var(--border-accent);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 6px 6px 0;
  color: var(--text);
  font-style: italic;
}

.docs-article ul, .docs-article ol {
  margin: 0 0 0.85rem 1.25rem;
  color: var(--text);
  font-size: 1.1875rem;
  line-height: 1.7;
}

.docs-article li { margin-bottom: 0.35rem; line-height: 1.7; }

.docs-toc {
  position: sticky;
  top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0.65rem 3rem 0.5rem;
  border-left: none;
  background: var(--docs-bg);
  width: var(--toc-w);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.docs-toc::-webkit-scrollbar { display: none; }

.docs-article hr {
  border: none;
  border-top: 1px solid var(--border-muted);
  margin: 1.25rem 0;
}

.docs-article .table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0 1.75rem;
  border: 1px solid #ffffff;
  border-radius: var(--radius);
}

.docs-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.0625rem;
}

.docs-article th, .docs-article td {
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 0.75rem 1rem;
  text-align: left;
  color: var(--text);
}

.docs-article tr:last-child td,
.docs-article tr:last-child th { border-bottom: 1px solid rgba(255, 255, 255, 0.35); }

.docs-article th {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  color: var(--text);
  font-size: 0.925rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.docs-article .glossary dt { font-weight: 600; margin-top: 0.75rem; color: var(--text); }
.docs-article .glossary dd { margin: 0.25rem 0 0.5rem 1rem; color: var(--text); font-size: 1.0625rem; }

.toc-label {
  font-size: calc(0.75rem + 3px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tree-text);
  margin: 0 0 0.65rem 0.45rem;
  white-space: nowrap;
}

.toc-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-tree .tree-link {
  padding-left: 0.45rem;
}

.toc-tree .toc-h2 .tree-link { padding-left: 1rem; }
.toc-tree .toc-h3 .tree-link { padding-left: 1.55rem; }
.toc-tree .toc-h4 .tree-link { padding-left: 2.1rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-muted);
  background: var(--nav-bg);
  padding: 0.85rem 1.25rem;
}

.site-footer.compact {
  margin-top: 0;
  flex-shrink: 0;
}

.page-docs .site-footer.compact {
  border-top: 1px solid var(--border-muted);
}

.footer-inner {
  max-width: var(--layout-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.footer-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--gray-300);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.footer-badge.yellow { background: var(--yellow); border-color: var(--yellow-dark); color: var(--black); }

.footer-links { display: flex; gap: 1rem; margin-left: auto; }
.footer-links a { font-size: 0.85rem; text-decoration: none; color: var(--text); opacity: 0.7; }
.footer-links a:hover { opacity: 1; background: transparent; text-decoration: underline; text-decoration-color: var(--yellow); }

/* Download picker */
.download-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  background: rgba(251, 219, 90, 0.06);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.download-bar select {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
}

/* Download hub (Node.js-style) */
.download-hub h1 {
  margin-bottom: 1.25rem;
}

.download-picker-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.5rem;
  font-size: 1.125rem;
  line-height: 1.6;
  margin: 0 0 1.25rem;
  color: var(--text);
}

.dl-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.dl-select-icon {
  position: absolute;
  left: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  pointer-events: none;
  z-index: 1;
}

.dl-select-icon svg {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
}

.dl-select {
  appearance: none;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%23c9d1d9' d='M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z'/%3E%3C/svg%3E") no-repeat right 0.6rem center;
  color: var(--text);
  cursor: pointer;
}

.dl-select-iconed {
  padding-left: 2.15rem;
}

.dl-select:hover,
.dl-select:focus {
  border-color: var(--yellow);
  outline: none;
}

.download-info {
  background: rgba(251, 219, 90, 0.1);
  border: 1px solid rgba(251, 219, 90, 0.35);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
}

.download-info strong {
  color: var(--yellow);
  margin-right: 0.35rem;
}

.download-info code {
  font-size: 0.88em;
}

.page-download .code-block-wrap {
  margin: 1.25rem 0;
}

.download-code-note {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: -0.5rem 0 1rem;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0.75rem;
}

.btn-dl-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-dl-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.btn-dl-primary,
.btn-dl-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.35rem;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-dl-primary {
  background: var(--yellow);
  color: var(--black);
  border: 2px solid var(--yellow-dark);
}

.download-hub .btn-dl-primary,
.download-hub .btn-dl-primary:hover,
.download-hub .btn-dl-primary:focus-visible {
  background: var(--yellow);
  color: var(--black);
  border-color: var(--yellow-dark);
  text-decoration: none;
  transform: none;
}

.download-hub .btn-dl-secondary,
.download-hub .btn-dl-secondary:hover,
.download-hub .btn-dl-secondary:focus-visible {
  background: transparent;
  color: var(--text);
  border-color: var(--gray-300);
  text-decoration: none;
  transform: none;
}

.download-hub .btn-dl-primary .btn-dl-icon svg {
  stroke: var(--black);
}

.download-hub .btn-dl-secondary .btn-dl-icon svg {
  stroke: currentColor;
}

.btn-dl-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--gray-300);
}

.download-detect {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.dl-detect-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--yellow);
  text-decoration: underline;
  cursor: pointer;
}

.dl-detect-link:hover {
  color: var(--yellow-dark);
}

.download-footlinks {
  margin: 2rem 0 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-muted);
}

.download-footlinks p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0.45rem 0;
}

.download-footlinks a {
  color: var(--yellow);
}

.download-footlinks a:hover {
  color: var(--yellow-dark);
}

.page-download .download-hub h2:first-of-type {
  margin-top: 0;
}

/* Responsive */
@media (max-width: 960px) {
  .docs-layout { grid-template-columns: var(--sidebar-w) 1fr; }
  .docs-toc { display: none; }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .top-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border-muted);
    padding: 0.75rem;
  }
  .top-nav.open { display: flex; }
  .home-hero { grid-template-columns: 1fr; overflow: hidden; }
  .page-home { overflow: hidden; height: 100vh; }
  .code-panel { min-height: 280px; }
  .code-panel pre { min-height: 200px; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--gray-300);
  }
  .docs-main { padding: 1.25rem; border-right: none; }
  .footer-links { margin-left: 0; width: 100%; }
  .home-bottom-legal {
    flex-direction: column;
    align-items: flex-start;
  }
  .home-legal-links {
    margin-left: 0;
    justify-content: flex-start;
  }
  .course-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Courses hub (Node.js-style card grid) ── */
.page-courses-hub .docs-article {
  max-width: none;
}

.courses-hub-inner {
  width: 100%;
}

.courses-hub-header {
  margin-bottom: 1.25rem;
}

.courses-hub-header h1 {
  font-size: clamp(1.75rem, 2.8vw, 2.35rem);
  font-weight: 700;
  margin: 0 0 0.65rem;
  letter-spacing: -0.02em;
}

.courses-hub-header p {
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1.65;
  margin: 0;
}

.courses-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
}

.page-courses-hub .course-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.page-courses-hub .course-card-logo {
  width: 58px;
}

.page-courses-hub .course-card-thumb-label {
  font-size: 1.5rem;
  line-height: 1.15;
}

.page-courses-hub .course-card-thumb {
  aspect-ratio: 16 / 8;
}

.page-courses-hub .course-card-cover {
  gap: 0.5rem;
  padding: 0 0.75rem;
}

.page-courses-hub .course-card-body {
  padding: 0.65rem 0.85rem 0.75rem;
  gap: 0.3rem;
}

.page-courses-hub .course-card-title {
  font-size: 1.3125rem;
  font-weight: 500;
  line-height: 1.25;
}

.page-courses-hub .course-card-summary {
  font-size: 1.0625rem;
  line-height: 1.45;
  -webkit-line-clamp: 2;
}

.page-courses-hub .course-card-meta {
  margin-top: 0.15rem;
}

.courses-filter-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  border-radius: var(--btn-radius);
  position: relative;
}

.courses-filter-btn:hover {
  color: var(--text);
}

.courses-filter-btn.active {
  color: var(--yellow);
}

.courses-filter-btn.active::after {
  content: "";
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: -0.48rem;
  height: 2px;
  background: var(--yellow);
  border-radius: 2px;
}

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

.course-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #010409;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.course-card[hidden] {
  display: none !important;
}

@media (hover: hover) {
  .course-card:hover {
    border-color: var(--yellow);
    text-decoration: none;
  }

  .course-card:hover .course-card-title {
    font-weight: 700;
  }
}

.course-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #010409;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.course-card-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 42%, #000 15%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 42%, #000 15%, transparent 70%);
}

.course-card-cover {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 0 1rem;
  text-align: center;
}

.course-card-logo {
  width: 96px;
  height: auto;
}

.course-card-thumb-label {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: 0.01em;
}

.course-card-body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
  background: #010409;
}

.course-card-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--yellow);
}

.course-card-title {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.35;
  letter-spacing: -0.01em;
  transition: font-weight 0.15s ease;
}

.course-card-summary {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-card-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.course-card-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--yellow);
  border: 1px solid var(--yellow-dark);
  color: var(--black);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.course-card-author {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.course-card-date {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Course lesson page ── */
.page-course .docs-article {
  max-width: var(--content-max);
}

.page-course .docs-article h1 {
  border-top: none;
  padding-top: 0;
}

.page-course .docs-article h2 {
  border-top: none;
  padding-top: 0;
  margin: 0;
  font-size: 1.35rem;
}

.course-breadcrumb {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.course-breadcrumb a {
  color: var(--text-muted);
}

.course-header {
  margin-bottom: 1.75rem;
}

.course-header h1 {
  margin: 0 0 0.65rem;
}

.course-lead {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

.course-step {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.course-step:last-of-type {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
}

.course-step-head {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0 1rem;
  align-items: baseline;
  margin-bottom: 1rem;
}

.course-step-num {
  font-family: var(--display);
  font-size: 2.25rem;
  font-weight: 400;
  line-height: 1;
  color: var(--white);
  text-align: right;
  align-self: baseline;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  width: auto;
  height: auto;
  min-width: 0;
}

.course-step-head h2 {
  font-family: var(--display);
  margin: 0;
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1.2;
  padding-top: 0.35rem;
  color: var(--text);
  letter-spacing: 0.01em;
}

.course-step-final .course-step-num {
  font-size: 1.75rem;
}

.course-step-body p {
  line-height: 1.75;
  margin-bottom: 1rem;
  color: var(--text);
  font-size: 1rem;
}

.course-step-body p:last-of-type {
  margin-bottom: 1rem;
}

.course-step-list {
  margin: 0 0 1.25rem 1.25rem;
  padding: 0;
  line-height: 1.75;
}

.course-step-list li {
  margin-bottom: 0.35rem;
}

.course-expected-output {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--btn-radius);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-x: auto;
}

.course-finish {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.course-finish-head {
  margin-bottom: 1.25rem;
}

.course-finish-title {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 400;
  margin: 0;
  padding-top: 0.35rem;
  color: var(--text);
  letter-spacing: 0.01em;
}

.course-source-wrap {
  margin-bottom: 1.25rem;
}

.course-playground {
  margin-top: 0;
  padding: 0;
  border: none;
  background: transparent;
  max-width: 100%;
}

.course-playground-toolbar {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  width: auto;
  max-width: 100%;
}

.course-playground-toolbar .btn {
  width: auto;
  min-width: 0;
  max-width: none;
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.course-terminal {
  background: var(--code-slate, #010409);
  border: 1px solid var(--code-slate-border, #1a1f2e);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  margin: 0;
}

.course-terminal-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem 0.65rem;
  background: transparent;
  border-bottom: 1px solid var(--code-slate-border, #1a1f2e);
}

.course-terminal-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.course-terminal-dot:first-child {
  background: #ff5f57;
}

.course-terminal-dot:nth-child(2) {
  background: #febc2e;
}

.course-terminal-dot:nth-child(3) {
  background: #28c840;
}

.course-terminal-title {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--code-muted, #94a3b8);
}

.course-terminal-body {
  padding: 1rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.5;
  min-height: 8rem;
  max-height: 20rem;
  overflow-y: auto;
  color: var(--code-fg, #e2e8f0);
  background: transparent;
}

.course-terminal-line {
  margin: 0 0 0.35rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.course-terminal-muted {
  color: var(--code-muted, #94a3b8);
}

.course-terminal-cmd {
  color: var(--yellow);
}

.course-terminal-err {
  color: #ff7b72;
}

.course-run-output {
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  white-space: pre-wrap;
  color: var(--code-fg, #e2e8f0);
  min-height: 0;
}

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

@media (max-height: 700px) {
  .home-copy h1 { font-size: 1.75rem; }
  .home-copy .lead { font-size: 0.9rem; margin-bottom: 0.75rem; }
  .code-panel pre { padding: 0.75rem; font-size: 0.72rem; }
}
