:root {
  --chalk: #f3efe6;
  --paper: #fbfaf6;
  --limewash: #e6dfd1;
  --timber: #6f4d35;
  --dark-timber: #3a2b22;
  --iron: #141414;
  --moss: #53695a;
  --blue: #516575;
  --brick: #9b5b43;
  --gold: #b9925a;
  --line: #d8d0c1;
  --muted: #6f6a60;
  --shadow: 0 18px 40px rgba(33, 28, 22, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--iron);
  background:
    linear-gradient(180deg, rgba(243, 239, 230, 0.94), rgba(251, 250, 246, 0.98)),
    repeating-linear-gradient(90deg, rgba(111, 77, 53, 0.04) 0 1px, transparent 1px 18px);
  line-height: 1.55;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 54px);
  background: rgba(251, 250, 246, 0.93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 220px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--dark-timber);
  background: var(--chalk);
  color: var(--dark-timber);
  font-weight: 800;
}

.brand strong { display: block; font-size: 0.98rem; }
.brand small { display: block; color: var(--muted); font-size: 0.78rem; }

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.site-nav a {
  padding: 8px 10px;
  text-decoration: none;
  border-radius: 6px;
  color: #3d3831;
  font-size: 0.92rem;
}

.site-nav a:hover,
.site-nav a.active {
  background: var(--dark-timber);
  color: var(--paper);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 9px 12px;
  border-radius: 6px;
  font: inherit;
}

