:root {
  --ivory: #f3e5c8;
  --ivory-soft: #fff5df;
  --gold: #c6a15b;
  --gold-bright: #efd89b;
  --ink: #100c0b;
  --forest: #14241b;
  --wine: #74293a;
  --safe-top: max(18px, env(safe-area-inset-top));
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
  color-scheme: dark;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

body {
  height: 100svh;
  color: var(--ivory);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  overscroll-behavior: none;
}

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

button {
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  background: none;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 1px solid var(--gold-bright);
  outline-offset: 5px;
}

#magicCanvas {
  position: fixed;
  z-index: 60;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.castle,
.scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
}

.castle {
  isolation: isolate;
  overflow: hidden;
  background: var(--ink);
}

.scene {
  z-index: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transform: scale(1.035);
  transition:
    opacity 640ms ease,
    transform 900ms cubic-bezier(.2, .75, .2, 1),
    visibility 0s linear 900ms;
}

.scene.is-active {
  z-index: 2;
  visibility: visible;
  opacity: 1;
  transform: scale(1);
  transition-delay: 0s;
}

.scene.is-leaving {
  z-index: 3;
  visibility: visible;
  opacity: 0;
  transform: scale(1.12);
  filter: blur(5px) brightness(1.18);
}

.scene__camera,
.scene__picture,
.scene__picture img,
.scene__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene__picture { display: block; }

.scene__camera {
  transform: translate3d(calc(var(--mx, 0) * -0.9%), calc(var(--my, 0) * -0.65%), 0) scale(1.035);
  transition: transform 800ms cubic-bezier(.2, .65, .2, 1);
  will-change: transform;
}

.scene__picture img,
.scene__image {
  display: block;
  object-fit: cover;
}

.entry-camera {
  transform: scale(1.01);
  background: #17100c;
}

.entry-camera img {
  object-position: center 62%;
}

.scene--entry.is-leaving .entry-camera {
  transform: scale(1.16);
  filter: blur(3px) brightness(1.16);
  transition: transform 1100ms cubic-bezier(.18, .78, .2, 1), filter 900ms ease;
}

.entry-gate {
  position: absolute;
  z-index: 5;
  top: 82%;
  left: 50%;
  width: min(63vw, 270px);
  height: 12svh;
  min-height: 82px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.entry-gate__focus {
  position: absolute;
  inset: 17% 6%;
  border: 1px solid transparent;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(239, 216, 155, 0);
  transition: border-color 350ms ease, box-shadow 350ms ease, transform 350ms ease;
}

/* The mobile entrance artwork already contains its designed title and button. */
.entry-gate__focus { display: none; }

.entry-gate:hover .entry-gate__focus,
.entry-gate:focus-visible .entry-gate__focus,
.entry-gate:active .entry-gate__focus {
  border-color: rgba(239, 216, 155, .72);
  box-shadow: 0 0 34px rgba(239, 216, 155, .34), inset 0 0 22px rgba(255, 247, 222, .12);
  transform: scale(1.05);
}

.entry-hint {
  display: none;
}

.hall-camera::after,
.gallery-world::after {
  position: absolute;
  content: "";
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 110px rgba(9, 5, 4, .42);
}

.hall-camera {
  --hall-offset: 0px;
  top: 0;
  left: 0;
  width: 177.78svh;
  min-width: 100vw;
  height: 100svh;
  transform: translate3d(calc(-1 * var(--hall-offset)), 0, 0) scale(1.012);
  transform-origin: 50% 50%;
  transition: transform 900ms cubic-bezier(.18, .74, .2, 1);
  touch-action: pan-y;
}

.hall-camera.is-dragging {
  transition: none;
}

.hall-camera .scene__image {
  object-fit: fill;
}

.scene-nav {
  position: absolute;
  z-index: 24;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: 50px 1fr 68px;
  align-items: center;
  width: 100%;
  min-height: 82px;
  padding: calc(var(--safe-top) + 4px) 18px 10px;
  background: linear-gradient(180deg, rgba(13, 8, 6, .64), rgba(13, 8, 6, 0));
}

.crest-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(239, 216, 155, .68);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(198, 161, 91, .1);
}

