:root {
  color-scheme: dark;
  --ink: #141410;
  --ink-soft: #1d1c18;
  --bone: #eee6d4;
  --paper: #d8cdb7;
  --muted: #9d9688;
  --copper: #c67542;
  --verdigris: #6d8e80;
  --line: rgba(238, 230, 212, 0.18);
  --serif: Iowan Old Style, Palatino Linotype, Book Antiqua, Palatino, Georgia, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 70% -10%, rgba(198, 117, 66, 0.11), transparent 35rem),
    var(--ink);
}

button, a { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 1000;
  padding: 0.75rem 1rem;
  color: var(--ink);
  background: var(--bone);
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 3vw;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 20, 16, 0.82);
  backdrop-filter: blur(18px);
}

.wordmark {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  color: var(--bone);
  text-decoration: none;
  font-family: var(--serif);
  letter-spacing: 0.02em;
}
.wordmark-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--copper);
  border-radius: 50%;
  color: var(--copper);
  font-style: italic;
}

.header-actions {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.8rem, 2vw, 1.8rem);
}

.site-navigation {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.9rem, 2.4vw, 2.2rem);
}

.site-navigation a {
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-navigation a:hover,
.site-navigation a:focus-visible,
.site-navigation a.active { color: var(--copper); }

.room-status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.73rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.status-light {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--verdigris);
  box-shadow: 0 0 12px var(--verdigris);
}

.experience { min-height: 100vh; }
.loading, .error-state {
  display: grid;
  min-height: 100vh;
  place-content: center;
  padding: 2rem;
  text-align: center;
}
.loading { color: var(--muted); letter-spacing: 0.08em; }
.loading-rule {
  display: block;
  width: 9rem;
  height: 1px;
  margin: 0 auto 1rem;
  overflow: hidden;
  background: var(--line);
}
.loading-rule::after {
  content: "";
  display: block;
  width: 40%;
  height: 100%;
  background: var(--copper);
  animation: load 1.2s ease-in-out infinite alternate;
}
@keyframes load { to { transform: translateX(150%); } }

