:root {
  --ink: #172026;
  --paper: #f5efe4;
  --surface: #fffaf2;
  --line: rgba(255, 255, 255, 0.2);
  --blue: #245c83;
  --blue-dark: #163f5c;
  --burgundy: #8e3342;
  --olive: #526443;
  --gold: #c79a3d;
  --white: #ffffff;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  color: var(--surface);
  background: #11161a;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.45;
  overflow: hidden;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.immersive-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 10px 4vw;
  background: rgba(17, 22, 26, 0.72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.immersive-brand,
.immersive-nav {
  display: inline-flex;
  align-items: center;
}

.immersive-brand {
  gap: 10px;
  text-decoration: none;
}

.immersive-brand span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--white);
  background: var(--burgundy);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  font-weight: 850;
}

.immersive-nav {
  gap: 16px;
  font-weight: 750;
}

.immersive-nav a {
  color: var(--surface);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.immersive-nav a:hover,
.immersive-nav a:focus-visible {
  border-color: var(--gold);
}

.immersive-stage {
  position: relative;
  width: 100%;
  height: 100vh;
}

#museum-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  outline: none;
}

.scene-panel {
  position: fixed;
  z-index: 4;
  pointer-events: none;
}

.scene-panel--intro {
  left: 4vw;
  top: 88px;
  max-width: min(560px, 86vw);
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

.scene-panel--intro p {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.scene-panel--intro h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.scene-controls-text {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.scene-controls-text span,
.zone-nav button,
.touch-pad button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 22, 26, 0.68);
  color: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(7px);
}

.scene-controls-text span {
  padding: 8px 10px;
  font-size: 0.86rem;
}

.info-panel {
  position: fixed;
  right: 4vw;
  bottom: 96px;
  z-index: 5;
  width: min(420px, 92vw);
  padding: 18px;
  background: rgba(255, 250, 242, 0.92);
  color: var(--ink);
  border: 1px solid rgba(23, 32, 38, 0.16);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.info-panel__kicker {
  margin: 0 0 8px;
  color: var(--burgundy);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.info-panel h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.info-panel p:not(.info-panel__kicker) {
  margin: 10px 0 0;
}

.info-panel a {
  display: inline-flex;
  margin-top: 12px;
  color: var(--blue-dark);
  font-weight: 850;
  text-decoration: none;
  border-bottom: 2px solid currentColor;
}

.info-panel a[hidden] {
  display: none;
}

.zone-nav {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 6;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

.zone-nav button,
.touch-pad button {
  min-height: 42px;
  padding: 8px 13px;
  cursor: pointer;
}

.zone-nav button:hover,
.zone-nav button:focus-visible,
.touch-pad button:hover,
.touch-pad button:focus-visible {
  background: rgba(199, 154, 61, 0.85);
  color: #11161a;
}

.touch-pad {
  position: fixed;
  right: 4vw;
  bottom: 22px;
  z-index: 6;
  display: none;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(2, 44px);
  gap: 6px;
}

.touch-pad button {
  width: 44px;
  height: 44px;
  padding: 0;
}

.touch-pad [data-move="forward"] {
  grid-column: 2;
}

.touch-pad [data-move="left"] {
  grid-column: 1;
  grid-row: 2;
}

.touch-pad [data-move="back"] {
  grid-column: 2;
  grid-row: 2;
}

.touch-pad [data-move="right"] {
  grid-column: 3;
  grid-row: 2;
}

.scene-loading,
.scene-error {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 8;
  display: grid;
  gap: 8px;
  width: min(360px, 86vw);
  padding: 18px;
  text-align: center;
  background: rgba(17, 22, 26, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}

.scene-loading[hidden],
.scene-error[hidden] {
  display: none;
}

.scene-loading strong,
.scene-error strong {
  color: var(--gold);
}

@media (max-width: 860px) {
  .immersive-header {
    align-items: start;
    min-height: 60px;
  }

  .immersive-nav {
    gap: 10px;
    font-size: 0.88rem;
  }

  .scene-panel--intro {
    top: 78px;
  }

  .scene-controls-text span:nth-child(2) {
    display: none;
  }

  .info-panel {
    left: 4vw;
    right: 4vw;
    bottom: 88px;
    width: auto;
    padding: 14px;
  }

  .zone-nav {
    left: 4vw;
    right: auto;
    transform: none;
    max-width: calc(92vw - 152px);
    overflow-x: auto;
  }

  .touch-pad {
    display: grid;
  }
}

@media (max-width: 560px) {
  .immersive-brand strong {
    display: none;
  }

  .immersive-nav {
    margin-left: auto;
  }

  .immersive-nav a:nth-child(2) {
    display: none;
  }

  .scene-panel--intro {
    max-width: 72vw;
  }

  .scene-controls-text {
    display: none;
  }

  .zone-nav button {
    min-width: 92px;
  }
}
