:root {
  color-scheme: dark;
  --ink: #f6ead4;
  --muted: #cdbda5;
  --paper: #2d1811;
  --paper-light: #43251a;
  --accent: #d9b768;
  --accent-bright: #ffe09a;
  --line: rgba(255, 224, 154, 0.26);
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: #160d09;
}

body {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at 50% 0%, rgba(130, 51, 30, 0.32), transparent 36rem),
    linear-gradient(150deg, #21110c, #0f0907 72%);
}

button {
  font: inherit;
}

a {
  color: inherit;
}

.site-header,
.room-layout,
footer {
  width: min(1240px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  padding: clamp(2rem, 6vw, 4.75rem) 0 clamp(1.4rem, 3vw, 2.5rem);
  text-align: center;
}

.room-navigation {
  display: flex;
  justify-content: flex-start;
  margin-bottom: clamp(1.15rem, 2.5vw, 1.8rem);
}

.room-navigation a {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(217, 183, 104, 0.38);
  border-radius: 0.2rem;
  color: #e9d9bc;
  background: rgba(61, 32, 20, 0.62);
  font-size: 0.78rem;
  text-decoration: none;
}

.room-navigation a:hover,
.room-navigation a:focus-visible {
  border-color: var(--accent);
  color: #fff0c7;
  background: rgba(86, 47, 28, 0.82);
  outline: 2px solid rgba(217, 183, 104, 0.18);
  outline-offset: 2px;
}

.eyebrow,
.detail-kicker {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.45rem, 7vw, 5.7rem);
  font-weight: 400;
  line-height: 0.95;
  text-wrap: balance;
}

.intro {
  max-width: 44rem;
  margin: 1.15rem auto 0;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  line-height: 1.6;
}

.room-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(18.5rem, 0.95fr);
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: start;
}

.room-section,
.detail-panel,
.mobile-actions {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  background: rgba(40, 21, 15, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.room-section {
  padding: clamp(0.45rem, 1vw, 0.75rem);
  border-radius: 0.8rem;
}

.room-stage {
  position: relative;
  isolation: isolate;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #1a0d09;
}

.room-stage::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: inherit;
  box-shadow: inset 0 0 4rem rgba(0, 0, 0, 0.22);
  content: "";
  pointer-events: none;
}

.room-stage > img {
  display: block;
  width: 100%;
  height: auto;
}

.hotspot {
  position: absolute;
  z-index: 2;
  width: clamp(1.7rem, 3.4vw, 2.7rem);
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  color: transparent;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
  text-decoration: none;
}

.hotspot::before {
  font-family: system-ui, sans-serif;
  font-size: clamp(1rem, 2vw, 1.45rem);
  font-weight: 600;
  content: "+";
}

.hotspot span {
  position: absolute;
  bottom: calc(100% + 0.7rem);
  left: 50%;
  width: max-content;
  max-width: 9rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  color: var(--ink);
  background: rgba(25, 13, 9, 0.94);
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.35rem);
  transition: opacity 160ms ease, transform 160ms ease;
}

.hotspot:hover,
.hotspot:focus-visible {
  border-color: #fff0ba;
  color: #21130d;
  background: var(--accent-bright);
  box-shadow: 0 0 0 0.6rem rgba(255, 217, 125, 0.26), 0 0 2rem rgba(255, 207, 94, 1);
  outline: none;
  transform: translate(-50%, -50%) scale(1.12);
}

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

.hotspot--personal { left: 61.4%; top: 55.4%; }
.hotspot--globe { left: 77%; top: 71%; }
.hotspot--portrait { left: 47%; top: 47%; }
.hotspot--fireplace { left: 27%; top: 70%; }

.discovery-zone {
  position: absolute;
  z-index: 2;
  border: 1px solid transparent;
  border-radius: 0.3rem;
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  transform: translate(-50%, -50%);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.discovery-zone span {
  position: absolute;
  bottom: calc(100% + 0.65rem);
  left: 50%;
  width: max-content;
  max-width: 9rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  color: var(--ink);
  background: rgba(25, 13, 9, 0.96);
  font-family: system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.35rem);
  transition: opacity 160ms ease, transform 160ms ease;
}

.discovery-zone:hover,
.discovery-zone:focus-visible {
  border-color: rgba(255, 239, 190, 0.9);
  box-shadow: 0 0 0 0.18rem rgba(255, 226, 150, 0.18), 0 0 1rem rgba(255, 211, 103, 0.72);
  outline: none;
}

.discovery-zone:hover span,
.discovery-zone:focus-visible span {
  opacity: 1;
  transform: translate(-50%, 0);
}

