:root {
  --wine: #78004c;
  --orange: #dc8900;
  --blue: #005caf;
  --ink: #292520;
  --paper: #f6f1e7;
  --line: #d9d1c4;
  --red: #e54931;
  --yellow: #f3ca3d;
  --serif: Georgia,'Times New Roman',serif;
  --sans: Arial,'Helvetica Neue',sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
}

button,input {
  font: inherit;
}

button,a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: .45;
}

a {
  color: inherit;
}

button:focus-visible,a:focus-visible,input:focus-visible,[tabindex]:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 5px;
}

h1,h2,h3,p {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
}

button {
  color: inherit;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none!important;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  padding: 12px 20px;
  background: white;
  z-index: 50;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.small-label {
  font-size: 12px;
  letter-spacing: .15em;
  font-weight: 700;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  min-height: 50px;
  background: var(--wine);
  border: 1px solid var(--wine);
  padding: 12px 22px;
  color: #fff;
  font-weight: 600;
}

.primary-button:hover {
  background: #560038;
}

.primary-button span {
  font-size: 24px;
  line-height: 1;
}

.secondary-button {
  background: transparent;
  border: 1px solid #958b7e;
  min-height: 44px;
  padding: 9px 16px;
}

.secondary-button:hover {
  background: #e9e2d5;
}

.museum-header {
  height: 88px;
  display: flex;
  align-items: center;
  background: var(--wine);
  color: #fff;
  padding: 0 3.3%;
  gap: 36px;
  position: relative;
  z-index: 5;
}

.wordmark {
  font: 800 40px/1 var(--sans);
  letter-spacing: -2px;
  text-decoration: none;
}

.wordmark span {
  color: #f1a414;
}

.main-nav {
  margin-left: auto;
  margin-right: auto;
}

.main-nav ul {
  display: flex;
  gap: 64px;
}

.nav-link {
  border: 0;
  background: transparent;
  color: #fff;
  font: 700 27px/1.4 var(--serif);
  padding: 14px 0;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 0;
  right: 0;
  height: 2px;
  background: #f1a414;
  transform: scaleX(0);
  transition: transform .2s;
}

.nav-link:hover::after,.nav-link.active::after {
  transform: scaleX(1);
}

.menu-button {
  width: 46px;
  height: 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  align-items: flex-end;
  border: 0;
  background: transparent;
  padding: 9px;
}

.menu-button span {
  display: block;
  width: 25px;
  height: 3px;
  background: white;
}

.menu-button span:last-child {
  width: 17px;
}

.entrance {
  position: relative;
  height: calc(100svh - 88px);
  min-height: 580px;
  overflow: hidden;
}

.entrance-art {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

.entrance-copy {
  position: relative;
  text-align: center;
  padding: 9vh 24px 0;
}

.entrance-copy .small-label {
  color: #776450;
}

.museum-name {
  font: clamp(23px,2.5vw,36px)/1.3 var(--serif);
  margin-top: 32px;
  color: #554837;
}

.entrance h1 {
  font: 900 clamp(72px,10vw,152px)/1.15 var(--sans);
  letter-spacing: -.055em;
  margin: 3px 0 18px;
}

.entrance h1 span:nth-child(1) {
  color: var(--wine);
}

.entrance h1 span:nth-child(2) {
  color: var(--orange);
}

.entrance h1 span:nth-child(3) {
  color: var(--blue);
}

.entrance-note {
  font-size: 14px;
  margin-top: 16px;
  color: #524737;
}

.entrance-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--wine);
  color: #fff;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 3.3%;
  font-size: 11px;
  letter-spacing: .13em;
}

.noscript-note {
  padding: 24px;
}

.gallery {
  height: calc(100svh - 88px);
  min-height: 600px;
  display: flex;
  flex-direction: column;
}

.gallery-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 3.3% 18px;
}

.gallery-heading .small-label {
  color: var(--wine);
  font-size: 11px;
  margin-bottom: 4px;
}

.gallery-heading h1 {
  font: 29px/1.2 var(--serif);
}

