.studio-stage {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.studio-stage > img, .art-window > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  image-rendering: pixelated;
}
/* All positions share the 672 × 448 coordinate space of the illustration. */
.typing-hands {
  position: absolute;
  left: 17.85714286%;
  top: 64.28571429%;
  width: 41.66666667%;
  height: 35.71428571%;
  pointer-events: none;
  image-rendering: pixelated;
  background: url("assets/digitacao-poses.png") 0 0 / 400% 200% no-repeat;
  animation: studio-typing 2.6s steps(1,end) infinite;
}
@keyframes studio-typing {
  0%, 34%, 84%, 100% { background-position: 0 0; }
  5%, 40% { background-position: 33.333333% 0; }
  10%, 61% { background-position: 66.666667% 0; }
  15%, 45% { background-position: 100% 0; }
  20%, 66% { background-position: 0 100%; }
  25%, 50% { background-position: 33.333333% 100%; }
  29%, 71% { background-position: 66.666667% 100%; }
  56%, 77% { background-position: 100% 100%; }
}
.studio-screen-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* Each line appears in sequence over three loops of the typing hands. */
.studio-code {
  font: 19px/1 var(--pixel);
  fill: #a9fb69;
}
.studio-code tspan { fill: #69ebff; }
.query-line { animation-duration: 7.8s; animation-iteration-count: infinite; }
.query-line.one { animation-name: type-select; animation-timing-function: steps(15, end); }
.query-line.two { animation-name: type-count; animation-timing-function: steps(8, end); }
.query-line.three { animation-name: type-from; animation-timing-function: steps(17, end); }
.query-line.four { animation-name: type-group; animation-timing-function: steps(17, end); }
@keyframes type-select {
  0% { clip-path: inset(0 100% 0 0) fill-box; }
  22%, 100% { clip-path: inset(0) fill-box; }
}
@keyframes type-count {
  0%, 23% { clip-path: inset(0 100% 0 0) fill-box; }
  35%, 100% { clip-path: inset(0) fill-box; }
}
@keyframes type-from {
  0%, 36% { clip-path: inset(0 100% 0 0) fill-box; }
  58%, 100% { clip-path: inset(0) fill-box; }
}
@keyframes type-group {
  0%, 59% { clip-path: inset(0 100% 0 0) fill-box; }
  81%, 100% { clip-path: inset(0) fill-box; }
}
.studio-paused :is(.typing-hands, .query-line) { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  /* Keep the static editor populated when the visitor prefers a quiet scene. */
  .art-window:has(.studio-control[data-paused="true"]) .query-line { clip-path: none; animation: none; }
}
.studio-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 5px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: 1.02rem/1 var(--pixel);
}
.studio-control::before {
  content: "";
  width: 8px;
  height: 9px;
  background: linear-gradient(90deg,currentColor 0 3px,transparent 3px 5px,currentColor 5px);
}
.studio-control[data-paused="true"]::before {
  background: currentColor;
  clip-path: polygon(0 0,35% 0,35% 18%,65% 18%,65% 35%,100% 35%,100% 65%,65% 65%,65% 82%,35% 82%,35% 100%,0 100%);
}
.studio-control:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}
.studio-control:hover { background: #ffffff30; }