.crest-button span {
  color: var(--gold-bright);
  font-family: Georgia, serif;
  font-size: 23px;
  font-style: italic;
}

.scene-nav__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .72);
}

.scene-nav__title strong {
  color: var(--ivory-soft);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .25em;
  text-indent: .25em;
}

.scene-nav__title small,
.scene-nav__counter,
.keeper-link {
  color: rgba(243, 229, 200, .72);
  font-family: Georgia, serif;
  font-size: 8px;
  letter-spacing: .24em;
}

.keeper-link {
  justify-self: end;
  color: rgba(243, 229, 200, .78);
  text-decoration: none;
  letter-spacing: .12em;
}

.hotspots {
  position: absolute;
  z-index: 20;
  inset: 0;
}

.hotspot {
  position: absolute;
  width: 74px;
  height: 74px;
  border-radius: 50%;
}

.hotspot__aura {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 239, 184, .9);
  border-radius: 50%;
  background: rgba(255, 230, 151, .34);
  box-shadow: 0 0 10px 3px rgba(255, 224, 126, .5), 0 0 30px 10px rgba(225, 178, 87, .24);
  animation: breathe 2.8s ease-in-out infinite;
}

.hotspot__aura::before,
.hotspot__aura::after {
  position: absolute;
  content: "";
  inset: -10px;
  border: 1px solid rgba(239, 216, 155, .42);
  border-radius: 50%;
  animation: orbit 5s linear infinite;
}

.hotspot__aura::after {
  inset: -19px;
  border-style: dotted;
  opacity: .42;
  animation-direction: reverse;
  animation-duration: 8s;
}

.hotspot__label {
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  display: flex;
  width: max-content;
  max-width: 132px;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px 9px;
  transform: translate(-50%, 8px);
  border: 1px solid rgba(198, 161, 91, .38);
  background: rgba(16, 12, 11, .72);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .25);
  color: var(--ivory-soft);
  font-size: 13px;
  letter-spacing: .15em;
  opacity: 0;
  backdrop-filter: blur(8px);
  pointer-events: none;
  transition: opacity 280ms ease, transform 280ms ease;
}

.hotspot__label small {
  color: rgba(239, 216, 155, .72);
  font-family: Georgia, serif;
  font-size: 8px;
  letter-spacing: .12em;
}

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

.hotspot--painting { top: 36.5%; left: 18.8%; }
.hotspot--book { top: 60.5%; left: 39%; }
.hotspot--mirror { top: 41%; left: 62.8%; }
.hotspot--projector { top: 49.5%; left: 78.8%; }
.hotspot--workshop { top: 53%; left: 49%; }
.hotspot--book .hotspot__aura { animation-delay: -.7s; }
.hotspot--mirror .hotspot__aura { animation-delay: -1.4s; }
.hotspot--projector .hotspot__aura { animation-delay: -2.1s; }

.scene-whisper,
.gallery-hint {
  position: absolute;
  z-index: 21;
  bottom: calc(var(--safe-bottom) + 12px);
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  color: rgba(255, 244, 216, .84);
  font-size: 11px;
  letter-spacing: .28em;
  text-indent: .28em;
  text-shadow: 0 2px 12px #000;
  white-space: nowrap;
  animation: whisper 3.2s ease-in-out infinite;
}

.hall-workshop-link {
  position: absolute;
  z-index: 26;
  right: 18px;
  bottom: calc(var(--safe-bottom) + 42px);
  display: grid;
  gap: 3px;
  min-width: 132px;
  padding: 9px 13px 10px;
  border: 1px solid rgba(239,216,155,.52);
  background: rgba(16,12,11,.68);
  box-shadow: 0 10px 28px rgba(0,0,0,.28), inset 0 0 18px rgba(239,216,155,.05);
  text-align: left;
  backdrop-filter: blur(8px);
}
.hall-workshop-link span { color: rgba(239,216,155,.72); font: 9px Georgia, serif; letter-spacing: .18em; }
.hall-workshop-link strong { color: var(--ivory-soft); font-size: 13px; font-weight: 400; letter-spacing: .12em; }
.hall-workshop-link:hover, .hall-workshop-link:focus-visible { border-color: var(--gold-bright); transform: translateY(-2px); }

