:root {
  --paper: #faf7f0;
  --paper-deep: #f1eadf;
  --ink: #1f1c18;
  --muted: #6f665b;
  --line: #d9cec0;
  --accent: #314c5f;
  --accent-2: #7a5f3f;
  --white: #fffdf8;
  --shadow: 0 18px 50px rgba(66, 50, 35, 0.12);
}

/* Base */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(122, 95, 63, 0.11), transparent 34rem),
    linear-gradient(180deg, var(--paper), #f8f3ea 60%, #fbf8f2);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}

/* Header / navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 247, 240, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  text-decoration: none;
  min-width: 190px;
}

.brand-mark {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 31px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.brand-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
}

.main-nav {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 14px;
}

.main-nav a {
  text-decoration: none;
  color: #433b33;
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--ink);
  border-bottom-color: var(--accent-2);
}

/* Typography */
.hero h1,
.page-hero h1,
h2,
h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 18px;
}

.lede {
  font-size: 20px;
  color: #4d463e;
  max-width: 720px;
  margin: 28px 0 0;
}

/* Hero */
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 96px 28px 72px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 54px;
  align-items: center;
}

.hero-single {
  grid-template-columns: minmax(0, 900px);
  justify-content: center;
}

.hero-single > div {
  max-width: 900px;
}

.hero h1 {
  font-size: clamp(48px, 7vw, 86px);
  margin: 0;
}

.hero-actions {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 18px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fffdf8;
}

.button.secondary {
  background: transparent;
  color: var(--accent);
}

/* Archive panel */
.archive-panel {
  background: rgba(255, 253, 248, 0.78);
  border: 1px solid var(--line);
  border-radius: 34px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-top {
  padding: 26px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.panel-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 30px;
  line-height: 1.1;
}

.panel-note {
  color: var(--muted);
  font-size: 14px;
  margin-top: 7px;
}

.record-strip {
  padding: 26px;
  display: grid;
  gap: 12px;
}

.record-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e7ded2;
  padding-bottom: 12px;
  color: #4a4239;
}

.record-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

/* Page hero */
.page-hero {
  max-width: 1040px;
  margin: 0 auto;
  padding: 82px 28px 48px;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(42px, 6vw, 68px);
  margin: 0;
}

.page-hero p {
  color: #514941;
  font-size: 19px;
  max-width: 760px;
  margin: 24px auto 0;
}

/* Breadcrumbs */
.breadcrumbs {
  max-width: 1120px;
  margin: 1.25rem auto 0;
  padding: 0 1.25rem;
  font-size: 0.86rem;
  color: rgba(72, 55, 34, 0.72);
}

.breadcrumbs a {
  color: rgba(72, 55, 34, 0.78);
  text-decoration: none;
  border-bottom: 1px solid rgba(72, 55, 34, 0.25);
}

.breadcrumbs a:hover {
  color: #3f2f1f;
  border-bottom-color: rgba(72, 55, 34, 0.55);
}

.breadcrumbs span {
  margin: 0 0.35rem;
}

.breadcrumbs span:last-child {
  color: rgba(45, 34, 22, 0.95);
}

/* Sections and grids */
.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 28px 72px;
}

.section.narrow {
  max-width: 850px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 28px;
}

.section-title h2 {
  margin: 0;
  font-size: 38px;
}

.section-title p {
  margin: 0;
  color: var(--muted);
  max-width: 420px;
}

