/* ============================================================
   Visual Reality — museum.css
   Green Tech Museum: CSS 3D walk-through gallery + exhibits
   Requires styles.css (design tokens, nav, footer, buttons)
   ============================================================ */

/* ---------- Hero ---------- */
.ms-hero {
  padding: calc(var(--header-h, 76px) + clamp(2.6rem, 6vw, 4.2rem)) 0 clamp(1.6rem, 3.5vw, 2.6rem);
  text-align: center;
}

.ms-hero h1 {
  max-width: 21ch;
  margin-inline: auto;
}

.ms-hero .lead {
  max-width: 46rem;
  margin-inline: auto;
}

.ms-hero-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1.5rem;
  margin: 1.6rem auto 0;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
}

.ms-chip-key {
  display: inline-block;
  min-width: 1.7em;
  padding: 0.12em 0.4em;
  margin-inline: 0.08em;
  border-radius: 7px;
  background: var(--mint, #e7f6ee);
  border: 1px solid rgba(14, 159, 110, 0.3);
  border-bottom-width: 2.5px;
  color: #047857;
  font-family: var(--font-body, Inter, sans-serif);
  font-size: 0.82em;
  text-align: center;
}

/* ---------- Toolbar (view toggle + hall dots) ---------- */
.ms-gallery {
  padding-bottom: clamp(2.4rem, 5vw, 4rem);
}

.ms-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 1.4rem;
  margin-bottom: 1.1rem;
}

.ms-viewtoggle {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--line, #dcebe2);
  box-shadow: var(--shadow-sm, 0 6px 18px rgba(11, 31, 22, 0.06));
}

.ms-viewbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.05rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft, #456a58);
  font: 600 0.9rem/1 var(--font-body, Inter, sans-serif);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.ms-viewbtn:hover {
  color: #065f46;
}