main { padding-bottom: 54px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  gap: clamp(26px, 5vw, 64px);
  align-items: center;
  min-height: 640px;
  padding: clamp(32px, 5vw, 68px) clamp(18px, 5vw, 72px) clamp(26px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
}

.hero h1,
.page-title h1 {
  margin: 0;
  max-width: 940px;
  font-size: clamp(2.2rem, 6vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p,
.page-title p {
  max-width: 780px;
  color: #4f493f;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
}

.hero-visual {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero-actions,
.quick-links,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button,
.quick-links a,
.filter-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid var(--dark-timber);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
}

.button.primary,
.quick-links a:hover,
.filter-row button.active {
  background: var(--dark-timber);
  color: var(--paper);
}

.button.secondary,
.quick-links a,
.filter-row button {
  background: rgba(251, 250, 246, 0.86);
  color: var(--dark-timber);
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 780px;
  margin: 24px 0 0;
}

.hero-facts div {
  padding: 12px;
  background: rgba(251, 250, 246, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hero-facts dt {
  color: var(--brick);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.hero-facts dd {
  margin: 4px 0 0;
  font-weight: 750;
}

.entry-grid,
.section-grid,
.dashboard-grid,
.card-grid,
.story-grid,
.gallery-grid,
.metric-grid,
.phase-grid,
.fact-strip,
.content-band {
  width: min(1180px, calc(100% - 36px));
  margin: 26px auto 0;
}

.fact-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.fact-strip article {
  display: grid;
  gap: 6px;
  min-height: 130px;
  padding: 18px;
  background: rgba(251, 250, 246, 0.94);
}

.fact-strip strong {
  color: var(--dark-timber);
  font-size: 1.1rem;
}

.fact-strip span {
  color: #4f493f;
}

.content-band {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 18px;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.entry-panel,
.panel,
.story-block,
.person-card,
.building-card,
.gallery-card,
.timeline-item,
.phase-card {
  background: rgba(251, 250, 246, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(33, 28, 22, 0.07);
}

.entry-panel {
  min-height: 220px;
  padding: clamp(22px, 4vw, 38px);
  text-decoration: none;
  border-left: 8px solid var(--moss);
}

.entry-panel:nth-child(2) { border-left-color: var(--brick); }
.entry-panel h2 { margin: 8px 0 10px; font-size: clamp(1.6rem, 3vw, 2.6rem); }
.panel-kicker,
.eyebrow {
  margin: 0 0 8px;
  color: var(--brick);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-grid,
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  padding: clamp(18px, 3vw, 26px);
}

.wide { grid-column: span 2; }

.section-heading h2,
.panel h2,
.story-block h2 {
  margin: 0 0 12px;
  line-height: 1.14;
}

.progress-stack {
  display: grid;
  gap: 12px;
}

.progress-item {
  display: grid;
  gap: 6px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 750;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  background: var(--limewash);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.progress-fill {
  height: 100%;
  width: var(--value);
  background: linear-gradient(90deg, var(--moss), var(--blue));
}

.progress-note,
.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.mini-list {
  display: grid;
  gap: 12px;
}

.mini-item {
  padding: 12px;
  background: var(--chalk);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.mini-item strong { display: block; }
.mini-item small { color: var(--muted); }
.mini-sources {
  display: block;
  margin-top: 8px;
  font-weight: 750;
}

.quick-links {
  width: min(1180px, calc(100% - 36px));
  margin: 26px auto 0;
}

.page-title {
  padding: clamp(42px, 7vw, 82px) clamp(18px, 5vw, 72px) 24px;
}

.story-title {
  background: linear-gradient(120deg, rgba(83, 105, 90, 0.12), rgba(155, 91, 67, 0.12));
  border-bottom: 1px solid var(--line);
}

.story-grid,
.card-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.reading-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.reading-guide div {
  padding: 14px;
  background: var(--chalk);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.reading-guide strong {
  display: block;
  margin-bottom: 6px;
}

.source-promise {
  border-left: 8px solid var(--moss);
}

.story-block,
.person-card,
.building-card,
.gallery-card,
.timeline-item,
.phase-card {
  padding: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.78rem;
  font-weight: 800;
}

.documented { color: var(--moss); }
.probable { color: var(--blue); }
.hypothesis, .foreloebig { color: var(--brick); }
.unknown, .open { color: #6d6254; }
.project-source { color: var(--gold); }

.timeline-list {
  width: min(980px, calc(100% - 36px));
  margin: 18px auto 0;
  display: grid;
  gap: 14px;
  position: relative;
}

.timeline-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.timeline-year {
  color: var(--dark-timber);
  font-size: 1.4rem;
  font-weight: 900;
}

.phase-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.phase-card,
.metric-card {
  min-height: 150px;
  padding: 16px;
  background: var(--chalk);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-number {
  display: block;
  margin: 8px 0;
  font-size: 2rem;
  font-weight: 900;
  color: var(--dark-timber);
}

.check-list {
  margin: 0;
  padding-left: 20px;
}

.check-list li { margin-bottom: 8px; }

.table-wrap { overflow-x: auto; }
.source-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
}
.source-table th,
.source-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.source-table th {
  background: var(--chalk);
  color: var(--dark-timber);
}

.gallery-card {
  padding: 0;
  overflow: hidden;
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--chalk);
  border-bottom: 1px solid var(--line);
}

.gallery-body { padding: 18px; }

.meta-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin-top: 12px;
  font-size: 0.92rem;
}

.meta-grid dt { color: var(--muted); }
.meta-grid dd { margin: 0; font-weight: 700; }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 4vw, 54px);
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
}

.site-footer strong,
.site-footer span { display: block; }
.site-footer a { color: var(--dark-timber); font-weight: 800; }

@media (max-width: 940px) {
  .site-header { align-items: flex-start; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    left: 18px;
    right: 18px;
    top: 72px;
    padding: 12px;
    justify-content: flex-start;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .hero-visual { max-width: 560px; }
  .hero-facts { grid-template-columns: 1fr; }
  .entry-grid,
  .section-grid,
  .dashboard-grid,
  .story-grid,
  .card-grid,
  .gallery-grid,
  .phase-grid,
  .metric-grid,
  .fact-strip,
  .content-band,
  .reading-guide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wide { grid-column: span 2; }
}

@media (max-width: 620px) {
  .site-header {
    padding: 12px 14px;
  }
  .brand { min-width: 0; }
  .brand small { display: none; }
  .site-nav { left: 12px; right: 12px; }
  .hero h1,
  .page-title h1 {
    font-size: 2.2rem;
    line-height: 1.04;
  }
  .entry-grid,
  .section-grid,
  .dashboard-grid,
  .story-grid,
  .card-grid,
  .gallery-grid,
  .phase-grid,
  .metric-grid,
  .fact-strip,
  .content-band,
  .reading-guide {
    grid-template-columns: 1fr;
  }
  .wide { grid-column: span 1; }
  .timeline-item {
    grid-template-columns: 1fr;
  }
  .site-footer {
    display: grid;
  }
}
