:root {
  --ink: #1f2420;
  --muted-ink: #5d625d;
  --paper: #f5f1e8;
  --paper-deep: #e8e0d1;
  --white: #fffdf8;
  --museum-red: #9f3028;
  --museum-red-dark: #772019;
  --line: rgba(31, 36, 32, 0.18);
  --shadow: 0 24px 70px rgba(47, 37, 25, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.page-width {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(245, 241, 232, 0.96);
}

.site-header__inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
}

.wordmark__mark {
  display: grid;
  place-items: center;
  width: 54px;
  aspect-ratio: 1;
  border-radius: 50%;
  color: var(--white);
  background: var(--museum-red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.wordmark__text {
  display: grid;
  line-height: 1.2;
}

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

.wordmark__text small {
  margin-top: 0.2rem;
  color: var(--muted-ink);
  font-size: 0.72rem;
}

.site-header nav a,
.text-link {
  color: var(--museum-red-dark);
  font-size: 0.88rem;
  font-weight: 700;
  text-underline-offset: 0.25em;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 83% 20%, rgba(159, 48, 40, 0.13), transparent 26rem),
    linear-gradient(145deg, var(--white), var(--paper));
}

.hero::after {
  content: "";
  position: absolute;
  right: -7rem;
  bottom: -11rem;
  width: 30rem;
  aspect-ratio: 1;
  border: 1px solid rgba(159, 48, 40, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 3rem rgba(159, 48, 40, 0.04), 0 0 0 8rem rgba(159, 48, 40, 0.025);
}

.hero__inner {
  position: relative;
  z-index: 1;
  padding-block: clamp(4.5rem, 10vw, 8.5rem);
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--museum-red);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.05;
}

h1 {
  max-width: 900px;
  margin-bottom: 1.4rem;
  font-size: clamp(3rem, 8vw, 6.7rem);
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3.7rem);
  letter-spacing: -0.035em;
}

h3 {
  font-size: 2rem;
}

.hero__lede {
  max-width: 680px;
  margin: 0 0 2.25rem;
  color: var(--muted-ink);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.archive-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.65rem;
  max-width: 900px;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--white);
  box-shadow: var(--shadow);
}

.archive-search input,
.archive-search select,
.archive-search input[type="submit"] {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 0.55rem;
}

.archive-search input[type="search"] {
  padding-inline: 1rem;
  color: var(--ink);
  background: transparent;
  font-size: 1rem;
}

.archive-search select {
  padding-inline: 1rem 2.5rem;
  color: var(--ink);
  background-color: var(--paper);
  cursor: pointer;
}

.archive-search input[type="submit"] {
  padding-inline: 1.65rem;
  color: var(--white);
  background: var(--museum-red);
  font-weight: 800;
  cursor: pointer;
}

.archive-search input[type="submit"]:hover {
  background: var(--museum-red-dark);
}

.archive-search :focus-visible,
.site-header a:focus-visible,
.text-link:focus-visible {
  outline: 3px solid rgba(159, 48, 40, 0.42);
  outline-offset: 3px;
}

.search-hint {
  margin: 0.9rem 0 0;
  color: var(--muted-ink);
  font-size: 0.82rem;
}

.archive-section,
.how-it-works,
.search-page {
  padding-block: clamp(4rem, 8vw, 7rem);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading__note {
  max-width: 21rem;
  margin: 0 0 0.45rem;
  color: var(--muted-ink);
  font-size: 0.9rem;
}

.publication-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.publication-card {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  padding: clamp(1.75rem, 4vw, 3.25rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--white);
}

.publication-card--dark {
  color: var(--white);
  background: var(--ink);
}

.publication-card__years {
  margin: 0 0 auto;
  color: var(--museum-red);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.publication-card--dark .publication-card__years {
  color: #e49a92;
}

.publication-card h3 {
  margin: 3rem 0 0.75rem;
}

.publication-card > p:not(.publication-card__years) {
  max-width: 31rem;
  margin: 0 0 1.6rem;
  color: var(--muted-ink);
}

.publication-card--dark > p:not(.publication-card__years) {
  color: #c6cac5;
}

.publication-card__status {
  font-size: 0.82rem;
  font-weight: 800;
}

.issue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 300px));
  gap: clamp(1rem, 3vw, 2rem);
  justify-content: start;
  margin-top: 3rem;
}

.issue-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--white);
}

.issue-card__cover {
  display: block;
  aspect-ratio: 3 / 4;
  background: #242722;
  overflow: hidden;
}

.issue-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 180ms ease;
}

.issue-card__cover:hover img {
  transform: scale(1.02);
}