.ms-viewbtn.active {
  background: linear-gradient(120deg, #0ea672, #0d9488);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(13, 148, 136, 0.35);
}

.ms-roomdots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ms-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.52rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--line, #dcebe2);
  background: #ffffff;
  color: var(--ink-soft, #456a58);
  font: 600 0.88rem/1 var(--font-body, Inter, sans-serif);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ms-dot:hover {
  transform: translateY(-1px);
  border-color: rgba(13, 148, 136, 0.55);
  color: #065f46;
}

.ms-dot.active {
  border-color: transparent;
  background: #06281d;
  color: #ffffff;
}

.ms-dot-ico {
  font-size: 0.95em;
  line-height: 1;
}

/* ---------- Stage shell ---------- */
.ms-stage-wrap {
  position: relative;
}

.ms-stage {
  --stage-h: clamp(430px, 62vh, 640px);
  position: relative;
  height: var(--stage-h);
  border-radius: 26px;
  overflow: hidden;
  perspective: 1050px;
  perspective-origin: 50% 46%;
  background:
    radial-gradient(120% 90% at 50% 0%, #eef8f2 0%, #dcefe6 55%, #cfe6db 100%);
  border: 1px solid var(--line, #dcebe2);
  box-shadow: var(--shadow-lg, 0 30px 60px rgba(11, 31, 22, 0.14));
  outline: none;
  cursor: grab;
  touch-action: pan-y;
}

.ms-stage:focus-visible {
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px rgba(13, 148, 136, 0.75);
}

.ms-stage:active {
  cursor: grabbing;
}

/* the moved "world" — transform driven by museum.js */
.ms-world {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}

.ms-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 22%),
    linear-gradient(0deg, rgba(6, 40, 29, 0.16) 0%, rgba(6, 40, 29, 0) 26%);
  box-shadow: inset 0 0 90px rgba(6, 40, 29, 0.16);
}

/* walk-transition blink (masks room hand-off) */
.ms-blink {
  position: absolute;
  inset: 0;
  background: #05231a;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

.ms-blink.on {
  animation: ms-blinkfade 0.95s ease-in-out;
}

@keyframes ms-blinkfade {
  0% { opacity: 0; }
  32% { opacity: 0.92; }
  68% { opacity: 0.92; }
  100% { opacity: 0; }
}

/* room visibility helper (JS toggles) */
.ms-room.is-far {
  visibility: hidden;
}

/* ---------- Room construction (3D) ---------- */
/* each room is a ZERO-SIZE anchor at the world origin; every surface
   inside is placed by its own transform (coordinates in museum.js) */
.ms-room {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}

.ms-room-surface {
  position: absolute;
  left: 0;
  top: 0;
  backface-visibility: hidden;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.ms-floor,
.ms-ceiling {
  width: var(--room-w, 1920px);
  height: var(--room-d, 950px);
}

.ms-floor {
  background:
    radial-gradient(58% 34% at 50% 62%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 70%),
    repeating-linear-gradient(0deg, rgba(6, 40, 29, 0.07) 0 1.5px, transparent 1.5px 96px),
    repeating-linear-gradient(90deg, rgba(6, 40, 29, 0.07) 0 1.5px, transparent 1.5px 96px),
    var(--room-floor, #e7f2ea);
  border-color: rgba(6, 40, 29, 0.08);
}

.ms-ceiling {
  background:
    var(--room-ceiling, linear-gradient(180deg, #f4faf6, #e9f5ef));
  border-color: rgba(6, 40, 29, 0.06);
}

.ms-ceiling::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 44%;
  height: 7%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 251, 235, 0.95), rgba(255, 255, 255, 0.1));
  box-shadow: 0 0 42px 12px rgba(254, 243, 199, 0.65);
}

.ms-wall-left,
.ms-wall-right {
  width: var(--room-d, 950px);
  height: var(--room-h, 620px);
  background:
    repeating-linear-gradient(0deg, rgba(6, 40, 29, 0.045) 0 1.5px, transparent 1.5px 110px),
    var(--room-wall, linear-gradient(180deg, #f2f8f4, #e3efe7));
  border-color: rgba(6, 40, 29, 0.06);
}

.ms-wall-left::after,
.ms-wall-right::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 10px;
  background: var(--room-skirting, rgba(6, 40, 29, 0.1));
  border-radius: 4px 4px 0 0;
}

/* framed "blueprints" hanging on side walls (decor only) */
.ms-wallframe {
  position: absolute;
  width: 190px;
  height: 128px;
  border-radius: 10px;
  border: 1px solid rgba(6, 40, 29, 0.14);
  background:
    linear-gradient(0deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.2)),
    var(--room-framebg, #ffffff);
  box-shadow: 0 14px 26px rgba(6, 40, 29, 0.14);
  display: grid;
  place-items: center;
  color: var(--room-accent, #0d9488);
}

.ms-wallframe svg {
  opacity: 0.8;
}

.ms-wallframe::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed currentColor;
  opacity: 0.35;
  border-radius: 7px;
}

.ms-backwall {
  width: var(--room-w, 1920px);
  height: var(--room-h, 620px);
  background:
    radial-gradient(90% 68% at 50% 108%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, var(--room-back-a, #eaf6ef), var(--room-back-b, #d8ece2));
  border-color: rgba(6, 40, 29, 0.09);
  overflow: hidden;
}

.ms-room-name {
  position: absolute;
  left: 0;
  right: 0;
  top: 46px;
  text-align: center;
  font-family: var(--font-display, Sora, sans-serif);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--room-deep, #065f46);
  opacity: 0.16;
  pointer-events: none;
}

.ms-room-sub {
  position: absolute;
  left: 0;
  right: 0;
  top: 108px;
  text-align: center;
  font: 600 15px/1 var(--font-body, Inter, sans-serif);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--room-deep, #065f46);
  opacity: 0.28;
  pointer-events: none;
}

/* doorway in the back wall */
.ms-door {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 300px;
  height: 400px;
  transform: translateX(-50%);
  border-radius: 150px 150px 0 0;
  background:
    radial-gradient(120% 110% at 50% 100%, #06281d 0%, #0b3b2c 58%, #14503c 100%);
  box-shadow:
    inset 0 0 34px rgba(0, 0, 0, 0.55),
    0 0 0 10px rgba(255, 255, 255, 0.55),
    0 0 0 12px var(--room-accent-soft, rgba(13, 148, 136, 0.4)),
    0 0 46px rgba(13, 148, 136, 0.35);
  display: grid;
  place-items: end center;
}

.ms-door::before {
  content: "";
  position: absolute;
  inset: 10px 10px 0;
  border-radius: 140px 140px 0 0;
  border: 1.5px dashed rgba(110, 231, 183, 0.4);
  pointer-events: none;
}

.ms-door-btn {
  position: relative;
  margin-bottom: 30px;
  padding: 0.72rem 1.25rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #06281d;
  font: 700 0.88rem/1.15 var(--font-body, Inter, sans-serif);
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(4, 47, 33, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  max-width: 240px;
}

.ms-door-btn:hover,
.ms-door-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(4, 47, 33, 0.5);
}

/* ---------- Exhibits (holo plinths) ---------- */
.ms-plinth {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}

.ms-plinth.is-far {
  visibility: hidden;
}

.ms-plinth-btn {
  position: absolute;
  left: -115px;
  top: -210px;
  width: 230px;
  padding: 1rem 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.66));
  box-shadow:
    0 24px 44px rgba(6, 40, 29, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.4) inset,
    0 0 30px var(--room-glow, rgba(13, 148, 136, 0.28));
  backdrop-filter: blur(5px);
  cursor: pointer;
  font-family: var(--font-body, Inter, sans-serif);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: ms-bob 5.2s ease-in-out infinite;
}

.ms-plinth:nth-child(2) .ms-plinth-btn { animation-delay: 0.9s; }
.ms-plinth:nth-child(3) .ms-plinth-btn { animation-delay: 1.7s; }

.ms-plinth-btn:hover,
.ms-plinth-btn:focus-visible {
  transform: translateY(-8px);
  box-shadow:
    0 34px 58px rgba(6, 40, 29, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset,
    0 0 44px var(--room-glow, rgba(13, 148, 136, 0.42));
}

.ms-plinth-btn:focus-visible {
  outline: 3px solid var(--room-accent, #0d9488);
  outline-offset: 3px;
}

.ms-plinth-no {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--room-accent, #0d9488);
}

.ms-plinth-frame {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #ffffff;
  background: linear-gradient(140deg, var(--room-accent, #0d9488), var(--room-accent-b, #0ea672));
  box-shadow: 0 12px 24px rgba(6, 40, 29, 0.28), inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.ms-plinth-frame svg {
  width: 44px;
  height: 44px;
}

.ms-plinth-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #06281d;
  line-height: 1.25;
}

.ms-plinth-cta {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-soft, #456a58);
}

.ms-plinth-base {
  position: absolute;
  left: -84px;
  top: 36px;
  width: 168px;
  height: 84px;
  background: linear-gradient(180deg, var(--room-accent, #0d9488), var(--room-deep, #065f46));
  opacity: 0.85;
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
  box-shadow: 0 22px 30px rgba(6, 40, 29, 0.3);
}

.ms-plinth-base::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 10px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

@keyframes ms-bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -7px; }
}

/* ---------- Stage overlays (callout / hint) ---------- */
.ms-roomcallout {
  position: absolute;
  top: 20px;
  left: 22px;
  padding: 0.7rem 1.1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 26px rgba(6, 40, 29, 0.16);
  pointer-events: none;
}

.ms-roomcallout-kicker {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft, #456a58);
}

.ms-roomcallout-name {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-display, Sora, sans-serif);
  font-size: 1.12rem;
  color: #06281d;
}

.ms-hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  background: rgba(6, 40, 29, 0.62);
  color: #d1fae5;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: calc(100% - 40px);
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.ms-hint.is-dim {
  opacity: 0;
}

/* ---------- Controls under the stage ---------- */
.ms-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  margin-top: 1.1rem;
}

.ms-walkbtns {
  display: flex;
  gap: 0.7rem;
  flex: 1 1 320px;
}

.ms-ctl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.65rem 1.2rem;
  border-radius: 13px;
  border: 1.5px solid var(--line, #dcebe2);
  background: #ffffff;
  color: #06281d;
  font: 600 0.92rem/1 var(--font-body, Inter, sans-serif);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.ms-ctl:hover {
  transform: translateY(-1px);
  border-color: rgba(13, 148, 136, 0.6);
  box-shadow: 0 10px 20px rgba(6, 40, 29, 0.1);
}

.ms-ctl:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ms-ctl-primary {
  flex: 1;
  background: linear-gradient(120deg, #0ea672, #0d9488);
  border-color: transparent;
  color: #ffffff;
  justify-content: space-between;
  box-shadow: 0 14px 26px rgba(13, 148, 136, 0.32);
}

.ms-ctl-sq {
  width: 46px;
  padding: 0;
  flex: none;
}

.ms-lookbtns {
  display: flex;
  gap: 0.7rem;
}

.ms-progress {
  margin: 0;
  color: var(--ink-soft, #456a58);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ---------- Minimap ---------- */
.ms-minimap {
  margin-top: 1.2rem;
  display: flex;
  justify-content: center;
}

.ms-minimap-track {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--line, #dcebe2);
  box-shadow: var(--shadow-sm, 0 6px 18px rgba(11, 31, 22, 0.06));
}

.ms-minimap-cell {
  width: 58px;
  height: 9px;
  border-radius: 999px;
  background: #dcebe2;
  transition: background 0.3s ease;
}

.ms-minimap-cell.is-active {
  background: linear-gradient(90deg, #0ea672, #0d9488);
}

.ms-minimap-walker {
  position: absolute;
  top: 50%;
  left: 21px;
  width: 15px;
  height: 15px;
  margin: -7.5px 0 0 -7.5px;
  border-radius: 50%;
  background: #06281d;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(6, 40, 29, 0.4);
  transition: left 0.85s cubic-bezier(0.65, 0, 0.35, 1);
}

.ms-noscript {
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  background: #fef9ec;
  border: 1px solid #fde68a;
  color: #92400e;
  font-weight: 600;
}

/* ---------- Exhibit modal ---------- */
.ms-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1.2rem;
}

.ms-modal[hidden] {
  display: none;
}

.ms-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 31, 22, 0.55);
  backdrop-filter: blur(6px);
}

.ms-modal-card {
  position: relative;
  width: min(940px, 100%);
  max-height: calc(100vh - 2.4rem);
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 40px 90px rgba(4, 31, 22, 0.45);
  animation: ms-pop 0.32s cubic-bezier(0.34, 1.4, 0.5, 1);
}

@keyframes ms-pop {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.ms-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(6, 40, 29, 0.1);
  color: #06281d;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ms-modal-close:hover {
  background: rgba(6, 40, 29, 0.18);
  transform: rotate(90deg);
}

.ms-modal-stage {
  margin: 0;
  min-height: 320px;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 1.8rem);
  background: linear-gradient(160deg, var(--theme-a, #fef9ec), var(--theme-b, #f2fbf5));
  border-right: 1px solid rgba(6, 40, 29, 0.08);
}

.ms-modal-stage[data-room-theme="solar"] { --theme-a: #fef6e7; --theme-b: #fdf1dc; }
.ms-modal-stage[data-room-theme="wind"]  { --theme-a: #ecf8fb; --theme-b: #ddf1f6; }
.ms-modal-stage[data-room-theme="hydro"] { --theme-a: #ebf7f8; --theme-b: #d9eff3; }
.ms-modal-stage[data-room-theme="ai"]    { --theme-a: #f0faf5; --theme-b: #e8f2f8; }

.ms-modal-stage svg {
  width: 100%;
  max-width: 460px;
  height: auto;
}

.ms-modal-body {
  padding: clamp(1.4rem, 3.4vw, 2.2rem);
}

.ms-modal-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft, #456a58);
}

.ms-modal-body h3 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.4rem, 3vw, 1.7rem);
  color: #06281d;
}

.ms-modal-tagline {
  margin: 0 0 1.1rem;
  color: #0d9488;
  font-weight: 600;
}

.ms-modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin: 0 0 1.15rem;
  padding: 0;
  list-style: none;
}

.ms-modal-stats li {
  padding: 0.75rem 0.6rem;
  border-radius: 13px;
  background: #f2faf5;
  border: 1px solid #d9ede2;
  text-align: center;
}

.ms-modal-stat-val {
  display: block;
  font-family: var(--font-display, Sora, sans-serif);
  font-size: 1.28rem;
  font-weight: 800;
  color: #065f46;
}

.ms-modal-stat-label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-soft, #456a58);
}

.ms-modal-story {
  margin: 0 0 1rem;
  color: #3c5a4c;
  line-height: 1.65;
}

.ms-modal-source {
  margin: 0 0 1.3rem;
  font-size: 0.78rem;
  color: #7b958a;
}

.ms-modal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid #e6f1ea;
  padding-top: 1.1rem;
}

.ms-modal-count {
  font-weight: 600;
  color: var(--ink-soft, #456a58);
  font-size: 0.88rem;
}

body.ms-modal-open {
  overflow: hidden;
}

/* ---------- 2D collection index ---------- */
.ms-index {
  padding-top: 0;
}

.ms-index .section-head {
  margin-bottom: 1.6rem;
}

.ms-roomgroup {
  margin-bottom: 2.2rem;
}

.ms-roomgroup-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.ms-roomgroup-ico {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #ffffff;
  background: linear-gradient(140deg, var(--room-accent, #0d9488), var(--room-accent-b, #0ea672));
  box-shadow: 0 10px 20px rgba(6, 40, 29, 0.18);
}

.ms-roomgroup-head h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #06281d;
}

.ms-roomgroup-head p {
  margin: 0.1rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft, #456a58);
}

.ms-roomgroup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.ms-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.2rem 1.25rem 1.3rem;
  border-radius: 18px;
  border: 1px solid var(--line, #dcebe2);
  background: #ffffff;
  box-shadow: var(--shadow-sm, 0 6px 18px rgba(11, 31, 22, 0.06));
  font-family: var(--font-body, Inter, sans-serif);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}

.ms-card:hover,
.ms-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(13, 148, 136, 0.5);
  box-shadow: 0 20px 36px rgba(6, 40, 29, 0.14);
}

.ms-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.ms-card-no {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--room-accent, #0d9488);
}

.ms-card-ico {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #ffffff;
  background: linear-gradient(140deg, var(--room-accent, #0d9488), var(--room-accent-b, #0ea672));
}

.ms-card h4 {
  margin: 0;
  font-size: 1.02rem;
  color: #06281d;
}

.ms-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-soft, #456a58);
}

.ms-card-cta {
  margin-top: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #0d9488;
}

.ms-card-cta svg {
  transition: transform 0.2s ease;
}

.ms-card:hover .ms-card-cta svg,
.ms-card:focus-visible .ms-card-cta svg {
  transform: translateX(3px);
}

/* ---------- Curator notes ---------- */
.ms-notes {
  padding: clamp(2rem, 5vw, 3.4rem) 0;
}

.ms-notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.ms-note {
  padding: 1.6rem 1.5rem;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid var(--line, #dcebe2);
  box-shadow: var(--shadow-sm, 0 6px 18px rgba(11, 31, 22, 0.06));
}

.ms-note-ico {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #e7f6ee;
  margin-bottom: 0.9rem;
}

.ms-note h3 {
  margin: 0 0 0.45rem;
  font-size: 1.08rem;
  color: #06281d;
}

.ms-note p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.62;
  color: var(--ink-soft, #456a58);
}

.ms-note code {
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: #e7f6ee;
  color: #047857;
  font-size: 0.85em;
}

/* ---------- Outro ---------- */
.ms-outro {
  padding: 0 0 clamp(3rem, 6vw, 4.5rem);
}

.ms-outro-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(2.2rem, 5.5vw, 3.6rem);
  border-radius: 28px;
  background:
    radial-gradient(130% 120% at 85% -10%, rgba(45, 212, 191, 0.25), transparent 55%),
    linear-gradient(135deg, #06281d 0%, #0b3b2c 55%, #0f4a37 100%);
  color: #ffffff;
}

.ms-outro-panel h2 {
  color: #ffffff;
  max-width: 24ch;
}

.ms-outro-copy {
  max-width: 44rem;
  color: #c9e8d8;
  line-height: 1.7;
}

.ms-outro-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
  margin: 1.8rem 0;
  max-width: 46rem;
}

.ms-outro .outro-stat {
  border-left: 2px solid rgba(94, 234, 212, 0.4);
  padding-left: 1.1rem;
}

.ms-outro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

/* ---------- Flat (2D) view state ---------- */
body.flat-view .ms-stage,
body.flat-view .ms-controls,
body.flat-view .ms-minimap {
  display: none;
}

/* ---------- SVG exhibit animations ---------- */
.ms-art .flow {
  stroke-dasharray: 6 6;
  animation: ms-dash 0.9s linear infinite;
}

@keyframes ms-dash {
  to { stroke-dashoffset: -12; }
}

.ms-art .spin-slow,
.ms-art .spin-slower {
  transform-box: view-box;
  animation: ms-spin 9s linear infinite;
}

.ms-art .spin-slower {
  animation-duration: 14s;
}

@keyframes ms-spin {
  to { transform: rotate(360deg); }
}

.ms-art .glow {
  transform-box: view-box;
  animation: ms-glow 2.4s ease-in-out infinite;
}

@keyframes ms-glow {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

.ms-art .blink {
  animation: ms-blink 1.5s ease-in-out infinite;
}

@keyframes ms-blink {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

.ms-art .fall {
  transform-box: view-box;
  animation: ms-fall 2.1s ease-in infinite;
}

@keyframes ms-fall {
  0% { transform: translateY(0); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translateY(26px); opacity: 0; }
}

.ms-art .glint {
  transform-box: view-box;
  animation: ms-glint 3.2s ease-in-out infinite;
}

@keyframes ms-glint {
  0% { transform: translateX(-80px); opacity: 0; }
  30% { opacity: 1; }
  60%, 100% { transform: translateX(320px); opacity: 0; }
}

.ms-art .grow-x {
  transform-box: fill-box;
  transform-origin: left center;
  animation: ms-growx 1.1s cubic-bezier(0.25, 0.9, 0.3, 1) both;
}

@keyframes ms-growx {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.ms-art .wave-a,
.ms-art .wave-b {
  transform-box: view-box;
  animation: ms-wave 3.4s ease-in-out infinite alternate;
}

.ms-art .wave-b {
  animation-duration: 4.1s;
  animation-delay: 0.4s;
}

@keyframes ms-wave {
  from { transform: translateX(0); }
  to { transform: translateX(-34px); }
}

.ms-art .drift-x {
  transform-box: view-box;
  animation: ms-drift 9s ease-in-out infinite alternate;
}

@keyframes ms-drift {
  from { transform: translateX(-14px); }
  to { transform: translateX(16px); }
}

.ms-art .mirror {
  animation: ms-tilt 2.6s ease-in-out infinite alternate;
}

@keyframes ms-tilt {
  from { transform: rotate(-9deg); }
  to { transform: rotate(7deg); }
}

.ms-art .water-up {
  animation: ms-water-up 5.5s ease-in-out infinite alternate;
}

@keyframes ms-water-up {
  from { y: 58px; height: 24px; }
  to { y: 38px; height: 44px; }
}

.ms-art .water-dn {
  animation: ms-water-dn 5.5s ease-in-out infinite alternate;
}

@keyframes ms-water-dn {
  from { y: 156px; height: 32px; }
  to { y: 148px; height: 40px; }
}

.ms-art .pump-up {
  animation: ms-pump-up 5.5s ease-in-out infinite alternate;
}

@keyframes ms-pump-up {
  0% { opacity: 0.15; }
  45%, 55% { opacity: 1; }
  100% { opacity: 0.15; }
}

.ms-art .pump-dn {
  animation: ms-pump-dn 5.5s ease-in-out infinite alternate;
}

@keyframes ms-pump-dn {
  0% { opacity: 1; }
  45%, 55% { opacity: 0.15; }
  100% { opacity: 1; }
}

.ms-art .tide-lr {
  animation: ms-tide-lr 6s ease-in-out infinite;
}

@keyframes ms-tide-lr {
  0%, 20% { opacity: 1; }
  50%, 80% { opacity: 0.1; }
  100% { opacity: 1; }
}

.ms-art .tide-rl {
  animation: ms-tide-rl 6s ease-in-out infinite;
}

@keyframes ms-tide-rl {
  0%, 20% { opacity: 0.1; }
  50%, 80% { opacity: 1; }
  100% { opacity: 0.1; }
}

.ms-art .rise {
  transform-box: view-box;
  animation: ms-rise 3.6s ease-out infinite;
}

@keyframes ms-rise {
  0% { transform: translateY(0); opacity: 0; }
  20% { opacity: 0.9; }
  100% { transform: translateY(-72px); opacity: 0; }
}

.ms-art .heat {
  transform-box: view-box;
  animation: ms-heat 2.6s ease-in-out infinite;
}

@keyframes ms-heat {
  0% { transform: translateY(0); opacity: 0.15; }
  40% { opacity: 0.7; }
  100% { transform: translateY(-10px); opacity: 0.15; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .ms-roomgroup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  .ms-stage {
    --stage-h: clamp(380px, 56vh, 540px);
    perspective: 860px;
  }

  .ms-room-name {
    font-size: 30px;
  }

  .ms-plinth-btn {
    left: -95px;
    top: -190px;
    width: 190px;
    padding: 0.8rem 0.7rem 0.9rem;
  }

  .ms-plinth-frame {
    width: 68px;
    height: 68px;
  }

  .ms-plinth-frame svg {
    width: 34px;
    height: 34px;
  }

  .ms-plinth-title {
    font-size: 0.85rem;
  }

  .ms-modal-card {
    grid-template-columns: 1fr;
  }

  .ms-modal-stage {
    border-right: 0;
    border-bottom: 1px solid rgba(6, 40, 29, 0.08);
    min-height: 250px;
  }

  .ms-modal-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ms-notes-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin-inline: auto;
  }
}

@media (max-width: 560px) {
  .ms-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ms-viewtoggle {
    align-self: center;
  }

  .ms-roomdots {
    justify-content: center;
  }

  .ms-dot {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }

  .ms-dot .ms-dot-ico {
    display: none;
  }

  .ms-stage {
    --stage-h: clamp(340px, 52vh, 470px);
    border-radius: 18px;
  }

  .ms-roomcallout {
    top: 12px;
    left: 12px;
    padding: 0.55rem 0.85rem;
  }

  .ms-roomcallout-name {
    font-size: 0.95rem;
  }

  .ms-hint {
    display: none;
  }

  .ms-walkbtns {
    flex-basis: 100%;
  }

  .ms-lookbtns {
    margin-left: auto;
  }

  .ms-progress {
    display: none;
  }

  .ms-minimap-cell {
    width: 44px;
  }

  .ms-roomgroup-grid {
    grid-template-columns: 1fr;
  }

  .ms-modal-stats {
    grid-template-columns: 1fr 1fr;
  }

  .ms-outro-stats {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  .ms-plinth-btn {
    left: -82px;
    top: -172px;
    width: 164px;
  }

  .ms-plinth-frame {
    width: 56px;
    height: 56px;
  }

  .ms-plinth-frame svg {
    width: 28px;
    height: 28px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .ms-plinth-btn,
  .ms-art .flow,
  .ms-art .spin-slow,
  .ms-art .spin-slower,
  .ms-art .glow,
  .ms-art .blink,
  .ms-art .fall,
  .ms-art .glint,
  .ms-art .wave-a,
  .ms-art .wave-b,
  .ms-art .drift-x,
  .ms-art .mirror,
  .ms-art .water-up,
  .ms-art .water-dn,
  .ms-art .pump-up,
  .ms-art .pump-dn,
  .ms-art .tide-lr,
  .ms-art .tide-rl,
  .ms-art .rise,
  .ms-art .heat {
    animation: none !important;
  }

  .ms-art .grow-x {
    animation-duration: 0.01s;
  }

  .ms-art .water-up { y: 38px; height: 44px; }
  .ms-art .water-dn { y: 148px; height: 40px; }
  .ms-art .pump-up { opacity: 1; }
  .ms-art .tide-lr { opacity: 1; }
  .ms-art .tide-rl { opacity: 0.15; }

  .ms-modal-card,
  .ms-minimap-walker,
  .ms-plinth-btn,
  .ms-ctl,
  .ms-card {
    transition: none !important;
  }
}

