:root {
  --bg: #f3efe4;
  --ink: #1c1914;
  --muted: #5c564c;
  --soft: #3f392f;
  --line: #ddd4c4;
  --orange: #9a4d12;
  --orange-hover: #6e3208;
  --bar: #10120e;
  --bar-ink: #efe7d6;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: ui-serif, "Iowan Old Style", Palatino, Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.55;
}

a {
  color: var(--orange);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover { color: var(--orange-hover); }

:focus-visible {
  outline: 2px solid #f38020;
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 60;
  background: var(--bg);
  color: var(--ink);
  padding: 0.4rem 0.7rem;
}

.skip:focus { top: 0.55rem; }

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 1.5rem;
  padding: 0.85rem 1.25rem;
  background: var(--bar);
  color: var(--bar-ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--bar-ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand img { width: 1.85rem; height: 1.85rem; display: block; }

.bar-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.1rem;
}

.bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
}

.theme-switch {
  font: inherit;
  color: var(--bar-ink);
  background: transparent;
  border: 1px solid #3c4134;
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  cursor: pointer;
}

.theme-switch:hover { border-color: #f38020; color: white; }

.bar nav a {
  color: #d9d0c0;
  text-decoration: none;
  font-size: 0.98rem;
}

.bar nav a:hover { color: white; }

.bar nav a[aria-current="page"] {
  color: #f38020;
  text-decoration: underline;
  text-underline-offset: 0.28em;
}

.wrap {
  width: min(42rem, calc(100% - 2.5rem));
  margin-inline: auto;
}

main.wrap { padding-block: 2.6rem 4.25rem; }

.crumb {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

h1 {
  margin: 0;
  font-size: clamp(2.7rem, 7vw, 4.2rem);
}

.lede {
  margin: 1rem 0 0;
  max-width: 36rem;
  color: var(--soft);
  font-size: 1.28rem;
  line-height: 1.4;
}

.kicker {
  margin: 0 0 0.55rem;
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 640;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.block { margin-top: 2.8rem; }

.block h2, .page-head h2 { margin: 0 0 0.8rem; font-size: 1.85rem; }

.prose p, .intro { max-width: 38rem; margin: 0.8rem 0; }

.study {
  padding: 1.2rem 0 1.25rem;
  border-top: 1px solid var(--line);
}

.study:last-child { border-bottom: 1px solid var(--line); }

.study h2, .study h3 {
  margin: 0.3rem 0 0.45rem;
  font-size: 1.55rem;
  line-height: 1.15;
}

.study h2 a, .study h3 a {
  color: inherit;
  text-decoration-color: #c4b49a;
}

.study h2 a:hover, .study h3 a:hover { color: var(--orange); }

.meta, .summary, .sources-line { margin: 0.35rem 0; }

.meta, .sources-line { color: var(--muted); font-size: 0.95rem; }

.pages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.pages a { font-weight: 520; }

.more { margin-top: 1.25rem; }

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.pager .next { justify-self: end; }

.pager .where { color: var(--muted); font-size: 0.95rem; }

.foot {
  border-top: 1px solid var(--line);
  padding-block: 1.2rem 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.foot p { margin: 0; }

.foot-line {
  display: flex;
  align-items: center;
  gap: 0.65rem 0.8rem;
  flex-wrap: wrap;
  margin: 0;
  color: var(--muted);
}
.foot-line a { color: inherit; text-decoration: none; }
.foot-line a:hover { color: var(--ink); }
.foot-line img { display: block; width: auto; }
.foot-line .logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.foot-line .logo .logo-mark {
  width: 2.5rem;
  height: 2.5rem;
}
.foot-line .logo-revisit { height: 18px; }

:root[data-theme="dark"] {
  --bg: #10120e;
  --ink: #efe7d6;
  --muted: #a39880;
  --soft: #d9d0c0;
  --line: #2e3428;
  --orange: #f38020;
  --orange-hover: #f3d2b0;
  --bar: #171a13;
  --bar-ink: #efe7d6;
  color-scheme: dark;
}

:root[data-theme="dark"] .bar { border-bottom: 1px solid var(--line); }

@media (max-width: 40rem) {
  .bar { align-items: flex-start; flex-direction: column; }
  .wrap { width: min(42rem, calc(100% - 2rem)); }
  main.wrap { padding-top: 2rem; }
  .study h2, .study h3 { font-size: 1.35rem; }
}
