:root {
  --H: 100svh;
  --ink: #000;
  --soft: #8E8E8E;
}
@supports not (height: 100svh) { :root { --H: 100vh; } }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #fff; }
body { font-family: "Fragment Mono", ui-monospace, Menlo, monospace; color: var(--ink); }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 6px; }

/* The wall: the whole screen, white fading to a faint grey toward the floor.
   It stays put while the art walks past. */
.room {
  height: var(--H);
  overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  background: linear-gradient(to bottom, #FFFFFF 0%, #FFFFFF 38%, #F7F7F7 66%, #ECECEC 100%);
}
.room::-webkit-scrollbar { display: none; }
.room:focus-visible { outline: none; }
.track { display: flex; height: 100%; width: max-content; }
.set { position: relative; display: flex; align-items: flex-start; height: 100%; flex: none; }

/* The only words */
.name {
  position: absolute; margin: 0;
  left: calc(var(--H) * .08); top: 46%;
  transform: translateY(-50%);
  font-size: max(11px, calc(var(--H) * .0135));
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--soft);
  white-space: nowrap;
}
.name b { font-weight: 400; color: var(--ink); -webkit-text-stroke: .045em currentColor; paint-order: stroke fill; }


/* Top navigation, shared by the museum and the archive */
.bar {
  position: sticky; top: 0; z-index: 5;
  min-height: 66px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px clamp(16px, 4vw, 56px);
}
.bar h1 {
  margin: 0; font-weight: 400; font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase;
}
.tools { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 28px); font-size: 12px; }
.tools a { color: var(--soft); text-decoration: none; }
.tools a:hover { color: var(--ink); }

.year {
  position: relative; display: inline-flex; align-items: center;
}
.year select {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-size: 12px; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--ink);
  padding: 2px 18px 2px 0; border-radius: 0; cursor: pointer;
}
.year::after { /* small caret */
  content: ""; position: absolute; right: 2px; top: 50%; width: 5px; height: 5px;
  border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.bar.solid { background: rgba(255,255,255,.94); backdrop-filter: blur(6px); }
.bar.float { position: fixed; left: 0; right: 0; background: transparent; pointer-events: none; }
.bar.float a { pointer-events: auto; }

/* A piece is just the image or video */
.bay { display: flex; flex-direction: column; align-items: center; flex: none; }
.piece { position: relative; flex: none; }
.art {
  display: block; width: 100%; height: 100%;
  padding: 0; border: 0; background: #EEE; cursor: zoom-in;
  box-shadow: 0 calc(var(--H) * .01) calc(var(--H) * .03) rgba(0,0,0,.09);
}
.art > img, .art > video {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%);
  filter: grayscale(1);
  transition: filter .5s ease;
}
.art:hover > img, .art:hover > video, .art:focus-visible > img, .art:focus-visible > video { filter: grayscale(.15); }

.motion-toggle {
  position: absolute; right: 8px; bottom: 8px;
  width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center;
  opacity: 0; transition: opacity .2s;
}
.piece:hover .motion-toggle, .motion-toggle:focus-visible, .paused .motion-toggle { opacity: .85; }
.motion-toggle svg { width: 9px; height: 9px; }

/* Up close, in colour */
dialog { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100svh; }
dialog::backdrop { background: rgba(255,255,255,.97); }
dialog[open] { display: grid; place-items: center; }
.closeup { display: grid; gap: 16px; justify-items: center; }
.closeup .big {
  width: min(86vw, calc(78svh * var(--ratio)));
  aspect-ratio: var(--ratio);
  box-shadow: 0 10px 40px rgba(0,0,0,.12);
}
.closeup .big > img, .closeup .big > video { display: block; width: 100%; height: 100%; object-fit: cover; }
.closeup .caption { margin: 0; text-align: center; font-size: 12px; display: grid; gap: 4px; }
.closeup .caption .t { white-space: pre-line; }
.closeup .caption .h { color: var(--soft); }
.close {
  position: fixed; top: 14px; right: 14px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid #000; background: #fff; color: #000;
  font: inherit; font-size: 13px; cursor: pointer;
}

/* Viewer: swipe, arrow keys or the buttons to move through a post */
.viewer { position: relative; display: grid; justify-items: center; gap: 10px; }
.slides {
  width: var(--vw); height: var(--vh);
  display: flex; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.slides::-webkit-scrollbar { display: none; }
.slides:focus-visible { outline: none; }
/* each photo fits whole inside the frame, portrait or landscape */
.slide { flex: 0 0 100%; height: 100%; min-width: 0; margin: 0; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.slide > img, .slide > video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; box-shadow: 0 10px 40px rgba(0,0,0,.12); }
.nav {
  position: absolute; top: calc(var(--vh) / 2); transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid #000; background: rgba(255,255,255,.92); color: #000;
  display: grid; place-items: center; cursor: pointer;
}
.nav svg { width: 12px; height: 12px; }
.nav.prev { left: -52px; } .nav.next { right: -52px; }
.nav[disabled] { opacity: .2; cursor: default; }
.where { font-size: 11px; color: var(--soft); letter-spacing: .04em; }
@media (max-width: 720px) { .nav { display: none; } }

.caption .tags { max-width: min(640px, 86vw); line-height: 1.7; color: var(--ink); text-wrap: balance; }
.caption .tag { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.caption .tag:hover, .caption .tag:focus-visible { border-bottom-color: currentColor; }

@media (prefers-reduced-motion: reduce) { .art > img, .art > video { transition: none; } }

/* Right-click notice */
img, video { -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; }
.notice {
  position: fixed; z-index: 50; pointer-events: none;
  padding: 7px 12px; border: 1px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink);
  font-family: "Fragment Mono", ui-monospace, Menlo, monospace; font-size: 12px; letter-spacing: .04em; white-space: nowrap;
  opacity: 0; transform: translateY(4px); transition: opacity .25s ease, transform .25s ease;
}
.notice.on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .notice { transition: none; } }
