@font-face {
  font-family: Lato;
  src: url("./fonts/lato-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Lato;
  src: url("./fonts/lato-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Lato;
  src: url("./fonts/lato-900.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: "Sorts Mill Goudy";
  src: url("./fonts/sorts-mill-goudy-normal.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Sorts Mill Goudy";
  src: url("./fonts/sorts-mill-goudy-italic.woff2") format("woff2");
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* Color & Surface Tokens */
  --paper: #ffffff;
  --ink: #1a1a1a;
  --muted: #666560;
  --line: #d9d9d6;
  --line-strong: #1a1a1a;
  --wash: #f6f5f1;
  --wash-deep: #eceae2;
  --accent: #806a38;
  --accent-soft: rgba(128, 106, 56, 0.11);
  --darkroom: #161514;
  --darkroom-surface: #201f1d;
  --darkroom-ink: #efede7;
  --darkroom-muted: #a6a299;
  --frame-inset: inset 0 0 0 1px rgba(26, 26, 26, 0.065);

  /* Typography & Hierarchy Tokens */
  --sans: Lato, Helvetica, Arial, sans-serif;
  --serif: "Sorts Mill Goudy", "Times New Roman", serif;
  --text-xs: 10px;
  --text-sm: 11px;
  --text-meta: 12px;
  --text-ui: 13px;
  --text-body: 14px;
  --text-prose: 16px;
  --text-card: 17px;
  --text-h1: 20px;

  /* Spatial & Layer Tokens */
  --masthead-h: 50px;
  --shell-max: 1184px;
  --z-masthead: 20;
  --z-hover-card: 25;
  --z-tray: 30;
  --z-dialog: 50;

  font: 16px/1.5 var(--sans);
  background: var(--paper);
  color: var(--ink);
  scroll-padding-top: 70px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; padding-bottom: var(--tray-offset, 0px); }
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; border-radius: 0; }
button, summary, select { cursor: pointer; }
img { display: block; width: 100%; height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
main:focus, .story-step:focus { outline: none; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
:lang(zh) { font-family: "Songti SC", "Noto Serif CJK SC", SimSun, serif; font-style: normal; }

kbd {
  display: inline-block;
  padding: 1px 4px;
  border: 1px solid var(--line);
  background: var(--wash);
  font: 700 9px/1.2 var(--sans);
  letter-spacing: 0.5px;
  color: var(--ink);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 60;
  transform: translateY(-180%);
  padding: 8px 12px;
  background: var(--paper);
  border: 1px solid var(--accent);
  font-size: var(--text-ui);
}
.skip-link:focus { transform: none; }

.shell, .site-footer { width: min(100% - 64px, var(--shell-max)); margin-inline: auto; }

/* Masthead */
.masthead {
  position: sticky;
  top: 0;
  z-index: var(--z-masthead);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent;
}
.masthead.is-scrolled { border-bottom-color: var(--line); }
.masthead-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  height: var(--masthead-h);
  padding-inline: 3.15%;
  gap: 8px;
}
.masthead summary,
.wordmark,
.masthead-categories > span:first-child {
  display: inline-block;
  width: max-content;
  padding-bottom: 3px;
  border-bottom: 2px solid currentColor;
  font-size: 12.8px;
  line-height: 1;
  letter-spacing: 4px;
  font-weight: 900;
}
.wordmark { text-transform: uppercase; letter-spacing: 5px; }
.masthead-categories {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.masthead-badge {
  padding: 1px 5px;
  background: var(--wash-deep);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
.masthead-categories > span:last-child { font-size: 17px; font-weight: 900; line-height: 1; }
.site-menu { position: relative; justify-self: start; }
.site-menu nav {
  position: absolute;
  top: calc(100% + 12px);
  left: -12px;
  display: grid;
  width: 192px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 8px 14px;
  box-shadow: 0 8px 24px rgba(26, 26, 26, 0.06);
}
.site-menu nav a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  font-size: var(--text-body);
  letter-spacing: 1.4px;
}
.site-menu nav a + a { border-top: 1px solid rgba(217, 217, 214, 0.45); }
.site-menu nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.site-menu nav a[aria-current="page"]::after { content: "—"; font-weight: 400; }
.site-menu nav a:hover, .masthead a:hover, .masthead summary:hover { color: var(--accent); }

/* Home Cover Slideshow */
.cover {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  width: 100%;
  min-height: calc(100svh - var(--masthead-h));
  overflow: hidden;
  background: #47382b;
  color: white;
  text-align: center;
  --cover-edge: 3.15%;
}
.cover-photos, .cover-photo, .cover-photo img, .cover::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cover-photos { z-index: -2; }
.cover-photo { opacity: 0; transition: opacity 180ms ease-out; }
.cover-photo.is-current { opacity: 1; }
.cover-photo img { object-fit: cover; object-position: var(--focus); transform: scale(var(--zoom)); }
.cover::after { content: ""; z-index: -1; background: linear-gradient(180deg, #0006, #0007 34%, #0007 62%, #000b); }
.cover-controls {
  position: absolute;
  inset: 12px var(--cover-edge) auto;
  display: flex;
  align-items: center;
  gap: 22px;
  z-index: 1;
}
.cover-progress { flex: 1; display: flex; gap: clamp(9px, 1.8vw, 28px); }
.cover-segment, .cover-playback {
  color: white;
  background: none;
  border: 0;
  padding: 0;
  min-height: 44px;
}
.cover-segment { flex: 1; display: grid; align-items: center; min-width: 24px; }
.cover-track { position: relative; height: 4px; border-radius: 3px; overflow: hidden; background: #fff6; }
.cover-segment[aria-current] .cover-track { background: #fffa; }
.cover-fill { position: absolute; inset: 0; background: white; transform: scaleX(0); transform-origin: left; }
.cover-segment[data-complete] .cover-fill { transform: none; }
.cover-segment:hover .cover-track { background: white; }
.cover-playback { min-width: 46px; font-size: var(--text-meta); font-weight: 700; letter-spacing: .06em; }
.cover-playback:hover { text-decoration: underline; text-underline-offset: 4px; }
.cover-text { padding: 84px 25px 112px; }
.cover h1 {
  font-size: clamp(40px, 5.25vw, 76px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .21em;
  line-height: 1.15;
  text-indent: .21em;
}
.cover-text p {
  margin: 24px auto 0;
  max-width: 64ch;
  font: italic clamp(16px, 1.65vw, 24px)/1.4 var(--serif);
  letter-spacing: .04em;
}
.cover-enter {
  display: inline-grid;
  justify-items: center;
  margin-top: 43px;
  min-width: 128px;
  border: 2px solid currentColor;
  padding: 14px 18px 10px;
  font-size: var(--text-meta);
  font-weight: 700;
  letter-spacing: 1.6px;
  background: #0002;
}
.cover-enter span { font-size: 16px; line-height: 1.05; }
.cover-enter:hover { color: var(--ink); background: white; border-color: white; }
.cover :focus-visible { outline-color: white; }
.cover-credit {
  position: absolute;
  left: var(--cover-edge);
  bottom: clamp(18px, 3vw, 46px);
  display: grid;
  gap: 4px;
  width: fit-content;
  max-width: calc(100% - var(--cover-edge) * 2);
  text-align: left;
  text-shadow: 0 1px 4px black;
}
.cover-record-id { font-size: var(--text-sm); letter-spacing: .16em; font-variant-numeric: tabular-nums; }
.cover-record-title { font-size: clamp(15px, 1.65vw, 26px); line-height: 1.3; }
.cover-credit:hover .cover-record-title { text-decoration: underline; text-underline-offset: 4px; }

/* Intro & About */
.collection-intro {
  width: min(100% - 36px, 600px);
  margin-inline: auto;
  padding: 82px 0 48px;
  text-align: center;
}
.collection-intro h1, .entry-heading h1, .story-intro h1, .compare-intro h1 {
  font-size: var(--text-h1);
  line-height: 1.5;
  font-weight: 900;
  letter-spacing: 3px;
}
.collection-intro p { margin-top: 15px; font: italic var(--text-prose)/1.55 var(--serif); color: var(--muted); }

.archive-intro {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(40px, 7vw, 104px);
  min-height: calc(100svh - 70px);
  padding-block: clamp(70px, 9vw, 115px);
}
.archive-intro:focus { outline: none; }
.archive-intro h2 {
  max-width: 12ch;
  margin: 18px 0 26px;
  font-size: clamp(38px, 4.2vw, 64px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.archive-intro-copy > p:not(.label) { max-width: 43ch; font: 18px/1.5 var(--serif); }
.archive-intro-copy > p + p:not(.label) { margin-top: 13px; }
.archive-intro-links { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 24px; }
.archive-intro-links a {
  padding-block: 4px;
  border-bottom: 1px solid currentColor;
  font-size: var(--text-ui);
  font-weight: 700;
  letter-spacing: .06em;
}
.archive-intro-links a:hover, .archive-intro-figure .record-id { color: var(--accent); }
.archive-intro-links span { margin-left: 4px; }
.archive-intro-figure a { display: block; box-shadow: var(--frame-inset); background: var(--wash); }
.archive-intro-figure figcaption {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font: italic var(--text-body)/1.5 var(--serif);
}
.archive-intro-figure figcaption .record-id { font-family: var(--sans); font-style: normal; }
.archive-intro + .collection-layout { padding-top: 22px; }

/* Categories Faceted Drawer (5 Dimensions + Multi-Select OR) */
.category-panel { border-block: 1px solid var(--line); }
.category-panel summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: var(--text-ui);
  font-weight: 900;
  letter-spacing: 2.5px;
}
.category-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.category-summary-hint {
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.category-chevron { font-size: 18px; font-weight: 400; transition: transform 150ms ease; }
.category-panel[open] .category-chevron { transform: rotate(45deg); }

.category-groups {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 36px);
  padding: 18px 0 22px;
  border-top: 1px solid var(--line);
}
.category-top-bar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(217, 217, 214, 0.6);
}
.category-note {
  font: italic 13px/1.4 var(--serif);
  color: var(--muted);
}
.category-group h3, .label {
  font-size: var(--text-xs);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}
.category-group h3 { margin-bottom: 8px; }
.category-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 3.5px 0;
  font-size: 13.5px;
  line-height: 1.35;
}
.all-link { width: auto; gap: 12px; font-weight: 700; }
.category-link:hover, .category-link[aria-current="true"] { color: var(--accent); }
.category-link[aria-current="true"] > span:first-child {
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 700;
}
.category-link.is-zero:not([aria-current="true"]) { opacity: 0.42; }
.category-count, .record-total, .record-id, .tabular {
  font-size: var(--text-sm);
  color: var(--muted);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

/* Collection Tools Bar (Search, Sort, Shuffle, View Switch) */
.collection-tools {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 20px;
  align-items: center;
  margin-top: 26px;
}
.search {
  position: relative;
  flex: 1 1 240px;
  max-width: 340px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.search:focus-within { border-color: var(--accent); }
.search input {
  min-width: 0;
  width: 100%;
  padding: 8px 24px 8px 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: var(--text-body);
}
.search input::placeholder { color: var(--muted); }
.search-kbd {
  position: absolute;
  right: 0;
  pointer-events: none;
  opacity: 0.65;
}
.search:focus-within .search-kbd { opacity: 0; }

.tools-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 20px;
}
.sort-control {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: var(--text-meta);
  color: var(--muted);
}
.sort-control label {
  font-size: var(--text-xs);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
}
.sort-control select {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 4px 2px;
  font-size: var(--text-ui);
  color: var(--ink);
}
.sort-control select:hover, .sort-control select:focus { border-color: var(--accent); }

.tool-btn {
  border: 1px solid var(--line);
  background: transparent;
  padding: 5px 10px;
  font-size: var(--text-meta);
  letter-spacing: 1px;
  color: var(--ink);
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.tool-btn:hover, .tool-btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--wash);
}

.view-switch { display: flex; gap: 16px; flex-shrink: 0; align-items: baseline; }
.view-switch a { padding: 6px 0; font-size: var(--text-ui); letter-spacing: 1.4px; }
.view-switch a[aria-current="true"] { border-bottom: 2px solid var(--ink); font-weight: 900; }
.view-switch a:hover { color: var(--accent); }

/* Results Heading & Active Filter Chips */
.results-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 22px 0 22px;
}
.results-heading h2 { font-size: 15px; letter-spacing: 2px; font-weight: 900; }
.active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  background: var(--wash);
  font-size: var(--text-meta);
  color: var(--ink);
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.clear-link { margin-left: auto; font-size: var(--text-meta); color: var(--accent); }
.clear-link:hover, .text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Gallery Masonry View — Fixed Typographic Hierarchy */
.gallery {
  --gallery-spacing: clamp(56px, 4.8vw, 76px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gallery-spacing) min(6.2vw, 92px);
  align-items: start;
}
.gallery.is-masonry {
  grid-auto-rows: 8px;
  row-gap: 0;
  margin-bottom: calc(-1 * var(--gallery-spacing));
}
.gallery.is-masonry .record-card { padding-bottom: var(--gallery-spacing); }

.record-card { position: relative; min-width: 0; }
.record-card.is-returned .card-image,
.index-row.is-returned {
  animation: archivalPulse 1.5s ease-out;
}
@keyframes archivalPulse {
  0% { background-color: var(--accent-soft); outline: 1px solid var(--accent); }
  100% { background-color: transparent; outline: 1px solid transparent; }
}

.record-card-link { display: block; }
.card-image {
  position: relative;
  background: var(--wash);
  box-shadow: var(--frame-inset);
  overflow: hidden;
}
.card-image.is-tall {
  height: 460px;
  padding: 16px;
}
.card-image.is-tall img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.card-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.card-compare-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 120ms ease, color 120ms ease, border-color 120ms ease;
}
.record-card:hover .card-compare-btn,
.record-card:focus-within .card-compare-btn,
.card-compare-btn[aria-pressed="true"] {
  opacity: 1;
}
.card-compare-btn[aria-pressed="true"],
.card-compare-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--paper);
}

.card-eyebrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}
.card-category {
  font-size: var(--text-sm);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
}
.card-title {
  margin-top: 5px;
  font-size: var(--text-card);
  line-height: 1.38;
  letter-spacing: 0.4px;
  font-weight: 700;
  color: var(--ink);
}
.record-card-link:hover .card-title { color: var(--accent); }
.card-book {
  margin-top: 6px;
  font: italic var(--text-body)/1.48 var(--serif);
  color: var(--muted);
}
.card-location {
  font-style: normal;
  font-family: var(--sans);
  font-size: var(--text-meta);
  color: var(--muted);
  letter-spacing: 0.2px;
}

.empty {
  border-top: 1px solid var(--line);
  padding-block: 28px;
  color: var(--muted);
  font-family: var(--serif);
}

/* Index View + Signature Moment 1: Dedicated Sticky Gutter Peek Rail */
.index-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  gap: 30px;
  align-items: start;
}
.record-index {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: left;
}
.record-index thead { border-block: 1px solid var(--line-strong); }
.record-index thead th {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--muted);
  font-weight: 700;
}
.record-index thead button {
  border: 0;
  padding: 0;
  background: transparent;
  text-transform: inherit;
  letter-spacing: inherit;
  text-align: left;
}
.record-index thead button:hover,
.record-index thead th:not([aria-sort="none"]) button { color: var(--ink); }

.record-index td, .record-index th {
  padding: 10px 12px 10px 0;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.record-index tr > :first-child { width: 56px; }
.record-index thead th:nth-child(2) { width: 27%; }
.record-index thead th:nth-child(3) { width: 26%; }
.record-index thead th:nth-child(4) { width: 19%; }
.record-index thead th:nth-child(5) { width: 15%; }
.record-index tr > :last-child:not([colspan]) { width: 68px; padding-right: 0; }

.index-row {
  border-bottom: 1px solid var(--line);
  content-visibility: auto;
  contain-intrinsic-size: auto 47px;
}
.index-row:hover, .index-row.is-kbd-active { background: rgba(246, 245, 241, 0.72); }
.index-row th { font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.index-object-wrap { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.index-object:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.index-view-pill {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}
.index-book, .index-location, .index-type { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.index-location { font-size: 12.5px; font-variant-numeric: tabular-nums; }

.index-action {
  text-align: right;
  white-space: nowrap;
}
.index-action button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
}
.index-action button[data-expand] { font-size: 19px; color: var(--accent); }
.index-action button:hover,
.index-action button[aria-pressed="true"] {
  background: var(--wash-deep);
  color: var(--accent);
}

.preview-row { border-bottom: 1px solid var(--line); background: var(--wash); }
.preview-row td { padding: 16px 18px; }
.inline-preview {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}
.inline-preview-thumb {
  background: var(--paper);
  padding: 6px;
  box-shadow: var(--frame-inset);
}
.inline-preview-thumb img { width: 100%; max-height: 136px; object-fit: contain; }
.inline-preview-body { display: grid; gap: 6px; max-width: 68ch; }
.inline-preview-note { font: 14.5px/1.55 var(--serif); color: var(--ink); }
.inline-preview-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2px; }

/* Gutter Peek Sticky Inspection Rail (Zero Overlap with Index Columns) */
.gutter-peek {
  position: sticky;
  top: 72px;
  width: 100%;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  transition: border-color 120ms ease-out;
}
.gutter-peek.is-active {
  border-color: var(--ink);
}
.gutter-peek-kicker {
  display: block;
  margin-bottom: 8px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.gutter-peek-frame {
  display: grid;
  place-items: center;
  background: var(--wash);
  box-shadow: var(--frame-inset);
  padding: 8px;
  min-height: 120px;
}
.gutter-peek-frame img {
  width: auto;
  max-width: 100%;
  max-height: 176px;
  object-fit: contain;
}
.gutter-peek-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: 9px;
}
.gutter-peek-title {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}
.gutter-peek-loc {
  margin-top: 3px;
  font: italic 12.5px/1.35 var(--serif);
  color: var(--muted);
}

/* Item Detail Page — Sequence Stepper, Side-by-Side Diptych, Darkroom & Related */
.text-link, .back-link { color: var(--accent); font-size: var(--text-ui); }
.item-path {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 22px 0 14px;
  border-bottom: 1px solid var(--line);
}
.back-link { justify-self: start; }
.back-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.back-link span { margin-right: 4px; }
.item-position {
  font-size: var(--text-sm);
  color: var(--muted);
  letter-spacing: 1.2px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.item-stepper {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: var(--text-meta);
  font-variant-numeric: tabular-nums;
}
.stepper-link {
  color: var(--ink);
  padding: 3px 0;
  border-bottom: 1px solid transparent;
}
.stepper-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.stepper-sep { color: var(--line); }

.entry-heading {
  max-width: 620px;
  margin-inline: auto;
  padding: 54px 0 42px;
  text-align: center;
}
.entry-eyebrow {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.entry-heading h1 { margin-top: 14px; }
.item-note { margin: 28px 0 22px; font: var(--text-prose)/1.68 var(--serif); text-align: left; }
.entry-credit { font: italic var(--text-body)/1.55 var(--serif); color: var(--muted); }

/* Visual Stage & Diptych Controls */
.visual-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.image-views {
  display: flex;
  align-items: baseline;
  gap: 8px 20px;
  flex-wrap: wrap;
}
.image-views button,
.stage-controls button {
  padding: 4px 0;
  border: 0;
  border-bottom: 1.5px solid transparent;
  background: none;
  color: var(--muted);
  font-size: var(--text-ui);
  letter-spacing: .7px;
}
.image-views button[aria-pressed="true"],
.image-views button:hover,
.stage-controls button[aria-pressed="true"],
.stage-controls button:hover {
  color: var(--accent);
  border-bottom-color: currentColor;
}
.image-views button[aria-pressed="true"],
.stage-controls button[aria-pressed="true"] {
  font-weight: 700;
}
.stage-controls {
  display: inline-flex;
  align-items: baseline;
  gap: 16px;
  margin-left: auto;
}
.toolbar-divider { color: var(--line); }

.record-stage {
  background: var(--wash);
  box-shadow: var(--frame-inset);
  padding: clamp(18px, 3vw, 36px);
  transition: background-color 180ms ease, color 180ms ease;
}
.record-stage.is-darkroom {
  background: var(--darkroom);
  color: var(--darkroom-ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.record-stage.is-darkroom figcaption,
.record-stage.is-darkroom .reading-cue { color: var(--darkroom-muted); }
.record-stage.is-darkroom figcaption strong { color: var(--darkroom-ink); }

.detail-image {
  display: grid;
  place-items: center;
  min-height: 240px;
}
.zoom-trigger {
  display: inline-block;
  border: 0;
  padding: 0;
  background: none;
  cursor: zoom-in;
  max-width: 100%;
}
.detail-image img {
  width: auto;
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
  margin-inline: auto;
}

/* Side-by-Side Diptych / Triptych Layout */
.diptych-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(18px, 2.6vw, 32px);
  align-items: end;
}
.diptych-plate {
  display: grid;
  gap: 12px;
}
.diptych-plate .detail-image {
  min-height: 180px;
  background: rgba(255, 255, 255, 0.35);
  padding: 12px;
}
.record-stage.is-darkroom .diptych-plate .detail-image {
  background: var(--darkroom-surface);
}
.diptych-plate .detail-image img { max-height: 60vh; }

figcaption {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-top: 14px;
  color: var(--muted);
  font: italic var(--text-body)/1.55 var(--serif);
  text-align: center;
}
figcaption strong {
  color: var(--ink);
  font: 700 var(--text-sm)/1.5 var(--sans);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.reading-cue {
  max-width: 66ch;
  margin: 14px auto 0;
  padding-top: 12px;
  border-top: 1px solid rgba(128, 106, 56, 0.25);
  text-align: center;
  font: italic 13.5px/1.5 var(--serif);
  color: var(--muted);
}
.reading-cue strong {
  font: 700 var(--text-xs)/1 var(--sans);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 6px;
}

/* Metadata Definition List */
.item-info { max-width: 620px; margin: 56px auto 0; }
.item-info dl > div {
  display: grid;
  grid-template-columns: minmax(110px, .36fr) minmax(0, 1fr);
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: var(--text-body);
}
.item-info dt { color: var(--muted); }
.item-info dd { overflow-wrap: anywhere; }

/* Related & Paired Records at Bottom of Detail */
.related-section {
  margin-top: 72px;
  padding-top: 32px;
  border-top: 1px solid var(--line-strong);
}
.related-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.related-header h2 {
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 900;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  align-items: start;
}
.related-card { display: block; }
.related-thumb {
  background: var(--wash);
  box-shadow: var(--frame-inset);
  padding: 10px;
  height: 190px;
  display: grid;
  place-items: center;
}
.related-thumb img {
  width: auto;
  max-width: 100%;
  max-height: 170px;
  object-fit: contain;
}
.related-card:hover .card-title { color: var(--accent); }
.related-card .card-title { font-size: 15px; margin-top: 6px; }

/* Held Accession Register Page */
.held-notice {
  max-width: 580px;
  margin: 64px auto 20px;
  padding: 32px;
  background: var(--wash);
  border: 1px solid var(--line);
}
.held-notice h1 {
  margin: 10px 0 16px;
  font-size: 19px;
  letter-spacing: 2px;
}
.held-notice p {
  font: var(--text-prose)/1.65 var(--serif);
  color: var(--ink);
}
.held-neighbors {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Signature Moment 3: Compare Page & Persistent Bookmark Slip */
.compare-tray {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-tray);
  background: var(--ink);
  color: var(--paper);
  border-top: 2px solid var(--accent);
}
.compare-tray-inner {
  width: min(100% - 40px, var(--shell-max));
  margin-inline: auto;
  min-height: 44px;
  padding: 6px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: var(--text-meta);
}
.tray-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.tray-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #d6c394;
}
.tray-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.12);
  font-variant-numeric: tabular-nums;
}
.tray-pill button {
  border: 0;
  background: none;
  color: #d6c394;
  padding: 0 2px;
  font-size: 13px;
}
.tray-actions { display: inline-flex; align-items: center; gap: 14px; }
.tray-open-link {
  padding: 4px 11px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: var(--text-xs);
}
.tray-open-link:hover { background: #967d44; }
.tray-clear-btn {
  border: 0;
  background: none;
  color: #bbb8b0;
  font-size: var(--text-meta);
}
.tray-clear-btn:hover { color: white; text-decoration: underline; }

.compare-intro {
  max-width: 640px;
  margin-inline: auto;
  padding: 72px 0 42px;
  text-align: center;
}
.compare-intro h1 { margin: 12px 0 16px; }
.compare-intro p { font: italic var(--text-prose)/1.55 var(--serif); color: var(--muted); }

.pair-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 14px;
  margin-bottom: 40px;
}
.pair-card {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--wash);
  text-align: left;
}
.pair-card:hover, .pair-card[aria-current="true"] {
  border-color: var(--accent);
  background: var(--paper);
}
.pair-card-ids { font-size: var(--text-xs); font-weight: 700; letter-spacing: 1.4px; color: var(--accent); font-variant-numeric: tabular-nums; }
.pair-card-title { font-size: 14px; font-weight: 700; }
.pair-card-sub { font: 13px/1.45 var(--serif); color: var(--muted); }

.compare-board {
  display: grid;
  grid-template-columns: repeat(var(--compare-cols, 2), minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  padding-top: 24px;
  border-top: 1px solid var(--line-strong);
}
.compare-col {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
}
.compare-col-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.compare-visual {
  background: var(--wash);
  box-shadow: var(--frame-inset);
  padding: 14px;
  min-height: 240px;
  display: grid;
  place-items: center;
}
.compare-visual img {
  width: auto;
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}
.compare-meta dl > div {
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.compare-meta dt {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--muted);
  margin-bottom: 3px;
}
.compare-note { font: 14.5px/1.6 var(--serif); }

/* High-Resolution Loupe Dialog */
.loupe-dialog {
  width: min(96vw, 1360px);
  max-height: 94vh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--darkroom);
  color: var(--darkroom-ink);
}
.loupe-dialog::backdrop { background: rgba(16, 15, 14, 0.82); }
.loupe-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-size: var(--text-meta);
}
.loupe-controls { display: inline-flex; gap: 14px; align-items: center; }
.loupe-controls button {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: var(--darkroom-ink);
  padding: 4px 10px;
  font-size: var(--text-xs);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.loupe-controls button:hover,
.loupe-controls button[aria-pressed="true"] {
  border-color: #d6c394;
  color: #d6c394;
}
.loupe-viewport {
  overflow: auto;
  max-height: calc(94vh - 96px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.loupe-viewport img {
  width: auto;
  max-width: 100%;
  max-height: calc(94vh - 140px);
  object-fit: contain;
  transition: width 150ms ease;
}
.loupe-viewport.is-zoomed {
  place-items: start center;
  cursor: grab;
}
.loupe-viewport.is-zoomed img {
  max-width: none;
  max-height: none;
  width: var(--zoom-w, 180%);
}
.loupe-caption {
  padding: 10px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font: italic 13.5px/1.45 var(--serif);
  color: var(--darkroom-muted);
  text-align: center;
}

/* Story Page */
.story-intro {
  max-width: 600px;
  margin-inline: auto;
  padding: 92px 0 64px;
  text-align: center;
}
.story-intro h1 { margin: 15px 0 24px; }
.story-intro > p:last-child { font: var(--text-prose)/1.65 var(--serif); }
.story-toc {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 26px;
}
.story-toc a {
  font-size: var(--text-meta);
  color: var(--accent);
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
}
.story-toc a:hover { border-bottom-color: var(--accent); }
.story-step { border-top: 1px solid var(--line); padding: 56px 0 72px; }
.story-copy { max-width: 580px; margin: 0 auto 40px; }
.story-sequence, .story-copy h2 { text-align: center; }
.story-sequence span { margin-left: 8px; color: var(--accent); }
.story-copy h2 { font-size: 19px; font-weight: 900; letter-spacing: 3px; line-height: 1.5; margin: 9px 0 23px; }
.story-copy > p:not(.label) { font: var(--text-prose)/1.65 var(--serif); }
.story-copy .story-cue { color: var(--muted); font-style: italic; margin: 13px 0 12px; }
.story-links { display: flex; flex-wrap: wrap; gap: 18px; align-items: baseline; }
.story-figure a { display: block; background: var(--wash); box-shadow: var(--frame-inset); padding: 14px; }
.story-figure img { max-height: 76vh; object-fit: contain; width: auto; max-width: 100%; margin-inline: auto; }
.story-close { border-top: 1px solid var(--line); padding: 45px 0 0; text-align: center; }
.story-close h2 { font-size: 19px; letter-spacing: 3px; line-height: 1.5; margin-bottom: 17px; }

/* Footer */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 22px 0 34px;
  margin-top: 90px;
  color: var(--muted);
  font-size: var(--text-xs);
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.footer-shortcuts { text-transform: none; letter-spacing: 0.4px; font-size: 11px; }
.no-script, .missing-page { padding-top: 35px; }

/* Responsive Breakpoints */
@media (max-width: 1040px) {
  .category-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .index-wrap { grid-template-columns: minmax(0, 1fr); }
  .gutter-peek, .footer-shortcuts, .search-kbd { display: none !important; }
}

@media (max-width: 950px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 6vw; }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-index thead th:nth-child(5), .index-type { display: none; }
  .record-index thead th:nth-child(2) { width: 31%; }
  .record-index thead th:nth-child(3) { width: 30%; }
  .record-index thead th:nth-child(4) { width: 23%; }
}

@media (max-width: 720px) {
  .shell, .site-footer { width: calc(100% - 36px); }
  .masthead-inner { padding-inline: 16px; }
  .masthead summary, .wordmark, .masthead-categories > span:first-child { font-size: 10px; letter-spacing: 2px; }
  .wordmark { letter-spacing: 2.4px; }
  .masthead-categories { gap: 4px; }
  .cover { --cover-edge: 18px; }
  .cover h1 { font-size: clamp(33px, 9vw, 52px); letter-spacing: .15em; text-indent: .15em; }
  .cover-text { padding: 70px 20px 98px; }
  .cover-controls { inset-block-start: 5px; gap: 10px; }
  .cover-progress { gap: clamp(2px, .75vw, 5px); }
  .archive-intro { grid-template-columns: minmax(0, 1fr); gap: 34px; padding-block: 60px; }
  .archive-intro h2 { margin-block: 13px 20px; }
  .archive-intro + .collection-layout { padding-top: 10px; }
  .collection-intro { padding: 54px 0 34px; }
  .category-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 14px 0 18px; }
  .category-summary-hint { display: none; }
  .collection-tools { margin-top: 18px; gap: 12px; }
  .search { max-width: none; flex-basis: 100%; }
  .search input { font-size: 16px; }
  .tools-right { width: 100%; justify-content: space-between; }
  .gallery { --gallery-spacing: 46px; column-gap: clamp(18px, 6vw, 44px); }
  .card-category { font-size: 10px; letter-spacing: 1.4px; }
  .card-title { font-size: 15px; }
  .card-book { font-size: 13px; }
  .card-compare-btn { opacity: 1; }
  .record-index thead th:nth-child(4), .index-location { display: none; }
  .record-index thead th:nth-child(2) { width: 42%; }
  .record-index thead th:nth-child(3) { width: auto; }
  .record-index tr > :first-child { width: 40px; }
  .record-index tr > :last-child:not([colspan]) { width: 58px; }
  .record-index td, .record-index th { padding-right: 6px; }
  .index-row th { font-size: 13px; }
  .index-book { font-size: 12px; }
  .inline-preview { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .item-path { grid-template-columns: 1fr auto; row-gap: 6px; padding-top: 16px; }
  .item-position { grid-column: 1 / -1; order: 3; text-align: left; }
  .entry-heading { padding: 38px 0 26px; }
  .entry-heading h1, .story-intro h1, .compare-intro h1 { font-size: 18px; letter-spacing: 2.2px; }
  .item-note { margin: 20px 0 16px; }
  .record-stage { padding: 12px; }
  .detail-image img, .story-figure img { max-height: 68vh; }
  .diptych-grid, .compare-board, .related-grid { grid-template-columns: minmax(0, 1fr); }
  .item-info { margin-top: 36px; }
  .story-intro { padding: 58px 0 42px; }
  .story-step { padding: 36px 0 52px; }
  .story-copy { margin-bottom: 24px; }
  .site-footer { margin-top: 60px; }
}

@media (max-width: 560px) {
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .gallery.is-masonry { grid-auto-rows: auto; }
  .category-groups { grid-template-columns: minmax(0, 1fr); }
}

/* Fix 300px–375px narrow viewport masthead overlap */
@media (max-width: 385px) {
  .masthead-inner { padding-inline: 10px; gap: 4px; }
  .masthead summary, .wordmark, .masthead-categories > span:first-child {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .masthead-categories > span:last-child { font-size: 13px; }
  .cover-playback { position: absolute; top: 35px; right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cover-photo, .category-chevron, .gutter-peek, .record-stage { transition: none; }
  .record-card.is-returned .card-image, .index-row.is-returned { animation: none; }
}
