:root {
  color-scheme: light;
  --paper: #f7f3eb;
  --ink: #211b16;
  --muted: #6d6258;
  --lacquer: #76552b;
  --wash: #eee7db;
  --step-0: 16px;
  --step-1: clamp(16px, 1.3vw, 18px);
  --step-2: clamp(22px, 2.35vw, 34px);
  --step-3: clamp(36px, 5vw, 72px);
  --step-4: clamp(52px, 8vw, 112px);
  --page: min(90vw, 1320px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100dvh;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  font-size: var(--step-1);
  line-height: 1.72;
}

a { color: inherit; text-decoration-color: var(--lacquer); text-underline-offset: .25em; }
a:hover { color: var(--lacquer); }
a:focus-visible { outline: 3px solid var(--lacquer); outline-offset: 5px; }

img { display: block; max-width: 100%; height: auto; background: var(--wash); }

.skip {
  position: fixed;
  z-index: 10;
  left: 20px;
  top: 12px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-180%);
}
.skip:focus { transform: translateY(0); }

.site-header {
  width: var(--page);
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: var(--step-0);
}

.site-brand { font-weight: 700; letter-spacing: .04em; text-decoration: none; }
.site-header nav { display: flex; align-items: center; gap: 4px; }
.site-header nav a {
  min-height: 44px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.site-header nav a[aria-current="page"] { color: var(--lacquer); }

main { width: 100%; overflow: clip; }
main > section,
.library-hero,
.country-hero,
.person-hero,
.reading-note { width: var(--page); margin-inline: auto; }

h1, h2, h3, h4, p, figure { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.08; text-wrap: balance; }
h1, h2, .person-hero .standfirst, .work-copy h4 { font-family: Georgia, "Noto Serif SC", serif; }
h1 { max-width: 12ch; margin-bottom: 28px; font-size: var(--step-4); font-weight: 400; letter-spacing: -.035em; }
h2 { margin-bottom: 48px; font-size: var(--step-3); font-weight: 400; letter-spacing: -.025em; }
h3, h4 { font-size: var(--step-2); }

.library-hero,
.country-hero,
.person-hero {
  min-height: min(780px, calc(100dvh - 88px));
  padding: 68px 0 120px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
  gap: 24px;
}

.hero-copy { grid-column: 1 / 7; max-width: 38ch; }
.hero-copy > p { max-width: 34ch; color: var(--ink); font-size: 18px; }
.hero-figure { grid-column: 7 / 13; margin: 0; align-self: end; }
.hero-figure a { display: block; overflow: hidden; }
.hero-figure img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transform-origin: center; animation: image-arrive 900ms ease-out both, image-breathe 14s ease-in-out 1s infinite alternate; }
figcaption,
.credit,
.country-credit,
.person-summary small { display: block; max-width: 60ch; margin-top: 12px; color: var(--ink); font-size: var(--step-0); line-height: 1.55; }

.library-home h1 { max-width: none; font-size: clamp(52px, 6.4vw, 92px); }

.primary-link,
.text-link {
  min-height: 48px;
  margin-top: 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  text-decoration: none;
}
.primary-link { padding: 8px 18px; background: var(--ink); color: var(--paper); }
.primary-link:hover { background: var(--lacquer); color: var(--paper); }

.country-section,
.people-index { padding: 128px 0 180px; }
.country-section > h2,
.people-index > h2 { max-width: 10ch; }

.country-feature {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  padding: 64px 0;
  color: inherit;
  text-decoration: none;
}
.country-feature::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 calc((100vw - 100%) / -2);
  background: var(--wash);
}
.country-copy { grid-column: 1 / 5; align-self: center; max-width: 32ch; }
.country-copy h3 { margin-bottom: 22px; font-size: var(--step-3); font-weight: 400; }
.country-people { margin-top: 34px; color: var(--lacquer); }
.country-images { grid-column: 6 / 13; min-height: 560px; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(8, 1fr); gap: 16px; }
.country-images img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.country-images img:nth-child(1) { grid-column: 1 / 4; grid-row: 1 / 6; }
.country-images img:nth-child(2) { grid-column: 4 / 8; grid-row: 1 / 4; }
.country-images img:nth-child(3) { grid-column: 2 / 5; grid-row: 6 / 9; }
.country-images img:nth-child(4) { grid-column: 5 / 8; grid-row: 4 / 9; }
.country-feature:hover .country-images img:nth-child(odd),
.country-feature:focus-visible .country-images img:nth-child(odd) { transform: translateY(-7px); }
.country-credit { grid-column: 6 / 13; }

