:root {
  --ink: #16161a;
  --muted: #6c6c74;
  --hair: #e2e2e0;
  --paper: #fbfbfa;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Inter, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0d0d10;
  color: #fff;
}

#stage { display: block; width: 100%; height: 100%; }

/* ---- loading ------------------------------------------------------------ */

#loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #0d0d10;
  color: #6c6c74;
  font-size: 13px;
  letter-spacing: 0.02em;
  z-index: 40;
  transition: opacity 0.6s ease;
}
#loading.done { opacity: 0; pointer-events: none; }

#fade {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: #0d0d10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}
#fade.on { opacity: 1; }

/* ---- chrome ------------------------------------------------------------- */

#chrome {
  position: fixed;
  top: 28px;
  left: 32px;
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.room-id { display: flex; align-items: baseline; gap: 12px; }

.room-id .gallery {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.room-id .title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.92);
}

#chrome .meta {
  margin-top: 5px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.38);
}

.sep { opacity: 0.4; margin: 0 6px; }

/* ---- gallery index ------------------------------------------------------ */

#index-toggle {
  position: fixed;
  top: 26px;
  right: 32px;
  z-index: 16;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(24, 24, 29, 0.82);
  backdrop-filter: blur(14px);
  color: rgba(255, 255, 255, 0.88);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
#index-toggle:hover {
  background: rgba(38, 38, 45, 0.92);
  border-color: rgba(255, 255, 255, 0.3);
}
#index-toggle .bars { display: grid; gap: 3px; }
#index-toggle .bars i {
  display: block; width: 13px; height: 1.5px;
  background: rgba(255, 255, 255, 0.7);
}

#room-label .r-note {
  display: block;
  margin-top: 5px;
  max-width: 34ch;
  font-size: 11px;
  line-height: 1.45;
  font-style: italic;
  color: rgba(255, 255, 255, 0.48);
}

body.index-open #room-label { opacity: 0; }

#index {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 84vw);
  z-index: 15;
  overflow-y: auto;
  padding: 84px 0 28px;
  background: rgba(16, 16, 20, 0.93);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  animation: slide-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
#index[hidden] { display: none; }

@keyframes slide-in {
  from { transform: translateX(28px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

#index header { padding: 0 26px 16px; }
#index h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}
#index header p {
  margin: 5px 0 0;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.38);
}

#floor-switch { display: flex; gap: 6px; margin-top: 14px; }
#floor-switch button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
#floor-switch button:hover { color: #fff; border-color: rgba(255, 255, 255, 0.36); }
#floor-switch button.current {
  background: rgba(200, 85, 63, 0.9);
  border-color: rgba(200, 85, 63, 0.9);
  color: #fff;
  cursor: default;
}

#index ol { margin: 0; padding: 0; list-style: none; }

#index li button {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 11px 26px;
  border: none;
  border-left: 2px solid transparent;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}
#index li button:hover { background: rgba(255, 255, 255, 0.06); }
#index li button.current {
  background: rgba(255, 255, 255, 0.08);
  border-left-color: #c8553f;
}

#index .num {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.36);
}
#index .name {
  font-size: 13.5px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.88);
}
#index .count {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
}

body.detail-open #index,
body.detail-open #index-toggle { opacity: 0; pointer-events: none; }

/* ---- floor plan, as orientation ----------------------------------------- */

#map {
  position: fixed;
  left: 32px;
  bottom: 58px;
  z-index: 13;
  margin: 0;
  width: 260px;
  padding: 10px 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(18, 18, 22, 0.8);
  backdrop-filter: blur(14px);
  transition: opacity 0.3s ease;
}
#map[hidden] { display: none; }
#map canvas { display: block; width: 100%; height: auto; cursor: pointer; }

#map figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
#map #map-room {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#map #map-expand {
  flex: none;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  font: inherit;
  font-size: 10.5px;
  cursor: pointer;
}
#map #map-expand:hover {
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.32);
}

body.detail-open #map { opacity: 0; pointer-events: none; }

/* ---- the way in --------------------------------------------------------- */

#enter {
  position: fixed;
  bottom: 26px;
  right: 32px;
  z-index: 14;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 16px 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(24, 24, 29, 0.82);
  backdrop-filter: blur(14px);
  color: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

