:root {
  --paper: #f6f1e7;
  --paper-2: #efe6d6;
  --card: #fffdf8;
  --ink: #2a241d;
  --muted: #5f5547;
  --line: #d9ccb6;
  --blue: #1d3b63;
  --blue-soft: #e3eaf3;
  --gold: #8a6a2f;
  --amber-soft: #f6e8cc;
  --amber-ink: #6b4a10;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 46rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--serif);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: #0f2645; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.2; font-weight: 600; }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.15rem); margin: 0 0 1rem; color: var(--blue); }
h3 { font-size: 1.2rem; margin: 2rem 0 0.6rem; }
q { font-style: italic; }
.small { font-size: 0.92rem; color: var(--muted); }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.6rem 1rem; z-index: 20; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(246, 241, 231, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem;
  padding: 0.55rem 1rem 0.35rem;
}
.brand { font-weight: 600; text-decoration: none; color: var(--ink); white-space: nowrap; font-size: 1.05rem; }
.brand span { color: var(--muted); font-weight: 400; }
.top nav { flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -1rem; padding: 0 1rem; }
.top nav::-webkit-scrollbar { display: none; }
.top ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; white-space: nowrap; }
.top nav a {
  display: inline-block; font: 500 0.9rem/1 var(--sans); text-decoration: none; color: var(--muted);
  padding: 0.6rem 0.65rem; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center;
}
.top nav a:hover, .top nav a[aria-current="true"] { color: var(--blue); background: var(--blue-soft); }
@media (min-width: 900px) {
  .top { flex-wrap: nowrap; padding: 0.4rem 1.5rem; }
  .top nav { flex: 0 1 auto; margin: 0 0 0 auto; padding: 0; }
}

main section { max-width: var(--max); margin: 0 auto; padding: 3rem 1.25rem; border-bottom: 1px solid var(--line); }
main section:last-child { border-bottom: 0; }

.eyebrow { font: 600 0.78rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin: 0 0 0.6rem; }

.hero { max-width: 64rem; display: grid; gap: 1.25rem; padding-top: 1.5rem; }
.portrait { margin: 0 auto; max-width: 11.5rem; }
.portrait img {
  border-radius: 6px; width: 100%;
  box-shadow: 0 0 0 6px var(--card), 0 0 0 7px var(--line), 0 14px 30px rgba(60, 40, 10, 0.18);
  filter: sepia(0.18) contrast(1.03);
}
.portrait figcaption { font: 0.8rem/1.45 var(--sans); color: var(--muted); margin-top: 1rem; text-align: center; }
.hero h1 { font-size: clamp(2.2rem, 8vw, 3.4rem); margin: 0; color: var(--ink); }
.hero h1 span { display: block; font-weight: 400; font-size: 0.6em; color: var(--muted); margin-top: 0.2rem; }
.aka { font: 0.9rem var(--sans); color: var(--muted); margin: 0.4rem 0 0; }
.lede { font-size: 1.3rem; color: var(--blue); margin: 1rem 0; }
.zl { font-style: italic; color: var(--muted); }
.zl span { font-style: normal; margin-right: 0.4rem; color: var(--ink); }
@media (min-width: 760px) {
  .portrait { max-width: 16rem; }
  .hero { grid-template-columns: 17rem 1fr; align-items: start; gap: 3rem; padding-top: 3.5rem; }
  .portrait { position: sticky; top: 5rem; }
}

.tag {
  display: inline-block; font: 600 0.72rem/1 var(--sans); letter-spacing: 0.03em;
  padding: 0.3rem 0.5rem; border-radius: 4px; vertical-align: 0.1em; white-space: nowrap;
}
.tag.doc { background: var(--blue-soft); color: var(--blue); }
.tag.fam { background: var(--amber-soft); color: var(--amber-ink); }
.legend { font: 0.88rem/2 var(--sans); color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.9rem; }
.legend .tag.fam { margin-left: 0.3rem; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  background: var(--blue); color: #fff; text-decoration: none; border: 0; border-radius: 8px;
  padding: 0.75rem 1.3rem; font: 600 1rem/1.2 var(--sans); cursor: pointer;
}
.button:hover { background: #142c4b; color: #fff; }

.facts { list-style: none; padding: 0; margin: 0; }
.facts li { padding: 0.75rem 0; border-bottom: 1px dashed var(--line); }
.facts li:last-child { border-bottom: 0; }
.facts .tag { margin-right: 0.4rem; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.25rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.1rem 0.75rem; }
.timeline li::before { content: ""; position: absolute; left: -1.72rem; top: 0.45rem; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--paper); border: 2px solid var(--gold); }
.timeline time { display: block; font: 600 0.85rem var(--sans); color: var(--gold); }

