/* Universal 2030-2050 Cinema Motion & Cross-Document View Transitions Kit
 * Compliant with Modern Web Guidance:
 * - Gated @view-transition on prefers-reduced-motion: no-preference
 * - Compositor-only transform & opacity motion (zero layout thrash)
 * - Scroll-driven reveal animations with graceful static fallback
 * - WCAG 2.2.2 pause-state hooks and focus-visible guarantees
 */

html, body {
  overflow-x: clip;
}

:focus-visible {
  outline: 2px solid var(--accent, #2fd4a8);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root) {
    animation: studio-vt-out 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  ::view-transition-new(root) {
    animation: studio-vt-in 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  @keyframes studio-vt-out {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.992); }
  }

  @keyframes studio-vt-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @supports (animation-timeline: view()) {
    .cinema-reveal {
      animation: studio-scroll-rise linear both;
      animation-timeline: view();
      animation-range: entry 4% cover 28%;
    }

    @keyframes studio-scroll-rise {
      from {
        opacity: 0.72;
        transform: translateY(18px) scale(0.99);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }
  }
}

.studio-reactive-stage {
  position: relative;
  border-radius: var(--radius, 18px);
  overflow: clip;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: radial-gradient(circle at 20% 20%, rgba(45, 212, 191, 0.14), rgba(15, 23, 42, 0.92));
}

.studio-reactive-canvas {
  display: block;
  width: 100%;
  height: 280px;
  cursor: crosshair;
}

.studio-reactive-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.78);
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
  font-size: 0.86rem;
}

.studio-reactive-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.studio-ctl-btn {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.85);
  color: #f8fafc;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.studio-ctl-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(94, 234, 212, 0.65);
  transform: translateY(-1px);
}

.studio-ctl-btn[data-active="true"] {
  background: rgba(20, 184, 166, 0.24);
  border-color: #2dd4bf;
  color: #ccfbf1;
}

.studio-protocol-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  opacity: 0.88;
}

.studio-protocol-bar a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