.issue-card__body {
  padding: 1.2rem;
}

.issue-card__publication {
  margin: 0 0 0.45rem;
  color: var(--museum-red);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.issue-card h3 {
  margin: 0;
  font-size: 1.3rem;
}

.issue-card h3 a {
  color: inherit;
  text-decoration: none;
}

.issue-card__body > p:last-child {
  margin: 0.65rem 0 0;
  color: var(--muted-ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.how-it-works {
  border-block: 1px solid var(--line);
  background: var(--paper-deep);
}

.how-it-works h2 {
  max-width: 650px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  padding: 0;
  margin: 3rem 0 0;
  list-style: none;
}

.steps li {
  border-top: 1px solid var(--ink);
  padding-top: 1rem;
}

.steps span {
  display: block;
  margin-bottom: 2.75rem;
  color: var(--museum-red);
  font-size: 0.74rem;
  font-weight: 800;
}

.steps strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
}

.steps p {
  color: var(--muted-ink);
  font-size: 0.9rem;
}

.search-page {
  min-height: 68vh;
}

.search-page h1 {
  max-width: none;
  font-size: clamp(2.6rem, 6vw, 5rem);
}

.empty-state {
  max-width: 720px;
  margin-top: 3rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--white);
}

.empty-state__label {
  color: var(--museum-red);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.empty-state h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.empty-state > p:not(.empty-state__label) {
  color: var(--muted-ink);
}

.result-count {
  margin: 2rem 0 1rem;
  color: var(--muted-ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.search-results {
  display: grid;
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.search-result {
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--white);
}

.search-result__publication {
  margin: 0 0 0.6rem;
  color: var(--museum-red);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.search-result h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.search-result h2 a {
  color: inherit;
  text-decoration-color: transparent;
  text-underline-offset: 0.16em;
}

.search-result h2 a:hover {
  text-decoration-color: var(--museum-red);
}

.search-result__meta,
.search-result__snippet {
  color: var(--muted-ink);
}

.search-result__meta {
  display: flex;
  gap: 0.5rem;
  margin-block: 0.6rem 1.2rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.search-result__snippet {
  max-width: 72ch;
  margin: 0;
  line-height: 1.7;
}

.search-result mark {
  padding-inline: 0.08em;
  color: inherit;
  background: #f3d5a1;
}

.page-viewer {
  background: var(--paper-deep);
}

.page-viewer__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

.page-viewer__header h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
}

.page-viewer__position {
  margin: 0.7rem 0 0;
  color: var(--muted-ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.secondary-action {
  flex: none;
  padding: 0.8rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 0.35rem;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.page-viewer__canvas {
  display: grid;
  place-items: start center;
  min-height: 55vh;
  padding: clamp(1rem, 3vw, 2.5rem);
  background: #242722;
  overflow: auto;
}

.page-viewer__image {
  display: block;
  width: min(100%, 1400px);
  height: auto;
  box-shadow: 0 1rem 3rem rgb(0 0 0 / 30%);
}

.page-viewer__controls {
  position: sticky;
  bottom: 0;
  z-index: 5;
  border-top: 1px solid var(--line);
  background: rgb(250 248 241 / 96%);
  backdrop-filter: blur(12px);
}

.page-viewer__controls-inner {
  min-height: 74px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.page-control {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
}

.page-control--next {
  justify-self: end;
}

.page-control--disabled {
  color: var(--muted-ink);
}

.page-viewer__counter {
  color: var(--muted-ink);
  font-size: 0.8rem;
  font-weight: 800;
}

.site-footer {
  color: #c6cac5;
  background: var(--ink);
}

.site-footer__inner {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
}

@media (max-width: 720px) {
  .site-header__inner {
    min-height: 74px;
  }

  .page-viewer__header {
    align-items: start;
    flex-direction: column;
    gap: 1.25rem;
  }

  .page-control__number {
    display: none;
  }

  .wordmark__mark {
    width: 45px;
  }

  .wordmark__text small,
  .site-header nav {
    display: none;
  }

  .hero__inner {
    padding-block: 4rem 5rem;
  }

  .hero::after {
    opacity: 0.55;
  }

  .archive-search {
    grid-template-columns: 1fr;
  }

  .archive-search__filter {
    border-top: 1px solid var(--line);
    padding-top: 0.55rem;
  }

  .section-heading,
  .site-footer__inner {
    align-items: start;
    flex-direction: column;
  }

  .publication-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .publication-card {
    min-height: 300px;
  }

  .steps span {
    margin-bottom: 1.5rem;
  }

  .site-footer__inner {
    justify-content: center;
    padding-block: 2rem;
  }

  .site-footer p {
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