.discovery-zone--chronicle { left: 80%; top: 45.4%; width: 1.1%; height: 8.1%; }
.discovery-zone--travel { left: 77%; top: 70.5%; width: 14%; height: 22%; border-radius: 50%; }
.discovery-zone--canvas { left: 42.9%; top: 31.2%; width: 7.6%; height: 14.2%; border-radius: 50%; }
.discovery-zone--treasure { left: 59.8%; top: 54.8%; width: 5.4%; height: 13.8%; border-radius: 0.18rem; }

body.treasure-reveal-active {
  overflow: hidden;
}

.treasure-reveal[hidden] {
  display: none;
}

.treasure-reveal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  overflow: auto;
  color: #f7ead1;
  opacity: 1;
  transition: opacity 600ms ease;
}

.treasure-reveal.is-closing {
  opacity: 0;
}

.treasure-reveal__shade {
  position: fixed;
  z-index: 0;
  inset: 0;
  background: rgba(13, 7, 5, 0.94);
  opacity: 0;
  backdrop-filter: blur(0);
}

.treasure-reveal.is-active .treasure-reveal__shade {
  animation: treasure-room-darkens 1400ms ease forwards;
}

.treasure-reveal__stage {
  position: relative;
  z-index: 1;
  min-height: max(100svh, var(--treasure-sequence-height, 100svh));
}

.treasure-frame {
  position: absolute;
  z-index: 2;
  top: var(--treasure-start-top);
  left: var(--treasure-start-left);
  width: var(--treasure-start-width);
  height: var(--treasure-start-height);
  padding: clamp(0.28rem, 1vw, 0.7rem);
  border: clamp(0.16rem, 0.45vw, 0.34rem) ridge #aa7a35;
  background:
    linear-gradient(135deg, #3c210f, #c59a4e 18%, #5a3416 42%, #d2ae63 72%, #3a1f0d);
  box-shadow:
    inset 0 0 0 2px rgba(255, 229, 159, 0.34),
    inset 0 0 0 5px rgba(51, 27, 12, 0.55),
    0 0.55rem 1.2rem rgba(0, 0, 0, 0.5);
  opacity: 0.78;
  transform: rotate(-8deg) skewY(-2deg);
  transform-origin: 50% 75%;
  will-change: top, left, width, height, transform, opacity;
}

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

.treasure-frame::before {
  inset: 0.25rem;
  border: 1px solid rgba(255, 230, 164, 0.42);
}

.treasure-frame::after {
  inset: 0.5rem;
  border: 1px solid rgba(55, 29, 12, 0.7);
}

.treasure-frame__mat {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 2px solid rgba(37, 19, 9, 0.9);
  background: #1d110c;
}

.treasure-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #1d110c;
  filter: blur(32px) saturate(0.62) brightness(0.68);
  opacity: 0.58;
  transform: scale(1.1);
  will-change: filter, opacity, transform;
}

.treasure-reveal__copy {
  position: absolute;
  z-index: 3;
  top: var(--treasure-copy-top);
  left: 50%;
  width: min(92vw, 52rem);
  padding: 0 1rem 2.5rem;
  text-align: center;
  transform: translateX(-50%);
}

.treasure-reveal__quote,
.treasure-reveal__copy h2,
.treasure-reveal__return {
  opacity: 0;
  transform: translateY(0.65rem);
}

.treasure-reveal__quote {
  max-width: 34rem;
  margin: 0 auto;
  color: #e8d7b7;
  font-size: clamp(1.05rem, 2.1vw, 1.55rem);
  font-style: italic;
  line-height: 1.45;
}

