:root {
  --bg: #faf8f4;
  --panel: #ffffff;
  --text: #1a1a1a;
  --muted: #5a5a5a;
  --faint: #9a9a9a;
  --accent: #b3261e;
  --accent-soft: #fbeceb;
  --border: #e4e0d8;
  --ink: #221c1c;
  --header-bg: #221c1c;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65; font-size: 17px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Canonical site header: one block, byte-identical on every page (checked by
   header-check.js). House dropdown pattern, as in precise/docs/academic.css:
   span.menu > span.menu-label + span.drop, opened on hover and focus-within.
   Pure CSS, no script. hrefs are root-absolute; the site is served at the domain root. */
.site-nav { position: sticky; top: 0; z-index: 1000; background: var(--header-bg); color: #fff;
            padding: 12px 20px; border-bottom: 3px solid var(--accent);
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.site-nav-inner { max-width: 820px; margin: 0 auto; display: flex; align-items: center; gap: 24px; }
.site-nav-brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.25em; }
.site-nav-links { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.site-nav a { color: #ecf0f1; text-decoration: none; }
.site-nav a:hover { color: #fff; text-decoration: underline; }

.site-nav .menu { position: relative; display: inline-block; }
.site-nav .menu-label { color: #ecf0f1; cursor: default; }
.site-nav .menu-label::after { content: " \25be"; font-size: .8em; }
.site-nav .menu:hover > .menu-label,
.site-nav .menu:focus-within > .menu-label { color: #fff; }
/* The menu's hover area extends 10px below the label so the pointer never
   crosses a dead gap on the way down to the drop. */
.site-nav .menu { padding-bottom: 10px; margin-bottom: -10px; }
.site-nav .drop { display: none; position: absolute; right: 0; top: 100%;
                  background: var(--header-bg); border: 1px solid rgba(255, 255, 255, .18);
                  border-radius: 4px; padding: 8px 0; min-width: 240px;
                  box-shadow: 0 6px 18px rgba(0, 0, 0, .22); }
.site-nav .menu:hover > .drop,
.site-nav .menu:focus-within > .drop { display: block; }
.site-nav .drop a { display: block; padding: 7px 16px; white-space: nowrap; }
.site-nav .drop a:hover { background: rgba(255, 255, 255, .10); color: #fff;
                          text-decoration: none; }

@media (max-width: 768px) {
  /* Not pinned, and the menu stays collapsed until tapped. With nine links an
     always-open list would eat the viewport. It opens on tap through
     :focus-within, since the label carries tabindex="0". */
  .site-nav { position: relative; }
  .site-nav-inner { flex-wrap: wrap; gap: 12px; }
  .site-nav-links { margin-left: 0; flex-wrap: wrap; gap: 16px; align-items: center; }
  .site-nav .menu { position: static; }
  .site-nav .drop { left: 12px; right: 12px; min-width: 0; }
}

main { max-width: 820px; margin: 32px auto; padding: 0 24px 60px; }
h1, h2, h3 { font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; }
h1 { font-size: 2.2rem; margin: 0 0 4px; line-height: 1.2; }
.subtitle { color: var(--muted); font-size: 1.12rem; margin: 0 0 24px; font-style: italic; }
h2 {
  font-size: 1.4rem; margin: 2.2em 0 0.6em;
  border-bottom: 1px solid var(--border); padding-bottom: 4px;
}
h3 { font-size: 1.1rem; margin: 1.6em 0 0.4em; color: var(--ink); }
p { margin: 0.8em 0; }
.lead { font-size: 1.08rem; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 8px; }
.muted { color: var(--muted); }
code {
  background: #f3f0ea; padding: 1px 5px;
  border-radius: 3px; font-size: 0.92em;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
}
blockquote {
  margin: 18px 0; padding: 10px 18px;
  border-left: 3px solid var(--border); color: var(--muted);
  font-family: Georgia, serif;
}
blockquote cite { display: block; font-size: 0.88rem; margin-top: 6px; font-style: normal; color: var(--faint); }

/* charge sheet at the top of every rebuke */
.charge-sheet {
  background: var(--panel); border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 6px; padding: 6px 18px; margin: 22px 0 28px;
}
.charge-sheet dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 12px 0; }
.charge-sheet dt {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 600; padding-top: 4px;
}
.charge-sheet dd { margin: 0; }
.charge-sheet .verdict { color: var(--accent); font-weight: 600; }

/* the argument being rebuked, stated fairly */
.steelman {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 20px; margin: 18px 0;
}
.steelman ol { margin: 10px 0; }

/* theorem box */
.theorem {
  background: var(--panel); border: 1px solid var(--border);
  border-left: 4px solid var(--ink);
  border-radius: 6px; padding: 6px 20px; margin: 20px 0;
}
.theorem .name {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 600; display: block; margin-top: 14px;
}
.display {
  text-align: center; margin: 16px 0; font-size: 1.05rem;
  font-family: Georgia, "Times New Roman", serif; overflow-x: auto;
}

/* code and demo */
pre.code, pre.out {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 14px 16px; margin: 18px 0; overflow-x: auto;
  font-size: 0.83rem; line-height: 1.55;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
}
pre.code { background: #f3f0ea; }
pre.out { background: var(--ink); color: #e9e4db; border-color: var(--ink); }
pre.code .c { color: #8a8378; }
button.run {
  font: inherit; font-size: 0.95rem; cursor: pointer;
  background: var(--accent); color: #fff; border: 0;
  border-radius: 6px; padding: 9px 18px; margin-top: 4px;
}
button.run:hover { background: #8e1d17; }
button.run:disabled { background: var(--faint); cursor: default; }

/* index listing */
.rebukes { list-style: none; padding-left: 0; }
.rebukes li {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 18px; margin-bottom: 12px;
}
.rebukes .title { font-family: Georgia, serif; font-size: 1.15rem; font-weight: 600; }
.rebukes .target { color: var(--muted); font-size: 0.92rem; }
.rebukes p { margin: 6px 0 0; }


.pagenav { margin: 0 0 22px; font-size: 0.95rem; }
.aside {
  background: var(--accent-soft); border-radius: 8px;
  padding: 4px 20px; margin: 24px 0;
}

.refs { list-style: none; padding-left: 0; font-size: 0.95rem; }
.refs li { margin-bottom: 10px; padding-left: 1.2em; text-indent: -1.2em; }

footer {
  max-width: 820px; margin: 40px auto 24px; padding: 16px 24px;
  font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--border);
}

@media (max-width: 520px) {
  .charge-sheet dl { grid-template-columns: 1fr; gap: 0; }
  .charge-sheet dd { margin-bottom: 8px; }
}
