:root {
  color-scheme: dark;
  --black: #160e11;
  --panel: #21151a;
  --ivory: #f7e8d6;
  --muted: #d0b5a4;
  --gold: #edba83;
  --line: #684638;
  --serif: "Baskerville", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ivory); background: var(--black); font: 1rem/1.55 var(--sans); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
a { color: inherit; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid #ffd6a6; outline-offset: 5px; }
h1, h2, p { margin: 0; }

.sr-only, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip { position: fixed; z-index: 5; top: .7rem; left: .7rem; background: var(--ivory); color: var(--black); padding: .6rem 1rem; }

.masthead {
  position: relative;
  z-index: 1;
  min-height: 68px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  column-gap: 1rem;
  padding: .65rem clamp(1rem, 4vw, 4.5rem);
  background: #170e12;
  border-bottom: 1px solid #674030;
}
.masthead nav { display: flex; align-items: center; gap: clamp(.8rem, 3vw, 2.1rem); flex-wrap: wrap; }
.masthead a, .masthead button { text-decoration: none; }
.masthead a:hover, .masthead button:hover { color: var(--gold); }
.masthead nav a, .masthead nav button { display: inline-flex; align-items: center; min-height: 44px; gap: .35rem; font-size: .88rem; }
.wordmark { font: 1.15rem var(--serif); }
.wordmark span, footer span { color: var(--gold); margin-right: .3em; }
#nav-count:not(:empty), #notebook-count:not(:empty) { font-variant-numeric: tabular-nums; color: var(--gold); }

.gallery {
  position: relative;
  isolation: isolate;
  height: clamp(640px, 58vw, 870px);
  background: linear-gradient(0deg, var(--black), transparent 14%), url("assets/room.jpg") center / 100% 100% no-repeat, #221114;
}
.intro { text-align: center; padding: clamp(2rem, 4vw, 4.2rem) 1rem 0; animation: emerge .6s ease-out both; }
.eyebrow { font: 700 .69rem/1.65 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.intro .eyebrow { display: flex; align-items: center; gap: .9rem; justify-content: center; }
.intro .eyebrow span { height: 1px; width: 1.75rem; background: var(--line); }
h1 { font: 400 clamp(3.4rem, 7.1vw, 8rem)/.83 var(--serif); letter-spacing: -.04em; margin: .24em 0 .2em; text-shadow: 0 3px 25px #100406; }
h1 em { color: #ffd7b4; font-weight: 400; }
.intro > p:last-child { font-size: clamp(.8rem, 1.22vw, 1rem); color: #ebcfc0; }

.exhibits {
  position: absolute;
  inset: 44% 3.25% 10.3%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.exhibit { position: relative; display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: center; border-radius: 42% 42% 5px 5px / 26% 26% 5px 5px; }
.display { position: absolute; inset: 0 15% auto; height: 31%; filter: drop-shadow(0 7px 8px #000); transition: filter .25s ease, transform .25s ease; }
.exhibit:hover .display, .exhibit:focus-visible .display { filter: drop-shadow(0 0 14px #e8a264a8); transform: translateY(-4px); }
.artifact, .artifact::before, .artifact::after { position: absolute; display: block; }
.artifact { bottom: 0; left: 50%; }
.artifact::before, .artifact::after { content: ""; }
.radio .artifact {
  width: clamp(76px, 10vw, 150px); aspect-ratio: 1.66;
  transform: translateX(-50%) rotate(-3deg);
  background: linear-gradient(165deg, #9e5933, #38211d 85%);
  border: 4px solid #8e5f42;
  border-radius: 9px;
  box-shadow: inset 0 0 0 2px #653c25, 2px 4px 0 #291b1a;
}
.radio .artifact::before { inset: 16% 36% 17% 9%; border: 1px solid #ad825a; border-radius: 3px; background: radial-gradient(circle, #28221f 38%, transparent 43%) 0 0 / 5px 5px, #b28c5e; }
.radio .artifact::after { right: 9%; top: 19%; width: 20%; aspect-ratio: 1; border-radius: 50%; border: 2px solid #ae7d50; background: radial-gradient(circle at 36% 36%, #765c46, #221715 74%); box-shadow: 0 25px 0 -3px #d4a36c; }
.map .artifact {
  width: clamp(60px, 8vw, 115px); aspect-ratio: 1.25;
  transform: translateX(-50%) rotate(12deg) skew(-12deg, -6deg);
  background: repeating-linear-gradient(90deg, #43291d16 0 1px, transparent 1px 18px), repeating-linear-gradient(0deg, #43291d20 0 1px, transparent 1px 18px), linear-gradient(120deg,#c79a64,#eac28e 48%,#ad703f);
  border: 1px solid #c08e56;
  border-radius: 5px 2px 6px 2px;
  box-shadow: 1px 3px 0 #705237, 2px 5px 0 #3e221a;
}
.map .artifact::before { inset: 17% 25% 23% 17%; border: 2px dashed #823f34; border-right-color: transparent; border-radius: 32% 80% 75% 20%; transform: rotate(-15deg); }
.map .artifact::after { width: 11%; aspect-ratio: 1; border: 1px solid #5f352a; top: 15%; right: 12%; transform: rotate(45deg); }
.lantern .artifact {
  width: clamp(37px, 5.2vw, 77px); aspect-ratio: .73;
  transform: translateX(-50%);
  border: 5px solid #71523a;
  border-top: 8px solid #a27e4f;
  border-bottom: 8px solid #775137;
  border-radius: 26% 26% 12% 12%;
  background: linear-gradient(90deg, transparent 45%, #6e4832 46% 55%, transparent 56%), radial-gradient(ellipse at 50% 80%, #ffe8a6, #c37440 44%, #492a2f 80%);
  box-shadow: 0 0 17px #ec9a493a;
}
.lantern .artifact::before { left: 22%; width: 48%; aspect-ratio: 1.1; top: -36%; border: 3px solid #987044; border-radius: 55% 55% 15% 15%; }
.lantern .artifact::after { left: 62%; top: 63%; width: 25%; height: 28%; background: #f1ce9b; transform: rotate(-13deg); }

.plaque {
  position: absolute;
  bottom: 5%;
  left: 13%;
  right: 13%;
  padding: .56rem .45rem .64rem;
  display: grid;
  gap: .13rem;
  background: #1b1011f2;
  border: 1px solid #845638;
  box-shadow: inset 0 0 0 3px #1b1011, inset 0 0 0 4px #5a392c;
}
.catalog-number { color: var(--gold); font-size: .64rem; letter-spacing: .18em; }
.plaque strong { font: 400 clamp(1.12rem, 2.2vw, 2rem)/1.05 var(--serif); }
.plaque-caption { font-size: clamp(.7rem, 1.04vw, .86rem); color: var(--muted); }
.gallery-state { margin-top: .16rem; color: var(--gold); font-size: .68rem; }

.workbench { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); gap: 1.5rem 3rem; align-items: center; max-width: 73rem; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 4rem) 4rem; }
h2 { font: 400 clamp(2.1rem, 4.5vw, 3.6rem)/1.01 var(--serif); margin: .2em 0; }
.workbench p:not(.eyebrow), .panel p:not(.eyebrow) { color: var(--muted); }
.slots { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.slot { min-height: 115px; display: grid; justify-items: center; align-content: center; gap: .15rem; padding: .6rem; border: 1px dashed var(--line); color: var(--muted); text-align: center; font-size: .86rem; }
.slot.occupied { border-style: solid; background: #251720; color: var(--ivory); animation: emerge .24s ease-out; }
.slot-mark { color: var(--gold); font: 1.35rem var(--serif); }
.remove { font-size: .82rem; min-height: 30px; }
.table-actions { grid-column: 2; display: flex; align-items: center; flex-wrap: wrap; gap: .55rem 1rem; }
footer { padding: 1.4rem 2rem; text-align: center; border-top: 1px solid #422932; color: var(--muted); font: 1rem var(--serif); }

.text-button { background: transparent; border: 0; padding: .15em 0; color: var(--gold); text-underline-offset: .24em; }
.text-button:hover { text-decoration: underline; }
.button { min-height: 44px; border: 1px solid #9b6e56; border-radius: 2px; background: transparent; color: var(--ivory); padding: .55rem .9rem; }
.button.primary { color: #21130f; background: #ebbd94; border-color: #ebbd94; font-weight: 650; }
.button:hover:not(:disabled) { color: #21130f; background: #ffdab7; }

dialog { width: min(39rem, calc(100% - 1.75rem)); max-height: calc(100% - 1.75rem); margin: auto; padding: 0; color: var(--ivory); background: var(--panel); border: 1px solid #a06d4e; box-shadow: 0 24px 60px #000a; }
dialog[open] { animation: emerge .22s ease-out both; }
dialog::backdrop { background: #10080cd9; }
.panel { position: relative; padding: clamp(1rem, 5vw, 2.5rem); }
.panel .eyebrow { padding-right: 2.6rem; }
.close { position: absolute; top: .6rem; right: .6rem; }
.close button { font-size: 1.5rem; width: 44px; height: 44px; background: var(--panel); border: 1px solid var(--line); border-radius: 2px; }
.story { margin-top: .9rem; }
.contribution { border-left: 2px solid var(--line); margin-top: 1rem; padding-left: .8rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .75rem; margin-top: 1.15rem; }
.actions .text-button { min-height: 44px; }
.notice:not(:empty) { margin-top: .85rem; }
.sources, .notebook-rows { list-style: none; padding: 0; display: grid; gap: .65rem; }
.sources li { border-left: 1px solid var(--line); padding-left: .8rem; }
.sources span, .notebook-rows span { display: block; font-size: .89rem; color: var(--muted); }
label { display: block; margin: .7rem 0 .25rem; }
input, textarea { width: 100%; color: var(--ivory); padding: .65rem; background: #180f13; border: 1px solid #94705d; }
textarea { resize: vertical; min-height: 7rem; }
.notebook-rows li { border-bottom: 1px solid var(--line); padding-bottom: .6rem; overflow-wrap: anywhere; }
.notebook-rows button { min-height: 44px; color: var(--gold); background: transparent; border: 0; padding: 0; text-align: left; font-weight: 600; text-decoration: underline; text-underline-offset: .22em; }
.empty { margin-top: 1rem; }

@keyframes emerge { from { opacity: .4; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 720px) {
  .masthead { align-items: flex-start; flex-wrap: wrap; }
  .wordmark { align-self: center; padding: .45rem 0; }
  .gallery { height: auto; background: linear-gradient(0deg, var(--black) 47%, transparent 90%), url("assets/room.jpg") center top / auto 485px no-repeat; }
  .intro { padding: 2.4rem .9rem 1.6rem; }
  h1 { font-size: clamp(2.85rem, 11vw, 4.25rem); }
  .intro > p:last-child { max-width: 29ch; margin: auto; }
  .exhibits { position: relative; inset: auto; grid-template-columns: 1fr; gap: .65rem; max-width: 31rem; margin: auto; padding: 0 1rem 1rem; }
  .exhibit { min-height: 112px; text-align: left; border: 1px solid #77503d; border-radius: 0; background: linear-gradient(90deg, #2b1b16, #1e1318 29%); }
  .display { inset: .35rem auto 15%; width: 27%; height: auto; background: radial-gradient(ellipse at top, #df99533e, transparent 68%); }
  .display .artifact { bottom: 12%; }
  .radio .artifact::after { box-shadow: 0 16px 0 -3px #d4a36c; }
  .plaque { position: relative; inset: auto; margin-left: 28%; border: 0; box-shadow: none; background: transparent; }
  .plaque strong { font-size: 1.48rem; }
  .plaque-caption { font-size: .8rem; }
  .workbench { grid-template-columns: 1fr; gap: 1rem; }
  .table-actions { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .exhibit:hover .display, .exhibit:focus-visible .display { transform: none; }
}
