/* MeshCam build guide. Matches the docs.getmeshcam.com landing page:
   deep green-black panels, amber accent, serif headings. System fonts only,
   so rendering makes no third-party request. */
:root {
  --bg: #0e1411;
  --panel: #16201a;
  --line: #26332b;
  --fg: #e9e5d8;
  --muted: #a9b3a4;
  --link: #7cb26a;
  --accent: #d9a441;
  --warn: #d9a441;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--link); }
a:hover { color: var(--accent); }

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.top .brand {
  color: var(--fg);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  text-decoration: none;
}
.top .home { color: var(--muted); font-size: 0.9rem; }

.wrap {
  display: grid;
  grid-template-columns: 15rem minmax(0, 46rem);
  gap: 2.5rem;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* Chapter list: a sticky sidebar on wide screens, a plain list above the
   text on phones. */
.chapters ol {
  position: sticky;
  top: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: ch;
}
.chapters li { counter-increment: ch; }
.chapters a {
  display: block;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
}
.chapters a::before {
  content: counter(ch) ". ";
  color: var(--line);
}
.chapters a:hover { color: var(--fg); background: var(--panel); }
.chapters a[aria-current="page"] {
  color: var(--fg);
  background: var(--panel);
  border-left: 3px solid var(--accent);
}

main { min-width: 0; }

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.25;
}
h1 { font-size: 2rem; margin: 0 0 1rem; }
h2 { font-size: 1.45rem; margin: 2.2rem 0 0.8rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.15rem; margin: 1.6rem 0 0.6rem; }

/* The pilcrow-style anchor the toc extension adds to each heading. */
.headerlink {
  margin-left: 0.4rem;
  color: var(--line);
  text-decoration: none;
  font-size: 0.8em;
}
h1:hover .headerlink, h2:hover .headerlink, h3:hover .headerlink { color: var(--muted); }

img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.2rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}

ul > li { margin-bottom: 0.4em; }
ol > li { margin-bottom: 0.6em; }

code {
  padding: 0.1em 0.35em;
  background: var(--panel);
  border-radius: 4px;
  font-size: 0.9em;
}
pre {
  overflow-x: auto;
  padding: 0.8rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
pre code { padding: 0; background: none; }

/* Tables scroll sideways on a phone rather than squeezing the text. */
table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.95rem;
}
th, td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th { background: var(--panel); }

.admonition {
  margin: 1.4rem 0;
  padding: 0.8rem 1rem;
  background: var(--panel);
  border-left: 4px solid var(--warn);
  border-radius: 6px;
}
.admonition-title {
  margin: 0 0 0.4rem;
  font-weight: 600;
  color: var(--accent);
}
.admonition > :last-child { margin-bottom: 0; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.pager a {
  flex: 1;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}
.pager a span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}
.pager .next { text-align: right; }

footer {
  padding: 1.5rem 1rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 52rem) {
  .wrap { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding-top: 1rem; }
  .chapters ol { position: static; }
  .chapters { padding-bottom: 0.8rem; border-bottom: 1px solid var(--line); }
  h1 { font-size: 1.7rem; }
  .pager { flex-direction: column; }
  .pager .next { text-align: left; }
}