.progress-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: #6a6258;
}

.progress-number {
  font-size: 26px;
  letter-spacing: -.03em;
  font-weight: 600;
  color: var(--wine);
}

.gallery-viewport {
  flex: 1;
  min-height: 350px;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  touch-action: pan-x;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  background: #e9dec8;
}

.gallery-viewport::-webkit-scrollbar {
  display: none;
}

.gallery-viewport.dragging {
  cursor: grabbing;
}

.panorama {
  position: relative;
  height: 122%;
  aspect-ratio: 2169/725;
  width: auto;
  max-width: none;
  user-select: none;
}

.panorama-image {
  width: 100%;
  height: 100%;
  max-width: none;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  z-index: 1;
  width: 48px;
  height: 48px;
  transform: translate(-50%,-50%);
  background: transparent;
  border: 0;
  padding: 9px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  touch-action: pan-x;
}

.dot-symbol {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 2px solid #292520;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 0 0 5px #fff5,0 3px 8px #0003;
  transition: transform .18s;
}

.game-dot .dot-symbol {
  background: var(--red);
  color: #fff;
}

.story-dot .dot-symbol {
  background: var(--yellow);
  color: #2c2823;
}

.hotspot:hover .dot-symbol,.hotspot:focus-visible .dot-symbol {
  transform: scale(1.2);
}

.hotspot.done .dot-symbol {
  background: var(--wine);
  color: #fff;
  border-color: #fff;
}

.hotspot-label {
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%,6px);
  position: absolute;
  left: 50%;
  bottom: 56px;
  min-width: 170px;
  white-space: nowrap;
  background: #fffaf1;
  padding: 13px 16px;
  text-align: left;
  box-shadow: 0 6px 20px #0002;
  font-size: 15px;
  font-weight: 600;
  transition: opacity .18s,transform .18s;
}

.hotspot-label small {
  display: block;
  font-size: 10px;
  letter-spacing: .08em;
  color: #75634c;
  margin-top: 3px;
}

.hotspot:hover,.hotspot:focus-visible {
  z-index: 2;
}

.hotspot:hover .hotspot-label,.hotspot:focus-visible .hotspot-label {
  opacity: 1;
  transform: translate(-50%,0);
}

.spot-bell {
  left: 27.7%;
  top: 36%;
}

.spot-pattern {
  left: 11%;
  top: 30%;
}

.spot-beads {
  left: 22.8%;
  top: 54%;
}

.spot-puzzle {
  left: 73.7%;
  top: 44%;
}

.spot-vessel {
  left: 53%;
  top: 46%;
}

.spot-box {
  left: 89%;
  top: 47%;
}

.gallery-controls {
  padding: 14px 3.3% 10px;
  background: var(--paper);
}

.control-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.movement-hint {
  font-size: 14px;
}

.movement-hint>span {
  margin-right: 10px;
  font-size: 21px;
}

.legend {
  display: flex;
  gap: 23px;
  font-size: 12px;
}

.legend>span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.legend-dot.red {
  background: var(--red);
}

.legend-dot.yellow {
  background: var(--yellow);
}

.legend-check {
  font-style: normal;
  color: var(--wine);
  font-weight: 700;
}

.direction-buttons {
  display: flex;
  gap: 8px;
}

.direction-buttons button {
  width: 40px;
  height: 36px;
  background: transparent;
  border: 1px solid #b8ad9c;
  font-size: 22px;
}

.direction-buttons button:hover {
  background: var(--wine);
  color: #fff;
}

#gallery-position {
  width: 100%;
  height: 22px;
  accent-color: var(--wine);
  cursor: ew-resize;
  margin: 7px 0 3px;
}

.zone-nav ul {
  display: flex;
  justify-content: space-between;
}

.zone-nav button {
  border: 0;
  background: transparent;
  color: #817364;
  padding: 4px 0;
  font-size: 11px;
  letter-spacing: .08em;
}

.zone-nav button span {
  font-size: 13px;
  letter-spacing: 0;
  margin-left: 8px;
}