#enter:hover {
  background: rgba(38, 38, 45, 0.92);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

#enter svg { width: 17px; height: 17px; fill: #c8553f; flex: none; }
#enter kbd { margin: 0; opacity: 0.65; }

body.walking #enter svg { fill: rgba(255, 255, 255, 0.5); transform: scaleX(-1); }

#hint, #walk-hint {
  position: fixed;
  bottom: 26px;
  left: 32px;
  z-index: 10;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.34);
  pointer-events: none;
  transition: opacity 0.35s ease;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  margin: 0 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  font: inherit;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.55);
}

body.detail-open #chrome,
body.detail-open #hint,
body.detail-open #walk-hint,
body.detail-open #room-label,
body.detail-open #enter,
body.detail-open #prompt { opacity: 0; pointer-events: none; }

/* ---- which gallery you're standing in ----------------------------------- */

#room-label {
  position: fixed;
  top: 82px;            /* clears the Galleries button */
  right: 32px;
  z-index: 11;
  text-align: right;
  pointer-events: none;
  animation: room-in 0.4s ease;
  transition: opacity 0.3s ease;
}

#room-label[hidden] { display: none; }

@keyframes room-in {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: none; }
}

#room-label .r-gallery {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

#room-label .r-title {
  display: block;
  margin-top: 3px;
  max-width: 34ch;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

/* ---- tour mode ---------------------------------------------------------- */

#tour-start {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 13;
  display: flex;
  gap: 8px;
  transition: opacity 0.3s ease;
}

#tour-start button {
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(24, 24, 29, 0.82);
  backdrop-filter: blur(14px);
  color: rgba(255, 255, 255, 0.88);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
#tour-start button:hover {
  background: rgba(38, 38, 45, 0.92);
  border-color: rgba(255, 255, 255, 0.32);
}

body.touring #tour-start,
body.detail-open #tour-start { opacity: 0; pointer-events: none; }

#tour {
  position: fixed;
  right: 32px;
  bottom: 92px;
  z-index: 13;
  width: min(340px, 80vw);
  padding: 16px 18px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(18, 18, 22, 0.86);
  backdrop-filter: blur(18px);
  animation: rise-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#tour[hidden] { display: none; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

#tour .t-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}
#tour .t-state {
  color: #e08a6d;
  letter-spacing: 0.08em;
}

body.tour-paused #tour {
  border-color: rgba(224, 138, 109, 0.4);
}

#tour .t-head #t-exit {
  margin-left: auto;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: none;
  cursor: pointer;
}

#t-voice, #t-music {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: none;
  color: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
}
#t-voice.off, #t-music.off {
  color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.08);
  text-decoration: line-through;
}
#tour .t-head #t-exit:hover { color: #fff; border-color: rgba(255,255,255,0.34); }

#tour .t-artist {
  margin: 0;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.94);
}
#tour .t-title {
  margin: 2px 0 0;
  font-size: 14px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.6);
}
#tour .t-blurb {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  max-height: 8.5em;
  overflow: hidden;
}

#tour .t-controls {
  display: flex;
  gap: 7px;
  margin-top: 14px;
}
#tour .t-controls button {
  flex: 1;
  padding: 7px 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: none;
  color: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
#tour .t-controls button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

body.detail-open #tour { opacity: 0; pointer-events: none; }
body.touring #prompt { opacity: 0; }

#ask {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: grid;
  place-items: center;
  background: rgba(8, 8, 11, 0.62);
  backdrop-filter: blur(6px);
}
#ask[hidden] { display: none; }

#ask .ask-card {
  position: relative;
  width: min(560px, 90vw);
  padding: 26px 28px 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(20, 20, 25, 0.96);
  animation: rise-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#ask label {
  display: block;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
}

#ask-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font: inherit;
  font-size: 16px;
}
#ask-input:focus { outline: none; border-color: rgba(255, 255, 255, 0.4); }
#ask-input::placeholder { color: rgba(255, 255, 255, 0.28); }

#ask-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
#ask-chips button {
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: none;
  color: rgba(255, 255, 255, 0.6);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
#ask-chips button:hover { color: #fff; border-color: rgba(255, 255, 255, 0.36); }

