/* ============================================================
   Hero · 360 viewer + cursor-mask reveal
   Base = final render, slowly panning.
   Reveal = a stack of stages (wireframe → massing → materials → warm → cool).
            Only one stage is "on". The whole layer is masked to a circle
            around the cursor — so the user sees the other-version of the
            space wherever they hover.
   ============================================================ */

.hero-pano {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: #f7f7f5;
  color: var(--neutral-900);
  overflow: hidden;
  cursor: none;
  isolation: isolate;
  -webkit-user-select: none;
  user-select: none;
}

.hero-pano * {
  -webkit-user-select: none;
  user-select: none;
}

.hero-pano.is-dragging {
  cursor: none;
}

/* ── WebGL 360 canvas (react-three-fiber) ───────────────── */
.pano-canvas-host {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: none;
}
.pano-canvas-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.pano-canvas-host .pano-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  opacity: 0;
  transition: opacity 0.55s ease-out;
}
.pano-canvas-wrap.is-ready canvas {
  opacity: 1;
}
.pano-canvas-wrap.is-dragging {
  cursor: grabbing;
}
/* Edge-only fade — no center wash (center wash made the spotlight look blurry) */
.pano-vignette {
  position: absolute; inset: 0; z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(247, 247, 245, 0.45) 0%,
    transparent 18%,
    transparent 78%,
    rgba(247, 247, 245, 0.55) 100%
  );
}

/* ── Cursor crosshair only (no ring) ───────────────────── */
.cursor-ring {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 30;
  border: none;
  box-shadow: none;
  transform: translate(-200px, -200px);
  transition: transform .08s linear, opacity .3s ease;
  opacity: 0;
}
.hero-pano:hover .cursor-ring { opacity: 1; }
.cursor-ring::before,
.cursor-ring::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(0, 0, 0, 0.45);
}
.cursor-ring::before {
  width: 1px;
  height: 14px;
  margin: -7px 0 0 -0.5px;
}
.cursor-ring::after {
  width: 14px;
  height: 1px;
  margin: -0.5px 0 0 -7px;
}

/* ── Top chrome bar (viewer status) ────────────────────── */
.pano-chrome {
  position: absolute; left: 0; right: 0; top: 0;
  z-index: 12;
  padding-top: calc(72px + var(--s4));
  pointer-events: none;
}
.pano-chrome .row {
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--neutral-500);
}
.pano-chrome .left { display: inline-flex; align-items: center; gap: 10px; }
.pano-chrome .dot.live {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0,160,200,.15);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(0,160,200,.15); }
  50%     { box-shadow: 0 0 0 8px rgba(0,160,200,0); }
}
.pano-chrome .kbd {
  padding: 6px 12px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  color: var(--neutral-500);
}

/* ── Stage progress bar (bottom) ───────────────────────── */
.pano-progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 12;
  padding-bottom: var(--s5);
  pointer-events: none;
}
.pano-progress .row {
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,.7);
}
.pano-progress .dots { display: inline-flex; gap: 8px; }
.pano-progress .d {
  width: 28px; height: 2px;
  background: rgba(255,255,255,.18);
  transition: background .4s ease;
}
.pano-progress .d.is-on { background: var(--accent); }

/* ── Centered copy ────────────────────────────────────── */
.pano-copy {
  position: relative; z-index: 11;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid; align-items: center;
  text-align: center;
  padding: calc(72px + var(--s8)) 0 calc(var(--s8) + 40px);
  pointer-events: none;
  isolation: isolate;
}
.pano-copy .container {
  width: 100%;
  max-width: var(--container-max);
}
/* Copy is visual only — pano drag passes through; buttons stay clickable */
.pano-copy .container > * { pointer-events: none; }
.pano-copy .actions a { pointer-events: auto; }
.pano-copy .display.reveal-chars {
  display: block;
  width: 100%;
  max-width: 18ch;
  margin-left: auto;
  margin-right: auto;
}
.pano-copy .display {
  color: var(--neutral-900);
  font-size: clamp(48px, 7.5vw, 80px);
  letter-spacing: -0.025em;
  line-height: 0.98;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-wrap: balance;
}
.pano-copy .reveal-chars .reveal-line {
  display: block;
  text-wrap: balance;
}
@supports not (text-wrap: balance) {
  .pano-copy .display,
  .pano-copy .reveal-chars .reveal-line {
    text-wrap: pretty;
  }
}
.pano-copy .lede {
  margin: var(--s4) auto 0;
  color: var(--neutral-600);
  font-weight: 300;
  font-size: clamp(18px, 1.7vw, 22px);
  -webkit-font-smoothing: antialiased;
}
.pano-copy .actions {
  margin-top: var(--s6);
  display: flex; gap: var(--s3); justify-content: center;
  flex-wrap: wrap;
}

/* ── Scroll cue ───────────────────────────────────────── */
.scroll-cue-2 {
  position: absolute; left: 50%; bottom: calc(var(--s8) + 8px);
  transform: translateX(-50%);
  z-index: 11;
  display: grid; gap: 8px; justify-items: center;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--neutral-400);
  pointer-events: none;
}
.scroll-cue-2 .bar {
  width: 1px; height: 36px;
  background: linear-gradient(180deg, var(--neutral-400), transparent);
  animation: drip 2.4s var(--ease-standard) infinite;
}

/* ── Tablet / mobile layout ─────────────────────────────── */
@media (max-width: 880px) {
  /* svh avoids dvh jumps when mobile browser chrome shows/hides at scroll end */
  .hero-pano,
  .pano-copy {
    min-height: 100svh;
  }
  .pano-copy {
    padding: calc(64px + var(--s6)) 0 calc(var(--s7) + 56px);
    align-items: center;
  }
  .pano-copy .display.reveal-chars {
    max-width: min(100%, 12ch);
  }
  .pano-copy .display {
    font-size: clamp(36px, 9.5vw, 64px);
    letter-spacing: -0.02em;
  }
  .pano-copy .lede {
    font-size: clamp(16px, 4vw, 18px);
    max-width: 32ch;
    padding: 0 var(--s2);
  }
  .pano-copy .actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    gap: var(--s2);
  }
  .pano-copy .actions .btn {
    width: 100%;
    justify-content: center;
  }
  .pano-vignette {
    background: linear-gradient(
      180deg,
      rgba(247, 247, 245, 0.55) 0%,
      transparent 22%,
      transparent 72%,
      rgba(247, 247, 245, 0.65) 100%
    );
  }
  .scroll-cue-2 {
    bottom: calc(var(--s6) + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 540px) {
  .pano-copy .display {
    font-size: clamp(32px, 10vw, 48px);
    line-height: 1.02;
  }
}

/* ── Touch / no-hover fallback (reveal driven in WebGL) ─── */
@media (hover: none) {
  .hero-pano { cursor: auto; touch-action: pan-y; }
  .pano-canvas-host,
  .pano-canvas-wrap { cursor: grab; touch-action: pan-y; }
  .pano-canvas-host .pano-canvas-wrap canvas { touch-action: pan-y; }
  .pano-canvas-wrap.is-dragging,
  .pano-canvas-wrap.is-dragging canvas { touch-action: none; }
  .cursor-ring { display: none; }
}
