:root {
  /* Theme tokens: update these first to reskin the full UI quickly. */
  --bg: #070a14;
  --card: rgba(16, 24, 42, 0.72);
  --card-solid: #101a30;
  --text: #f4f8ff;
  --muted: #abc0e2;
  --accent: #5de4d6;
  --accent-2: #7f90ff;
  --border: rgba(171, 192, 226, 0.24);
  --shadow: 0 16px 40px rgba(7, 10, 20, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.max-w-9xl {
  /* Tailwind-like container utility implemented in plain CSS. */
  width: min(100% - 2rem, 1600px);
  margin-inline: auto;
}

.site-bg {
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(circle at 20% 10%, rgba(127, 144, 255, 0.4), transparent 35%),
    radial-gradient(circle at 85% 5%, rgba(93, 228, 214, 0.24), transparent 30%),
    linear-gradient(180deg, #0b1020 0%, #060810 100%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 2000;
  backdrop-filter: blur(10px);
  background: rgba(6, 8, 16, 0.6);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 600;
}

.brand img {
  width: 28px;
  height: 28px;
}

.top-nav {
  display: flex;
  gap: 1.1rem;
  color: var(--muted);
}

.top-nav a:hover {
  color: var(--text);
}

.page-content {
  padding-block: 1.5rem 4rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.hero-copy,
.hero-sidebar,
.section-shell {
  /* Shared glassmorphism panel style used across major sections. */
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: clamp(1rem, 3vw, 2rem);
}

.hero-copy h1 {
  margin: 0.4rem 0 0.6rem;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: clamp(1.7rem, 5vw, 3.2rem);
}

.hero-subtitle {
  margin: 0.1rem 0 0.75rem;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
}

.hero-copy p {
  margin: 0;
}

.hero-copy p + p {
  margin-top: 0.55rem;
}

.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.hero-meta-row span {
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: rgba(8, 14, 28, 0.58);
}

.eyebrow {
  color: var(--accent);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
}

.hero-sidebar {
  padding: 1rem 1rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.floor-mini-map {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.floor-chip {
  border: 1px solid var(--border);
  background: rgba(8, 14, 28, 0.8);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.floor-chip.active {
  color: #07121b;
  background: var(--accent);
  border-color: var(--accent);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.05rem;
}

.badge {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(127, 144, 255, 0.18);
  border: 1px solid rgba(127, 144, 255, 0.35);
  font-size: 0.8rem;
}

.tour-wrapper {
  margin-bottom: 2rem;
}

.tour-stage {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  min-height: 78vh;
}

#pano {
  position: absolute;
  inset: 0;
  transition: opacity 280ms ease;
}

.tour-stage.scene-switching #pano {
  opacity: 0.5;
}

.section-shell {
  margin-top: 1.5rem;
  padding: 1.2rem;
}

.section-shell h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: clamp(1.25rem, 2.8vw, 2rem);
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.feature-card,
.learning-panel,
.gallery-item,
.table-wrap,
.faq-item {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(7, 12, 24, 0.65);
}

.feature-card {
  padding: 1rem;
}

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

.gallery-item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.badge-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.badge-tile {
  padding: 0.8rem;
  border: 1px solid var(--border);
  background: rgba(93, 228, 214, 0.1);
  border-radius: 14px;
}

.table-wrap {
  overflow: auto;
  padding: 0.4rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 0.75rem;
  color: var(--muted);
}

th {
  color: var(--text);
}

.tabs-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.tab-btn {
  border: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
}

.tab-btn.active {
  color: #051219;
  border-color: var(--accent);
  background: var(--accent);
}

.learning-panel {
  padding: 1rem;
}

#sceneQuickJump {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.quick-jump-btn,
#sceneFilter {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: rgba(8, 14, 28, 0.8);
  color: var(--text);
}

#sceneFilter {
  margin-top: 0.2rem;
}

#sceneSearchInput,
#sceneTypeFilter {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: rgba(8, 14, 28, 0.8);
  color: var(--text);
  margin-bottom: 0.5rem;
}

.tour-stage-tools {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  z-index: 70;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tour-tool-btn {
  border: 1px solid var(--border);
  background: rgba(8, 14, 28, 0.82);
  color: var(--text);
  border-radius: 8px;
  padding: 0.35rem 0.58rem;
  font-size: 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.tour-tool-btn:hover {
  border-color: var(--accent-2);
}

.tour-tool-btn img {
  width: 12px;
  height: 12px;
  object-fit: contain;
}

#tourPlayBtn .icon-play.on {
  display: none;
}

#tourPlayBtn.playing .icon-play.on {
  display: inline-block;
}

#tourPlayBtn.playing .icon-play.off {
  display: none;
}

.tour-progress-wrap {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 56px;
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
  z-index: 69;
}

.tour-progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 240ms ease;
}

.scene-list-tools {
  padding: 0.5rem;
  background: rgba(8, 14, 28, 0.82);
  border-bottom: 1px solid var(--border);
}

.scene-list-clear {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font-size: 0.78rem;
  background: rgba(8, 14, 28, 0.8);
  color: var(--text);
  cursor: pointer;
}

.scene-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 75;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.55rem;
  background: rgba(5, 9, 18, 0.45);
  backdrop-filter: blur(2px);
}

.scene-loading-overlay.active {
  display: flex;
}

.loader-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulseDot 900ms ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.35); opacity: 1; }
}

.shortcut-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.shortcut-modal.open {
  display: block;
}

.shortcut-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.shortcut-modal-card {
  position: relative;
  max-width: 430px;
  margin: 10vh auto 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0b1326;
  padding: 1rem;
}

.shortcut-list {
  margin: 0.85rem 0;
  padding-left: 1rem;
}

