:root {
  color-scheme: dark;
  --glass: rgba(8, 8, 8, 0.56);
  --glass-strong: rgba(0, 0, 0, 0.68);
  --line: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.62);
  --shadow: 0 18px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #050505;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body {
  position: fixed;
  inset: 0;
  color: var(--text);
  overscroll-behavior: none;
}

button {
  font: inherit;
}

.tour {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  background: #050505;
  isolation: isolate;
}

.tour__canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.tour.is-dragging .tour__canvas {
  cursor: grabbing;
}

.tour__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, transparent 42%, rgba(0, 0, 0, 0.18) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 22%, transparent 72%, rgba(0, 0, 0, 0.22));
  z-index: 2;
}

.hotspots {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.hotspot {
  --x: 50vw;
  --y: 50vh;
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  border: 0;
  padding: 0;
  color: #fff;
  background: transparent;
  pointer-events: auto;
  transform: translate3d(var(--x), var(--y), 0);
  opacity: 1;
  cursor: pointer;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.38));
  transition:
    opacity 180ms ease,
    filter 260ms ease;
}

.hotspot.is-hidden {
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0));
}

.hotspot__target {
  position: absolute;
  left: 0;
  top: 0;
  width: 52px;
  height: 52px;
  transform: translate(-50%, -50%);
}

.hotspot__dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.32),
    0 5px 16px rgba(0, 0, 0, 0.34);
  transition:
    width 360ms cubic-bezier(0.22, 1, 0.36, 1),
    height 360ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hotspot__dot::after {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.34);
  opacity: 0;
  transform: scale(0.68);
  transition:
    opacity 360ms ease,
    transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hotspot__label {
  position: absolute;
  left: 15px;
  top: 50%;
  height: 20px;
  max-width: min(220px, calc(100vw - 64px));
  padding: 2px 10px 3px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  backdrop-filter: blur(19.65px);
  -webkit-backdrop-filter: blur(19.65px);
  transform: translateY(-50%) translateX(0) scale(1);
  transform-origin: left center;
  overflow: hidden;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  line-height: 15px;
  letter-spacing: 0;
  transition:
    opacity 260ms ease,
    max-width 360ms cubic-bezier(0.22, 1, 0.36, 1),
    padding 360ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hotspot__label-text {
  display: block;
  transition:
    opacity 180ms ease,
    transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hotspot.is-flipped .hotspot__label {
  left: auto;
  right: 15px;
  transform-origin: right center;
}

.hotspot:hover .hotspot__dot,
.hotspot:focus-visible .hotspot__dot {
  width: 28px;
  height: 28px;
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.13),
    0 0 34px rgba(255, 255, 255, 0.42),
    0 12px 28px rgba(0, 0, 0, 0.35);
}

.hotspot:hover .hotspot__dot::after,
.hotspot:focus-visible .hotspot__dot::after {
  opacity: 1;
  transform: scale(1);
}

.hotspot:hover .hotspot__label,
.hotspot:focus-visible .hotspot__label {
  max-width: 22px;
  padding-left: 0;
  padding-right: 0;
  opacity: 0.1;
  transform: translateY(-50%) translateX(-3px) scale(0.92);
}

.hotspot.is-flipped:hover .hotspot__label,
.hotspot.is-flipped:focus-visible .hotspot__label {
  transform: translateY(-50%) translateX(3px) scale(0.92);
}

.hotspot:hover .hotspot__label-text,
.hotspot:focus-visible .hotspot__label-text {
  opacity: 0;
  transform: translateY(5px);
}

.hotspot:focus-visible {
  outline: none;
}

.hotspot:focus-visible .hotspot__target {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 6px;
  border-radius: 999px;
}

.scene-chip {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  top: max(16px, env(safe-area-inset-top));
  z-index: 7;
  display: grid;
  gap: 2px;
  min-width: 148px;
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px 12px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.1);
  -webkit-backdrop-filter: blur(24px) saturate(1.1);
}

.scene-chip__status {
  min-height: 13px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scene-chip__title {
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0;
  white-space: nowrap;
}

.controls {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 7;
  display: flex;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.1);
  -webkit-backdrop-filter: blur(24px) saturate(1.1);
}

.control-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.control-button:hover,
.control-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
  outline: none;
}

.control-button:active {
  transform: translateY(0) scale(0.98);
}

.control-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.transition-layer {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.08), transparent 35%),
    rgba(0, 0, 0, 0.72);
  opacity: 1;
  transition: opacity 360ms ease;
}

.transition-layer.is-ready {
  opacity: 0;
}

.transition-layer.is-switching {
  opacity: 1;
}

.fallback {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #050505;
  color: #fff;
  text-align: center;
}

@media (max-width: 680px) {
  .scene-chip {
    left: 12px;
    top: 12px;
    min-width: 132px;
    padding: 9px 10px 10px;
  }

  .scene-chip__title {
    font-size: 13px;
  }

  .controls {
    right: 12px;
    bottom: 12px;
    gap: 6px;
    padding: 6px;
  }

  .control-button {
    width: 36px;
    height: 36px;
  }

  .hotspot__label {
    height: 22px;
    padding-top: 3px;
    font-size: 12px;
    line-height: 15px;
  }
}

@media (hover: none) {
  .hotspot__target {
    width: 64px;
    height: 64px;
  }

  .hotspot__dot {
    width: 12px;
    height: 12px;
  }

  .hotspot:hover .hotspot__label {
    max-width: min(220px, calc(100vw - 64px));
    padding-left: 10px;
    padding-right: 10px;
    opacity: 1;
    transform: translateY(-50%);
  }

  .hotspot:hover .hotspot__label-text {
    opacity: 1;
    transform: none;
  }
}

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