.gallery-world {
  --gallery-offset: 0px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  min-width: 100vw;
  height: 100svh;
  transform: translate3d(calc(-1 * var(--gallery-offset)), 0, 0) scale(1.012);
  transform-origin: 50% 50%;
  transition: transform 900ms cubic-bezier(.18, .74, .2, 1);
  will-change: transform;
  touch-action: manipulation;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,231,177,.18), transparent 32%),
    linear-gradient(115deg, #241611 0%, #4a2d24 44%, #241611 100%);
}

.gallery-world.is-dragging {
  transition: none;
}

.gallery-world__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .42;
  filter: saturate(.72) sepia(.18) brightness(.72);
}

.gallery-architecture {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(13,7,5,.72), transparent 18%, transparent 82%, rgba(13,7,5,.72)),
    linear-gradient(180deg, rgba(14,7,5,.18), transparent 24%, rgba(9,5,4,.44));
}

.gallery-architecture::before,
.gallery-architecture::after {
  position: absolute;
  content: "";
  top: 14%;
  bottom: 12%;
  width: 13px;
  background: linear-gradient(90deg, #3e2417, #d0a05a 44%, #4b2b1a);
  box-shadow: 0 0 0 2px rgba(239,216,155,.18), 0 0 28px rgba(239,190,102,.16);
}
.gallery-architecture::before { left: 8%; }
.gallery-architecture::after { right: 8%; }

.gallery-display {
  position: absolute;
  z-index: 7;
  inset: 16% 9% 18%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(22px, 5vw, 72px);
  overflow-y: auto;
  align-content: start;
  padding: 8px 4px 20px;
  scrollbar-width: none;
}
.gallery-display::-webkit-scrollbar { display: none; }

.art-frame {
  position: absolute;
  z-index: 8;
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: .72;
  padding: 10px;
  overflow: visible;
  border: 2px solid #a97c37;
  background: #23160e;
  box-shadow:
    0 0 0 4px #3a2615,
    0 0 0 6px #d1aa61,
    0 14px 30px rgba(0, 0, 0, .5),
    inset 0 0 14px rgba(238, 206, 132, .45);
  transform: perspective(700px) rotateY(var(--frame-tilt, 0deg));
  transition: filter 280ms ease, box-shadow 280ms ease, transform 280ms ease;
  opacity: 1;
  pointer-events: auto;
}

.art-frame::before {
  position: absolute;
  z-index: 2;
  content: "";
  inset: -10px;
  border: 1px solid rgba(236, 202, 128, .35);
  pointer-events: none;
}

.art-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.9) contrast(1.02);
}

.art-frame span {
  position: absolute;
  top: calc(100% + 17px);
  left: 50%;
  width: max-content;
  transform: translateX(-50%);
  color: #f8e9c6;
  font-size: clamp(10px, 1.4svh, 14px);
  letter-spacing: .18em;
  text-shadow: 0 2px 8px #000;
  opacity: .88;
}

.art-frame:hover,
.art-frame:focus-visible,
.art-frame.is-near {
  filter: brightness(1.1);
  box-shadow:
    0 0 0 4px #4b3118,
    0 0 0 6px #e2bd72,
    0 0 38px rgba(237, 196, 110, .42),
    0 18px 36px rgba(0, 0, 0, .54);
}

.art-frame--one { --frame-tilt: 2deg; }
.art-frame--two { --frame-tilt: -2deg; }

.scene-nav--gallery {
  grid-template-columns: 54px 1fr 54px;
}

.back-button,
.viewer-close {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ivory-soft);
}