.people-index { display: block; }
.person-entry {
  min-height: 640px;
  margin: 0 0 120px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
  gap: 24px;
  color: inherit;
  text-decoration: none;
}
.person-gallery { min-height: 580px; display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(7, 1fr); gap: 16px; }
.person-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.person-gallery img:first-child { grid-column: 1 / 5; grid-row: 1 / 8; }
.person-gallery img:last-child { grid-column: 4 / 7; grid-row: 2 / 6; }
.person-entry-left .person-gallery { grid-column: 1 / 8; }
.person-entry-left .person-summary { grid-column: 9 / 13; }
.person-entry-right .person-gallery { grid-column: 6 / 13; order: 2; }
.person-entry-right .person-summary { grid-column: 1 / 5; }
.person-entry:hover .person-gallery img:last-child,
.person-entry:focus-visible .person-gallery img:last-child { transform: translateY(9px); }
.person-meta { color: var(--lacquer); font-size: 18px; }
.person-summary { max-width: 32ch; }
.person-summary h3 { margin: 16px 0 24px; font-family: Georgia, "Noto Serif SC", serif; font-size: var(--step-3); font-weight: 400; }

.person-hero { align-items: start; }
.person-hero-copy { grid-column: 1 / 7; padding-top: 42px; }
.person-hero .hero-figure { grid-column: 8 / 13; align-self: center; }
.person-hero .hero-figure img { aspect-ratio: 4 / 5; }
.person-meta { margin-bottom: 18px; }
.person-hero .en { margin: -12px 0 32px; color: var(--lacquer); font-family: Georgia, "Noto Serif SC", serif; font-size: var(--step-2); }
.person-hero .standfirst { max-width: 60ch; font-size: var(--step-1); line-height: 1.85; }

.reading-note {
  margin-bottom: 160px;
  padding: 56px max(24px, 6vw);
  background: var(--wash);
  display: grid;
  grid-template-columns: 3fr 7fr;
  gap: 40px;
}
.reading-note h2 { margin: 0; font-size: var(--step-2); }
.reading-note p { max-width: 60ch; margin: 0; }

.timeline,
.person-page main > section { padding-bottom: 112px; }
.section-heading { display: grid; grid-template-columns: 4fr 8fr; gap: 24px; align-items: end; margin-bottom: 96px; }
.section-heading h2 { grid-column: 5 / 13; margin-bottom: 0; }
.section-note { grid-column: 1 / 4; grid-row: 1; margin: 0; color: var(--muted); }

.period { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; margin-bottom: 112px; }
.period.period-last { margin-bottom: 0; }
.period-marker { grid-column: 1 / 4; }
.period-years { margin: 0; color: var(--lacquer); font-family: Georgia, "Noto Serif SC", serif; font-size: var(--step-2); line-height: 1.2; }
.period-content { grid-column: 5 / 13; }
.period-content > h3,
.period-content > p,
.period-question,
.related-link { max-width: 60ch; }
.period-content > h3 { margin: 0 0 36px; font-weight: 500; }
.period-content > p { margin-bottom: 28px; }
.period-question { margin-top: 40px; padding: 28px 32px; background: var(--wash); }

.work-feature { margin: 64px 0 80px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 24px; align-items: center; }
.work-feature .work-image { grid-column: 1 / 6; }
.work-feature .work-copy { grid-column: 6 / 9; }
.work-feature-portrait .work-image { grid-column: 5 / 9; }
.work-feature-portrait .work-copy { grid-column: 1 / 5; grid-row: 1; }
.work-image { display: block; }
.work-image img { width: 100%; }
.work-copy h4 { margin: 10px 0 16px; font-weight: 500; }
.work-copy h4 a { min-height: 44px; display: inline-flex; align-items: center; }
.work-note,
.work-meta { margin-bottom: 8px; color: var(--lacquer); font-size: var(--step-0); }
.work-copy > p:not(.work-note):not(.work-meta):not(.credit) { margin-bottom: 20px; }

.work-pair { margin: 64px 0 80px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: start; }
.work-mini:first-child { grid-column: 1 / 8; }
.work-mini:last-child { grid-column: 9 / 13; margin-top: 120px; }
.work-mini .work-copy { margin-top: 24px; }

.thread-grid { max-width: 980px; margin-left: auto; display: grid; gap: 72px; }
.thread-grid article { display: grid; grid-template-columns: 4fr 8fr; gap: 24px; }
.thread-grid h3 { margin: 0; font-weight: 500; }
.thread-grid article > p:last-child { max-width: 60ch; margin: 0; }
.thread-number { display: none; }
.closing-note { max-width: 60ch; margin: 72px 0 0 auto; font-family: Georgia, "Noto Serif SC", serif; font-size: var(--step-1); line-height: 1.72; }