.grid {
  display: grid;
  gap: 22px;
  margin-bottom: 1.5rem;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section > .card + .grid {
  margin-top: 1.75rem;
}

/* Cards */
.card {
  background: rgba(255, 253, 248, 0.78);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px;
  box-shadow: 0 10px 35px rgba(66, 50, 35, 0.08);
  cursor: default;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 28px;
}

.card p {
  margin: 0 0 1rem;
  color: #554d44;
}

.meta {
  color: var(--accent-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 800;
  margin-bottom: 10px;
}

.link-card,
.card.link-card {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(66, 50, 35, 0.11);
  border-color: rgba(122, 95, 63, 0.32);
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card-link h3 {
  color: inherit;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag {
  border: 1px solid #d8cbbc;
  background: #f6efe5;
  color: #645847;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
}

/* Text panels */
.prose {
  max-width: 800px;
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 34px;
  box-shadow: 0 10px 35px rgba(66, 50, 35, 0.07);
  line-height: 1.7;
  font-size: 1.05rem;
}

.prose p {
  margin: 0 0 1.2rem;
  font-size: 18px;
  color: #4d453d;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose h3 {
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
}

.text-panel {
  background: rgba(255, 253, 248, 0.46);
  border: 1px solid rgba(217, 206, 192, 0.72);
  border-radius: 22px;
  padding: 1.5rem 1.65rem;
}

.text-panel p {
  margin: 0 0 1.1rem;
  color: #4d453d;
}

.text-panel p:last-child {
  margin-bottom: 0;
}

.note-banner {
  margin: 2rem auto;
  padding: 1rem 1.25rem;
  max-width: 800px;
  background: rgba(20, 30, 40, 0.04);
  border-left: 3px solid #2c3e50;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #2c3e50;
}

/* Search */
.search-box {
  width: min(100%, 520px);
  margin: 0 auto 28px;
  display: block;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.82);
  font-size: 15px;
  outline: none;
}

.search-box:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(49, 76, 95, 0.1);
}

/* Timeline */
.timeline {
  display: grid;
  gap: 18px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  align-items: start;
}

.timeline-date {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* Dots */
.dot {
  width: 6px;
  height: 6px;
  background: #555;
  border-radius: 50%;
  flex: none;
}

.dot.strong {
  width: 8px;
  height: 8px;
  background: #222;
}

.dot.faint {
  background: #aaa;
}

/* Overview page */
.overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(340px, 460px);
  column-gap: 1rem;
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
}

.overview-layout .prose {
  max-width: none;
  width: 100%;
}

.overview-sidebar {
  position: static;
  width: 100%;
}

.overview-image-card {
  background: #f4f1ea;
  border: 1px solid rgba(60, 45, 25, 0.14);
  border-radius: 18px;
  padding: 0.5rem;
  margin-bottom: 1.5rem;
}

.overview-image-card img {
  width: 100%;
  display: block;
  border-radius: 12px;
  cursor: zoom-in;
}

.overview-image-card figcaption {
  margin-top: 0.7rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #6b6257;
}

/* Documents and records */
.document-placeholder {
  height: 210px;
  border-radius: 18px;
  border: 1px dashed #cbbca9;
  background: linear-gradient(135deg, #efe6d8, #fbf7ee);
  display: grid;
  place-items: center;
  color: var(--muted);
  margin-bottom: 18px;
}

.document-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
  max-width: 100%;
  justify-items: center;
}

.document-figure {
  margin: 0;
  background: #f4f1ea;
  border: 1px solid rgba(60, 45, 25, 0.14);
  border-radius: 18px;
  padding: 0.6rem;
  width: 100%;
  max-width: 680px;
  overflow: hidden;
}

.document-figure.compact {
  max-width: 320px;
  margin: 1.5rem auto;
}

.document-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: contain;
}

.document-figure figcaption {
  margin-top: 0.7rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #6b6257;
}

.record-gallery {
  display: grid;
  gap: 1.25rem;
}

.record-exhibit {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
  gap: 1.25rem;
  align-items: start;
  background: #fffaf2;
  border: 1px solid rgba(60, 45, 25, 0.12);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 8px 20px rgba(60, 45, 25, 0.05);
}

.record-exhibit-text h3 {
  margin-top: 0.25rem;
}

.record-thumb {
  margin: 0;
  background: #f4f1ea;
  border: 1px solid rgba(60, 45, 25, 0.14);
  border-radius: 14px;
  padding: 0.5rem;
  overflow: hidden;
}

.record-thumb img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
  border-radius: 10px;
}

/* Context image galleries */
.context-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.context-gallery.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

.context-gallery.two .context-figure img {
  height: 300px;
  object-fit: contain;
}

.context-gallery + p,
.context-gallery + .text-panel,
.context-gallery + h3,
.context-gallery + h4 {
  margin-top: 1rem;
}

.context-figure {
  margin: 0;
  background: #f4f1ea;
  border: 1px solid rgba(60, 45, 25, 0.14);
  border-radius: 18px;
  padding: 0.65rem;
}

.context-figure img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
}

.context-figure figcaption {
  margin-top: 0.7rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #5c5246;
}

/* Surname meaning / stamp layout */
.meaning-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 1.5rem;
  align-items: start;
}

.meaning-text p:first-child {
  margin-top: 0;
}

.meaning-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 1.25rem;
  align-items: start;
}

.stamp-aside {
  margin: 0;
  background: #f4f1ea;
  border: 1px solid rgba(60, 45, 25, 0.14);
  border-radius: 16px;
  padding: 0.5rem;
}

.stamp-aside img {
  display: block;
  width: 100%;
  max-height: 245px;
  object-fit: contain;
  border-radius: 10px;
}

.stamp-aside figcaption {
  margin-top: 0.55rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #6b6257;
}

/* Map */
.map-section {
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
}

.map-feature {
  margin: 0 auto;
  width: fit-content;
  max-width: 720px;
  background: #f4f1ea;
  border: 1px solid rgba(60, 45, 25, 0.14);
  border-radius: 22px;
  padding: 0.75rem;
  box-shadow: 0 10px 28px rgba(60, 45, 25, 0.06);
  overflow: hidden;
}

.map-feature img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  margin-left: auto;
  margin-right: auto;
}

.map-feature figcaption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #5c5246;
  text-align: center;
}

/* Split cards with media */
.card-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
  gap: 1.35rem;
  align-items: start;
}

.card-split-text p:first-child {
  margin-top: 0;
}

