/* Palette lifted from the theme's Ivory style, so the documentation looks
   like the product it documents. Dark mode uses Noir. */
:root {
  --bg: #FBFAF7;
  --fg: #211E1A;
  --accent: #7E6132;
  --muted: color-mix(in srgb, var(--fg) 62%, var(--bg));
  --rule: color-mix(in srgb, var(--fg) 14%, var(--bg));
  --panel: color-mix(in srgb, var(--fg) 4%, var(--bg));
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1917;
    --fg: #F4F1EA;
    --accent: #C9A96A;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.shell { display: flex; align-items: flex-start; max-width: 1180px; margin: 0 auto; }

/* Sidebar ---------------------------------------------------------------- */
.side {
  flex: 0 0 232px;
  padding: 2.75rem 1.5rem 3rem 2rem;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}
.brand { display: block; text-decoration: none; color: inherit; margin-bottom: 2rem; }
.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: .01em;
}
.brand span {
  display: block;
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: .3rem;
}
.side nav { display: flex; flex-direction: column; gap: .15rem; }
.side nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  padding: .4rem .7rem;
  border-radius: 4px;
  border-left: 2px solid transparent;
}
.side nav a:hover { color: var(--fg); background: var(--panel); }
.side nav a[aria-current="page"] {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--panel);
}
.side footer {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: .78rem;
  color: var(--muted);
}
.side footer a { color: var(--accent); }

/* Content ---------------------------------------------------------------- */
main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 2.75rem 2rem 6rem;
  max-width: 46rem;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.25; }
h1 { font-size: 2.35rem; margin: 0 0 1.5rem; letter-spacing: -.01em; }
h2 {
  font-size: 1.55rem;
  margin: 3rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
h3 { font-size: 1.15rem; margin: 2rem 0 .6rem; }
h4 { font-size: 1rem; margin: 1.5rem 0 .5rem; }
h1 + h2 { border-top: 0; padding-top: 0; margin-top: 1rem; }
/* The markdown uses `---` before some sections. That <hr> plus the <h2>'s own
   top border draws two lines with dead space between them — keep the <hr>. */
hr + h2 { border-top: 0; padding-top: 0; margin-top: 1.5rem; }

p { margin: 0 0 1.1rem; }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

ul, ol { margin: 0 0 1.1rem; padding-left: 1.35rem; }
li { margin-bottom: .35rem; }
li::marker { color: var(--muted); }

strong { font-weight: 600; }

blockquote {
  margin: 1.5rem 0;
  padding: .9rem 1.2rem;
  border-left: 2px solid var(--accent);
  background: var(--panel);
  border-radius: 0 4px 4px 0;
}
blockquote p:last-child { margin-bottom: 0; }

code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--panel);
  padding: .13em .38em;
  border-radius: 3px;
}
pre {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  margin: 0 0 1.4rem;
}
pre code { background: none; padding: 0; font-size: .85rem; line-height: 1.55; }

/* Wide tables scroll inside their own box rather than pushing the page sideways. */
.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .8rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th {
  font-family: var(--sans);
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
tbody tr:last-child td { border-bottom: 0; }

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

/* Landing cards ---------------------------------------------------------- */
.cards { display: grid; gap: .85rem; margin: 2rem 0 0; }
.card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.15rem 1.3rem;
}
.card:hover { border-color: var(--accent); background: var(--panel); }
.card strong { display: block; font-family: var(--serif); font-size: 1.15rem; font-weight: 400; }
.card span { display: block; color: var(--muted); font-size: .88rem; margin-top: .25rem; }

.skip {
  position: absolute;
  left: -9999px;
  background: var(--bg);
  color: var(--fg);
  padding: .6rem 1rem;
  z-index: 10;
}
.skip:focus { left: 1rem; top: 1rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 820px) {
  .shell { display: block; }
  .side {
    position: static;
    max-height: none;
    flex: none;
    padding: 1.75rem 1.25rem 0;
    border-bottom: 1px solid var(--rule);
  }
  .side nav { flex-direction: row; flex-wrap: wrap; gap: .25rem; }
  .side nav a { border-left: 0; border-bottom: 2px solid transparent; }
  .side nav a[aria-current="page"] { border-left: 0; border-bottom-color: var(--accent); }
  .side footer { margin-top: 1.25rem; }
  main { padding: 2rem 1.25rem 4rem; max-width: none; }
  h1 { font-size: 1.9rem; }
}