.treasure-reveal__copy h2 {
  margin: 0.55rem 0 0;
  color: #e1bd6c;
  font-size: clamp(1.85rem, 4.6vw, 3.7rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0;
}

.treasure-reveal__return {
  margin-top: 1.45rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid rgba(225, 189, 108, 0.55);
  border-radius: 0.2rem;
  color: #f6ead4;
  background: rgba(65, 34, 20, 0.82);
  cursor: pointer;
}

.treasure-reveal__return:hover,
.treasure-reveal__return:focus-visible {
  border-color: #e1bd6c;
  background: #5b321e;
  outline: 2px solid rgba(225, 189, 108, 0.32);
  outline-offset: 3px;
}

.treasure-reveal.is-active .treasure-reveal__quote {
  animation: treasure-copy-appears 900ms ease 7300ms forwards;
}

.treasure-reveal.is-active .treasure-reveal__copy h2 {
  animation: treasure-copy-appears 900ms ease 8200ms forwards;
}

.treasure-reveal.is-active .treasure-reveal__return {
  animation: treasure-copy-appears 800ms ease 9000ms forwards;
}

@keyframes treasure-room-darkens {
  to {
    opacity: 1;
    backdrop-filter: blur(2px);
  }
}

@keyframes treasure-copy-appears {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.discovery-zone--shelf-book {
  border-radius: 0.08rem;
  transition: background 180ms ease, box-shadow 180ms ease, filter 180ms ease, transform 180ms ease;
}

.discovery-zone--shelf-book:hover,
.discovery-zone--shelf-book:focus-visible {
  border-color: rgba(255, 235, 174, 0.42);
  background: rgba(255, 218, 126, 0.12);
  box-shadow: 0 0 0.45rem rgba(255, 218, 126, 0.32);
  filter: brightness(1.16);
  transform: translate(-50%, -50%) scale(1.07);
}

.discovery-zone--shelf-book:hover span,
.discovery-zone--shelf-book:focus-visible span {
  opacity: 0;
}

.room-footer-tools {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.35rem 0.2rem;
}

.room-hint {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
}

.room-hint span {
  display: inline-grid;
  width: 1.35rem;
  aspect-ratio: 1;
  border: 1px solid var(--accent);
  border-radius: 50%;
  place-items: center;
  color: var(--accent-bright);
}

.journey-reset {
  flex: 0 0 auto;
  min-height: 2.15rem;
  padding: 0.48rem 0.72rem;
  border: 1px solid rgba(217, 183, 104, 0.42);
  border-radius: 0.18rem;
  color: #e9d9bc;
  background:
    linear-gradient(rgba(91, 52, 29, 0.82), rgba(55, 29, 17, 0.9)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 5px);
  box-shadow: inset 0 0 0 1px rgba(255, 231, 178, 0.07);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.76rem;
  cursor: pointer;
}

.journey-reset:hover,
.journey-reset:focus-visible {
  border-color: var(--accent);
  color: #fff0c7;
  background:
    linear-gradient(rgba(108, 63, 34, 0.9), rgba(67, 36, 20, 0.94)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 5px);
  outline: 2px solid rgba(217, 183, 104, 0.18);
  outline-offset: 2px;
}

.detail-panel {
  position: sticky;
  top: 1rem;
  min-height: 18rem;
  padding: clamp(1.3rem, 3vw, 2rem);
  border-radius: 0.8rem;
}

.detail-panel h2,
.mobile-actions h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 400;
  line-height: 1.05;
}

.detail-copy {
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  line-height: 1.58;
}

.detail-copy p {
  margin: 0;
}

.detail-copy p + p {
  margin-top: 0.72rem;
}

.detail-action {
  margin: 1.25rem 0 0;
  padding-top: 1.05rem;
  border-top: 1px solid var(--line);
  color: var(--accent-bright);
  font-style: italic;
  line-height: 1.5;
}

.mobile-actions {
  display: none;
  padding: 1rem;
  border-radius: 0.8rem;
}

.action-grid {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.action-grid button,
.action-grid a {
  display: grid;
  gap: 0.2rem;
  min-height: 4.4rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  text-decoration: none;
}

.action-grid button:hover,
.action-grid button:focus-visible,
.action-grid button.is-active,
.action-grid a:hover,
.action-grid a:focus-visible {
  border-color: var(--accent);
  background: rgba(217, 183, 104, 0.12);
  outline: none;
}

.action-grid span {
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
}

footer {
  padding: 2.5rem 0 3rem;
  color: #9d8b76;
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  text-align: center;
}

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

@media (max-width: 880px) {
  .room-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-panel {
    position: static;
    min-height: 0;
  }

  .mobile-actions {
    display: block;
  }
}

@media (max-width: 560px) {
  .site-header,
  .room-layout,
  footer {
    width: min(100% - 1rem, 1240px);
  }

  .site-header {
    padding-top: 2rem;
  }

  .room-navigation {
    margin-bottom: 1.2rem;
  }

  .room-navigation a {
    justify-content: center;
    width: 100%;
    min-height: 2.75rem;
  }

  h1 {
    font-size: clamp(2.15rem, 11vw, 3rem);
  }

  h1 span {
    display: block;
  }

  .intro {
    font-size: 0.88rem;
  }

  .room-section {
    padding: 0.3rem;
  }

  .room-hint {
    font-size: 0.7rem;
  }

  .room-footer-tools {
    align-items: stretch;
    flex-direction: column;
    padding: 0.65rem 0.4rem 0.35rem;
  }

  .journey-reset {
    align-self: flex-start;
    min-height: 2.75rem;
    width: 100%;
    font-size: 0.78rem;
  }

  .hotspot span {
    display: none;
  }

  .discovery-zone span {
    display: none;
  }

  .detail-panel {
    padding: 1.2rem;
  }

  .treasure-reveal__copy {
    width: min(94vw, 32rem);
    padding-inline: 0.65rem;
  }

  .treasure-reveal__quote {
    max-width: 19rem;
  }

  .treasure-reveal__return {
    min-height: 2.8rem;
  }
}

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