/* The chart, the seated artist and the desk share one native scroll distance. */
html:has(.studio-preview) { overflow-anchor: none }
.studio-preview #tokens:focus-visible { outline: none }
.studio-preview #tokens:focus-visible #token-title {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em;
}
/* This extra containing block gives WebKit's and Chromium's native scrolling
   threads a real rail. The following section overlaps the same space. */
.studio-preview .studio-rail { margin-bottom: calc(var(--bar) - 100svh); }
.studio-preview .studio-rail #tokens::after {
  content: ''; display: block; height: calc(100svh - var(--bar));
}
.studio-preview .studio-rail #tokens .ridge-hero { position: sticky; top: var(--studio-stick-top,0); }
.studio-preview #questions {
  --studio-actor-w: min(59vw, 78svh, 802px);
  --studio-actor-cx: min(71%, calc(50% + 325px));
  --studio-actor-top: clamp(15px, 6svh, 68px);
  --studio-mouth-x: calc(var(--studio-actor-cx) + var(--studio-actor-w) * .010);
  --studio-mouth-y: calc(var(--studio-actor-top) + var(--studio-actor-w) * .43975);
  position: relative;
  z-index: 1;
  isolation: isolate;
  background: #040b09;
  border-top: 0;
}
.studio-preview #scene.studio-holding { z-index: 2; }
.studio-preview #scene.studio-crossing {
  z-index: 2; overflow: clip visible; background: transparent; pointer-events: none;
}
.studio-crossing #tokens,
.studio-crossing #tokens .ridge-hero { background: transparent; border-color: transparent; }
.studio-crossing .ridge-plot > :is(.ridge-lines,.ridge-overlay) {
  transform: translateY(var(--studio-chart-y)); opacity: var(--studio-chart-ink);
}
.studio-crossing #tokens :is(.ridge-intro,.ridge-meta,.page-foot,.ridge-prompt,.ridge-releases) {
  opacity: var(--studio-labels); transform: translateY(var(--studio-label-y));
}
.studio-crossing #tokens .ridge-reading { visibility: hidden }
.studio-crossing .ridge-hit { pointer-events: none }
.studio-preview .studio-ridge-dust {
  position: absolute; display: block; max-width: none; pointer-events: none;
}
.studio-ink-dispersing .ridge-plot > :is(.ridge-lines,.ridge-overlay) { visibility: hidden; }
.studio-preview .studio-replaced .ridge-artist { opacity: 0 }
.studio-preview .studio-camera-room {
  position: absolute; z-index: -1; inset: -120lvh 0 0; overflow: clip; pointer-events: none;
}
.studio-preview #scene.studio-crossing #home { overflow: clip }
.studio-preview .studio-dock {
  position: absolute; z-index: -1; pointer-events: none;
  width: var(--studio-actor-w); aspect-ratio: 808 / 846;
  left: calc(var(--studio-actor-cx) - var(--studio-actor-w) * .5);
  top: calc(120lvh + var(--studio-actor-top));
  opacity: 0;
}
.studio-preview .studio-camera-live .studio-dock { opacity: 1 }
.studio-preview #questions:not(.studio-in-frame) .talk-portrait { opacity: 0 }
.studio-preview .talk-portrait,
.studio-preview .studio-worktop {
  position: absolute; inset: 0;
  transform: translate3d(var(--camera-x,0px),var(--camera-y,0px),0) scale(var(--camera-scale,1));
  transform-origin: 0 0;
}
.studio-preview .talk-portrait { isolation: isolate }
.studio-preview .talk-portrait > :is(img,canvas) {
  display: block; position: absolute; inset: 0; width: 100%; height: 100%;
}
.studio-preview .talk-portrait::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  left: 58%; top: 68%; width: 180%; height: 156%; transform: translate(-50%, -50%);
  background: radial-gradient(ellipse closest-side, #1c3830 5%, rgb(16 40 32 / .66) 58%, transparent 97%);
  mask-image: linear-gradient(to bottom, #000 58%, transparent 73%);
}
.studio-preview .studio-worktop::before,
.studio-preview .studio-worktop::after {
  content: ''; position: absolute; pointer-events: none;
  opacity: var(--studio-room,1);
}
.studio-preview .studio-worktop::before {
  inset: -18% -15% 12% 1%;
  background: radial-gradient(ellipse at 64% 42%, rgb(204 180 139 / .075), transparent 63%);
}
.studio-preview .studio-worktop::after {
  left: -80%; right: -45%; top: 95.5%; height: calc(clamp(37px,10svh,108px) + var(--studio-table-depth,0px));
  opacity: var(--studio-surface,1);
  /* The same horizon remains under the pen while the terrain recedes. The
     shadows under the two wrists are separate from the desk's thin lip. */
  background:
    radial-gradient(ellipse 12% 5px at 53% 4px, #030b08 8%, transparent 98%),
    radial-gradient(ellipse 12% 5px at 67% 4px, #030b08 10%, transparent 98%),
    linear-gradient(to bottom, #273a30 0, #1e3026 1px, transparent 2px),
    linear-gradient(to bottom, #112119, #0d1b15 46%, #192b21 47%, #0a130f 49%, #040b09 92%);
  mask-image: linear-gradient(90deg,transparent, rgb(0 0 0/.63) 15%, #000 36% 85%,transparent);
}
.studio-preview #questions:not(.studio-mounted) .studio-dock,
.studio-preview #questions .ridge-to-question { display: none }
@media (max-width: 700px) {
  .studio-preview #questions {
    --studio-actor-w: min(78vw, 49svh, 395px);
    --studio-actor-cx: 60%;
    --studio-actor-top: clamp(4px, 2svh, 16px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .studio-preview .studio-rail { margin-bottom: 0; }
  .studio-preview .studio-rail #tokens::after { display: none; }
  .studio-preview .studio-rail #tokens .ridge-hero { position: relative; top: auto; }
}
