* { box-sizing: border-box; }

:root {
  --ink: #181818;
  --muted: #6b6b68;
  --line: #dedbd5;
  --paper: #f6f4ef;
  --white: #fff;
  --max: 1440px;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246,244,239,.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  letter-spacing: .01em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 34px 60px;
}

.hero {
  max-width: 920px;
  padding: 95px 0 72px;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1,
.detail-copy h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.025em;
}

.hero h1 {
  font-size: clamp(46px, 6.4vw, 92px);
  max-width: 1000px;
}

.hero-copy {
  max-width: 690px;
  margin: 30px 0 0;
  color: #565652;
  line-height: 1.65;
  font-size: 16px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.count-label {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.search-wrap { width: min(420px, 50vw); }

.search-wrap input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #aaa69e;
  background: transparent;
  padding: 8px 2px;
  outline: none;
  font: inherit;
  color: var(--ink);
}

.search-wrap input:focus { border-bottom-color: var(--ink); }

.status {
  padding: 28px 0;
  color: var(--muted);
  font-size: 14px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 42px 22px;
  padding: 38px 0 72px;
}

.card {
  cursor: pointer;
  min-width: 0;
}

.card-image-wrap {
  aspect-ratio: 4 / 3;
  background: #ebe8e1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .35s ease;
}

.card:hover .card-image { transform: scale(1.018); }

.card-placeholder {
  color: #9d9992;
  font-size: 12px;
}

.card-info { padding-top: 14px; }

.card-number {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.card-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.2;
}

.card-artist {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.text-button, .nav-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 0;
  font: inherit;
  font-size: 13px;
}

.text-button:hover, .nav-button:hover { text-decoration: underline; }

.detail {
  padding: 70px 0 10px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr);
  gap: 70px;
  align-items: start;
}

.detail-image-wrap {
  min-height: 520px;
  background: #ebe8e1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-image {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
}

.detail-image-placeholder {
  color: var(--muted);
  font-size: 13px;
}

.detail-copy {
  position: sticky;
  top: 115px;
}

.detail-copy h1 {
  font-size: clamp(38px, 4.4vw, 67px);
  line-height: 1.02;
}

.detail-artist {
  margin: 15px 0 34px;
  color: #4e4e4a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-style: italic;
}

.metadata {
  margin: 0;
  border-top: 1px solid var(--line);
}

.metadata-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 22px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.metadata dt {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.metadata dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.catalogue-section {
  margin-top: 36px;
}

.catalogue-section h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 400;
}

.catalogue-section p {
  color: #454541;
  line-height: 1.75;
  font-size: 15px;
  white-space: pre-line;
}

.artwork-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  margin-top: 70px;
  padding: 24px 0 54px;
}

footer {
  border-top: 1px solid var(--line);
  max-width: var(--max);
  margin: 0 auto;
  padding: 30px 34px 44px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  color: var(--muted);
  font-size: 12px;
}

footer p { margin: 0; }
.footer-note { max-width: 600px; text-align: right; line-height: 1.5; }

.hidden { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.error-box {
  border: 1px solid #c9c4bb;
  background: #fff;
  padding: 22px;
  line-height: 1.6;
  font-size: 14px;
}

@media (max-width: 1050px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: 1fr; gap: 40px; }
  .detail-copy { position: static; }
}

@media (max-width: 760px) {
  .header-inner, main, footer { padding-left: 18px; padding-right: 18px; }
  .header-inner { padding-top: 16px; padding-bottom: 16px; }
  .brand-title { font-size: 18px; }
  .brand-subtitle { display: none; }
  .hero { padding: 62px 0 52px; }
  .hero h1 { font-size: 48px; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .search-wrap { width: 100%; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 13px; }
  .detail { padding-top: 36px; }
  .detail-image-wrap { min-height: 300px; }
  .metadata-row { grid-template-columns: 90px 1fr; }
  footer { flex-direction: column; }
  .footer-note { text-align: left; }
}

@media (max-width: 450px) {
  .gallery { grid-template-columns: 1fr; }
}
