:root {
  color-scheme: light;
  background: #dfe7ea;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body,
#app {
  background: #dfe7ea;
}

#app {
  position: relative;
  isolation: isolate;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#scene:active {
  cursor: grabbing;
}

.hotspot-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.hotspot {
  --hotspot-scale: 1;
  --hotspot-label-shift: 0px;
  position: absolute;
  top: -100px;
  left: -100px;
  display: flex;
  min-width: 48px;
  min-height: 48px;
  padding: 0 10px 8px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f6fbfa;
  font: inherit;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  cursor: pointer;
  transform: translate3d(-50%, -100%, 0) scale(var(--hotspot-scale));
  transform-origin: 50% 100%;
  transition: opacity 180ms ease, filter 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.hotspot.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hotspot__label {
  display: inline-flex;
  height: 30px;
  padding: 0 11px 0 8px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9px;
  background: rgba(15, 31, 36, 0.88);
  box-shadow: 0 10px 28px rgba(16, 40, 45, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transform: translateX(var(--hotspot-label-shift));
  transition: transform 180ms ease, background 180ms ease, opacity 120ms ease;
}

.hotspot.is-selected {
  --hotspot-label-shift: 0px;
}

.hotspot__index {
  color: #35e1c2;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.hotspot__stem {
  width: 1px;
  height: 23px;
  background: linear-gradient(to bottom, rgba(53, 225, 194, 0.9), rgba(53, 225, 194, 0.22));
}

.hotspot__dot {
  position: relative;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  background: #35e1c2;
  box-shadow: 0 2px 10px rgba(16, 40, 45, 0.32), 0 0 0 3px rgba(16, 40, 45, 0.22);
}

.hotspot__dot::after {
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(53, 225, 194, 0.75);
  border-radius: 50%;
  content: "";
  animation: hotspot-pulse 2.8s ease-out infinite;
}

.hotspot:nth-child(2) .hotspot__dot::after {
  animation-delay: 350ms;
}

.hotspot:nth-child(3) .hotspot__dot::after {
  animation-delay: 700ms;
}

.hotspot:nth-child(4) .hotspot__dot::after {
  animation-delay: 1050ms;
}

.hotspot:hover .hotspot__label,
.hotspot:focus-visible .hotspot__label,
.hotspot.is-selected .hotspot__label {
  background: rgba(10, 54, 55, 0.95);
  transform: translate(var(--hotspot-label-shift), -2px);
}

.hotspot:focus-visible .hotspot__label {
  box-shadow: 0 0 0 3px rgba(53, 225, 194, 0.32), 0 10px 28px rgba(16, 40, 45, 0.2);
}

.hotspot.is-selected .hotspot__dot {
  box-shadow: 0 2px 10px rgba(16, 40, 45, 0.32), 0 0 0 6px rgba(53, 225, 194, 0.22);
}

.hotspot-layer.is-interacting .hotspot__label {
  opacity: 0;
  transform: translate(var(--hotspot-label-shift), 3px);
}

.hotspot-card {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 4;
  width: min(304px, calc(100vw - 40px));
  padding: 19px 18px 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: rgba(14, 28, 32, 0.88);
  color: #f6fbfa;
  box-shadow: 0 22px 60px rgba(13, 27, 31, 0.24);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: hotspot-card-in 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hotspot-card[hidden] {
  display: none;
}

.hotspot-card__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(246, 251, 250, 0.76);
  font: 300 24px/1 system-ui, sans-serif;
  cursor: pointer;
}

.hotspot-card__close:hover,
.hotspot-card__close:focus-visible {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.hotspot-card__close:focus-visible,
.hotspot-card__overview:focus-visible {
  outline: 2px solid #35e1c2;
  outline-offset: 2px;
}

.hotspot-card__kicker {
  margin: 0 42px 7px 0;
  color: #35e1c2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hotspot-card__title {
  margin: 0;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hotspot-card__description {
  margin: 12px 0 17px;
  color: rgba(236, 246, 244, 0.74);
  font-size: 13px;
  line-height: 1.7;
}

.hotspot-card__overview {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(53, 225, 194, 0.48);
  border-radius: 10px;
  background: rgba(53, 225, 194, 0.12);
  color: #74eed8;
  font: 650 13px/1 inherit;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.hotspot-card__overview:hover {
  background: #35e1c2;
  color: #10282d;
}

@keyframes hotspot-pulse {
  0% {
    opacity: 0.8;
    transform: scale(0.5);
  }
  72%,
  100% {
    opacity: 0;
    transform: scale(1.55);
  }
}

@keyframes hotspot-card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 640px) {
  .hotspot {
    min-width: 52px;
    min-height: 52px;
    padding-inline: 12px;
  }

  .hotspot__label {
    opacity: 0;
    transform: translate(var(--hotspot-label-shift), 3px);
  }

  .hotspot:hover .hotspot__label,
  .hotspot:focus-visible .hotspot__label,
  .hotspot.is-selected .hotspot__label {
    opacity: 1;
  }

  .hotspot-card {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hotspot,
  .hotspot__label,
  .hotspot-card,
  .hotspot-card__overview {
    transition: none;
    animation: none;
  }

  .hotspot__dot::after {
    animation: none;
    opacity: 0.35;
  }
}