.card-split-text p:last-child {
  margin-bottom: 0;
}

.card-split-media {
  margin: 0;
  width: 100%;
  background: #f4f1ea;
  border: 1px solid rgba(60, 45, 25, 0.14);
  border-radius: 14px;
  padding: 0.5rem;
}

.card-split-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: contain;
  border-radius: 10px;
}

.card-split-media figcaption {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #6d6252;
  text-align: center;
}

.card-split-media-stack {
  display: grid;
  gap: 1rem;
}

.card-split-media-stack .card-split-media img {
  max-height: 380px;
}

/* Lightbox */
.lightbox-link {
  display: block;
  cursor: zoom-in;
}

.lightbox-link img {
  display: block;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(24, 18, 12, 0.82);
}

.lightbox.is-open {
  display: flex;
}

.lightbox-inner {
  margin: 0;
  max-width: min(1100px, 94vw);
  max-height: 92vh;
  display: grid;
  gap: 0.75rem;
}

.lightbox-inner {
  margin: 0;
  max-width: min(1100px, 94vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.lightbox-inner img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  background: #f4f1ea;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.lightbox-inner figcaption {
  display: block;
  width: 100%;
  max-width: min(900px, 90vw);
  color: #f8f1e7;
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}


.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  left: auto;
  z-index: 10000;

  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(255, 248, 236, 0.45);
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.12);
  color: #fff8ec;

  font-size: 2rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 248, 236, 0.22);
}

body.lightbox-open {
  overflow: hidden;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 28px;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

/* Tablet and mobile layout */
@media (max-width: 1000px) {
  .overview-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .header-inner {
    position: relative;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 64px;
  }

  .hero-single {
    grid-template-columns: 1fr;
  }

  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-flex;
    border: 1px solid var(--line);
    background: transparent;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
  }

  .main-nav {
    display: none;
    position: absolute;
    left: 18px;
    right: 18px;
    top: calc(100% + 10px);
    z-index: 20;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px;
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: start;
    gap: 12px;
  }

  .main-nav.open {
    display: flex;
  }

  .section-title {
    display: block;
  }

  .section-title h2 {
    margin-bottom: 10px;
  }

  .timeline-item,
  .record-exhibit,
  .card-split,
  .meaning-card,
  .meaning-layout {
    grid-template-columns: 1fr;
  }

  .card-split {
    gap: 1rem;
  }

  .card-split-media {
    max-width: none;
    margin: 0;
  }

  .card-split-media img,
  .card-split-media-stack .card-split-media img {
    max-height: none;
  }

  .record-thumb img {
    max-height: none;
  }

  .context-gallery,
  .context-gallery.two {
    grid-template-columns: 1fr;
  }

  .context-figure img,
  .context-gallery.two .context-figure img {
    height: auto;
    max-height: 360px;
    object-fit: contain;
  }
}

@media (max-width: 760px) {
  .header-inner {
    padding: 16px 14px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    font-size: 28px;
  }

  .brand-subtitle {
    font-size: 10px;
    letter-spacing: 0.16em;
  }

  .breadcrumbs {
    padding-left: 14px;
    padding-right: 14px;
  }

  .section {
    padding: 42px 14px 60px;
  }

  .page-hero {
    padding: 64px 18px 42px;
  }

  .page-hero p {
    font-size: 17px;
  }

  .section-title h2 {
    font-size: 34px;
  }

  .card {
    padding: 20px;
    border-radius: 20px;
  }

  .prose {
    padding: 24px;
    border-radius: 22px;
  }

  .prose p {
    font-size: 17px;
  }

  .text-panel {
    padding: 1.2rem 1.25rem;
  }

  .grid {
    gap: 16px;
  }

  .map-feature {
    padding: 0.45rem;
    border-radius: 16px;
  }

  .map-feature img {
    border-radius: 12px;
  }

  .stamp-aside {
    max-width: 170px;
    margin: 0 auto;
  }

  .lightbox {
    padding: 1rem;
  }

  .lightbox-inner img {
    max-height: 78vh;
  }
}

@media (max-width: 480px) {
  .section {
    padding-left: 10px;
    padding-right: 10px;
  }

  .page-hero {
    padding-left: 14px;
    padding-right: 14px;
  }

  .card {
    padding: 16px;
  }

  .meta {
    font-size: 11px;
    letter-spacing: 0.11em;
  }

  .main-nav {
    left: 10px;
    right: 10px;
  }
}

.table-wrap {
  overflow-x: auto;
  margin-top: 1.5rem;
}

.record-context-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: #f8f4ec;
  border: 1px solid rgba(60, 45, 25, 0.18);
}

.record-context-table th,
.record-context-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(60, 45, 25, 0.14);
  vertical-align: top;
  text-align: left;
}

.record-context-table th {
  background: #eadfc9;
  color: #2f2418;
  font-weight: 700;
}

.record-context-table td {
  color: #3f3327;
}

.record-context-table tr:last-child td {
  border-bottom: none;
}