.zone-nav button.selected {
  color: var(--wine);
  font-weight: 700;
}

dialog {
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 25px 100px #0005;
  max-height: 90svh;
}

dialog::backdrop {
  background: #1c1420a8;
  backdrop-filter: blur(5px);
}

.experience-dialog {
  width: min(1000px,calc(100% - 48px));
  overflow-y: auto;
}

.close-button {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 40px;
  height: 40px;
  border: 1px solid #a39480;
  background: var(--paper);
  font-size: 27px;
  line-height: 1;
  z-index: 2;
}

.experience-layout {
  display: grid;
  grid-template-columns: 38% 62%;
  min-height: 550px;
}

.object-panel {
  background: #e7dfd1;
  padding: 30px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.object-index {
  font-size: 12px;
  letter-spacing: .14em;
  color: #76654e;
}

.object-panel img {
  width: 100%;
  height: 350px;
  object-fit: contain;
  mix-blend-mode: multiply;
  margin: 18px 0;
}

.object-panel p {
  font-size: 13px;
  line-height: 1.5;
  color: #64543f;
  margin-top: auto;
}

.activity-panel {
  padding: 55px 44px 36px;
  min-width: 0;
}

.activity-panel .small-label {
  color: var(--wine);
  margin-bottom: 13px;
}

.activity-panel h2,.utility-dialog h2 {
  font: 40px/1.1 var(--serif);
  letter-spacing: -.03em;
}

.activity-intro {
  margin-top: 16px;
  color: #6a6054;
  max-width: 430px;
  font-size: 15px;
  line-height: 1.6;
}

.activity-feedback {
  font-size: 14px;
  min-height: 42px;
  margin: 15px 0;
  color: var(--wine);
}

.completion-message {
  background: #e8eee5;
  border-left: 3px solid #4f7150;
  padding: 14px 16px;
  margin-top: 22px;
  font-size: 14px;
  color: #29432b;
}

.completion-message strong {
  display: block;
  margin-bottom: 5px;
}

.activity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.activity-note {
  font-size: 12px;
  color: #827462;
  margin-top: 14px;
}

.story-description {
  font: 21px/1.6 var(--serif);
  margin: 25px 0;
}

.story-prompt {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 14px;
  color: #6a6054;
}

.rhythm-steps {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.rhythm-step {
  width: 43px;
  height: 43px;
  border: 1px solid #c8baa6;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: #958369;
}

.rhythm-step.lit {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.tone-buttons {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 10px;
  margin-top: 18px;
}

.tone-button {
  min-height: 92px;
  background: #ebe1ce;
  border: 1px solid #c8baa6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 26px;
}

.tone-button span {
  font-size: 12px;
}

.tone-button.lit,.tone-button:active {
  background: var(--wine);
  color: #fff;
}

.tone-button:disabled {
  opacity: .6;
}

.puzzle-grid {
  width: min(100%,300px);
  aspect-ratio: 1.23;
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 5px;
  margin: 24px auto 0;
}

.puzzle-tile {
  position: relative;
  border: 2px solid transparent;
  background-image: url('assets/tang-porcelain-dish.webp');
  background-size: 200% 200%;
  padding: 0;
  cursor: grab;
  touch-action: pan-y;
}

.puzzle-tile[data-piece="0"] {
  background-position: 0 0;
}

.puzzle-tile[data-piece="1"] {
  background-position: 100% 0;
}

.puzzle-tile[data-piece="2"] {
  background-position: 0 100%;
}

.puzzle-tile[data-piece="3"] {
  background-position: 100% 100%;
}

.puzzle-tile.selected {
  border-color: var(--wine);
  outline: 3px solid var(--wine);
  outline-offset: 1px;
  z-index: 1;
}

.puzzle-tile span {
  position: absolute;
  bottom: 5px;
  left: 5px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  background: #fffdf1d9;
  font-size: 12px;
  color: #41372a;
}

.puzzle-grid.solved {
  gap: 0;
}

.puzzle-grid.solved .puzzle-tile {
  border: 0;
}

.puzzle-grid.solved span {
  display: none;
}

.pattern-target {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 14px;
  font-size: 13px;
}

.pattern-sample {
  width: 66px;
  height: 72px;
  background-image: url('assets/shang-bronze-bell.webp');
  background-size: 300% 300%;
  background-position: 0 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px #c8baa6;
  flex-shrink: 0;
}

.pattern-board {
  width: 180px;
  aspect-ratio: 1991/2840;
  margin: auto;
  position: relative;
}

.pattern-board>img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pattern-cells {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3,1fr);
  grid-template-rows: repeat(3,1fr);
}

.pattern-cell {
  border: 1px solid #fff5;
  background: transparent;
  position: relative;
}

.pattern-cell:hover {
  background: #ffcf3b44;
}

.pattern-cell.wrong {
  background: #df493766;
}

.pattern-cell.correct {
  background: #f3ca3d77;
  outline: 3px solid var(--wine);
  outline-offset: -3px;
}

.pattern-cell.correct::after {
  content: '✓';
  color: var(--wine);
  font-size: 32px;
  font-weight: 700;
}

.utility-dialog {
  width: min(850px,calc(100% - 40px));
  padding: 42px;
}

.utility-dialog>.small-label {
  color: var(--wine);
  margin-bottom: 12px;
}

.utility-dialog h2 {
  margin-bottom: 24px;
}

.route-list {
  display: grid;
  gap: 12px;
}

.route-card {
  display: flex;
  align-items: center;
  gap: 22px;
  text-align: left;
  border: 1px solid var(--line);
  background: transparent;
  padding: 20px;
  width: 100%;
}

.route-card:hover {
  border-color: var(--wine);
  background: #ede4d6;
}

.route-card>span {
  font: 36px var(--serif);
  color: var(--wine);
}

.route-card strong {
  display: block;
  font-size: 18px;
  font-weight: 500;
}

.route-card small {
  display: block;
  color: #776753;
  font-size: 13px;
  margin-top: 4px;
}

.collection-list {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 18px;
}

.collection-card {
  border: 1px solid var(--line);
  background: #ede6d9;
  padding: 15px;
  text-align: left;
}

.collection-card:hover {
  border-color: var(--wine);
}

.collection-card img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.collection-card strong {
  display: block;
  font: 18px/1.2 var(--serif);
  margin: 14px 0 8px;
}

.collection-card small {
  font-size: 11px;
  color: #7a624f;
}

.help-list {
  display: grid;
  gap: 19px;
  margin-top: 10px;
}

.help-list li {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  font-size: 15px;
  color: #6a6054;
}

.help-list strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.utility-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
  align-items: center;
  font-size: 14px;
}

@media(min-width:1700px) {
  .panorama {
    height: 135%;
  }
  .entrance-copy {
    padding-top: 10vh;
  }
}

@media(max-width:900px) {
  .museum-header {
    gap: 20px;
    height: 74px;
    padding-inline: 24px;
  }
  .wordmark {
    font-size: 32px;
  }
  .main-nav ul {
    gap: 30px;
  }
  .nav-link {
    font-size: 23px;
  }
  .gallery {
    height: calc(100svh - 74px);
  }
  .entrance {
    height: calc(100svh - 74px);
  }
  .experience-layout {
    grid-template-columns: 33% 67%;
  }
  .activity-panel {
    padding: 50px 28px 30px;
  }
  .object-panel {
    padding: 24px 18px;
  }
  .object-panel img {
    height: 310px;
  }
  .legend {
    gap: 14px;
  }
  .movement-hint {
    font-size: 12px;
  }
  .gallery-heading h1 {
    font-size: 25px;
  }
  .progress-summary {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
  }
  .progress-number {
    font-size: 23px;
  }
}

@media(max-width:600px) {
  .museum-header {
    height: 70px;
    padding: 0 16px;
    gap: 12px;
  }
  .wordmark {
    font-size: 26px;
    letter-spacing: -1.4px;
  }
  .main-nav {
    margin-right: 0;
  }
  .main-nav ul {
    gap: 15px;
  }
  .nav-link {
    font: 600 15px/1.4 var(--serif);
  }
  .menu-button {
    width: 32px;
    padding: 3px;
  }
  .menu-button span {
    width: 20px;
    height: 2px;
  }
  .menu-button span:last-child {
    width: 14px;
  }
  .entrance {
    height: calc(100svh - 70px);
    min-height: 560px;
  }
  .entrance-copy {
    padding: 65px 18px 0;
  }
  .entrance-copy .small-label {
    font-size: 9px;
    letter-spacing: .09em;
  }
  .museum-name {
    margin-top: 26px;
    font-size: 24px;
  }
  .entrance h1 {
    font-size: clamp(54px,18vw,72px);
    letter-spacing: -.06em;
    margin: 10px 0 20px;
  }
  .entrance-art {
    object-position: center bottom;
  }
  .entrance-note {
    font-size: 12px;
  }
  .entrance-footer {
    font-size: 9px;
    padding-inline: 16px;
    gap: 20px;
  }
  .entrance-footer span:last-child {
    text-align: right;
  }
  .gallery {
    height: calc(100svh - 70px);
    min-height: 570px;
  }
  .gallery-heading {
    padding: 17px 18px;
    gap: 14px;
  }
  .gallery-heading .small-label {
    font-size: 9px;
  }
  .gallery-heading h1 {
    font-size: 22px;
    max-width: 220px;
  }
  .progress-summary {
    font-size: 10px;
    white-space: nowrap;
  }
  .progress-number {
    font-size: 21px;
  }
  .gallery-viewport {
    min-height: 320px;
  }
  .gallery-controls {
    padding: 12px 18px;
  }
  .control-topline {
    flex-wrap: wrap;
    gap: 9px;
  }
  .movement-hint {
    flex: 1;
    font-size: 12px;
  }
  .legend {
    order: 3;
    width: 100%;
    font-size: 11px;
    gap: 16px;
  }
  .direction-buttons button {
    height: 31px;
    width: 34px;
    font-size: 18px;
  }
  .zone-nav button {
    font-size: 10px;
  }
  .zone-nav button span {
    font-size: 10px;
    margin-left: 3px;
  }
  .hotspot-label {
    display: none;
  }
  .experience-dialog {
    width: calc(100% - 24px);
  }
  .experience-layout {
    display: block;
  }
  .object-panel {
    min-height: 140px;
    max-height: 180px;
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 10px 16px;
    padding: 22px;
  }
  .object-index {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    font-size: 10px;
    padding-right: 24px;
  }
  .object-panel img {
    grid-column: 1;
    grid-row: 1/3;
    height: 110px;
    margin: 0;
    align-self: center;
  }
  .object-panel p {
    grid-column: 2;
    grid-row: 2;
    font-size: 11px;
    margin: 0;
  }
  .activity-panel {
    padding: 26px 23px 28px;
  }
  .activity-panel h2,.utility-dialog h2 {
    font-size: 32px;
  }
  .activity-panel .small-label {
    font-size: 10px;
    margin-bottom: 8px;
  }
  .activity-intro {
    font-size: 14px;
    margin-top: 12px;
  }
  .rhythm-steps {
    margin-top: 20px;
  }
  .tone-button {
    min-height: 78px;
  }
  .puzzle-grid {
    width: 240px;
    margin-top: 18px;
  }
  .utility-dialog {
    padding: 38px 24px 28px;
  }
  .collection-list {
    grid-template-columns: repeat(2,1fr);
    gap: 12px;
  }
  .collection-card {
    padding: 10px;
  }
  .collection-card img {
    height: 95px;
  }
  .collection-card strong {
    font-size: 16px;
  }
  .route-card {
    padding: 16px;
    gap: 14px;
  }
  .route-card strong {
    font-size: 16px;
  }
  .route-card small {
    font-size: 12px;
  }
  .pattern-board {
    width: 150px;
  }
}

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