.back-button svg,
.viewer-close svg {
  width: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scene-nav__counter {
  justify-self: end;
  letter-spacing: .08em;
}

.gallery-rail,
.hall-rail {
  position: absolute;
  z-index: 25;
  bottom: calc(var(--safe-bottom) + 48px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(-50%);
}

.gallery-rail button,
.hall-rail button {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.gallery-rail button::before,
.hall-rail button::before {
  display: block;
  width: 4px;
  height: 4px;
  margin: auto;
  content: "";
  border-radius: 50%;
  background: rgba(243, 229, 200, .62);
  box-shadow: 0 0 0 0 rgba(198, 161, 91, 0);
  transition: box-shadow 250ms ease, background 250ms ease;
}

.gallery-rail button.is-active::before,
.hall-rail button.is-active::before {
  background: var(--gold-bright);
  box-shadow: 0 0 0 5px rgba(198, 161, 91, .22), 0 0 16px rgba(239, 216, 155, .7);
}

.gallery-hint {
  bottom: calc(var(--safe-bottom) + 14px);
  font-size: 9px;
}

.artwork-viewer {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  width: 100vw;
  height: 100svh;
  place-items: center;
  padding: calc(var(--safe-top) + 64px) 20px calc(var(--safe-bottom) + 22px);
  visibility: hidden;
  background: #0b0807;
  opacity: 0;
  transition: opacity 520ms ease, visibility 0s linear 520ms;
}

.artwork-viewer::before {
  position: absolute;
  content: "";
  inset: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(116, 41, 58, .18), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(198, 161, 91, .12), transparent 35%);
  pointer-events: none;
}

.artwork-viewer.is-open {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.viewer-close {
  position: absolute;
  z-index: 4;
  top: calc(var(--safe-top) + 12px);
  left: 18px;
  color: rgba(255, 245, 222, .86);
  font-size: 11px;
  letter-spacing: .16em;
}

.viewer-art {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(100%, 520px);
  max-height: 80svh;
  margin: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 18px;
}

.viewer-art img {
  display: block;
  width: 100%;
  max-height: 61svh;
  object-fit: contain;
  border: 1px solid rgba(198, 161, 91, .52);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .64), 0 0 0 6px rgba(198, 161, 91, .04);
  transform: translateY(20px) scale(.92);
  opacity: 0;
  transition: transform 720ms cubic-bezier(.16, .78, .2, 1), opacity 500ms ease;
}

.artwork-viewer.is-open .viewer-art img {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.viewer-art figcaption {
  padding: 0 4px;
  transform: translateY(12px);
  opacity: 0;
  transition: transform 500ms ease 180ms, opacity 500ms ease 180ms;
}

.artwork-viewer.is-open figcaption {
  transform: translateY(0);
  opacity: 1;
}

.book-viewer {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100svh;
  padding: calc(var(--safe-top) + 70px) 24px calc(var(--safe-bottom) + 24px);
  visibility: hidden;
  background: #16100c;
  opacity: 0;
  transition: opacity 420ms ease, visibility 0s linear 420ms;
}

.workshop-viewer {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-top) + 64px) 22px calc(var(--safe-bottom) + 22px);
  visibility: hidden;
  background: radial-gradient(circle at 50% 36%, rgba(198,161,91,.16), transparent 48%), #0c0908;
  opacity: 0;
  transition: opacity 360ms ease, visibility 0s linear 360ms;
}
.workshop-viewer.is-open { visibility: visible; opacity: 1; transition-delay: 0s; }
.workshop-card {
  width: min(100%, 520px);
  padding: 38px 24px 30px;
  border: 1px solid rgba(198,161,91,.55);
  background: linear-gradient(150deg, rgba(71,43,27,.84), rgba(20,13,10,.94));
  box-shadow: 0 28px 90px rgba(0,0,0,.56), inset 0 0 50px rgba(239,216,155,.05);
  text-align: center;
}
.workshop-card h1 { margin: 10px 0 10px; font-size: clamp(28px, 8vw, 42px); font-weight: 400; letter-spacing: .12em; }
.workshop-card > p:not(.book-page__index) { color: rgba(243,229,200,.72); font-size: 13px; letter-spacing: .08em; }
.workshop-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.workshop-link { display: grid; gap: 7px; padding: 18px 12px; border: 1px solid rgba(198,161,91,.42); background: rgba(14,9,7,.52); color: inherit; text-align: left; text-decoration: none; transition: background 240ms ease, border-color 240ms ease, transform 240ms ease; }
.workshop-link:hover, .workshop-link:focus-visible { border-color: var(--gold-bright); background: rgba(116,41,58,.26); transform: translateY(-3px); }
.workshop-link span { color: var(--gold-bright); font: 11px Georgia, serif; letter-spacing: .2em; }
.workshop-link strong { font-size: 16px; font-weight: 500; letter-spacing: .12em; }
.workshop-link small { color: rgba(243,229,200,.56); font-size: 10px; }

.book-viewer.is-open {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.book-page {
  position: relative;
  width: min(100%, 430px);
  min-height: min(66svh, 560px);
  padding: 48px 30px 44px;
  border: 1px solid rgba(126, 83, 35, .72);
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.25), transparent 36%),
    linear-gradient(135deg, #d3b27a, #f0dba9 42%, #c39b5f);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .58), inset 0 0 0 8px rgba(111, 71, 29, .12);
  color: #342216;
  transform: translateY(22px) rotate(-1deg) scale(.96);
  opacity: 0;
  transition: transform 650ms cubic-bezier(.17, .78, .2, 1), opacity 420ms ease;
}

.book-viewer.is-open .book-page {
  transform: translateY(0) rotate(-1deg) scale(1);
  opacity: 1;
}

.book-page::before,
.book-page::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.book-page::before {
  inset: 15px;
  border: 1px solid rgba(103, 64, 25, .4);
}

.book-page::after {
  inset: 24px;
  border: 1px solid rgba(103, 64, 25, .18);
}

.book-page__index,
.book-page__note {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: Georgia, serif;
  letter-spacing: .2em;
}

.book-page__index {
  font-size: 10px;
  color: rgba(52, 34, 22, .66);
}

.book-page h1 {
  position: relative;
  z-index: 1;
  margin: 58px 0 22px;
  font-size: clamp(30px, 9vw, 44px);
  font-weight: 400;
  letter-spacing: .16em;
}

.book-page__rule {
  position: relative;
  z-index: 1;
  width: 74px;
  height: 1px;
  margin-bottom: 34px;
  background: #78552c;
}

.book-page__empty,
.book-page__note {
  position: relative;
  z-index: 1;
  max-width: 18em;
  line-height: 2;
}

.book-page__empty {
  margin: 0 0 18px;
  font-size: 18px;
  letter-spacing: .08em;
}

.book-page__note {
  font-family: inherit;
  font-size: 12px;
  letter-spacing: .06em;
  opacity: .7;
}

.book-page__mark {
  position: absolute;
  right: 46px;
  bottom: 40px;
  color: rgba(104, 62, 24, .48);
  font-family: Georgia, serif;
  font-size: 64px;
  font-style: italic;
}

.viewer-art figcaption > p:first-child {
  margin: 0 0 7px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: .3em;
}

.viewer-art h1 {
  margin: 0;
  color: var(--ivory-soft);
  font-size: clamp(24px, 7vw, 34px);
  font-weight: 400;
  letter-spacing: .08em;
}

.viewer-art figcaption > p:last-child {
  max-width: 35em;
  margin: 12px 0 0;
  color: rgba(243, 229, 200, .66);
  font-size: 12px;
  line-height: 1.85;
  letter-spacing: .08em;
}

.transition-light {
  position: fixed;
  z-index: 70;
  top: 50%;
  left: 50%;
  width: 10vmax;
  height: 10vmax;
  transform: translate(-50%, -50%) scale(.1);
  border-radius: 50%;
  background: #fff4d5;
  box-shadow: 0 0 90px 45px rgba(255, 221, 151, .7);
  opacity: 0;
  pointer-events: none;
}

.transition-light.is-flashing {
  animation: portalFlash 980ms cubic-bezier(.2, .7, .2, 1) both;
}

.castle-toast {
  position: fixed;
  z-index: 90;
  bottom: calc(var(--safe-bottom) + 66px);
  left: 50%;
  width: max-content;
  max-width: calc(100vw - 40px);
  padding: 11px 16px;
  transform: translate(-50%, 12px);
  border: 1px solid rgba(198, 161, 91, .38);
  background: rgba(16, 12, 11, .82);
  color: var(--ivory-soft);
  font-size: 12px;
  letter-spacing: .12em;
  opacity: 0;
  backdrop-filter: blur(10px);
  pointer-events: none;
  transition: opacity 260ms ease, transform 260ms ease;
}

.castle-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@keyframes breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(.8); opacity: .68; }
  50% { transform: translate(-50%, -50%) scale(1.18); opacity: 1; }
}

