:root {
  --page-bg: #efe7d6;
  --paper-bg: #fdfbf5;
  --ink: #2f2a22;
  --muted-ink: #6f6658;
  --rule: #c8b37a;
  --rule-soft: #ddd2b8;
  --accent: #5f4a1f;
  --link: #075b9a;
  --box-bg: #f6f0e4;
  --shadow: rgba(34, 25, 10, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.65;
}

.site-header,
.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 24px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.site-title {
  font-size: 1.05rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: bold;
}

.site-nav a,
.back-link,
.bio-link {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.site-nav a:hover,
.back-link:hover,
.bio-link:hover {
  border-bottom-style: solid;
}

.page-wrap {
  max-width: 1120px;
  margin: 0 auto 48px;
  padding: 0 24px;
}

.biography-page {
  background: var(--paper-bg);
  border: 1px solid var(--rule-soft);
  border-radius: 10px;
  box-shadow: 0 8px 28px var(--shadow);
  overflow: hidden;
}

.hero {
  padding: 34px 42px 26px;
  background: linear-gradient(180deg, #fffdf8 0%, #f7f0e3 100%);
  border-bottom: 2px solid var(--rule);
}

.kicker {
  margin: 0 0 6px;
  color: var(--muted-ink);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .82rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  color: var(--accent);
  line-height: 1.1;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted-ink);
  font-size: 1.1rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 34px;
  padding: 34px 42px 42px;
}

.main-content h2,
.aside-card h2,
.gallery-section h2 {
  color: var(--accent);
  margin-top: 0;
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: 7px;
}

.main-content p {
  text-align: justify;
  text-indent: 1.75em;
  margin: 0 0 1.15em;
}

.main-content p.first {
  text-indent: 0;
}

.infobox,
.aside-card {
  background: var(--box-bg);
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 22px;
}

.infobox h2 {
  text-align: center;
  margin-bottom: 12px;
}

.fact-list {
  margin: 0;
}

.fact-list div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(200, 179, 122, .45);
}

.fact-list div:first-child {
  border-top: 0;
}

.fact-list dt {
  font-weight: bold;
  color: var(--accent);
}

.fact-list dd {
  margin: 0;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  border-left: 3px solid var(--rule);
  padding: 0 0 14px 14px;
  position: relative;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline time {
  display: block;
  font-weight: bold;
  color: var(--accent);
}

.gallery-section {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 28px;
  border-top: 2px solid var(--rule);
}

.gallery-note {
  color: var(--muted-ink);
  margin-top: -4px;
}

.thumbnail-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.document-thumb {
  border: 1px solid var(--rule-soft);
  background: #fffaf0;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 2px 7px rgba(0,0,0,.12);
  transition: transform .15s ease, box-shadow .15s ease;
}

.document-thumb:hover,
.document-thumb:focus {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(0,0,0,.20);
  outline: 2px solid rgba(7, 91, 154, .25);
}

.document-thumb img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  border: 4px solid white;
  box-shadow: 0 1px 5px rgba(0,0,0,.2);
  background: #eee;
}

.document-thumb span {
  display: block;
  margin-top: 9px;
  font-weight: bold;
  line-height: 1.25;
}

.document-thumb small {
  display: block;
  margin-top: 4px;
  color: var(--muted-ink);
}

.viewer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 8, 4, .88);
  color: white;
  padding: 24px;
}

.viewer.open {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}

.viewer-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.viewer-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
}

.viewer-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.viewer button {
  appearance: none;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.1);
  color: white;
  border-radius: 5px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 1rem;
}

.viewer button:hover,
.viewer button:focus {
  background: rgba(255,255,255,.22);
}

.viewer-stage {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.viewer-stage.dragging {
  cursor: grabbing;
}

.viewer-stage img {
  max-width: 92vw;
  max-height: 76vh;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  background: white;
  padding: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,.65);
}

.viewer-caption {
  margin: 0 auto;
  max-width: 900px;
  text-align: center;
  color: rgba(255,255,255,.88);
  font-size: .95rem;
}

.site-footer {
  color: var(--muted-ink);
  font-size: .9rem;
}

@media (max-width: 850px) {
  .site-header {
    display: block;
  }

  .content-grid {
    grid-template-columns: 1fr;
    padding: 26px 22px 30px;
  }

  .hero {
    padding: 26px 22px 22px;
  }

  .main-content p {
    text-align: left;
  }
}
