:root {
  --paper: #f6f2ea;
  --ink: #1d1b18;
  --muted: #6b645a;
  --rule: #d8d0c2;
  --accent: #b5482a;
  --accent-soft: #e9c9bd;
  --panel: #fffdf8;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15140f;
    --ink: #ece6da;
    --muted: #a39b8d;
    --rule: #3a362e;
    --accent: #e0805f;
    --accent-soft: #4a2c22;
    --panel: #1d1b16;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 1rem 1rem;
}
.site-header .inner, main, .site-footer .inner {
  max-width: 46rem;
  margin: 0 auto;
}
.site-header .inner { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.5rem; justify-content: space-between; }
.brand { font-family: var(--sans); font-weight: 700; letter-spacing: .02em; text-decoration: none; color: var(--ink); }
.brand span { color: var(--accent); }
nav { font-family: var(--sans); font-size: .9rem; display: flex; gap: 1.1rem; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; }
nav a[aria-current="page"], nav a:hover { color: var(--ink); }

main { padding: 2.5rem 1rem 4rem; }
h1, h2, h3 { line-height: 1.2; font-weight: 600; }
h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 .75rem; }
h3 { font-size: 1.15rem; margin: 1.75rem 0 .4rem; }
.lede { font-size: 1.3rem; color: var(--muted); margin-top: 0; }
.kicker { font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin: 0 0 .5rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.card {
  display: block; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px;
  padding: 1.1rem 1.2rem; text-decoration: none; color: var(--ink);
}
.card:hover { border-color: var(--accent); }
.card strong { display: block; font-family: var(--sans); font-size: 1rem; margin-bottom: .3rem; }
.card span { font-size: .95rem; color: var(--muted); }

.figure {
  background: var(--panel); border: 1px solid var(--rule); border-radius: 12px;
  padding: 1rem; margin: 2rem 0;
}
.figure svg { width: 100%; height: auto; display: block; }
.figure figcaption { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-top: .75rem; }
.controls { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.controls button {
  font-family: var(--sans); font-size: .85rem; padding: .45rem .85rem; border-radius: 999px;
  border: 1px solid var(--rule); background: transparent; color: var(--ink); cursor: pointer;
}
.controls button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.thinker-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.thinker-list li { padding: .9rem 0; border-bottom: 1px solid var(--rule); }
.thinker-list .name { font-family: var(--sans); font-weight: 600; }
.thinker-list .dates { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-left: .4rem; }
.thinker-list p { margin: .25rem 0 0; font-size: 1rem; }
.status { font-family: var(--sans); font-size: .75rem; color: var(--muted); border: 1px solid var(--rule); border-radius: 999px; padding: .05rem .5rem; margin-left: .4rem; }

.site-footer { border-top: 1px solid var(--rule); padding: 1.5rem 1rem; font-family: var(--sans); font-size: .85rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.toc { display: flex; flex-wrap: wrap; gap: .35rem .5rem; font-family: var(--sans); font-size: .82rem; margin: 1.5rem 0 1rem; }
.toc a { text-decoration: none; color: var(--muted); border: 1px solid var(--rule); border-radius: 999px; padding: .2rem .65rem; }
.toc a:hover { color: var(--ink); border-color: var(--accent); }
section { scroll-margin-top: 1rem; }
.fig-no { font-weight: 600; color: var(--ink); }
.slider-label { display: block; font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-top: .75rem; }
.figure input[type=range] { width: 100%; accent-color: var(--accent); margin: .35rem 0 0; }
.readout { font-family: var(--sans); font-size: .9rem; margin: .6rem 0 0; }
.verdict { font-family: var(--sans); font-size: .9rem; margin: .5rem 0 0; padding: .6rem .8rem; border-radius: 8px; border-left: 4px solid var(--rule); background: var(--paper); }
.verdict[data-kind="bad"] { border-left-color: var(--accent); }
.verdict[data-kind="ok"] { border-left-color: var(--muted); }
.summary li { margin: .35rem 0; }
.credit { font-family: var(--sans); font-size: .8rem; color: var(--muted); margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.controls button:disabled { opacity: .5; }

/* Artworks */
.plate { margin: 2.25rem 0; }
.plate img { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.08); background: var(--rule); }
.plate figcaption { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-top: .65rem; line-height: 1.5; }
.plate figcaption strong { color: var(--ink); font-weight: 600; }
.plate .credit-line { display: block; font-size: .75rem; margin-top: .2rem; }
.plate.narrow { max-width: 30rem; margin-left: auto; margin-right: auto; }
.plate.bleed { margin-left: -1rem; margin-right: -1rem; }
.plate.bleed img { border-radius: 0; }
@media (min-width: 52rem) { .plate.bleed { margin-left: -4rem; margin-right: -4rem; } .plate.bleed img { border-radius: 4px; } }
.hero-plate { margin: 0 0 2rem; }

/* Thinker pages */
blockquote.frag { margin: 1.25rem 0; padding: .25rem 0 .25rem 1.1rem; border-left: 3px solid var(--accent); font-size: 1.2rem; font-style: italic; }
blockquote.frag cite { display: block; font-style: normal; font-family: var(--sans); font-size: .8rem; color: var(--muted); margin-top: .3rem; }
table.compare { width: 100%; border-collapse: collapse; margin: 2rem 0; font-size: .95rem; }
table.compare caption { text-align: left; font-family: var(--sans); font-weight: 600; font-size: .9rem; margin-bottom: .5rem; }
table.compare th, table.compare td { text-align: left; vertical-align: top; padding: .6rem .5rem; border-top: 1px solid var(--rule); }
table.compare thead th { font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-top: 0; }
table.compare tbody th { font-family: var(--sans); font-size: .85rem; font-weight: 600; width: 28%; }
@media (max-width: 30rem) { table.compare { font-size: .88rem; } table.compare th, table.compare td { padding: .5rem .3rem; } }
.reading { padding-left: 1.2rem; font-size: 1rem; }
.reading li { margin: .4rem 0; }
.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-family: var(--sans); font-size: .9rem; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.thinker-list a.name { color: var(--ink); text-decoration-color: var(--accent); }

/* Reading page */
.booklist { list-style: none; padding: 0; margin: 0 0 1rem; border-top: 1px solid var(--rule); }
.booklist li { padding: .9rem 0; border-bottom: 1px solid var(--rule); }
.booklist .title { font-family: var(--sans); font-weight: 600; }
.booklist .by { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-left: .4rem; }
.booklist p { margin: .3rem 0 0; font-size: 1rem; }
.booklist .related { color: var(--muted); }
.booklist .buy { font-family: var(--sans); font-size: .85rem; }
.audio { font-family: var(--sans); font-size: .75rem; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: .05rem .5rem; margin-left: .4rem; white-space: nowrap; }

/* Compare all views */
.table-wrap { overflow-x: auto; }
.bigcompare { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .9rem; margin: 1rem 0; }
.bigcompare caption { text-align: left; color: var(--muted); font-size: .85rem; margin-bottom: .5rem; }
.bigcompare th, .bigcompare td { text-align: left; vertical-align: top; padding: .6rem .5rem; border-bottom: 1px solid var(--rule); }
.bigcompare thead th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.bigcompare tbody th a { color: var(--ink); text-decoration-color: var(--accent); }
.bigcompare .deutsch-row { background: var(--panel); }
.pill { display: inline-block; font-family: var(--sans); font-size: .72rem; border-radius: 999px; padding: .05rem .5rem; margin-right: .3rem; border: 1px solid var(--rule); color: var(--muted); white-space: nowrap; }
.pill.yes { border-color: var(--accent); color: var(--accent); }
.pill.no { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 52rem) {
  .bigcompare thead { display: none; }
  .bigcompare caption { display: block; width: 100%; }
  .bigcompare, .bigcompare tbody, .bigcompare tr, .bigcompare th, .bigcompare td { display: block; width: 100%; }
  .bigcompare tr { border-bottom: 1px solid var(--rule); padding: .6rem 0; }
  .bigcompare tr[hidden] { display: none; }
  .bigcompare th, .bigcompare td { border: 0; padding: .2rem 0; }
  .bigcompare tbody th { font-size: 1.05rem; }
  .bigcompare td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
}

/* Keyboard focus and skip link */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.controls button:focus-visible { outline-offset: 3px; border-radius: 999px; }
.skip { position: absolute; left: 1rem; top: -3rem; background: var(--accent); color: #fff; padding: .4rem .8rem; border-radius: 6px; font-family: var(--sans); font-size: .9rem; z-index: 10; text-decoration: none; }
.skip:focus { top: .6rem; }
.thinker-list .pill { margin-left: .4rem; vertical-align: 1px; }

/* Glossary */
.glossary dt { font-family: var(--sans); font-weight: 600; margin-top: 1.2rem; scroll-margin-top: 1rem; }
.glossary dd { margin: .25rem 0 0; font-size: 1rem; }
.glossary .related { color: var(--muted); font-size: .95rem; }
.footer-links { display: block; margin-top: .4rem; }
.footer-links a { color: var(--muted); }
.compare-more { font-family: var(--sans); font-size: .9rem; margin-top: .4rem; }
