/* Study 016 — a living, voice-reactive material inside the Shader Lab stage. */
.companion-hero-frame {
  display: none;
  opacity: 0;
  transition: opacity .55s ease;
}
.hero-stage.is-companion {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  overflow: visible;
}
.hero-stage.is-companion:hover { border-color: transparent; }
.hero-stage.is-companion .hero-poster { opacity: 0; pointer-events: none; }
.hero-stage > .study-handoff.from-companion { background: transparent; }
.hero-stage.is-companion + .stage-subrow { position: relative; z-index: 10; }
.hero-stage.is-companion .companion-hero-frame {
  display: block;
  position: absolute;
  /* The live object jumps, stretches and grows satellite lobes. Let its
     rendering viewport bleed past the former stage on every side vertically. */
  top: -160px;
  left: 0;
  right: 0;
  width: 100%;
  height: calc(100% + 240px);
  border: 0;
  z-index: 4;
  background: transparent;
  /* Fade at the larger viewport's perimeter, well outside the character,
     so its animated silhouette has no hard crop line. */
  -webkit-mask-image: radial-gradient(ellipse 56% 60% at 50% 48%, #000 68%, transparent 100%);
  mask-image: radial-gradient(ellipse 56% 60% at 50% 48%, #000 68%, transparent 100%);
}
.hero-stage.is-companion .companion-hero-frame.is-ready { opacity: 1; }
.hero-stage.is-companion .hero-live-tools { top: 8px; right: 8px; }
.hero-stage.is-companion .hero-live-tools button {
  background: rgba(5, 14, 20, .25);
  border-color: rgba(173, 214, 236, .22);
  box-shadow: none;
  backdrop-filter: blur(8px);
  color: #b9cdd9;
}
.hero-stage.is-companion .hero-live-tools button:hover,
.hero-stage.is-companion .hero-live-tools button[aria-expanded="true"] {
  background: rgba(38, 73, 100, .4);
  border-color: rgba(183, 225, 247, .55);
  color: #f0faff;
}
.hero-stage.is-companion .stage-label-dot {
  background: #8cdaff;
  box-shadow: 0 0 15px rgba(100, 195, 255, .75);
}
.hero-stage.is-companion .stage-label { color: #afc7d8; }
.hero-stage.is-companion .stage-grid,
.hero-stage.is-companion .stage-glass,
.hero-stage.is-companion .stage-sweep,
.hero-stage.is-companion .stage-side-label,
.hero-stage.is-companion .stage-bottom-info,
.hero-stage.is-companion .scene-touchpoint { display: none; }
.hero-stage.is-companion .stage-corner { border-color: #8bc8ed; opacity: .52; }

/* The full viewer uses the same live study, not a flattened WebGL screenshot. */
.viewer-shell[data-scene="companion"] { --acid: #91d9f9; }
.viewer-shell[data-scene="companion"] .viewer-content {
  display: block;
  position: relative;
  flex: 1;
  min-height: 0;
}
.viewer-shell[data-scene="companion"] .viewer-render {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #03050a;
}
.viewer-shell[data-scene="companion"] .viewer-render .companion-frame:not([hidden]) {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 8;
  opacity: 1;
  background: #03050a;
  pointer-events: auto;
}
.viewer-shell[data-scene="companion"] :is(
  .viewer-info, .viewer-scene, .viewer-poster, .scene-touchpoint,
  .viewer-frame-corner, .viewer-render-note
) { display: none; }
.viewer-shell[data-scene="companion"] .viewer-close {
  color: #cdeeff;
  border-color: rgba(145, 217, 249, .28);
}
.viewer-shell[data-scene="companion"] .viewer-close:hover {
  background: #b3e6ff;
  color: #061322;
}
@media (max-width: 760px) {
  .hero-stage.is-companion .companion-hero-frame {
    top: -110px;
    height: calc(100% + 190px);
  }
}
@media (max-width: 440px) {
  .hero-stage.is-companion { min-height: 280px; }
  .hero-stage.is-companion .stage-label { top: 14px; left: 16px; font-size: 7px; }
  .hero-stage.is-companion .stage-corner { width: 17px; height: 17px; }
  .hero-stage.is-companion .hero-live-tools { top: 5px; right: 4px; }
}