@keyframes orbit {
  to { transform: rotate(360deg); }
}

@keyframes whisper {
  0%, 100% { opacity: .48; }
  50% { opacity: .92; }
}

@keyframes portalFlash {
  0% { transform: translate(-50%, -50%) scale(.08); opacity: 0; }
  38% { opacity: .62; }
  68% { transform: translate(-50%, -50%) scale(15); opacity: .95; }
  100% { transform: translate(-50%, -50%) scale(22); opacity: 0; }
}

@media (min-aspect-ratio: 4/5) {
  .hall-camera { width: max(130vw, 177.78svh); }
  .hotspot--painting { top: 36.5%; left: 18.8%; }
  .hotspot--book { top: 60.5%; left: 39%; }
  .hotspot--mirror { top: 41%; left: 62.8%; }
  .hotspot--projector { top: 49.5%; left: 78.8%; }
  .hotspot--workshop { top: 53%; left: 49%; }
  .hall-rail { display: none; }
  .gallery-world { width: 100vw; }
  .gallery-display { inset: 16% 14% 18%; gap: 6vw; }
}

@media (max-aspect-ratio: 4/5) {
  .entry-gate { top: 78%; }
  .gallery-display { inset: 17% 14% 20%; grid-template-columns: 1fr 1fr; gap: 16px; }
  .hall-workshop-link { right: 14px; bottom: calc(var(--safe-bottom) + 48px); }
  .art-frame { padding: 7px; }
  .art-frame span { top: calc(100% + 10px); font-size: 10px; letter-spacing: .1em; }
}

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

  .scene__camera {
    transform: scale(1.02);
  }
}

