:root {
  --bg: #f6f1e7;
  --paper: #fbf8f2;
  --ink: #2a241d;
  --muted: #6f6454;
  --line: #d9cfbd;
  --accent: #7a2e22;
  --blue: #1f4e8c;
  --shadow: 0 1px 2px rgba(60, 45, 20, .08), 0 8px 24px rgba(60, 45, 20, .08);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1916;
    --paper: #23201c;
    --ink: #ebe4d8;
    --muted: #a99d8b;
    --line: #3a352e;
    --accent: #d38a7a;
    --blue: #8fb3e6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }

/* ---------- navigation ---------- */
nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  font-family: var(--sans); font-size: 14px;
}
nav ul {
  list-style: none; margin: 0 auto; padding: 0 16px;
  max-width: 1100px; display: flex; gap: 22px; overflow-x: auto; white-space: nowrap;
}
nav a { display: block; padding: 12px 0; color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  max-width: 1100px; margin: 0 auto; padding: 64px 24px 48px;
  display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: 56px; align-items: center;
}
.hero figure { margin: 0; }
.hero img { border-radius: 3px; box-shadow: var(--shadow); filter: sepia(.12); }
.hero .kicker { font-family: var(--sans); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.hero h1 { font-size: clamp(38px, 5.4vw, 64px); line-height: 1.05; margin: 0 0 18px; font-weight: 500; letter-spacing: -.01em; }
.hero .dates { font-size: 21px; color: var(--muted); margin: 0 0 26px; }
.hero .dates span { white-space: nowrap; }
.hero > div { min-width: 0; }
.hero .lead { font-size: 21px; margin: 0; }
.cross { color: var(--muted); }

/* ---------- sections ---------- */
main { padding-bottom: 40px; }
section { max-width: 1100px; margin: 0 auto; padding: 56px 24px; border-top: 1px solid var(--line); }
.prose { max-width: 700px; }
section h2 { font-size: clamp(28px, 3.6vw, 38px); font-weight: 500; line-height: 1.15; margin: 0 0 8px; }
section .sub { font-family: var(--sans); font-size: 14px; color: var(--muted); letter-spacing: .04em; margin: 0 0 28px; text-transform: uppercase; }
h3 { font-size: 23px; font-weight: 600; margin: 36px 0 8px; }
p { margin: 0 0 18px; }
.note {
  font-size: 17px; color: var(--muted); border-left: 3px solid var(--line); padding: 2px 0 2px 16px; margin: 24px 0;
}

/* two-column layout for text + figure */
.split { display: grid; grid-template-columns: 1fr minmax(260px, 420px); gap: 48px; align-items: start; }
.split.rev { grid-template-columns: minmax(260px, 420px) 1fr; }

figure { margin: 28px 0; }
figure a { display: block; }
figure img { border-radius: 3px; box-shadow: var(--shadow); background: var(--paper); }
figcaption { font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 10px; }
figure.wide { max-width: 100%; }

/* timeline */
.timeline { list-style: none; margin: 8px 0 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 24px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 9px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--muted);
}
.timeline li.key::before { background: var(--accent); border-color: var(--accent); }
.timeline .t { display: block; font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.timeline li.key .t { color: var(--accent); }

/* quoted letter */
blockquote.letter {
  margin: 28px 0; padding: 26px 30px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 3px; box-shadow: var(--shadow);
  font-size: 18px; line-height: 1.7;
}
blockquote.letter p:last-child { margin-bottom: 0; }
blockquote.letter .sig { text-align: right; font-style: italic; color: var(--muted); }
blockquote.doc {
  margin: 20px 0; padding: 14px 18px; background: var(--paper); border-left: 3px solid var(--blue);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere;
}

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; }
.gallery figure { margin: 0; }

.sources { font-size: 16px; }
.sources li { margin-bottom: 6px; }

footer {
  max-width: 1100px; margin: 0 auto; padding: 40px 24px 64px; border-top: 1px solid var(--line);
  font-family: var(--sans); font-size: 14px; color: var(--muted);
}

@media (max-width: 820px) {
  body { font-size: 18px; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 32px 16px 36px; }
  .hero figure { max-width: 340px; }
  .hero .dates span { white-space: normal; }
  section { padding: 40px 16px; }
  .split, .split.rev { grid-template-columns: 1fr; gap: 8px; }
  blockquote.letter { padding: 18px; font-size: 17px; }
}

/* language switch: right on desktop, first on phones */
nav li.lang { margin-left: auto; }
nav li.lang a, nav li.lang2 a { color: var(--ink); font-weight: 600; }
@media (max-width: 820px) {
  nav li.lang { order: -2; margin-left: 0; }
  nav li.lang2 { order: -1; }
}

/* ---------- lightbox ---------- */
figure a { cursor: zoom-in; }
body.lightbox-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  background: rgba(20, 16, 12, .94);
  color: #ebe4d8;
  font-family: var(--sans);
  touch-action: none;
}
.lightbox[hidden] { display: none; }
.lightbox-stage {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: zoom-out;
}
.lightbox-stage img {
  max-width: 100vw; max-height: calc(100vh - 72px);
  width: auto; height: auto;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .6);
  transform-origin: center center;
  will-change: transform;
  user-select: none; -webkit-user-drag: none;
  cursor: zoom-in;
}
.lightbox.is-zoomed .lightbox-stage img { cursor: grab; }
.lightbox.is-zoomed .lightbox-stage img:active { cursor: grabbing; }
.lightbox-caption {
  margin: 0; padding: 12px 56px 14px 20px;
  font-size: 14px; line-height: 1.5; color: #c9bfae;
  text-align: center; min-height: 72px; box-sizing: border-box;
  overflow: hidden; text-overflow: ellipsis;
}
.lightbox-close {
  position: absolute; top: 10px; right: 12px; z-index: 1;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff;
  font-size: 30px; line-height: 44px; cursor: pointer;
}
.lightbox-close:hover, .lightbox-close:focus-visible { background: rgba(255, 255, 255, .25); outline: none; }
