@import url("./transition-sound.css");
@import url("./room-cinema.css");
@import url("./station-wayfinder.css");
@import url("./route-transition.css");
@import url("./return-plaque.css");

:root {
  color-scheme: dark;
  font-family: Georgia, "Times New Roman", serif;
  background: #171713;
  color: #f8f1dc;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-width: 320px; min-height: 100%; }

body { min-height: 100dvh; overflow: hidden; background: #171713; }
/* A decoded destination cover spans the full-document cinematic handoff. */
html[data-transition-arrival], html[data-transition-arrival] body {
  background-image: var(--arrival-image);
  background-size: var(--arrival-fit);
  background-position: var(--arrival-position);
  background-repeat: no-repeat;
}

.skip-link {
  position: fixed; z-index: 100; top: 0.75rem; left: 0.75rem; padding: 0.75rem 1rem;
  background: #fff7db; color: #171713; transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.room {
  position: relative; width: 100%; height: 100dvh; min-height: 34rem; isolation: isolate;
  overflow: hidden; opacity: 0; transition: opacity 420ms ease;
}
.room.is-ready { opacity: 1; }
.room.is-leaving { opacity: 0; }
.room.room--video-arrival { transition: none; }

/* These approved office scenes keep the painted Return sign in view, including
   portrait phones. Still and video share this exact 16:9 room surface. */
.room[data-room-framing="complete-scene"] {
  position: absolute;
  width: min(100vw, calc(100dvh * 16 / 9));
  height: min(100dvh, calc(100vw * 9 / 16));
  min-height: 0;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.room__picture { position: absolute; inset: 0; z-index: -3; }
.room[data-room-framing="full-viewport"] { height: 100dvh; min-height: 0; }
.room__art { width: 100%; height: 100%; object-fit: cover; }
.room__shade { display: none; }

.room__header {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.hotspots { position: absolute; inset: 0; }
.hotspot {
  --x: 50%; --y: 50%; --hotspot-width: 12%; --hotspot-height: 12%;
  position: absolute; left: var(--x); top: var(--y); width: var(--hotspot-width); height: var(--hotspot-height);
  min-width: 3rem; min-height: 3rem; transform: translate(-50%, -50%); color: inherit; text-decoration: none;
  display: block; border-radius: 0.4rem; outline: none; cursor: pointer;
}
.hotspot:hover { background: rgb(210 172 85 / 0.07); box-shadow: 0 0 1.4rem rgb(225 186 91 / 0.22); }
.hotspot.hotspot--video-return {
  background-image: var(--return-artwork);
  background-size: var(--return-artwork-size);
  background-position: var(--return-artwork-position);
  background-repeat: no-repeat;
}
.hotspot:focus-visible { outline: 0.2rem solid #d9ad4e; outline-offset: 0.18rem; box-shadow: 0 0 1.1rem rgb(225 186 91 / 0.28); }
.hotspot__sign-text {
  position: absolute;
  left: 32%; right: 18%; top: 9%; bottom: 9%;
  display: flex; flex-direction: column; justify-content: center;
  padding-left: 1%;
  color: #f4dfb2;
  background: #20180e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: calc(var(--hotspot-height) * .305);
  line-height: 1.15;
  text-align: left;
  white-space: nowrap;
  pointer-events: none;
}
.hotspot.is-viewport-unavailable,
.book-hotspot.is-viewport-unavailable,
.room-interaction.is-viewport-unavailable { pointer-events: none; }

.room-interaction {
  --x: 50%; --y: 50%; --hotspot-width: 18%; --hotspot-height: 18%; --glow-idle: .25; --glow-breathe: .34; --glow-hover: .48;
  position: absolute; left: var(--x); top: var(--y); width: var(--hotspot-width); height: var(--hotspot-height);
  min-width: 3rem; min-height: 3rem; padding: 0; border: 0; border-radius: 46%;
  outline: none; background: transparent; cursor: pointer; isolation: isolate;
}
.room-interaction::before {
  content: ""; position: absolute; inset: -10%; z-index: -1; border-radius: 48%; pointer-events: none;
  opacity: var(--glow-idle);
  background: radial-gradient(ellipse at 50% 52%, rgb(236 190 91 / .34) 0 18%, rgb(190 119 42 / .17) 42%, transparent 72%);
  filter: blur(clamp(.45rem, 1.4vw, 1.25rem));
  animation: room-object-glow var(--discovery-duration, 5.5s) ease-in-out var(--discovery-delay, 0s) infinite;
}
.room-interaction::after { content: ""; position: absolute; inset: 0; border-radius: 46%; pointer-events: none; background: linear-gradient(110deg, transparent 30%, rgb(243 202 125 / .27) 49%, transparent 67%); background-size: 300% 100%; mask-image: radial-gradient(ellipse, #000 10%, transparent 70%); animation: room-object-shimmer var(--discovery-duration, 5.5s) ease-in-out var(--discovery-delay, 0s) infinite; }
.room-interaction:is(:hover, :focus-visible)::before { animation: none; opacity: var(--glow-hover); filter: blur(clamp(.35rem, 1vw, .9rem)) drop-shadow(0 0 1rem rgb(229 169 67 / .38)); }
.room-interaction:focus-visible { outline: .15rem solid #e5b85b; outline-offset: .15rem; }
.room-interaction[data-glow-level="strong"]::before { background: radial-gradient(ellipse, rgb(241 189 86 / .65), rgb(220 149 54 / .3) 40%, transparent 72%); }
.room-interaction--no-glow::before, .room-interaction--no-glow::after { display: none; }
.room.interaction-preview .room-interaction { outline: .12rem dashed rgb(255 229 161 / .72); outline-offset: .1rem; background: rgb(221 167 73 / .1); }
@keyframes room-object-glow { 0%, 55%, 100% { transform: scale(.98); opacity: var(--glow-idle); } 72% { transform: scale(1.035); opacity: var(--glow-breathe); } }
@keyframes room-object-shimmer { 0%, 55% { opacity: 0; background-position: 100% 0; } 65% { opacity: .6; } 88%, 100% { opacity: 0; background-position: 0% 0; } }

.room-experience { width: min(38rem, calc(100% - 2rem)); border: 1px solid #8f6737; padding: 0; color: #f2e2bc; background: #28180f; box-shadow: 0 1.5rem 4rem #000a; }
.room-experience::backdrop { background: rgb(15 9 6 / .74); backdrop-filter: blur(4px); }
.room-experience section { padding: clamp(1.25rem, 5vw, 2.5rem); text-align: center; }
.room-experience h2 { margin-top: 0; font-weight: 400; }
.room-experience p { line-height: 1.6; }
.room-experience button { min-height: 2.75rem; padding: .55rem 1rem; border: 1px solid #b88b4d; color: #f1dfb7; background: #3a2415; font: inherit; cursor: pointer; }
.room-experience button:focus-visible { outline: .2rem solid #e0b85d; outline-offset: .18rem; }

.room__secondary { display: none; }

.room__note { position: absolute; right: clamp(1rem, 4vw, 4rem); bottom: clamp(1rem, 4vw, 2.5rem); max-width: 22rem; margin: 0; padding: 0.55rem 0.75rem; background: rgb(21 21 17 / 0.74); color: #eee5ca; font: 0.9rem/1.45 system-ui, sans-serif; }
.no-script { position: fixed; inset: auto 1rem 1rem; z-index: 200; padding: 1rem; background: #fff7db; color: #171713; font: 1rem/1.5 system-ui, sans-serif; }

@media (max-width: 42rem) {
  .room { min-height: 30rem; }
  .room__note { left: 1rem; right: 1rem; bottom: 4.75rem; max-width: none; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .room-interaction::before { animation: none; opacity: var(--glow-breathe); }
  .room-interaction::after { animation: none; display: none; }
  .room-interaction:is(:hover, :focus-visible)::before { animation: none; opacity: var(--glow-hover); transform: none; }
}

@media (forced-colors: active) {
  .hotspot:focus-visible, .room-interaction:focus-visible { outline: 0.25rem solid Highlight; box-shadow: none; }
}

/* Cropped content only; Return remains at the top of the viewport. */
.room-contents-trigger {
  position: fixed;
  z-index: 60;
  bottom: max(.85rem, env(safe-area-inset-bottom));
  right: max(.85rem, env(safe-area-inset-right));
  min-height: 44px;
  max-width: calc(100vw - 1.7rem);
  padding: .6rem .85rem;
  border: 1px solid #b79a5d;
  border-radius: .18rem;
  color: #efdeb0;
  background: #182d24;
  font: 1rem/1.25 Georgia, "Times New Roman", serif;
  cursor: pointer;
}
.room-contents-trigger[hidden], .room-contents-dialog li[hidden] { display: none; }
.room-contents-dialog {
  width: min(28rem, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid #b79a5d;
  color: #efdeb0;
  background: #182d24;
  font-family: Georgia, "Times New Roman", serif;
}
.room-contents-dialog::backdrop { background: rgb(8 11 8 / .8); }
.room-contents-dialog h2 { margin: 0 0 .75rem; font-size: 1.2rem; }
.room-contents-dialog ul { list-style: none; padding: 0; margin: 0; }
.room-contents-dialog button {
  width: 100%;
  min-height: 48px;
  padding: .65rem;
  border: 1px solid #947a45;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.room-contents-dialog .room-contents-close { margin-top: .75rem; text-align: center; }
.room-contents-trigger:focus-visible, .room-contents-dialog button:focus-visible { outline: 2px solid #e2bb61; outline-offset: 2px; }
