.tour-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 104px 24px 84px;
  color: var(--cream, #fffaf2);
  background:
    radial-gradient(circle at 17% 4%, rgba(133, 87, 212, 0.34), transparent 34%),
    radial-gradient(circle at 86% 82%, rgba(211, 140, 199, 0.16), transparent 30%),
    #130d1f;
}

.tour-section::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, transparent, #000 24%, #000 76%, transparent);
}

.tour-head {
  max-width: 780px;
  margin: 0 auto 38px;
  text-align: center;
}

.tour-section .kicker {
  color: #eee4ff;
  border: 1px solid rgba(232, 217, 254, 0.28);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.tour-section .h2 {
  color: #fffaf2;
}

.tour-section .h2 .italic {
  color: #cbb2fa;
}

.tour-section .lede {
  max-width: 64ch;
  margin-inline: auto;
  color: rgba(255, 250, 242, 0.72);
}

.tour-stage {
  position: relative;
  max-width: 1180px;
  height: clamp(500px, 72vh, 720px);
  min-height: 500px;
  margin: 0 auto;
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 32px;
  background: #100a19;
  box-shadow:
    0 42px 110px rgba(0, 0, 0, 0.52),
    0 0 0 8px rgba(255, 255, 255, 0.035),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  cursor: grab;
  touch-action: none;
}

.tour-stage::before,
.tour-stage::after {
  position: absolute;
  z-index: 3;
  inset-inline: 0;
  height: 24%;
  content: "";
  pointer-events: none;
}

.tour-stage::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(8, 5, 14, 0.56), transparent);
}

.tour-stage::after {
  bottom: 0;
  height: 34%;
  background: linear-gradient(to top, rgba(8, 5, 14, 0.86), transparent);
}

.tour-stage.is-dragging {
  cursor: grabbing;
}

.tour-stage.is-full {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#ppd-tour {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(16, 10, 25, 0.15), rgba(16, 10, 25, 0.15)),
    url("images/tour/studio-preview.webp?v=5") center / cover no-repeat;
}

#ppd-tour canvas {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tour-stage.is-ready #ppd-tour canvas {
  opacity: 1;
}

.tour-load {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  color: #eee4ff;
  background: rgba(16, 10, 25, 0.72);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0.45s ease;
  backdrop-filter: blur(14px);
}

.tour-load::before {
  width: 42px;
  height: 42px;
  margin: auto;
  content: "";
  border: 2px solid rgba(238, 228, 255, 0.18);
  border-top-color: #cbb2fa;
  border-radius: 50%;
  animation: tourSpin 0.9s linear infinite;
}

.tour-load.hide {
  visibility: hidden;
  opacity: 0;
}

.tour-topbar {
  position: absolute;
  z-index: 5;
  top: 18px;
  right: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.tour-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px;
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 999px;
  background: rgba(13, 8, 22, 0.52);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(16px);
}

.tour-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d4b7ff;
  box-shadow: 0 0 0 5px rgba(203, 178, 250, 0.13), 0 0 16px #a783ed;
  animation: tourPulse 2.2s ease-in-out infinite;
}

.tour-hint {
  position: absolute;
  z-index: 5;
  top: 70px;
  left: 50%;
  max-width: calc(100% - 36px);
  margin: 0;
  padding: 9px 14px;
  color: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(13, 8, 22, 0.42);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.35s ease;
  backdrop-filter: blur(12px);
}

.tour-hint.hide {
  opacity: 0;
}

.tour-hud {
  position: absolute;
  z-index: 5;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 16px;
}

.tour-hud-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tour-hud-side:last-child {
  justify-content: flex-end;
}

.tour-center {
  display: grid;
  gap: 7px;
  min-width: min(360px, 38vw);
  text-align: center;
}

.tour-title {
  font-family: "DM Serif Display", serif;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.1;
}

.tour-subtitle {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.tour-compass {
  position: relative;
  width: min(260px, 32vw);
  height: 18px;
  margin: 3px auto 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 20px,
      rgba(255, 255, 255, 0.2) 20px 21px
    ),
    rgba(8, 5, 14, 0.42);
}

.tour-compass::after {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 50%;
  width: 1px;
  content: "";
  background: rgba(255, 255, 255, 0.8);
}

.tour-compass-window {
  position: absolute;
  top: 4px;
  left: calc(50% - 30px);
  width: 60px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #9a73e7, #d4b7ff);
  box-shadow: 0 0 15px rgba(167, 131, 237, 0.8);
  transition: transform 0.08s linear;
}

.tour-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 42px;
  min-height: 42px;
  padding: 0 13px;
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(13, 8, 22, 0.58);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(15px);
}

.tour-button:hover,
.tour-button:focus-visible,
.tour-button.is-on {
  color: #fff;
  border-color: rgba(212, 183, 255, 0.72);
  outline: none;
  background: rgba(124, 91, 201, 0.78);
  transform: translateY(-2px);
}

.tour-button-icon {
  font-size: 17px;
  line-height: 1;
}

.tour-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 720px;
  margin: 24px auto 0;
  color: rgba(255, 250, 242, 0.64);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.tour-note::before {
  flex: 0 0 auto;
  width: 26px;
  height: 1px;
  content: "";
  background: #a783ed;
}

.tour-actions {
  display: flex;
  justify-content: center;
  margin: 28px auto 0;
}

.tour-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fffaf2;
  color: #1a1228;
  font: 800 15px/1 "Plus Jakarta Sans", sans-serif;
  padding: 16px 28px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 5px 5px 0 #a783ed;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tour-cta:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 #a783ed;
}

@keyframes tourSpin {
  to { transform: rotate(360deg); }
}

@keyframes tourPulse {
  50% { opacity: 0.6; transform: scale(0.88); }
}

@media (max-width: 760px) {
  .tour-section {
    padding: 78px 16px 70px;
  }

  .tour-head {
    margin-bottom: 28px;
  }

  .tour-stage {
    height: min(68svh, 590px);
    min-height: 500px;
    border-radius: 24px;
  }

  .tour-topbar {
    top: 12px;
    right: 12px;
    left: 12px;
  }

  .tour-hint {
    top: 60px;
    overflow: hidden;
    max-width: calc(100% - 24px);
    text-overflow: ellipsis;
  }

  .tour-hud {
    right: 12px;
    bottom: 12px;
    left: 12px;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }

  .tour-center {
    min-width: 0;
  }

  .tour-compass {
    width: min(180px, 42vw);
  }

  .tour-subtitle,
  .tour-angle,
  .tour-button span:not(.tour-button-icon) {
    display: none;
  }

  .tour-button {
    width: 42px;
    padding: 0;
  }

  .tour-hud-side {
    gap: 5px;
  }

  .tour-hud-side:first-child .tour-button:not(:first-child) {
    display: none;
  }
}

@media (max-width: 390px) {
  .tour-stage {
    height: 560px;
    min-height: 0;
  }

  .tour-title {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour-load::before,
  .tour-live-dot {
    animation: none;
  }
}