.intro-panel {
  position: relative;
  display: grid;
  min-height: 100svh;
  padding: clamp(7rem, 14vh, 10rem) clamp(1.5rem, 7vw, 7rem) 3rem;
  align-content: center;
  overflow: hidden;
}
.intro-panel::before {
  content: "";
  position: absolute;
  inset: 18% 5% 12% 48%;
  border: 1px solid var(--line);
  background:
    linear-gradient(110deg, rgba(255,255,255,0.04), transparent 35%),
    radial-gradient(circle at 50% 30%, rgba(198,117,66,0.25), transparent 5%, rgba(20,20,16,0.7) 38%),
    repeating-linear-gradient(90deg, transparent 0 12%, rgba(238,230,212,0.04) 12.3% 12.5%);
  transform: perspective(700px) rotateY(-13deg);
  box-shadow: -4rem 4rem 8rem rgba(0,0,0,0.45);
}
.intro-panel::after {
  content: "01";
  position: absolute;
  right: 6vw;
  bottom: 1vh;
  color: rgba(238,230,212,0.025);
  font-family: var(--serif);
  font-size: clamp(16rem, 40vw, 40rem);
  line-height: 0.7;
}
.intro-copy, .enter-button, .intro-footer { position: relative; z-index: 1; }
.intro-copy { max-width: 62rem; }
.kicker, .gallery-kicker, .section-label, .record-number {
  margin: 0 0 1.2rem;
  color: var(--copper);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
h1 {
  max-width: 12ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.5rem, 9vw, 9.5rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.88;
  text-wrap: balance;
}
.summary {
  max-width: 34rem;
  margin: 2rem 0 0;
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.55;
}
.enter-button {
  display: flex;
  width: min(100%, 19rem);
  margin-top: clamp(3rem, 8vh, 6rem);
  padding: 1rem 0;
  justify-content: space-between;
  border: 0;
  border-bottom: 1px solid var(--bone);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.enter-button:hover { color: var(--copper); border-color: var(--copper); }
.intro-footer {
  position: absolute;
  left: clamp(1.5rem, 7vw, 7rem);
  right: clamp(1.5rem, 7vw, 7rem);
  bottom: 2rem;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.gallery-shell {
  min-height: 100svh;
  padding: 6.5rem clamp(1rem, 3vw, 3rem) 3rem;
  background: #0e0e0c;
}
.gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  max-width: 1500px;
  margin: 0 auto 1.25rem;
}
.gallery-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  font-weight: 400;
}
.gallery-kicker { margin-bottom: 0.45rem; }
.position-readout {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
}
.position-rule { width: 3rem; height: 1px; background: var(--line); }

.room {
  position: relative;
  max-width: 1500px;
  min-height: min(68vh, 760px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(238,230,212,0.12);
  background:
    linear-gradient(90deg, rgba(0,0,0,0.44), transparent 25% 75%, rgba(0,0,0,0.44)),
    #24231f;
  perspective: 1100px;
  isolation: isolate;
}
.room::before, .room::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  width: 26%;
  background: linear-gradient(90deg, #121210, #2d2b25);
}
.room::before { left: 0; transform-origin: left; clip-path: polygon(0 0, 100% 13%, 100% 87%, 0 100%); }
.room::after { right: 0; transform: scaleX(-1); clip-path: polygon(0 0, 100% 13%, 100% 87%, 0 100%); }
.room-floor, .room-ceiling {
  position: absolute;
  z-index: -2;
  left: 0;
  right: 0;
  height: 27%;
  background: repeating-linear-gradient(90deg, transparent 0 9.9%, rgba(238,230,212,0.065) 10%), linear-gradient(#25231e, #11110f);
}
.room-floor { bottom: 0; clip-path: polygon(22% 0, 78% 0, 100% 100%, 0 100%); }
.room-ceiling { top: 0; transform: scaleY(-1); clip-path: polygon(22% 0, 78% 0, 100% 100%, 0 100%); }
.room-glow {
  position: absolute;
  left: 50%;
  top: 4%;
  width: 30%;
  height: 55%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(244,226,181,0.16), transparent 68%);
  filter: blur(18px);
}
.artifact-bays { position: absolute; inset: 0; transform-style: preserve-3d; }
.artifact-bay {
  --shift: 0px;
  --turn: 0deg;
  position: absolute;
  left: 50%;
  top: 10%;
  display: grid;
  width: clamp(230px, 26vw, 390px);
  justify-items: center;
  transform:
    translateX(calc(-50% + var(--shift)))
    translateZ(-40px)
    rotateY(var(--turn))
    scale(0.82);
  opacity: 0.36;
  transition: transform 700ms cubic-bezier(.2,.75,.2,1), opacity 500ms ease;
  pointer-events: none;
}
.artifact-bay.active { transform: translateX(-50%) translateZ(80px) rotateY(0) scale(1); opacity: 1; pointer-events: auto; }
.artifact-bay:not(.active):not(.distant) { pointer-events: auto; }
.artifact-bay.distant { opacity: 0; }
.case-light {
  position: absolute;
  z-index: -1;
  top: -7%;
  width: 130%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(255,235,194,0.13), transparent 66%);
  filter: blur(8px);
}
.artifact-frame {
  position: relative;
  display: block;
  width: min(100%, 330px);
  aspect-ratio: 4 / 5;
  padding: clamp(0.7rem, 1.6vw, 1.3rem);
  overflow: hidden;
  border: 1px solid rgba(221,193,135,0.5);
  background: #0a0a09;
  box-shadow: 0 2rem 4rem rgba(0,0,0,0.48), inset 0 0 0 6px #1a1712;
  cursor: zoom-in;
}
.artifact-frame img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9) contrast(1.03); transition: transform 600ms ease; }
.artifact-frame:hover img { transform: scale(1.035); }
.frame-corner { position: absolute; width: 13px; height: 13px; border-color: var(--copper); }
.frame-corner-a { left: 0.55rem; top: 0.55rem; border-left: 1px solid; border-top: 1px solid; }
.frame-corner-b { right: 0.55rem; bottom: 0.55rem; border-right: 1px solid; border-bottom: 1px solid; }
.wall-label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  width: min(100%, 330px);
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.wall-number { color: var(--copper); font-size: 0.65rem; }
.wall-label h3 { margin: 0; font-family: var(--serif); font-size: 1.1rem; font-weight: 400; }
.wall-label p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.7rem; line-height: 1.4; }
.movement-hint {
  position: absolute;
  left: 1.2rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  color: #858075;
  font-size: 0.66rem;
}
kbd { min-width: 1.55rem; padding: 0.2rem 0.35rem; border: 1px solid var(--line); border-radius: 2px; text-align: center; }
.gallery-controls {
  display: grid;
  grid-template-columns: 3rem minmax(12rem, 24rem) 3rem;
  gap: 0.65rem;
  justify-content: center;
  margin: 1.25rem 0;
}
.move-button, .inspect-button {
  min-height: 3rem;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}
