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

/* ── Variables ────────────────────────────────────────────── */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas,
    monospace;

  --color-bg: #111113;
  --color-surface: #18181b;
  --color-text: #e4e4e7;
  --color-text-secondary: #a0a0a8;
  --color-border: #2a2a2e;
  --color-accent: #4d8eff;
  --color-accent-hover: #6ea8fe;
  --color-code-bg: #1e1e22;
  --color-hero-bg: #141416;

  --max-width: 72rem;
  --nav-height: 3.5rem;
}

/* ── Base ─────────────────────────────────────────────────── */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

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

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header nav {
  max-width: 84rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.site-logo {
  width: 1.6rem;
  height: 1.6rem;
  flex-shrink: 0;
}

.site-title:hover {
  text-decoration: none;
  color: var(--color-accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-header ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.site-header ul a {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.site-header ul a:hover,
.site-header ul a.active {
  color: var(--color-accent);
  text-decoration: none;
}

.icon-github {
  width: 1rem;
  height: 1rem;
  vertical-align: -0.15em;
  margin-right: 0.3em;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  background: var(--color-hero-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 8rem 1.5rem 8rem;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 3rem;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-content {
  text-align: left;
}

.hero-visual img {
  width: 100%;
  height: auto;
}

.hero h1,
.hero .hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0;
  background: linear-gradient(135deg, #4d8eff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  max-width: 36rem;
  margin: 1rem 0 1.5rem;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
}

.hero-links {
  display: flex;
  gap: 0.75rem;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

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

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ── Home: components section ────────────────────────────── */
/* ── Capabilities ─────────────────────────────────────────── */
.capabilities {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
}

.capabilities h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  text-align: center;
}

.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ── Carousel ──────────────────────────────────────────────── */
.carousel {
  max-width: var(--max-width);
  margin: 0 auto;
}

.carousel-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.carousel-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  font-family: inherit;
}

.carousel-tab:hover {
  color: var(--color-text);
}

.carousel-tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.carousel-slides {
  position: relative;
}

.carousel-slide {
  display: none;
}

.carousel-slide.active {
  display: block;
}

.carousel-slide .cap-text {
  margin-bottom: 1rem;
}

.carousel-slide .cap-text p {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

.cap-panel {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-surface);
}

.cap-text {
  padding: 1.5rem 1.5rem 1rem;
}

.cap-text h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.cap-text p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

.cap-code {
  margin: 0;
  padding: 1rem 1.5rem;
  background: var(--color-code-bg);
  border-top: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  overflow-x: auto;
}

.cap-code .c {
  color: #6b7280;
}

/* ── How it works (terminal demo) ────────────────────────── */
.how-it-works {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.how-it-works h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

.terminal-demo {
  max-width: var(--max-width);
  margin: 0 auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.terminal-chrome {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: #1a1a1e;
  border-bottom: 1px solid var(--color-border);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.terminal-title {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
}

.terminal-body {
  margin: 0;
  padding: 1.25rem 1.5rem;
  background: #0d0d0f;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  overflow-x: auto;
  white-space: pre;
  min-height: 18rem;
}

.terminal-body .term-line {
  display: inline;
}

.terminal-body .prompt {
  color: #34d399;
  font-weight: 700;
}

.terminal-body .c {
  color: #6b7280;
}

.terminal-body .h {
  color: #a0a0a8;
  font-weight: 600;
}

/* ── Key Features ─────────────────────────────────────────── */
.home-features {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 3rem;
}

.home-features h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 3rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.feature {
  text-align: center;
}

.feature-icon {
  width: 2.25rem;
  height: 2.25rem;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.feature-icon-networking { color: #4d8eff; }
.feature-icon-ssh        { color: #34d399; }
.feature-icon-cloud      { color: #a78bfa; }
.feature-icon-pxe        { color: #fb923c; }
.feature-icon-k8s        { color: #22d3ee; }
.feature-icon-gpu        { color: #f472b6; }

.feature h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 0.4rem;
}

.feature p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}


/* ── Home: steps section ─────────────────────────────────── */
.home-steps {
  background: var(--color-hero-bg);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 3.5rem 1.5rem;
}

.home-steps-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.home-steps h2 {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.75rem;
}

.home-steps-lead {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.home-steps-lead a {
  color: var(--color-accent);
}

.home-steps-footer {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-top: 2rem;
}

.home-steps-footer a {
  color: var(--color-accent);
}

.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.steps-list li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.step-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  line-height: 2rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-accent);
  border: 1.5px solid var(--color-accent);
  border-radius: 50%;
}

.step-desc {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.step-code {
  position: relative;
  margin-top: 0.35rem;
}

.step-code code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  background: var(--color-code-bg);
  padding: 0.5rem 2.5rem 0.5rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  white-space: pre;
  overflow-x: auto;
}

.copy-btn {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 3px;
  color: var(--color-text-secondary);
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
}

.copy-btn:hover {
  opacity: 1;
  color: var(--color-text);
}

.copy-btn.copied {
  opacity: 1;
  color: #34d399;
}

.copy-btn svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

.step-note {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-style: italic;
}

.step-output {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  background: var(--color-code-bg);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  white-space: pre;
  overflow-x: auto;
}

.overview-lead {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
}

.docs-category {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border);
}

.docs-category:first-of-type {
  margin-top: 0;
}

/* ── Overview grid ────────────────────────────────────────── */
.overview {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}

.overview > h2 {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
}

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

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

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
}

.card a {
  font-size: 0.875rem;
  font-weight: 500;
}

/* ── Content single ───────────────────────────────────────── */
.content-single,
.content-list {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.content-single h1,
.content-list h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.content-single h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.content-single h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.content-single h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.content-single p {
  margin-bottom: 1rem;
}

.content-single ul,
.content-single ol {
  margin: 0 0 1rem 1.5rem;
}

.content-single li {
  margin-bottom: 0.25rem;
}

.content-single blockquote {
  border-left: 3px solid var(--color-accent);
  margin: 1.5rem 0;
  padding: 0.5rem 1rem;
  color: var(--color-text-secondary);
  background: var(--color-code-bg);
  border-radius: 0 4px 4px 0;
}

/* ── Content images ───────────────────────────────────────── */
.content-single img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem 0;
}

/* ── Table of Contents sidebar ───────────────────────────── */
.page-with-toc {
  display: flex;
  max-width: 84rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-with-toc .content-single {
  flex: 1;
  min-width: 0;
  max-width: var(--max-width);
  padding: 2.5rem 0 4rem;
  margin: 0;
}

.toc-sidebar {
  width: 18rem;
  flex-shrink: 0;
  padding-top: 2.5rem;
  margin-right: 2.5rem;
}

.toc-inner {
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
  max-height: calc(100vh - var(--nav-height) - 3rem);
  overflow-y: auto;
  padding-bottom: 2rem;
}

.toc-inner::-webkit-scrollbar {
  width: 3px;
}

.toc-inner::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.toc-heading {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
}

.toc-sidebar #TableOfContents {
  border-left: 1px solid var(--color-border);
}

.toc-sidebar #TableOfContents ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-sidebar #TableOfContents > ul > li > a {
  font-weight: 600;
}

.toc-sidebar #TableOfContents li {
  margin: 0;
}

.toc-sidebar #TableOfContents a {
  display: block;
  padding: 0.35rem 0 0.35rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
  border-left: 2px solid transparent;
  margin-left: -1px;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

.toc-sidebar #TableOfContents a:hover {
  color: var(--color-accent-hover);
  text-decoration: none;
}

.toc-sidebar #TableOfContents a.active {
  color: var(--color-accent);
  border-left-color: var(--color-accent);
}

/* Nested h3 items indented */
.toc-sidebar #TableOfContents ul ul a {
  padding-left: 1.75rem;
  font-weight: 400;
  font-size: 0.825rem;
}

/* ── Code ─────────────────────────────────────────────────── */
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-code-bg);
  padding: 0.15em 0.35em;
  border-radius: 4px;
}

pre {
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  line-height: 1.55;
  position: relative;
}

pre .copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

pre:hover .copy-btn {
  opacity: 1;
}

pre .copy-btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

pre .copy-btn svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

/* ── Tables ───────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
}

th {
  background: var(--color-code-bg);
  font-weight: 600;
}

/* ── Page list ────────────────────────────────────────────── */
.page-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-list li {
  border-bottom: 1px solid var(--color-border);
}

.page-list li:last-child {
  border-bottom: none;
}

.page-list a {
  display: block;
  padding: 1rem 0;
}

.page-list a:hover {
  text-decoration: none;
}

.page-list a:hover strong {
  color: var(--color-accent);
}

.page-list strong {
  display: block;
  font-size: 1.05rem;
  color: var(--color-text);
  margin-bottom: 0.15rem;
}

.page-list .desc {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--color-border);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.site-footer a {
  color: var(--color-text-secondary);
  font-weight: 500;
}

.site-footer a:hover {
  color: var(--color-accent);
}

/* ── Details/summary ──────────────────────────────────────── */
details {
  margin-bottom: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
}

summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

details[open] summary {
  margin-bottom: 0.75rem;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 960px) {
  .toc-sidebar {
    display: none;
  }

  .page-with-toc {
    display: block;
  }

  .page-with-toc .content-single {
    padding: 2.5rem 0 4rem;
    max-width: var(--max-width);
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 3rem 1rem 2.5rem;
  }

  .hero-layout {
    grid-template-columns: 1fr;
  }

  .hero-content {
    text-align: center;
  }

  .hero-links {
    justify-content: center;
  }

  .hero h1,
  .hero .hero-title {
    font-size: 2rem;
  }

  .hero-links {
    flex-direction: column;
    align-items: center;
  }

  .site-header ul {
    gap: 1rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-4 {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .capabilities-grid {
    grid-template-columns: 1fr;
  }

  .prev-next {
    flex-direction: column;
  }
}

/* ── Breadcrumbs ─────────────────────────────────────────── */
.breadcrumbs {
  margin-bottom: 1rem;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  color: var(--color-text-secondary);
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin: 0 0.5rem;
  color: var(--color-border);
}

.breadcrumbs li:last-child {
  color: var(--color-text);
  font-weight: 500;
}

.breadcrumbs a {
  color: var(--color-text-secondary);
}

.breadcrumbs a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

/* ── Section nav in sidebar ──────────────────────────────── */
.section-nav {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
}

.section-nav li {
  margin: 0;
}

.section-nav a,
.section-nav span {
  display: block;
  padding: 0.3rem 0 0.3rem 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.section-nav a:hover {
  color: var(--color-accent-hover);
  text-decoration: none;
}

.section-nav li.active span {
  color: var(--color-accent);
  border-left-color: var(--color-accent);
  font-weight: 600;
}

.toc-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0.75rem 0;
}

/* ── Page description ────────────────────────────────────── */
.page-description,
.section-description {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  margin-top: -0.75rem;
}

/* ── Subsection headings in list pages ───────────────────── */
.subsection-heading {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
}

.subsection-desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
}

/* ── Card links (list pages) ─────────────────────────────── */
.grid-cards {
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.card-link {
  display: block;
  text-decoration: none;
  position: relative;
  transition: border-color 0.15s, transform 0.15s;
}

.card-link:hover {
  border-color: var(--color-accent);
  text-decoration: none;
  transform: translateY(-1px);
}

.card-link h3 {
  color: var(--color-text);
  transition: color 0.15s;
}

.card-link:hover h3 {
  color: var(--color-accent);
}

.card-link p {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0;
}

.card-arrow {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 1rem;
  color: var(--color-text-secondary);
  transition: color 0.15s, transform 0.15s;
}

.card-link:hover .card-arrow {
  color: var(--color-accent);
  transform: translateX(2px);
}

/* ── Prev / Next navigation ──────────────────────────────── */
.prev-next {
  display: flex;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.prev-next-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  text-decoration: none;
  transition: border-color 0.15s;
}

.prev-next-link:hover {
  border-color: var(--color-accent);
  text-decoration: none;
}

.next-link {
  text-align: right;
  align-items: flex-end;
}

.prev-next-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
}

.prev-next-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-accent);
}

.prev-next-link:hover .prev-next-title {
  color: var(--color-accent-hover);
}

/* ── Edit this page link ─────────────────────────────────── */
.edit-link {
  margin-top: 2.5rem;
  padding-top: 1rem;
}

.edit-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.edit-link a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.edit-icon {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}

/* ── Callout / Admonition boxes ──────────────────────────── */
.callout {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  border-left: 3px solid;
}

.callout-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
}

.callout-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.callout-body {
  font-size: 0.9rem;
  line-height: 1.6;
}

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

.callout-body code {
  font-size: 0.82em;
}

/* Note (blue) */
.callout-note {
  background: rgba(77, 142, 255, 0.08);
  border-left-color: #4d8eff;
}

.callout-note .callout-header {
  color: #4d8eff;
}

/* Warning (amber) */
.callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border-left-color: #f59e0b;
}

