/*
 * The documentation pages, in the app's palette.
 *
 * Same ink scale and same two typefaces as the landing page and as Capra itself, because
 * a page of documentation that looks like somewhere else is one more thing for a reader
 * to place before they can read it.
 */
:root {
  --ink-950: #08090b;
  --ink-900: #0b0c0e;
  --ink-850: #0e1013;
  --ink-800: #111317;
  --ink-700: #1a1e24;
  --ink-600: #232830;
  --bone: #e8e5de;
  --bone-dim: #c9c5bc;
  --slate: #8b93a1;
  --haze: #626b7a;
  --haze-deep: #454d59;
  --tungsten: #e0a44f;
  --tungsten-bright: #f2bd72;
  --sans: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--bone-dim);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }

a { color: var(--tungsten); text-decoration: none; }
a:hover { color: var(--tungsten-bright); }
a:focus-visible { outline: 2px solid var(--tungsten); outline-offset: 3px; border-radius: 2px; }

header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11, 12, 14, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink-700);
}
.rail { display: flex; align-items: center; gap: 1.5rem; height: 52px; font-size: 0.875rem; }
.rail a { color: var(--slate); }
.rail a:hover { color: var(--bone); }
.mark {
  font-weight: 600; font-size: 0.8125rem; letter-spacing: 0.34em;
  color: var(--bone) !important; flex-shrink: 0;
}
.spacer { flex: 1; }

/* ── Two columns: the pages, and the page ───────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 3.5rem;
  align-items: start;
  padding-top: 3rem;
  padding-bottom: 4rem;
}

aside { position: sticky; top: 76px; }
aside nav { display: flex; flex-direction: column; gap: 0.1rem; }
aside nav a {
  color: var(--slate);
  font-size: 0.9375rem;
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  border-left: 2px solid transparent;
  text-transform: capitalize;
}
aside nav a:hover { color: var(--bone); background: var(--ink-850); }
aside nav a.here {
  color: var(--bone);
  border-left-color: var(--tungsten);
  background: var(--ink-850);
}

.eyebrow {
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--haze); margin: 0 0 0.75rem 0.6rem;
}

/* ── The page itself ────────────────────────────────────────────────────────── */
main { min-width: 0; max-width: 46rem; }

main h1 {
  margin: 0 0 1.5rem; font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600; color: var(--bone); line-height: 1.2;
}
main h2 {
  margin: 3rem 0 1rem; font-size: 1.375rem; font-weight: 600; color: var(--bone);
  padding-top: 1.5rem; border-top: 1px solid var(--ink-700);
}
main h3 { margin: 2rem 0 0.5rem; font-size: 1.0625rem; font-weight: 500; color: var(--bone); }
main h4 { margin: 1.5rem 0 0.4rem; font-size: 0.9375rem; font-weight: 500; color: var(--bone-dim); }

p { margin: 0 0 1.1rem; }
b { color: var(--bone); font-weight: 500; }

hr { border: 0; border-top: 1px solid var(--ink-700); margin: 2.5rem 0; }

ul, ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--haze); }

code {
  font-family: var(--mono); font-size: 0.8125rem;
  background: var(--ink-800); color: var(--tungsten);
  padding: 0.1rem 0.4rem; border-radius: 2px;
}

pre {
  margin: 0 0 1.4rem; padding: 1rem 1.2rem; overflow-x: auto;
  background: var(--ink-950); border: 1px solid var(--ink-700); border-radius: 3px;
  font-family: var(--mono); font-size: 0.8125rem; line-height: 1.7; color: var(--bone-dim);
}
/* Code inside a block is already set; the inline treatment would double it up. */
pre code { background: none; color: inherit; padding: 0; }

table { width: 100%; border-collapse: collapse; margin: 0 0 1.4rem; font-size: 0.9375rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 0.6rem 1rem 0.6rem 0; border-bottom: 1px solid var(--ink-700); vertical-align: top; }
th {
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--haze); font-weight: 400;
  border-bottom-color: var(--ink-600);
}
td:first-child { color: var(--bone); }

footer {
  padding: 2.5rem 0 3.5rem; border-top: 1px solid var(--ink-700);
  font-size: 0.875rem; color: var(--haze);
}
footer a { color: var(--slate); }
footer a:hover { color: var(--bone); }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; gap: 2rem; }
  aside { position: static; }
  aside nav { flex-direction: row; flex-wrap: wrap; }
}
