:root {
  color-scheme: light dark;
  --background: #faf9f5;
  --surface: #fff;
  --text: #222;
  --muted: #5f5f5f;
  --border: #d6d6d6;
  --accent: #000;
  --header: #292929;
  --header-text: #f7f7f7;
  --note: #f0f0f0;
  --content-width: 790px;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.78;
  text-rendering: optimizeLegibility;
}
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.skip-link {
  position: absolute;
  left: 1rem;
  top: -6rem;
  z-index: 1000;
  padding: .7rem 1rem;
  background: var(--surface);
  font-family: var(--sans);
}
.skip-link:focus { top: 1rem; }

.topbar {
  background: var(--header);
  color: var(--header-text);
  border-bottom: 3px solid #b7b7b7;
}
.topbar-inner {
  max-width: 1530px;
  margin: 0 auto;
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.brand {
  display: flex;
  flex-direction: column;
  color: inherit;
  line-height: 1.3;
  text-decoration: none;
}
.brand small {
  margin-bottom: .25rem;
  color: inherit;
  font: .66rem/1.3 var(--sans);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.brand strong { font-size: 1.62rem; font-weight: 400; letter-spacing: .005em; }
.topnav { margin-left: auto; display: flex; gap: 1.9rem; font: .85rem/1.5 var(--sans); }
.topnav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.topnav a:hover { text-decoration: underline; }
.topbar :focus-visible { outline-color: #f0f0f0; }

.reader-toolbar {
  max-width: 1530px;
  margin: 0 auto;
  padding: .65rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font: .73rem/1.6 var(--sans);
}
.reader-toolbar > div { display: flex; align-items: center; gap: 1rem; }
.reader-toolbar a { min-height: 24px; display: inline-flex; align-items: center; color: inherit; }
.nav-toggle,
.nav-backdrop,
.nav-close { display: none; }
.nav-toggle {
  min-height: 36px;
  padding: .3rem .55rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: .72rem var(--sans);
}
.hamburger { width: 16px; display: inline-grid; gap: 3px; }
.hamburger span { display: block; height: 1px; background: currentColor; }

.shell {
  max-width: 1530px;
  margin: auto;
  padding: 1.7rem 2rem 4rem;
  display: grid;
  grid-template-columns: 230px minmax(0, var(--content-width)) 195px;
  gap: 2.7rem;
  align-items: start;
  justify-content: center;
}
.side,
.toc {
  position: sticky;
  top: 1.1rem;
  align-self: start;
  max-height: calc(100vh - 2.2rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  color: var(--muted);
  font: .76rem/1.5 var(--sans);
}
.side { padding-right: 1rem; }
.toc { font-size: .69rem; }
.side h2,
.toc h2 {
  margin: 0 0 .7rem;
  padding: 0 0 .7rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font: 650 .65rem/1.5 var(--sans);
  letter-spacing: .13em;
  text-transform: uppercase;
}
.side a,
.toc a {
  display: block;
  padding: .3rem 0;
  color: var(--muted);
  text-decoration: none;
}
.side a:hover,
.toc a:hover { color: var(--accent); text-decoration: underline; }
.side .section-title {
  margin: 1.25rem 0 .35rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .61rem;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.toc .local-toc-list a { padding: .25rem .1rem .25rem .65rem; border-left: 2px solid transparent; }
.toc .local-toc-list a:hover { border-left-color: var(--border); }

main { min-width: 0; max-width: 100%; outline: none; }
.page {
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow-wrap: break-word;
}
.page > .kicker:first-child {
  margin: 0 0 .85rem;
  color: var(--muted);
  font: .66rem/1.65 var(--sans);
  font-weight: 400;
  letter-spacing: .11em;
  text-transform: uppercase;
}
h1 {
  margin: .2rem 0 .8rem;
  font-size: 2.5rem;
  font-weight: normal;
  line-height: 1.25;
  letter-spacing: -.025em;
  text-wrap: pretty;
}
h2 {
  margin: 2.6rem 0 1.1rem;
  font-size: 1.65rem;
  font-weight: normal;
  line-height: 1.25;
  text-wrap: pretty;
}
h3 {
  margin: 2rem 0 1rem;
  font-size: 1.24rem;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: pretty;
}
p { margin: 0 0 1.12em; }
.lead {
  margin: .2rem 0 1.6rem;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1.55;
}
.meta { margin: -1rem 0 1.8rem; color: var(--muted); font: .7rem/1.75 var(--sans); }
blockquote {
  margin: 1.6rem 0;
  padding: .9rem 1.1rem;
  border-left: 3px solid var(--accent);
  background: var(--note);
}
ul, ol { padding-left: 1.35em; }
code { padding: .08em .25em; background: var(--note); font: .9em var(--mono); }

.searchbox { margin: 1.6rem 0 1.9rem; display: flex; gap: .6rem; }
.searchbox input {
  flex: 1;
  width: 100%;
  min-height: 44px;
  padding: .65rem .75rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font: .9rem var(--sans);
}
.btn,
button.btn {
  min-height: 44px;
  padding: .65rem 1.2rem;
  border: 1px solid var(--header);
  border-radius: 0;
  background: var(--header);
  color: var(--header-text);
  cursor: pointer;
  font: .78rem var(--sans);
  text-decoration: none;
}
.btn.secondary { border-color: var(--border); background: var(--note); color: var(--text); }

.grid {
  margin: 1.25rem 0 2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1.6rem;
  border-top: 1px solid var(--border);
}
.card {
  padding: 1.1rem 0 1.2rem;
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.card h3 { margin: .15rem 0 .45rem; font-size: 1.08rem; font-weight: 500; }
.card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.65; }
.card .status {
  color: var(--muted);
  font: .62rem/1.5 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.article-list { margin-top: 1.2rem; border-top: 1px solid var(--border); }
.article-row { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.article-row > a,
.question-title { font-size: 1.03rem; font-weight: 500; line-height: 1.5; }
.article-row > a { text-decoration-thickness: 1px; }
.article-row .summary { margin: .25rem 0 .45rem; color: var(--muted); font-size: .88rem; line-height: 1.65; }
.question-meta { font-family: var(--sans); line-height: 1.4; }
.tag {
  display: inline-block;
  margin: .15rem .25rem .1rem 0;
  padding: .08rem .38rem;
  border: 1px solid var(--border);
  color: var(--muted);
  font: .64rem/1.55 var(--sans);
  text-decoration: none;
}
.tag[href]:hover { color: var(--text); border-color: var(--text); }
.status-tag { text-transform: uppercase; letter-spacing: .06em; }
.planned .question-title { color: var(--muted); }
.index-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1.4rem;
  margin: 1.4rem 0 2.2rem;
  padding: .85rem 0;
  border-block: 1px solid var(--border);
  font: .76rem/1.6 var(--sans);
}
.heading-count {
  margin-left: .35rem;
  color: var(--muted);
  font: .65em/1 var(--sans);
  vertical-align: middle;
}
.index-note { max-width: 42rem; color: var(--muted); font-size: .92rem; }
.note {
  margin: 1.4rem 0;
  padding: .9rem 1rem;
  border-left: 3px solid var(--border);
  background: var(--note);
  font: .78rem/1.7 var(--sans);
}
.sources { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.hidden { display: none !important; }
.footer {
  max-width: 1530px;
  margin: 0 auto;
  padding: 1.5rem 2rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font: .68rem/1.7 var(--sans);
}

@media (min-width: 1600px) {
  .shell { grid-template-columns: 245px minmax(0, var(--content-width)) 210px; gap: 3rem; }
}
@media (max-width: 1190px) {
  .shell { max-width: 1100px; grid-template-columns: 210px minmax(0, var(--content-width)); gap: 2.1rem; }
  .toc { display: none; }
}
@media (max-width: 800px) {
  .topbar-inner { display: block; padding: 1rem 1.2rem; }
  .brand { width: max-content; }
  .brand strong { font-size: 1.45rem; }
  .brand small { font-size: .6rem; }
  .topnav { display: none; }
  .reader-toolbar { position: relative; z-index: 61; padding: .5rem 1.2rem; background: var(--background); border-bottom: 1px solid var(--border); }
  .nav-toggle { display: inline-flex; align-items: center; gap: .5rem; }
  .shell { display: block; padding: 1.15rem 1.25rem 2.5rem; }
  .js-ready .side {
    position: fixed;
    z-index: 70;
    inset: 0 auto 0 0;
    width: min(86vw, 340px);
    max-height: 100vh;
    margin: 0;
    padding: 1.4rem 1.3rem 2rem;
    overflow-y: auto;
    border: 0;
    border-right: 1px solid var(--border);
    background: var(--background);
    box-shadow: 12px 0 28px rgba(0,0,0,.18);
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  .js-ready .nav-close {
    position: absolute;
    top: .65rem;
    right: .8rem;
    display: grid;
    width: 40px;
    height: 40px;
    padding: 0;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: 1.5rem/1 var(--sans);
  }
  .js-ready .side > h2:first-of-type { padding-right: 2.5rem; }
  .js-ready.nav-open .side { transform: translateX(0); }
  .js-ready .nav-backdrop {
    position: fixed;
    z-index: 65;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(0,0,0,.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .js-ready.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  .js-ready.nav-open { overflow: hidden; }
  .side {
    position: static;
    width: 100%;
    max-height: none;
    margin-bottom: 1.5rem;
    padding: 1rem 0 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: .88rem;
  }
  .side a { min-height: 36px; display: flex; align-items: center; }
  h1 { font-size: 2.12rem; }
  h2 { margin-top: 2.2rem; font-size: 1.46rem; }
  h3 { font-size: 1.2rem; }
  .lead { font-size: 1.12rem; }
  .grid { grid-template-columns: 1fr; }
  .searchbox { gap: .4rem; }
  .searchbox .btn { padding-inline: .8rem; }
  .footer { padding: 1.5rem 1.25rem 2rem; }
}
@media (max-width: 540px) {
  .topnav { gap: .8rem 1.2rem; }
  .searchbox { flex-direction: column; }
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #171717;
    --surface: #202020;
    --text: #e5e5e5;
    --muted: #aaa;
    --border: #444;
    --accent: #fff;
    --header: #292929;
    --header-text: #fff;
    --note: #242424;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media print {
  :root { color-scheme: light; --background: #fff; --surface: #fff; --text: #000; --muted: #333; --border: #bbb; --accent: #000; --note: #fafafa; }
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.55; }
  .topbar, .reader-toolbar, .side, .toc, .footer, .skip-link, .searchbox { display: none !important; }
  .shell { display: block; max-width: none; margin: 0; padding: 0; }
  h1 { font-size: 26pt; }
  h2 { font-size: 17pt; }
  h3 { font-size: 13pt; }
  p { orphans: 3; widows: 3; }
}