/* Castle 7 — restrained cinematic finish */
#magicCanvas { opacity: .34; transition: opacity 360ms ease; }
body[data-scene="entry"] #magicCanvas { opacity: .12; }

.scene {
  transform: scale(1.012);
  transition: opacity 380ms ease, transform 520ms cubic-bezier(.22,.72,.2,1), visibility 0s linear 520ms;
}
.scene.is-leaving { transform: scale(1.035); filter: blur(2px) brightness(1.05); }
.scene__camera { transition-duration: 420ms; }

.entry-camera img { object-position: center center; }
.entry-gate { top: 79%; width: min(59vw, 270px); height: 9svh; min-height: 64px; }

.hotspot { width: 62px; height: 62px; }
.hotspot__aura {
  width: 8px;
  height: 8px;
  border: 0;
  background: #ffeab0;
  box-shadow: 0 0 8px 2px rgba(255,225,145,.62), 0 0 24px 7px rgba(213,172,91,.18);
  animation-duration: 3.8s;
}
.hotspot__aura::before { inset: -7px; border-color: rgba(239,216,155,.24); animation: none; }
.hotspot__aura::after { display: none; }
.hotspot__label {
  top: calc(100% - 4px);
  gap: 3px;
  padding: 7px 0 8px;
  border: 0;
  border-top: 1px solid rgba(239,216,155,.5);
  background: linear-gradient(180deg, rgba(12,9,8,.78), rgba(12,9,8,.48));
  box-shadow: none;
  font-size: 12px;
  letter-spacing: .18em;
  backdrop-filter: blur(5px);
}
.hotspot__label small { font-size: 7px; letter-spacing: .18em; }
.hotspot--workshop .hotspot__label { opacity: .88; transform: translate(-50%, 0); }