kbd {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  background: rgba(255, 255, 255, 0.08);
}

.faq-item summary {
  cursor: pointer;
  padding: 0.8rem 1rem;
  font-weight: 600;
}

.faq-item p {
  padding: 0 1rem 0.9rem;
  color: var(--muted);
}

.site-footer {
  padding: 1rem 0 1.6rem;
  color: var(--muted);
  text-align: center;
}

.site-footer.reveal {
  transform: translateY(42px);
}

.site-footer p + p {
  margin-top: 0.4rem;
}

.site-footer p {
  margin: 0;
  font-weight: 400;
}

.reveal {
  /* Initial state for IntersectionObserver-driven reveal animations. */
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.in {
  /* Final state once section enters viewport. */
  opacity: 1;
  transform: translateY(0);
}

/* ------- Marzipano control skin ------- */
#titleBar {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  max-width: min(70vw, 420px);
  height: 46px;
  text-align: center;
  z-index: 60;
  pointer-events: none;
}

#titleBar .sceneName {
  margin: 0;
  display: inline-block;
  min-width: 180px;
  max-width: min(70vw, 420px);
  line-height: 46px;
  padding: 0 1rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  background: rgba(8, 14, 28, 0.72);
  backdrop-filter: blur(6px);
  border-radius: 0 0 10px 10px;
}

#fullscreenToggle,
#autorotateToggle,
#sceneListToggle,
.viewControlButton {
  position: absolute;
  width: 46px;
  height: 46px;
  padding: 8px;
  border-radius: 0 0 12px 12px;
  background: rgba(8, 14, 28, 0.75);
  z-index: 65;
}

#fullscreenToggle,
#autorotateToggle {
  right: 0;
  top: 0;
}

#sceneListToggle {
  left: 0;
  top: 0;
}

body.fullscreen-enabled #fullscreenToggle {
  display: block;
}

body.fullscreen-enabled #autorotateToggle {
  right: 48px;
}

#sceneListToggle .icon,
#fullscreenToggle .icon,
#autorotateToggle .icon,
.viewControlButton .icon {
  width: 30px;
  height: 30px;
}

#fullscreenToggle .icon.on,
#autorotateToggle .icon.on,
#sceneListToggle .icon.on {
  display: none;
}

#fullscreenToggle.enabled .icon.on,
#autorotateToggle.enabled .icon.on,
#sceneListToggle.enabled .icon.on {
  display: block;
}

#fullscreenToggle.enabled .icon.off,
#autorotateToggle.enabled .icon.off,
#sceneListToggle.enabled .icon.off {
  display: none;
}

#sceneList {
  /* Sidebar remains inside panorama stage and slides in/out via margin-left. */
  position: absolute;
  top: 0;
  left: -190px;
  width: 190px;
  height: 100%;
  max-height: 100%;
  overflow: auto;
  padding-top: 46px;
  transition: margin-left 0.45s ease;
  z-index: 58;
}

#sceneList .scenes {
  background: rgba(8, 14, 28, 0.82);
}

#sceneList.enabled {
  margin-left: 190px;
}

#sceneList .scene {
  display: block;
}

#sceneList .text {
  min-height: 36px;
  line-height: 36px;
  padding-inline: 12px;
  font-size: 0.95rem;
}

#sceneList .scene.current,
.no-touch #sceneList .scene:hover {
  background: rgba(127, 144, 255, 0.3);
}

.viewControlButton {
  display: none;
  bottom: 8px;
  left: 50%;
  border-radius: 12px;
}

body.view-control-buttons .viewControlButton {
  display: block;
}

.viewControlButton-1 {
  margin-left: -141px;
}
.viewControlButton-2 {
  margin-left: -94px;
}
.viewControlButton-3 {
  margin-left: -47px;
}
.viewControlButton-4 {
  margin-left: 0;
}
.viewControlButton-5 {
  margin-left: 47px;
}
.viewControlButton-6 {
  margin-left: 94px;
}

.link-hotspot {
  width: 62px;
  height: 62px;
  margin-left: -31px;
  margin-top: -31px;
}

.link-hotspot-icon {
  width: 100%;
  height: 100%;
}

.link-hotspot-tooltip {
  /* Hotspot label formatting: keep names compact and readable. */
  position: absolute;
  left: 100%;
  top: 16px;
  margin-left: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(7, 12, 24, 0.9);
  opacity: 0;
  transform: translateX(-7px);
  transition: transform 0.24s ease, opacity 0.24s ease;
  pointer-events: none;
  white-space: nowrap;
  width: max-content;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.no-touch .link-hotspot:hover .link-hotspot-tooltip {
  opacity: 1;
  transform: translateX(0);
}

.info-hotspot .info-hotspot-header,
.info-hotspot-modal .info-hotspot-header {
  background: rgba(7, 12, 24, 0.9);
}

/* Force full-viewport panorama when fullscreen is active. */
#tourExperience:fullscreen,
#tourExperience:-webkit-full-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  min-height: 100vh;
  border-radius: 0;
  border: 0;
  margin: 0;
}

@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .grid-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .badge-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  /* Mobile-first adjustments for compact controls and single-column sections. */
  .max-w-9xl {
    width: calc(100% - 1rem);
  }

  .top-nav {
    display: none;
  }

  .tour-stage {
    min-height: 64vh;
  }

  .grid-cards,
  .gallery-grid,
  .badge-row {
    grid-template-columns: 1fr;
  }

  .tour-stage-tools {
    bottom: 10px;
    left: 50%;
    right: auto;
  }

  #titleBar {
    max-width: min(74vw, 340px);
  }

  #sceneList {
    width: 100%;
    left: -100%;
  }

  #sceneList.enabled {
    margin-left: 100%;
  }

  body.view-control-buttons .viewControlButton {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
