:root {
  --paper: #f7f3ec;
  --paper-deep: #efe9dc;
  --card: #fffdf8;
  --ink: #23211b;
  --muted: #6f6a5e;
  --line: #d9d2c2;
  --line-strong: #b8b0a0;
  --green: #1f5c45;
  --green-deep: #143d2e;
  --brick: #a8402f;
  --amber: #9a7418;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --content-max: 860px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.65;
  font-size: 17px;
}

a { color: var(--green); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--green-deep); }

/* ===== Layout: fixed left rail + content ===== */
.layout { display: flex; min-height: 100vh; }

aside.side {
  width: 232px;
  flex: 0 0 232px;
  border-right: 1px solid var(--line);
  padding: 36px 28px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.15;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.brand:hover { color: var(--ink); }
.brand span { display: block; color: var(--green); font-style: italic; font-weight: 400; }

.side-tag {
  font-family: var(--sans);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 10px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

nav.main {
  display: flex;
  flex-direction: column;
  margin-top: 22px;
  gap: 2px;
}
nav.main a {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink);
  text-decoration: none;
  padding: 7px 0 7px 14px;
  border-left: 2px solid transparent;
}
nav.main a:hover { color: var(--green); border-left-color: var(--line-strong); }
nav.main a.current { color: var(--green); border-left-color: var(--green); font-weight: 600; }

.side-foot {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

main.content { flex: 1; min-width: 0; }

.wrap {
  max-width: var(--content-max);
  margin: 0;
  padding: 0 56px;
}

/* ===== Masthead (was hero) ===== */
.hero {
  padding: 64px 0 36px;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 8px;
}
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  max-width: 720px;
}
.hero p.lead {
  font-size: 1.12rem;
  font-style: italic;
  color: var(--muted);
  max-width: 620px;
  margin: 0 0 26px;
}
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 2px;
  text-decoration: none;
}
.btn-primary { background: var(--green); color: #f7f3ec; border: 1px solid var(--green); }
.btn-primary:hover { background: var(--green-deep); border-color: var(--green-deep); color: #f7f3ec; }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }

/* ===== Stats: ledger row, not cards ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 34px 56px 0;
  max-width: calc(var(--content-max) - 112px);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.stat-card { padding: 18px 18px 16px 0; }
.stat-card + .stat-card { padding-left: 18px; border-left: 1px solid var(--line); }
.stat-card .num { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--green-deep); line-height: 1.1; }
.stat-card .label { font-family: var(--sans); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-top: 5px; }

/* ===== Sections ===== */
section.block { padding: 44px 0 8px; }
section.block h2 {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 6px;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
  max-width: 720px;
}
section.block h2 + p.subtle {
  font-family: var(--sans);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 20px;
}
section.block p { max-width: 700px; }
section.block.alt { background: transparent; }

/* Findings: numbered editorial list */
.findings { display: grid; grid-template-columns: 1fr; gap: 0; max-width: 720px; }
.finding-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.finding-card:first-child { border-top: none; }
.finding-card .n {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-style: italic;
  color: var(--green);
  line-height: 1;
  background: none;
  width: auto; height: auto;
}
.finding-card p { margin: 0; }

figure.centered { margin: 10px 0 30px; }
figure.centered img {
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px;
}
figure.centered figcaption {
  font-family: var(--sans);
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 10px;
  max-width: 640px;
}

/* ===== Data files table ===== */
table.files {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.9rem;
}
table.files th, table.files td {
  text-align: left;
  padding: 13px 16px 13px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.files th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 2px solid var(--ink);
  background: none;
}
table.files code {
  font-size: 0.82rem;
  background: var(--paper-deep);
  padding: 2px 6px;
  border-radius: 2px;
  white-space: nowrap;
}
table.files .btn { padding: 6px 14px; font-size: 0.8rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 26px 30px;
  max-width: 720px;
}
.card p { max-width: none; }

pre.bibtex {
  background: var(--green-deep);
  color: #e9e4d8;
  padding: 18px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.55;
}

/* ===== Contribute ===== */
.contrib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 820px; }
.contrib-grid .card { max-width: none; }
.contrib-grid .card h3 { margin-top: 0; font-size: 1.15rem; }

form.feedback { font-family: var(--sans); }
form.feedback label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin: 15px 0 5px;
}
form.feedback input,
form.feedback select,
form.feedback textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #fff;
  font-size: 0.95rem;
  font-family: var(--sans);
}
form.feedback input:focus, form.feedback textarea:focus { outline: 2px solid var(--green); outline-offset: -1px; }
form.feedback textarea { min-height: 130px; resize: vertical; }
.hp-field { position: absolute; left: -9999px; top: -9999px; }
form.feedback button {
  margin-top: 18px;
  background: var(--green);
  color: #f7f3ec;
  border: 1px solid var(--green);
  padding: 11px 22px;
  border-radius: 2px;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--sans);
  cursor: pointer;
}
form.feedback button:hover { background: var(--green-deep); }
.form-note { font-family: var(--sans); font-size: 0.82rem; color: var(--muted); margin-top: 10px; }

/* ===== Team ===== */
.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 820px; }
.team-grid .card { max-width: none; }
.team-card h3 { margin: 0 0 2px; font-size: 1.2rem; }
.team-card .role {
  font-family: var(--sans);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

/* ===== Footer ===== */
footer.site {
  border-top: 1px solid var(--line-strong);
  margin-top: 56px;
  padding: 26px 0 44px;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
}
footer.site .wrap { display: flex; flex-direction: column; gap: 6px; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--green); }
footer.site .cite-as {
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.5;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  margin-bottom: 12px;
  max-width: 720px;
}
footer.site .cite-as strong { display: block; color: var(--green-deep); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; margin-bottom: 4px; }
footer.site .cite-as a { color: var(--green); }

.side-foot strong {
  display: block;
  color: var(--green-deep);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.66rem;
  margin-bottom: 4px;
}

/* ===== Responsive ===== */
@media (max-width: 880px) {
  .layout { flex-direction: column; }
  aside.side {
    width: 100%;
    flex: none;
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line-strong);
    padding: 22px 24px 14px;
  }
  .brand span { display: inline; }
  .side-tag { border-bottom: none; padding-bottom: 0; }
  nav.main { flex-direction: row; flex-wrap: wrap; gap: 2px 18px; margin-top: 12px; }
  nav.main a { padding: 4px 0; border-left: none; border-bottom: 2px solid transparent; }
  nav.main a.current { border-bottom-color: var(--green); }
  .side-foot { display: none; }
  .wrap { padding: 0 24px; }
  .hero { padding: 36px 0 26px; }
  .stats { margin: 26px 24px 0; grid-template-columns: repeat(2, 1fr); max-width: none; }
  .stat-card:nth-child(odd) { padding-left: 0; border-left: none; }
  .stat-card:nth-child(n+3) { border-top: 1px solid var(--line); }
  .contrib-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .finding-card { grid-template-columns: 44px 1fr; }
}