.scene-whisper,
.gallery-hint { animation: none; opacity: .72; font-size: 9px; }
.hall-workshop-link { display: none !important; }

.gallery-world {
  transform: none;
  transition: none;
  background: linear-gradient(145deg, #1a110e, #321f18 52%, #150e0c);
}
.gallery-world__image { opacity: .16; filter: saturate(.55) brightness(.7); }
.gallery-architecture { display: none; }
.gallery-display {
  inset: 16% 6% 15%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
  align-content: center;
  padding: 10px;
  overflow-y: auto;
  scrollbar-width: none;
}
.art-frame {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  padding: 6px;
  transform: none;
  border: 1px solid rgba(232,202,139,.58);
  background: #17100d;
  box-shadow: 0 0 0 2px #3d291d, 0 14px 36px rgba(0,0,0,.34);
  filter: none;
  transition: transform 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
}
.art-frame::before { display: none; }
.art-frame img { object-position: center; }
.art-frame span {
  top: calc(100% + 10px);
  max-width: 100%;
  overflow: hidden;
  color: rgba(255,239,205,.84);
  font-size: 9px;
  letter-spacing: .12em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.art-frame:hover,
.art-frame:focus-visible,
.art-frame.is-near {
  transform: translateY(-3px);
  filter: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 2px #3d291d, 0 18px 48px rgba(0,0,0,.48), 0 0 28px rgba(198,161,91,.14);
}

.workshop-viewer {
  align-items: end;
  padding: calc(var(--safe-top) + 70px) 18px 0;
  background: linear-gradient(180deg, rgba(10,7,6,.58), #0d0908 46%);
  backdrop-filter: blur(10px);
}
.workshop-card {
  width: min(100%, 700px);
  max-height: calc(100svh - var(--safe-top) - 70px);
  padding: 34px 22px calc(var(--safe-bottom) + 26px);
  overflow-y: auto;
  border: 0;
  border-top: 1px solid rgba(226,190,119,.52);
  background: linear-gradient(145deg, rgba(39,25,19,.98), rgba(16,11,9,.99));
  box-shadow: 0 -22px 70px rgba(0,0,0,.45);
  text-align: left;
}
.workshop-card h1 { margin: 8px 0 8px; font-size: clamp(30px,8vw,44px); }
.workshop-card > p:not(.book-page__index) { margin: 0; font-size: 11px; }
.workshop-links { display: grid; grid-template-columns: 1fr; gap: 0; margin-top: 25px; border-top: 1px solid rgba(198,161,91,.22); }
.workshop-link {
  position: relative;
  display: grid;
  grid-template-columns: 88px 1fr 22px;
  grid-template-rows: auto auto;
  gap: 4px 10px;
  align-items: center;
  padding: 16px 2px;
  border: 0;
  border-bottom: 1px solid rgba(198,161,91,.2);
  background: transparent;
}
.workshop-link:hover,
.workshop-link:focus-visible { padding-inline: 9px; border-color: rgba(239,216,155,.48); background: rgba(255,255,255,.025); transform: none; }
.workshop-link span { grid-row: 1 / 3; font-size: 9px; opacity: .72; }
.workshop-link strong { font-size: 15px; font-weight: 400; }
.workshop-link small { grid-column: 2; font-size: 9px; }
.workshop-link i { grid-column: 3; grid-row: 1 / 3; color: var(--gold-bright); font: normal 16px Georgia,serif; }

@media (min-aspect-ratio: 4/5) {
  .entry-gate { top: 71.5%; left: 85%; width: min(15vw,250px); height: 10svh; }
  .gallery-display { inset: 20% 8% 20%; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(22px,3vw,52px); overflow: visible; }
  .art-frame { max-height: 54svh; }
  .workshop-viewer { place-items: center; padding: 80px 24px 24px; }
  .workshop-card { padding: 46px 46px 38px; border: 1px solid rgba(226,190,119,.42); }
}