.feature { max-width: 68rem !important; }
.feature > h2, .feature > h3, .feature > p, .feature > aside, .feature > .cols { max-width: var(--max); margin-left: auto; margin-right: auto; }
.feature > .eyebrow { max-width: var(--max); margin-left: auto; margin-right: auto; }
.committee { margin: 1.5rem -1.25rem 2rem; }
.photo-wrap { position: relative; background: #222; }
.photo-wrap img { width: 100%; }
.marker {
  display: none; position: absolute; transform: translate(-50%, -50%);
  width: 1.6rem; height: 1.6rem; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--gold); color: #fff; font: 700 0.95rem/1 var(--sans);
  box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0,0,0,0.5);
}
.m1 { left: 53%; top: 62%; }
.m2 { left: 79%; top: 62%; }
.m3 { left: 93%; top: 66%; }
.m4 { left: 17.5%; top: 62%; }
.photo-wrap.show .marker { display: flex; }
.toggle {
  margin: 0.75rem 1.25rem 0; min-height: 44px; padding: 0.5rem 1rem; border-radius: 999px;
  border: 1px solid var(--blue); background: var(--card); color: var(--blue); font: 600 0.92rem var(--sans); cursor: pointer;
}
.toggle[aria-pressed="true"] { background: var(--blue); color: #fff; }
.committee figcaption { font: 0.9rem/1.5 var(--sans); color: var(--muted); padding: 0.75rem 1.25rem 0; }
.committee figcaption strong { display: block; color: var(--ink); }
@media (min-width: 900px) {
  .committee { margin: 2rem auto; max-width: 65rem; }
  .photo-wrap { border-radius: 6px; overflow: hidden; box-shadow: 0 18px 40px rgba(40, 25, 5, 0.22); }
  .toggle, .committee figcaption { margin-left: 0; padding-left: 0; }
}
.cols { display: grid; gap: 0 2.5rem; }
@media (min-width: 900px) { .cols { grid-template-columns: 1fr 1fr; max-width: 65rem !important; } }
.who { padding-left: 1.4rem; }
.who li { margin-bottom: 0.5rem; }
.who li::marker { font: 700 1rem var(--sans); color: var(--gold); }
.inscription { border-radius: 4px; margin: 0.5rem 0 0.75rem; }

.careful { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 6px; padding: 0.25rem 1.25rem; margin-top: 2rem; }
.careful h3 { margin-top: 1rem; }

.sources { padding-left: 1.4rem; }
.sources li { margin-bottom: 1.25rem; }
.sources h3 { margin: 0 0 0.25rem; font-size: 1.08rem; }
.sources p { margin: 0.25rem 0; }

.tree { display: grid; gap: 0; justify-items: center; margin: 1.5rem 0 2rem; }
.gen { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; }
.person { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.9rem; text-align: center; min-width: 11rem; max-width: 17rem; }
.person strong { display: block; }
.person span { display: block; font: 0.82rem/1.4 var(--sans); color: var(--muted); }
.person.unknown { border-style: dashed; }
.person.wide { max-width: 22rem; }
.amp { font: 600 1.1rem var(--sans); color: var(--gold); }
.line { width: 2px; height: 1.6rem; background: var(--gold); }
@media (max-width: 560px) {
  .gen { flex-direction: column; gap: 0.2rem; }
  .person { min-width: 15rem; }
}

form { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; }
.field { margin-bottom: 1.1rem; }
label { display: block; font: 600 0.95rem/1.4 var(--sans); margin-bottom: 0.35rem; }
.req, .opt { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
input[type="text"], textarea {
  width: 100%; font: 1rem/1.5 var(--sans); color: var(--ink); background: #fff;
  border: 1px solid #b9aa90; border-radius: 6px; padding: 0.7rem 0.75rem; min-height: 48px;
}
input[type="text"]:focus, textarea:focus { border-color: var(--blue); outline: 3px solid rgba(29, 59, 99, 0.25); outline-offset: 0; }
[aria-invalid="true"] { border-color: #a2331f !important; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.25rem 0 1.25rem; }
.check input { width: 1.3rem; height: 1.3rem; margin-top: 0.15rem; flex: none; accent-color: var(--blue); }
.check label { font-weight: 400; margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { font: 0.98rem/1.5 var(--sans); padding: 0.85rem 1rem; border-radius: 8px; background: #e6f0e2; border: 1px solid #a9c79d; color: #24451b; }
.notice.err { background: #f7e3de; border-color: #d7a596; color: #7a2412; }

.memories { list-style: none; padding: 0; }
.memories li { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem; margin-bottom: 0.9rem; }
.memories p { margin: 0 0 0.5rem; white-space: pre-line; }
.memories .by { font: 0.88rem var(--sans); color: var(--muted); margin: 0; }

footer { background: var(--paper-2); border-top: 1px solid var(--line); padding: 2rem 1.25rem 2.5rem; text-align: center; }
footer p { max-width: var(--max); margin: 0.4rem auto; }

.comments { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.comments li, .rv li { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0.9rem 1.1rem; margin-bottom: 0.8rem; }
.comments li.empty { color: var(--muted); font-style: italic; }
.c-body { margin: 0 0 0.4rem; white-space: pre-line; overflow-wrap: anywhere; }
.by { font: 0.88rem/1.4 var(--sans); color: var(--muted); margin: 0; }
.form-h { margin-top: 0; }
.cf-turnstile { margin: 0.25rem 0 1rem; min-height: 65px; }
.private { margin-top: 2rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 0.25rem 1rem 1rem; }
.private summary { cursor: pointer; font: 600 1rem/1.4 var(--sans); color: var(--blue); padding: 0.75rem 0; min-height: 44px; }
.private[open] summary { margin-bottom: 0.25rem; }
.review { max-width: var(--max); margin: 0 auto; padding: 2rem 1.25rem; }
.review h1 { color: var(--blue); }
.rv { list-style: none; padding: 0; }
.rv li.is-hidden { opacity: 0.6; border-style: dashed; }
.acts { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.acts form { background: none; border: 0; padding: 0; }
.mini { min-height: 40px; padding: 0.4rem 0.9rem; border-radius: 6px; border: 1px solid var(--blue); background: var(--card); color: var(--blue); font: 600 0.9rem var(--sans); cursor: pointer; }
.mini.danger { border-color: #a2331f; color: #a2331f; }
