:root {
  --paper: #efe6d4;
  --paper-2: #f7f1e6;
  --ink: #1c1915;
  --ink-soft: #4e463c;
  --rule: #cbbfa8;
  --lagoon: #0f5c56;
  --lagoon-deep: #083f3b;
  --cane: #a97832;
  --clay: #8c3b2c;
  --moss: #246246;
  --stamp: #7d2430;
  --shadow: 0 16px 40px rgba(28, 25, 21, 0.08);
  --serif: "Fraunces", "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.55;
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, rgba(28, 25, 21, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(28, 25, 21, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
}

.watermark {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='180'%3E%3Ctext x='150' y='100' text-anchor='middle' fill='%231c1915' font-family='sans-serif' font-size='16' font-weight='600' transform='rotate(-24 150 90)'%3Eassets.mkweli.tech%3C/text%3E%3C/svg%3E");
  background-repeat: repeat;
}

a { color: var(--lagoon-deep); }
a:hover { color: var(--clay); }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: white;
  padding: 0.5rem 0.8rem;
  z-index: 30;
}
.skip:focus { top: 0.5rem; }

.hub-bar {
  background: var(--ink);
  color: #f3ecdf;
  padding: 0.45rem 1.25rem;
  font-size: 0.92rem;
}
.hub-bar a { color: #f3ecdf; }
.hub-bar p { margin: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(239, 230, 212, 0.94);
  border-bottom: 1px solid var(--ink);
  backdrop-filter: blur(12px);
}

.gazette {
  margin: 0;
  padding: 0.35rem 1.25rem;
  background: var(--lagoon-deep);
  color: #f3ecdf;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.7rem;
  background: var(--lagoon-deep);
  color: #f3ecdf;
  font-family: var(--serif);
  font-weight: 640;
}
.brand strong { display: block; font-size: 1.15rem; }
.brand small { color: var(--ink-soft); font-size: 0.85rem; }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper-2);
}
.lang-switch button {
  border: 0;
  background: transparent;
  padding: 0.4rem 0.85rem;
  font: inherit;
  cursor: pointer;
}
.lang-switch button[aria-checked="true"] {
  background: var(--lagoon-deep);
  color: #f3ecdf;
}

main { max-width: 1100px; margin: 0 auto; padding: 1.25rem; }

.hero {
  background: var(--paper-2);
  border: 1px solid var(--ink);
  border-radius: 1.1rem;
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.1rem;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 640;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  line-height: 1.15;
  margin: 0 0 0.6rem;
}
.lede { margin: 0; color: var(--ink-soft); font-size: 1.08rem; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.7rem;
  margin-bottom: 1.1rem;
}
.stat-item {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
}
.stat-value { display: block; font-family: var(--serif); font-size: 1.55rem; font-weight: 640; }
.stat-label { color: var(--ink-soft); font-size: 0.92rem; }

.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}
.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.filters input,
.filters select {
  font: inherit;
  font-size: 1.05rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--ink);
  border-radius: 0.7rem;
  background: #fffdf8;
  color: var(--ink);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--ink);
  border-radius: 1rem;
  background: #fffdf8;
  box-shadow: var(--shadow);
}
table.people {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  font-size: 1rem;
}
table.people th,
table.people td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
table.people th {
  position: sticky;
  top: 0;
  background: var(--lagoon-deep);
  color: #f3ecdf;
  font-weight: 560;
  font-size: 0.92rem;
}
table.people tbody tr { cursor: pointer; }
table.people tbody tr:hover { background: rgba(15, 92, 86, 0.08); }
table.people td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.people a.row-name {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}
table.people a.row-name:hover { color: var(--clay); text-decoration: underline; }
.pdf-link {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--lagoon);
  color: var(--lagoon-deep);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}
.pdf-link:hover { background: var(--lagoon-deep); color: #f3ecdf; }

.meta-line {
  margin: 0.6rem 0 1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.person-view { display: none; }
body[data-view="person"] .list-view { display: none; }
body[data-view="person"] .person-view { display: block; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
  font-weight: 560;
  text-decoration: none;
  color: var(--lagoon-deep);
}
.person-card {
  background: var(--paper-2);
  border: 1px solid var(--ink);
  border-radius: 1.1rem;
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
}
.person-card h1 {
  font-family: var(--serif);
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
}
.person-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}
.pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 92, 86, 0.12);
  color: var(--lagoon-deep);
  font-size: 0.9rem;
}

.section-block {
  margin: 1.1rem 0;
  padding-top: 0.7rem;
  border-top: 1px solid var(--rule);
}
.section-block h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  margin: 0 0 0.45rem;
}
.none {
  color: var(--ink-soft);
  font-style: italic;
  margin: 0;
}
.asset-list {
  margin: 0;
  padding-left: 1.15rem;
}
.asset-list li { margin: 0.25rem 0; }

.pdf-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.sheet {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 1rem;
  padding: 1.1rem 1.25rem;
  margin: 1.2rem 0;
}
.sheet h2 {
  font-family: var(--serif);
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}
.sheet p { margin: 0.4rem 0; color: var(--ink-soft); }

.site-footer {
  max-width: 1100px;
  margin: 0 auto 2rem;
  padding: 0 1.25rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.site-footer a { color: var(--lagoon-deep); }

/* Small visit counter in the footer */
.site-footer .visit-counter {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}
.site-footer .visit-counter[hidden] { display: none; }

@media (max-width: 800px) {
  .filters { grid-template-columns: 1fr; }
  table.people { font-size: 0.95rem; min-width: 720px; }
  main { padding: 0.9rem; }
  .hero { padding: 1.1rem; }
}
