/*
  Rules that only apply once the Three.js scene is running (body.scene-3d),
  plus the camera controls. Mobile first, same breakpoints as studio.css.
*/

/* ---------- The live scene replaces the still image ---------- */

.scene-3d #studio-canvas {
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}

.scene-3d #studio-canvas.is-dragging {
  cursor: grabbing;
}

/* ---------- Hotspots follow the 3D objects (positioned by world.js) ---------- */

.scene-3d .scene-hotspot {
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  gap: 12px;
  padding: 0;
  transform: translate(-50%, -50%);
  transition: opacity .25s;
}

.scene-3d .scene-hotspot > i {
  flex: none;
}

.scene-3d .scene-hotspot > span {
  position: absolute;
  top: 40px;
}

.scene-3d .scene-hotspot.is-hover > span {
  opacity: 1;
  transform: none;
}

.scene-3d .scene-hotspot.is-hover > i {
  background: var(--accent);
  transform: scale(1.3);
}

/* ---------- Camera controls ---------- */

.camera-controls {
  position: absolute;
  z-index: 5;
  right: var(--gutter);
  bottom: 244px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: opacity .25s;
}

.camera-controls[hidden],
#camera-reset[hidden] {
  display: none;
}

.camera-controls button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(215, 232, 222, .3);
  border-radius: 999px;
  background: rgba(9, 28, 34, .62);
  color: var(--ink);
  font: 500 14px/1 var(--sans);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color .18s, border-color .18s;
}

.camera-controls button:hover {
  background: rgba(22, 62, 66, .78);
  border-color: rgba(215, 232, 222, .55);
}

.camera-controls kbd {
  display: none;
  padding: 3px 6px;
  border: 1px solid rgba(215, 232, 222, .3);
  border-radius: 4px;
  color: var(--muted);
}

.camera-icon {
  font-size: 18px;
  line-height: 12px;
  color: var(--accent);
}

.camera-help {
  display: none;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  text-shadow: 0 1px 8px rgba(7, 24, 26, .7);
}

/* ---------- Look-around mode ---------- */

.exploring .hero-copy,
.exploring .collection-nav,
.exploring .site-header {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.exploring .scene-hotspot {
  opacity: 0;
  pointer-events: none;
}

.exploring .camera-controls {
  left: 50%;
  right: auto;
  bottom: 84px;
  flex-wrap: wrap;
  justify-content: center;
  width: calc(100% - 40px);
  transform: translateX(-50%);
}

.exploring .camera-help {
  display: inline;
  order: 3;
  width: 100%;
  text-align: center;
}

.panel-open .camera-controls {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Small, short phones: the doors need the room ---------- */

@media (max-width: 759px) and (max-height: 700px) {
  body:not(.exploring) .camera-controls {
    display: none;
  }
}

/* ---------- 480px and up: the doors sit in two rows of three ---------- */

@media (min-width: 480px) {
  .camera-controls {
    bottom: 188px;
  }
}

/* ---------- 760px and up ---------- */

@media (min-width: 760px) {
  .camera-controls {
    top: 96px;
    bottom: auto;
  }

  .camera-controls kbd {
    display: inline-block;
  }

  .exploring .camera-controls {
    top: auto;
    bottom: 10%;
    flex-wrap: nowrap;
    width: auto;
    white-space: nowrap;
  }

  .exploring .camera-help {
    order: 0;
    width: auto;
  }
}
