/* Static guide pages (generated by tools/build_site.py). Colours follow the study hub. */
:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --border: rgba(15, 23, 42, 0.12);
  --text: #14172b;
  --text-2: #3d4360;
  --text-3: #5d6480;
  --accent: #6d28d9;
  --link: #5b21b6;
  --code-bg: #eef0f7;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07080f;
    --surface: #10121c;
    --border: rgba(255, 255, 255, 0.10);
    --text: #eef1f8;
    --text-2: #b0b6cb;
    --text-3: #8f96ad;
    --accent: #a78bfa;
    --link: #c4b5fd;
    --code-bg: #0e1019;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07080f;
  --surface: #10121c;
  --border: rgba(255, 255, 255, 0.10);
  --text: #eef1f8;
  --text-2: #b0b6cb;
  --text-3: #8f96ad;
  --accent: #a78bfa;
  --link: #c4b5fd;
  --code-bg: #0e1019;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 var(--font);
}
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 13px; letter-spacing: .02em;
}
.top nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; }
.top nav a { color: var(--text-2); text-decoration: none; }
.top nav a:hover { color: var(--text); text-decoration: underline; }

main { max-width: 820px; margin: 0 auto; padding: 24px 16px 48px; }
.crumbs { font-size: 14px; color: var(--text-3); margin-bottom: 8px; overflow-wrap: anywhere; }
.crumbs a { color: var(--text-3); }
.meta, .lede { color: var(--text-2); font-size: 15px; margin: 0 0 24px; }
.edit { margin-top: 32px; font-size: 14px; }

.md h1, main > h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.4rem); line-height: 1.2; margin: 8px 0 16px; }
.md h2 { font-size: 1.5rem; line-height: 1.3; margin: 2.2em 0 .6em; padding-top: .4em; border-top: 1px solid var(--border); }
.md h3 { font-size: 1.2rem; margin: 1.8em 0 .5em; }
.md h4 { font-size: 1.05rem; margin: 1.6em 0 .4em; }
.md h2, .md h3, .md h4 { scroll-margin-top: 16px; overflow-wrap: anywhere; }
.md p, .md ul, .md ol { margin: 0 0 1em; }
.md li { margin: .25em 0; }
.md img { max-width: 100%; height: auto; }
.md blockquote { margin: 0 0 1em; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--text-2); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.md hr + h2 { border-top: 0; padding-top: 0; margin-top: 0; }

.md code { font-family: var(--mono); font-size: .9em; background: var(--code-bg); padding: .1em .35em; border-radius: 5px; }
.md pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; line-height: 1.5; }
.md pre code { background: none; padding: 0; font-size: 14px; }
.md pre code.hljs { background: none; padding: 0; }

.table-wrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--border); border-radius: 10px; }
.md table { border-collapse: collapse; width: 100%; font-size: 15px; }
.md th, .md td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.md th { background: var(--code-bg); font-weight: 600; }
@media (max-width: 720px) {
  .md table { width: max-content; min-width: 100%; }
  .md th, .md td { min-width: 7.5rem; max-width: 17rem; }
}
.md tr:last-child td { border-bottom: 0; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; }
.pager a {
  display: block; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); text-decoration: none; color: var(--text); font-weight: 600;
}
.pager a small { display: block; color: var(--text-3); font-weight: 500; font-size: 13px; }
.pager .next { text-align: right; }

main section h2 { font-size: 1.25rem; margin: 1.8em 0 .4em; }
main section ul { margin: 0; padding-left: 1.2em; columns: 2 280px; column-gap: 32px; }
main section li { margin: .2em 0; break-inside: avoid; }

.foot { border-top: 1px solid var(--border); padding: 16px; text-align: center; font-size: 14px; color: var(--text-3); }

@media (max-width: 560px) {
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
}
@media print {
  .top, .pager, .foot, .meta, .edit, .crumbs { display: none; }
  body { background: #fff; color: #000; }
}