.inspect-button { padding: 0 1rem; border-color: var(--copper); color: var(--bone); }
.move-button:hover, .inspect-button:hover { background: var(--bone); color: var(--ink); }
.artifact-index { display: flex; max-width: 1500px; margin: 0 auto; border-top: 1px solid var(--line); }
.index-marker {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 0.45rem;
  padding: 1rem;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.index-marker span:first-child { font-size: 0.6rem; }
.index-marker span:last-child { overflow: hidden; font-family: var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.index-marker.active { color: var(--bone); background: rgba(198,117,66,0.08); box-shadow: inset 0 2px var(--copper); }

.curatorial-panel {
  display: grid;
  grid-template-columns: minmax(8rem, 0.6fr) 1fr 1.25fr;
  gap: clamp(2rem, 6vw, 7rem);
  padding: clamp(5rem, 10vw, 10rem) clamp(1.5rem, 7vw, 7rem);
  border-top: 1px solid var(--line);
  background: #191914;
}
.curatorial-panel h2 { margin: 0 0 1.2rem; font-family: var(--serif); font-size: clamp(2rem, 4vw, 4rem); font-weight: 400; }
.curatorial-panel p:not(.section-label) { color: var(--muted); line-height: 1.7; }
.curatorial-panel blockquote { margin: 0; color: var(--paper); font-family: var(--serif); font-size: clamp(1.25rem, 2.3vw, 2rem); line-height: 1.48; }
.exhibit-footer { display: flex; justify-content: space-between; gap: 2rem; padding: 2rem 3vw; color: var(--muted); font-size: 0.68rem; border-top: 1px solid var(--line); }

.artifact-dialog {
  width: min(96vw, 1450px);
  height: min(92vh, 900px);
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  color: var(--bone);
  background: #151511;
  box-shadow: 0 2rem 8rem rgba(0,0,0,0.7);
}
.artifact-dialog::backdrop { background: rgba(3,3,2,0.84); backdrop-filter: blur(10px); }
.dialog-close {
  position: absolute;
  z-index: 10;
  top: 1rem;
  right: 1rem;
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(20,20,16,0.8);
  cursor: pointer;
  font-size: 1.6rem;
}
.dialog-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.75fr); height: 100%; }
.image-inspector { display: grid; min-height: 0; padding: 1.5rem; background: #0b0b09; grid-template-rows: minmax(0,1fr) auto auto; }
.image-stage { position: relative; display: grid; min-height: 0; place-items: center; overflow: hidden; }
.image-stage img { width: 100%; height: 100%; object-fit: contain; }
.image-step {
  position: absolute;
  top: 50%;
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(20,20,16,0.8);
  cursor: pointer;
}
.image-previous { left: 0.5rem; }
.image-next { right: 0.5rem; }
.image-caption { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.72rem; text-align: center; }
.image-thumbnails { display: flex; gap: 0.5rem; justify-content: center; margin-top: 0.75rem; }
.thumbnail { width: 56px; height: 56px; padding: 3px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.thumbnail.active { border-color: var(--copper); }
.artifact-record { padding: clamp(3rem, 5vw, 5.5rem) clamp(1.5rem, 4vw, 4rem); overflow: auto; border-left: 1px solid var(--line); }
.artifact-record h2 { margin: 0; font-family: var(--serif); font-size: clamp(2.3rem, 4vw, 4.5rem); font-weight: 400; letter-spacing: -0.04em; line-height: 0.98; }
.dialog-subtitle { color: var(--paper); font-family: var(--serif); font-size: 1.2rem; font-style: italic; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.55rem 1.25rem; margin: 2rem 0; padding: 1.25rem 0; border-block: 1px solid var(--line); font-size: 0.75rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.dialog-description { color: var(--paper); font-family: var(--serif); font-size: 1.1rem; line-height: 1.75; }
.research { margin-top: 2.2rem; }
.research h3 { margin: 0 0 1rem; color: var(--copper); font-size: 0.67rem; letter-spacing: 0.16em; text-transform: uppercase; }
.research p { padding-left: 1rem; border-left: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; line-height: 1.7; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 2rem; }
.tag-list span { padding: 0.4rem 0.65rem; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 0.62rem; text-transform: uppercase; }

.error-state h1 { max-width: 14ch; font-size: clamp(2.4rem, 6vw, 5rem); }
.error-state p:last-child { max-width: 34rem; color: var(--muted); line-height: 1.7; }

@media (max-width: 800px) {
  .site-header { min-height: 62px; }
  .room-status { font-size: 0; }
  .intro-panel::before { inset: 30% -20% 10% 45%; opacity: 0.6; }
  .intro-footer { align-items: end; gap: 1rem; }
  .intro-footer span:last-child { text-align: right; }
  .gallery-shell { padding-top: 5rem; }
  .room { min-height: 63vh; }
  .artifact-bay { top: 12%; width: min(63vw, 320px); transform: translateX(calc(-50% + var(--shift))) rotateY(var(--turn)) scale(0.78); }
  .artifact-bay.active { transform: translateX(-50%) scale(1); }
  .movement-hint { display: none; }
  .artifact-index { overflow-x: auto; }
  .index-marker { flex: 0 0 9rem; }
  .curatorial-panel { grid-template-columns: 1fr; }
  .section-label { margin-bottom: -1rem; }
  .dialog-layout { grid-template-columns: 1fr; overflow: auto; }
  .artifact-dialog { height: 96vh; }
  .image-inspector { min-height: 52vh; }
  .artifact-record { overflow: visible; border-left: 0; border-top: 1px solid var(--line); }
  .dialog-close { position: fixed; }
  .exhibit-footer { flex-direction: column; }
}

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

/* Museum and artifact navigation */
.museum-selector {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.museum-selector select,
.collection-jump-control select {
  min-height: 2.6rem;
  max-width: min(24vw, 18rem);
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--bone);
  background: #171713;
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.02em;
  text-transform: none;
}

.museum-selector select:hover,
.museum-selector select:focus-visible,
.collection-jump-control select:hover,
.collection-jump-control select:focus-visible {
  border-color: var(--copper);
  outline: none;
}

.artifact-sequence {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.7rem;
  margin: 1.35rem 0 0;
  padding: 0.75rem 0;
  border-block: 1px solid var(--line);
}

.artifact-sequence button {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  gap: 0.55rem;
  border: 0;
  color: var(--paper);
  background: transparent;
  cursor: pointer;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.artifact-sequence button:last-child { justify-content: flex-end; }
.artifact-sequence button:hover:not(:disabled) { color: var(--copper); }
.artifact-sequence button:disabled { color: #5f5b52; cursor: default; }

#artifact-position {
  color: var(--muted);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .room-status { display: none; }
}

@media (max-width: 900px) {
  .museum-selector > span { display: none; }
  .museum-selector select { max-width: 13rem; }
  .site-navigation { overflow-x: auto; scrollbar-width: none; }
  .site-navigation::-webkit-scrollbar { display: none; }
}

@media (max-width: 700px) {
  .wordmark > span:last-child { display: none; }

  .site-header { gap: 0.7rem; padding-inline: 1rem; }
  .header-actions { gap: 0.7rem; }
  .site-navigation { justify-content: flex-start; }
  .site-navigation a { font-size: 0.66rem; }

  .museum-selector select {
    width: min(38vw, 9rem);
    max-width: none;
    min-height: 2.4rem;
    font-size: 0.67rem;
  }

  .artifact-sequence { margin-top: 1rem; }
}
/* Museum home and relationship navigation */
.artifact-context {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.artifact-context h3 {
  margin: 0 0 0.85rem;
  color: var(--copper);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#dialog-context-links {
  display: grid;
  gap: 0.6rem;
}

#dialog-context-links a {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  color: var(--bone);
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease;
}

#dialog-context-links a:hover {
  border-color: var(--copper);
  background: rgba(198, 117, 66, 0.07);
}

#dialog-context-links a > span:first-child {
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#dialog-context-links a strong {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
}

#dialog-context-links a > span:last-child {
  color: var(--copper);
  font-size: 0.66rem;
}