.callout-warning .callout-header {
  color: #f59e0b;
}

/* Tip (green) */
.callout-tip {
  background: rgba(52, 211, 153, 0.08);
  border-left-color: #34d399;
}

.callout-tip .callout-header {
  color: #34d399;
}

/* Important (red) */
.callout-important {
  background: rgba(239, 68, 68, 0.08);
  border-left-color: #ef4444;
}

.callout-important .callout-header {
  color: #ef4444;
}

/* ── Multi-column footer ─────────────────────────────────── */
.footer-columns {
  display: flex;
  justify-content: center;
  gap: 4rem;
  max-width: 84rem;
  margin: 0 auto;
  padding: 0 1.5rem 1.5rem;
}

.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 0.35rem;
}

.footer-col a {
  font-size: 0.825rem;
  color: var(--color-text-secondary);
}

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

.footer-bottom {
  border-top: 1px solid var(--color-border);
  margin-top: 1rem;
  padding-top: 1rem;
}

/* ── Search trigger button ────────────────────────────────── */
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.search-trigger:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
}

.search-trigger .search-icon {
  width: 0.85rem;
  height: 0.85rem;
}

.search-label {
  margin-right: 0.5rem;
}

.search-kbd {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  color: var(--color-text-secondary);
  line-height: 1;
}

/* ── Search modal ────────────────────────────────────────── */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.search-modal[hidden] {
  display: none;
}

.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.search-modal-content {
  position: relative;
  width: 100%;
  max-width: 36rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.search-modal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.search-modal-header .search-icon {
  width: 1rem;
  height: 1rem;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.search-modal-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
}

.search-modal-input::placeholder {
  color: var(--color-text-secondary);
}

.search-results {
  max-height: 50vh;
  overflow-y: auto;
}

.search-result {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.1s;
}

.search-result:hover {
  background: var(--color-code-bg);
  text-decoration: none;
}

.search-result:last-child {
  border-bottom: none;
}

.search-result-title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}

.search-result-excerpt {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.search-result-excerpt mark {
  background: rgba(77, 142, 255, 0.2);
  color: var(--color-accent);
  border-radius: 2px;
  padding: 0 2px;
}

.search-no-results {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

@media (max-width: 960px) {
  .footer-columns {
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .search-label {
    display: none;
  }

  .search-kbd {
    display: none;
  }

  .search-modal-content {
    margin: 0 1rem;
  }

  .footer-columns {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
}
