@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&display=swap");

:root {
  --bg: #fbfbfa;
  --paper: #ffffff;
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --line: #dcdcd7;
  --link: #1b4f72;
  --link-hover: #0e2f45;
  --note: #f4f4f1;
  --rail-w: 210px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--link-hover); }

.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
  max-width: 1080px;
  margin: 0 auto;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.rail {
  border-right: 1px solid var(--line);
  padding: 28px 18px 48px;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  background: #f7f7f5;
}

.rail .brand {
  display: block;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  text-decoration: none;
  margin-bottom: 6px;
}
.rail .brand:hover { color: var(--link); }

.rail .tag {
  color: var(--muted);
  font-size: 11.5px;
  margin: 0 0 22px;
  line-height: 1.4;
}

.rail .label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10.5px;
  color: var(--muted);
  margin: 0 0 8px;
  font-weight: 500;
}

.rail nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 5px 8px;
  border-left: 2px solid transparent;
}
.rail nav a:hover {
  background: #ecece8;
  color: var(--link);
}
.rail nav a.active {
  background: #ecece8;
  border-left-color: var(--ink);
  font-weight: 600;
}

.page {
  padding: 36px 44px 72px;
  max-width: 46rem;
}

.kicker {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

h2 {
  font-size: 1.28rem;
  font-weight: 600;
  margin: 2rem 0 0.55rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

h3 {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  margin: 1.35rem 0 0.4rem;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 1.4rem;
}

p { margin: 0 0 0.95rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin: 0.28rem 0; }
li::marker { color: var(--muted); }

.muted { color: var(--muted); }

.note,
.card {
  background: var(--note);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  padding: 12px 14px;
  margin: 1rem 0 1.25rem;
  font-size: 0.95rem;
}
.note.warn,
.card.warn,
.warn { border-left-color: #8a4b2a; }
.note.ok,
.card.ok,
.ok { border-left-color: #2f5d3a; }
.note h3,
.card h3 { margin-top: 0; }
.note p:last-child,
.card p:last-child { margin-bottom: 0; }

.toc {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13.5px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  margin: 0 0 1.5rem;
  background: #fcfcfb;
}
.toc strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.toc ol {
  margin: 0;
  padding-left: 1.1rem;
}
.toc li { margin: 0.2rem 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0.4rem 0 1.2rem;
  font-family: "IBM Plex Sans", sans-serif;
}
th, td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
th {
  background: #f3f3f0;
  font-weight: 600;
  font-size: 0.82rem;
}

code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.86em;
  background: #f0f0ec;
  padding: 0.08em 0.28em;
  border: 1px solid var(--line);
}

footer.meta,
footer {
  margin-top: 3rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 12.5px;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 0.7rem;
}

ul.tight { padding-left: 1.15rem; }
ul.tight li { margin: 0.18rem 0; }

.pill { display: none; }
header.site { display: none; }
.wrap { padding: 0; max-width: none; }

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
    border-left: none;
    border-right: none;
  }
  .rail {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 16px 16px 14px;
  }
  .rail nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 2px;
  }
  .rail nav a {
    border-left: none;
    padding: 4px 8px;
  }
  .rail nav a.active {
    border-left: none;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .page { padding: 24px 18px 56px; }
  h1 { font-size: 1.65rem; }
}