.source-list { max-width: 860px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.source-list li { margin-bottom: 10px; }
.source-list a { min-height: 48px; padding: 8px 0; display: inline-flex; align-items: center; }

.archive-summary,
.sources-section { padding-top: 112px; background: var(--wash); }

.site-footer {
  min-height: 320px;
  padding: 72px max(5vw, 20px) 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 64px;
  background: var(--ink);
  color: var(--paper);
}
.footer-name,
.site-footer > p:first-child { max-width: 12ch; margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: var(--step-3); line-height: 1.08; }
.site-footer-filings { margin: 0; display: flex; flex-wrap: wrap; gap: 10px 16px; color: #d7ccbc; font-size: var(--step-0); }
.site-footer a { min-height: 44px; display: inline-flex; align-items: center; color: inherit; }
.site-footer a:hover { color: var(--paper); }
.site-footer a:focus-visible { outline-color: var(--paper); }

.site-header,
.hero-copy,
.hero-figure,
.country-section > h2,
.country-copy,
.country-images img,
.people-index > h2,
.person-gallery img,
.person-summary,
.reading-note,
.section-heading,
.period,
.work-feature,
.work-mini,
.thread-grid article,
.source-list li { animation: content-arrive 900ms ease-out both; }

.hero-figure,
.country-images img:nth-child(even),
.person-gallery img:last-child,
.period:nth-of-type(even),
.work-mini:last-child { animation-delay: 120ms; }

@keyframes image-arrive {
  from { opacity: 0; transform: scale(1.06) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes content-arrive {
  from { opacity: 1; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes image-breathe {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.018) translate3d(0, -5px, 0); }
}

@media (max-width: 900px) {
  :root { --page: calc(100% - 40px); }
  .site-header { min-height: 76px; }
  .site-brand { max-width: 17ch; line-height: 1.25; }
  .site-header nav a { padding-inline: 10px; }
  .library-hero,
  .country-hero,
  .person-hero { min-height: auto; padding: 58px 0 104px; grid-template-columns: 1fr; gap: 48px; }
  .hero-copy,
  .hero-figure,
  .person-hero-copy,
  .person-hero .hero-figure { grid-column: 1; max-width: none; }
  .hero-figure { width: 84%; margin-left: auto; }
  .person-hero .hero-figure { width: 72%; margin: 0; }
  .country-section,
  .people-index { padding: 96px 0 128px; }
  .country-feature { grid-template-columns: 1fr; padding-block: 56px; }
  .country-copy,
  .country-images,
  .country-credit { grid-column: 1; }
  .country-images { min-height: 480px; margin-top: 32px; }
  .person-entry { min-height: 0; margin-bottom: 128px; grid-template-columns: 1fr; gap: 42px; }
  .person-entry-left .person-gallery,
  .person-entry-right .person-gallery,
  .person-entry-left .person-summary,
  .person-entry-right .person-summary { grid-column: 1; order: initial; }
  .person-entry-right .person-summary { order: 2; }
  .person-gallery { min-height: 500px; }
  .reading-note { grid-template-columns: 1fr; margin-bottom: 120px; }
  .section-heading { grid-template-columns: 1fr; margin-bottom: 72px; }
  .section-heading h2,
  .section-note { grid-column: 1; grid-row: auto; }
  .section-note { order: 2; }
  .period { grid-template-columns: 1fr; margin-bottom: 96px; }
  .period-marker,
  .period-content { grid-column: 1; }
  .period-marker { margin-bottom: 18px; }
  .work-feature { grid-template-columns: 1fr; }
  .work-feature .work-image,
  .work-feature .work-copy,
  .work-feature-portrait .work-image,
  .work-feature-portrait .work-copy { grid-column: 1; grid-row: auto; }
  .work-feature-portrait .work-copy { order: 2; }
  .work-pair { grid-template-columns: 1fr; gap: 72px; }
  .work-mini:first-child,
  .work-mini:last-child { grid-column: 1; margin-top: 0; }
  .thread-grid { margin-left: 0; }
  .thread-grid article { grid-template-columns: 1fr; gap: 12px; }
  .closing-note { margin-left: 0; }
  .source-list { margin-left: 0; }
}

@media (max-width: 520px) {
  .site-header { align-items: flex-start; padding: 14px 0; }
  .site-brand { min-height: 48px; display: flex; align-items: center; }
  .site-header nav { gap: 0; }
  .library-hero,
  .country-hero,
  .person-hero { padding-top: 38px; }
  .hero-figure { width: 100%; }
  .person-hero .hero-figure { width: 82%; }
  .country-images { min-height: 430px; gap: 10px; }
  .country-images img:nth-child(1) { grid-column: 1 / 5; }
  .country-images img:nth-child(2) { grid-column: 5 / 8; }
  .country-images img:nth-child(3) { grid-column: 1 / 4; }
  .country-images img:nth-child(4) { grid-column: 4 / 8; }
  .person-gallery { min-height: 430px; }
  .person-gallery img:first-child { grid-column: 1 / 6; }
  .person-gallery img:last-child { grid-column: 4 / 7; }
  .reading-note { padding: 40px 24px; }
  .period-question { padding: 24px; }
  .site-footer { min-height: 360px; }
  .site-footer-filings { display: grid; gap: 0; }
  .site-footer-separator { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
