/* =========================================================
   CUBES — Three.js stage + overlay UI
   ========================================================= */

.cube-stage {
  position: relative;
  min-height: 100dvh;
  width: 100%;
  display: block;
  padding: 0;
  overflow: hidden;
}

/* The Three.js canvas fills the stage */
.cube-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  /* Prevents browser touch scrolling/pinch from interfering with our drag */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Intro copy overlaid in upper-left */
.cube-intro {
  position: absolute;
  top: 96px;
  left: var(--gutter);
  max-width: 360px;
  z-index: 5;
  pointer-events: none;
}
.cube-intro h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 8px 0 12px;
}
.cube-intro p {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* Caption shown when a face is expanded */
.cube-caption {
  position: absolute;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(8px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.55);
  padding: 8px 12px;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease), transform .45s var(--ease);
}
.cube-caption.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Close button while expanded */
.cube-close {
  position: absolute;
  top: 96px;
  right: var(--gutter);
  z-index: 9;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--rule);
  padding: 8px 12px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.cube-close.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.cube-close:hover {
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 720px) {
  .cube-intro { display: none; }
  .cube-close { top: 72px; right: 16px; }
}
