.office-view { cursor:default; }
.demo-viewport { position:relative; aspect-ratio:2.15; overflow:hidden; border-radius:.7rem; background:#f0f0f0; }
.demo-camera { position:absolute; width:100%; aspect-ratio:1.6; left:50%; top:50%; transform:translate(-50%,-50%); }
.demo-scene {
  --opening-zoom:155%;
  --portrait-size:3.8cqw;
  position:absolute; width:var(--opening-zoom); aspect-ratio:1.6; left:50%; top:58%;
  transform:translate(-50%,-58%); container-type:inline-size;
}
.demo-scene .demo-floor, .office-view .demo-floor { width:100%; height:auto; aspect-ratio:auto; display:block; }
/* This higher-resolution crop is aligned with the center of the full map. */
.demo-scene .demo-floor-detail {
  position:absolute;
  top:22%;
  left:20%;
  width:60%;
  height:auto;
  aspect-ratio:auto;
  mask-image:radial-gradient(ellipse at center, #000 61%, transparent 73%);
}
/* Scale the walking sprites with the map, including on narrow screens. */
.demo-person { z-index:1; position:absolute; width:1.7%; aspect-ratio:4 / 5; transform:translate(-50%,-88%); }
.demo-self {
  --meet-x:49.54%; --meet-y:56.11%; --avatar-strip:url("/assets/studio-walk-green.webp?v=c643954118e6");
  left:var(--meet-x); top:var(--meet-y); width:1.5%;
}
.demo-teammate {
  --meet-x:50.88%; --meet-y:60.23%; --avatar-strip:url("/assets/studio-walk-blue.webp?v=cb925d1f4241");
  left:var(--meet-x); top:var(--meet-y);
}
.proximity-ring { position:absolute; left:50.21%; top:58.17%; width:9%; height:9%; transform:translate(-50%,-50%); border-radius:50%; border:clamp(2px,.28cqw,11px) solid #4d9d66; background:#93dc9b33; }
.demo-face { position:absolute; z-index:2; width:var(--portrait-size); height:auto; aspect-ratio:1; object-fit:cover; transform:translate(-50%,-50%); border:clamp(2px,.18cqw,7px) solid white; border-radius:50%; background:#eee; box-shadow:0 2px 8px #22222233; }
.demo-face.first, .demo-speaking { left:46.5%; --speaker-top:51.5%; }
.demo-face.first { top:var(--speaker-top); }
.demo-face.second { left:54.3%; top:55.8%; }
.demo-speaking {
  position:absolute; z-index:3; top:calc(var(--speaker-top) + var(--portrait-size) / 2);
  width:clamp(24px,1.1cqw,36px); aspect-ratio:1; transform:translate(-50%,-50%);
  display:grid; place-items:center; border-radius:50%; color:#267349; background:#fff;
  box-shadow:0 1px 4px #20202033; opacity:0; pointer-events:none;
}
.demo-speaking svg { width:68%; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; }
/* Keep the preview controls anchored while the camera follows the avatars. */
.demo-hud {
  --key: clamp(22px, 2.6vw, 32px);
  --pad: clamp(6px, 1vw, 13px);
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
  color: #343538;
  font-size: clamp(.63rem, 1vw, .77rem);
  font-weight: 600;
  line-height: 1;
}
.demo-hud svg { width: 1.3em; height: 1.3em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.demo-personal, .demo-roster, .demo-tools { position: absolute; display: flex; align-items: center; gap: 3px; }
.demo-personal { top: var(--pad); right: var(--pad); }
.demo-roster, .demo-tools, .demo-key { background: #fff; border: 1px solid #e4e3e1; border-radius: .55rem; box-shadow: 0 1px 3px #25252120; }
.demo-key, .demo-tools > span, .demo-roster span { display: inline-flex; align-items: center; justify-content: center; min-width: var(--key); height: var(--key); }
.demo-muted { color: #95434d; background: #ffeded; }
.demo-mic { position:relative; }
.demo-mic-on { position:absolute; inset:0; display:grid; place-items:center; border-radius:inherit; color:#267349; background:#e6f5eb; opacity:0; }
.demo-status { padding-inline: .45em; gap: .45em; color: #355742; }
.demo-status::before { content: ""; width: .65em; height: .65em; border-radius: 50%; background: #38a466; }
.office-view .demo-profile img { width: calc(var(--key) - 5px); height: auto; aspect-ratio: 1; border-radius: 50%; background: #edf0ee; }
.demo-roster, .demo-tools { bottom: var(--pad); padding: 3px; }
.demo-roster { left: var(--pad); padding-left: .55em; }
.demo-tools { right: var(--pad); }
.demo-tools > span, .demo-roster span { background: #f4f4f4; border-radius: .35rem; }
.demo-zoom { gap: .6em; padding-inline: .45em; font-variant-numeric: tabular-nums; }
.demo-zoom-value { flex:none; inline-size:5ch; text-align:center; white-space:nowrap; }
.demo-zoom svg { width: 1em; }
/* Each strip has a standing pose followed by twelve frames of walking. */
:is(.demo-self,.demo-teammate)::before, :is(.demo-self,.demo-teammate)::after {
  content:"";
  position:absolute;
  inset:0;
  background:var(--avatar-strip) left center / 1300% 100% no-repeat;
}
:is(.demo-self,.demo-teammate)::after { opacity:0; }
.demo-viewport[data-animated] {
  --cycle-length:13s;
  --cycle:var(--cycle-length) linear infinite both;
  --fade-cycle:var(--cycle-length) ease-in-out infinite both;
  --pose-cycle:var(--cycle-length) step-end infinite both;
}
.demo-viewport[data-animated] .demo-scene { animation:office-zoom var(--cycle); }
.demo-viewport[data-animated] .demo-self { animation:meet-left var(--cycle); }
.demo-viewport[data-animated] .demo-teammate { animation:meet-right var(--cycle); }
.demo-viewport[data-animated] :is(.demo-self,.demo-teammate)::before { animation:meeting-pose var(--pose-cycle); }
.demo-viewport[data-animated] :is(.demo-self,.demo-teammate)::after {
  animation:walking-pose var(--pose-cycle), avatar-stride .82s steps(12,jump-none) infinite;
}
.demo-viewport[data-animated] .demo-teammate::after { animation-delay:0s,-.24s; }
/* Both videos start at arrival (25%) and run for 4.4 seconds. */
.demo-viewport[data-animated] :is(.proximity-ring,.demo-face,.demo-speaking) { animation:camera-arrives var(--fade-cycle); animation-delay:3.25s; }
.demo-viewport[data-animated] .demo-speaking path {
  transform-box:fill-box; transform-origin:center; animation:demo-speaking-bar .65s ease-in-out var(--bar-delay,0s) alternate infinite;
}
.demo-speaking path:nth-child(even) { --bar-delay:-.4s; }
.demo-speaking path:nth-child(3n) { --bar-delay:-.18s; }
.demo-viewport[data-animated] .demo-mic-on { animation:demo-mic-on var(--pose-cycle); }
.demo-viewport[data-paused] *, .demo-viewport[data-paused] *::before, .demo-viewport[data-paused] *::after {
  animation-play-state:paused !important;
}
@keyframes office-zoom {
  /* Resize the scene so the browser paints the map at the zoomed resolution. */
  0%,85%,100% { width:var(--opening-zoom); }
  27%,58% { width:325%; }
}
/* Both avatars arrive together and walk at the same speed. */
@keyframes meet-left {
  0%,4.13% { left:54.77%; top:49.21%; opacity:0; }
  7.5% { opacity:1; }
  25%,60% { left:var(--meet-x); top:var(--meet-y); }
  78.5% { opacity:1; }
  82.02%,100% { left:45.52%; top:64.35%; opacity:0; }
}
@keyframes meet-right {
  0% { left:41.66%; top:64.19%; opacity:0; }
  3.5% { opacity:1; }
  /* Evenly spaced points round the cabinet at a steady walking pace. */
  4.17% { left:42.99%; top:63.08%; }
  8.33% { left:44.42%; top:62.15%; }
  12.5% { left:45.94%; top:61.38%; }
  16.67% { left:47.54%; top:60.78%; }
  20.83% { left:49.19%; top:60.39%; }
  25%,60% { left:var(--meet-x); top:var(--meet-y); }
  75.5% { opacity:1; }
  78.99%,100% { left:55.25%; top:53.66%; opacity:0; }
}
@keyframes avatar-stride {
  from { background-position-x:calc(100% / 12); }
  to { background-position-x:100%; }
}
@keyframes walking-pose { 0%,60% { opacity:1; } 25%,100% { opacity:0; } }
@keyframes meeting-pose { 0%,60% { opacity:0; } 25%,100% { opacity:1; } }
@keyframes camera-arrives { 0%,34%,100% { opacity:0; } 2%,32% { opacity:1; } }
@keyframes demo-speaking-bar { from { transform:scaleY(.5); } to { transform:scaleY(1); } }
@keyframes demo-mic-on { 0%,59%,100% { opacity:0; } 25% { opacity:1; } }
@media(max-width:42rem) {
  .demo-hud { --key: clamp(28px, 7.7vw, 34px); font-size: clamp(.72rem, 3vw, .85rem); }
  .demo-viewport { aspect-ratio:1.24; }
  .demo-camera { width:145%; }
}
@media(max-width:22rem) {
  .demo-tools { gap: 1px; }
  .demo-zoom { gap: .22em; }
  .demo-roster span { min-width: 1.5em; }
}