#ask-result { margin-top: 16px; }
#ask-result .r-summary {
  margin: 0;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.9);
}
#ask-result .r-hint {
  margin: 10px 0 6px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.45);
}
/* One row per work, each one a target. This was a single clipped paragraph at
   11.5px and 40% white — the works were already clickable, but nothing about
   them said so and `max-height` hid all but the first two. */
#ask-result .r-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 40vh;
  overflow-y: auto;
}

#ask-go {
  width: 100%;
  margin-top: 18px;
  padding: 11px 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
#ask-go:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
#ask-go:disabled { opacity: 0.32; cursor: default; }

#ask-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
#ask-close:hover { color: #fff; }

/* ---- proximity prompt --------------------------------------------------- */

#prompt {
  position: fixed;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  align-items: baseline;
  gap: 12px;
  max-width: min(760px, 88vw);
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(18, 18, 22, 0.78);
  backdrop-filter: blur(14px);
  white-space: nowrap;
  pointer-events: none;
  animation: prompt-in 0.22s ease;
  transition: opacity 0.3s ease;
}

#prompt[hidden] { display: none; }

@keyframes prompt-in {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

#prompt .p-artist {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
}

#prompt .p-title {
  font-size: 13px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.55);
  overflow: hidden;
  text-overflow: ellipsis;
}

#prompt .p-key {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

/* ---- artwork detail — quiet, white, reverent ---------------------------- */

#detail {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--paper);
  color: var(--ink);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 64px;
  padding: 72px 72px 72px 96px;
  animation: rise 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

#detail[hidden] { display: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.plate {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 0;
}

/* No image in the catalogue record — say so, rather than showing a broken one. */
.plate.no-image::after {
  content: "No image in the collection record";
  display: grid;
  place-items: center;
  width: min(42vh, 90%);
  aspect-ratio: 4 / 5;
  padding: 24px;
  background: #f1f0ec;
  border: 1px solid var(--hair);
  color: #9a9aa2;
  font-size: 13px;
  text-align: center;
}

.plate img {
  max-width: 100%;
  max-height: 78vh;
  background: #fff;
  padding: 26px;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.04),
    0 12px 34px rgba(0, 0, 0, 0.11),
    0 2px 6px rgba(0, 0, 0, 0.05);
}

.info { max-width: 460px; }

.info h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -0.018em;
}

.info .artist {
  margin: 14px 0 0;
  font-size: 17px;
  color: #3a3a41;
}

.info .date {
  margin: 3px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.info .blurb {
  margin: 22px 0 0;
  font-size: 15.5px;
  line-height: 1.62;
  color: #2c2c33;
  max-width: 44ch;
}

/* Text restated from the catalogue record rather than written about the work —
   set quieter so it never reads as commentary. */
.info .blurb.from-catalogue {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.info dl {
  margin: 30px 0 0;
  border-top: 1px solid var(--hair);
  font-size: 13.5px;
  line-height: 1.55;
}

.info dl > div {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hair);
}

.info dt { color: var(--muted); }
.info dd { margin: 0; }

.info .source { margin: 24px 0 0; font-size: 13px; color: var(--muted); }
.info .source a { color: var(--ink); text-underline-offset: 3px; }

.info .source .note {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: #9a9aa2;
}

#detail-close {
  position: absolute;
  top: 30px;
  left: 32px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #efefec;
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}
#detail-close:hover { background: #e4e4e0; }

@media (max-width: 900px) {
  #detail {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 80px 26px 32px;
    align-content: start;
    overflow-y: auto;
  }
  .plate img { max-height: 46vh; padding: 14px; }
  .info h1 { font-size: 23px; }
}




/* The one-line summary under the title in the proximity prompt. */
#prompt .p-summary {
  display: block;
  margin-top: .15rem;
  font-size: .78rem;
  color: #8f8b95;
  max-width: 26rem;
}


/* Works in a tour proposal: a plain numbered reading list. */
.r-work {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 12.5px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.72);
}
.r-work .n {
  flex: none;
  min-width: 1.1em;
  color: rgba(255, 255, 255, 0.35);
  font-variant-numeric: tabular-nums;
}


/* The way back onto the tour, where thumbs already are. */
#detail-return {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 31;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font: 600 14px Helvetica, Arial, sans-serif;
  background: #1c1c21;
  color: #f4f2ee;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}
#detail-return:hover { background: #2e2e35; }
