.live-viewer {
  margin-top: 46px;
  width: min(1180px, calc(100% - 48px));
}
.viewer-intro {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 12px;
  color: var(--muted);
}
.viewer-intro .petal-dot {
  width: 5px;
  height: 5px;
  opacity: 0.7;
}
.viewer-stage {
  position: relative;
  height: clamp(320px, 37vw, 500px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  outline-offset: -4px;
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 7%,
    #000 93%,
    transparent
  );
}
.viewer-stage:focus-visible {
  outline: 2px solid var(--accent);
  border-radius: 16px;
}
.viewer-stage::-webkit-scrollbar {
  display: none;
}
.viewer-stage.is-zoomed {
  overflow-x: hidden;
  scroll-snap-type: none;
  touch-action: none;
}
.viewer-stage.is-dragging,
.viewer-stage.is-demonstrating {
  scroll-snap-type: none;
}
.viewer-stage.is-dragging {
  cursor: grabbing;
}
.viewer-track {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  height: 100%;
  width: max-content;
}
.viewer-photo {
  position: relative;
  flex: none;
  scroll-snap-align: center;
  opacity: 0.32;
  transform: scale(0.9);
  transition:
    opacity 240ms,
    transform 300ms var(--ease);
}
.viewer-photo.is-active {
  opacity: 1;
  transform: none;
  z-index: 1;
}
.is-zoomed .viewer-photo:not(.is-active) {
  opacity: 0;
}
.viewer-window {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 18px 38px -18px #0008;
  transform: translate(-50%, -50%) scale(0.76);
}
.viewer-window img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  pointer-events: none;
}
.is-animating .viewer-window,
.is-animating .viewer-window img {
  transition: transform 220ms var(--ease);
}
.viewer-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  max-width: 850px;
  margin: 4px auto 0;
  padding-inline: 24px;
}
.viewer-file {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
}
.viewer-file [data-count] {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.viewer-navigation,
.viewer-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.viewer-zoom {
  justify-self: end;
  gap: 4px;
}
.viewer-toolbar .round-button {
  background: transparent;
  color: var(--muted);
}
.viewer-toolbar .round-button:hover {
  background: var(--wash);
  color: var(--accent);
}
.viewer-toolbar button:disabled {
  opacity: 0.3;
  cursor: default;
  transform: none;
}
.viewer-toolbar .reset-button {
  min-width: 52px;
  padding: 0 6px;
  background: transparent;
  color: var(--muted);
  position: relative;
  font-variant-numeric: tabular-nums;
}
.reset-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
}
.viewer-toolbar .reset-button:hover [data-zoom-value] {
  opacity: 0;
}
.viewer-toolbar .reset-button:hover .reset-label {
  opacity: 1;
  color: var(--accent);
}
.gesture-hints {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 770px;
  margin: 34px auto 0;
}
.gesture-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 12px;
  background: transparent;
  border-radius: 14px;
}
.ghost-scene {
  position: relative;
  display: block;
  width: 112px;
  height: 112px;
  margin-bottom: 10px;
}
.ghost-hand {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  background: url("assets/gesture-hands.webp") 0 0 / 300% 100% no-repeat;
  opacity: 0.64;
  filter: saturate(0.5);
  mask-image: linear-gradient(#000 58%, transparent 98%);
  transition:
    opacity 220ms,
    filter 220ms;
}
[data-gesture="pinch"] .ghost-hand {
  background-position: 50% 0;
}
[data-gesture="pan"] .ghost-hand {
  background-position: 100% 0;
}
.gesture-cue strong {
  font-size: 13px;
  font-weight: 550;
  transition: color 180ms;
}
.gesture-cue > span:last-child {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}
.gesture-cue:hover strong,
.gesture-cue[aria-pressed="true"] strong {
  color: var(--accent);
}
.gesture-cue:hover .ghost-hand,
.gesture-cue:focus-visible .ghost-hand,
.gesture-cue[aria-pressed="true"] .ghost-hand {
  opacity: 0.9;
  filter: saturate(0.85);
}
.gesture-trail {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms;
}
.swipe-trail {
  width: 86px;
  height: 2px;
  top: 23px;
  left: 13px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.pinch-trail {
  width: 55px;
  height: 55px;
  top: 14px;
  left: 22px;
  background: radial-gradient(ellipse, #ef9ac918, transparent 70%);
}
.pan-trail {
  inset: 0;
  background: radial-gradient(ellipse, #ef9ac918, transparent 65%);
}
.gesture-cue:hover .gesture-trail,
.gesture-cue[aria-pressed="true"] .gesture-trail {
  opacity: 0.6;
}
[data-demonstrating="swipe"] [data-gesture="swipe"] .ghost-hand,
[data-gesture="swipe"]:hover .ghost-hand {
  animation: ghost-swipe 1600ms var(--ease) both;
}
[data-demonstrating="pinch"] [data-gesture="pinch"] .ghost-hand,
[data-gesture="pinch"]:hover .ghost-hand {
  animation: ghost-pinch 1600ms var(--ease) both;
}
[data-demonstrating="pan"] [data-gesture="pan"] .ghost-hand,
[data-gesture="pan"]:hover .ghost-hand {
  animation: ghost-pan 2200ms var(--ease) both;
}
@keyframes ghost-swipe {
  0%,
  12% {
    transform: translateX(14px) rotate(5deg);
  }
  70%,
  100% {
    transform: translateX(-14px) rotate(-5deg);
  }
}
@keyframes ghost-pinch {
  0%,
  12% {
    transform: scale(0.86) rotate(-8deg);
  }
  80%,
  100% {
    transform: scale(1.08) rotate(4deg);
  }
}
@keyframes ghost-pan {
  0%,
  30% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(14px, -10px) rotate(6deg);
  }
}
.viewer-help {
  margin-top: 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  text-align: center;
}
.viewer-help > span:not(.sr-only) {
  display: block;
  font-size: 10px;
  opacity: 0.8;
  margin-top: 2px;
}
@media (max-width: 900px) {
  .viewer-toolbar {
    gap: 12px;
    padding-inline: 12px;
  }
  .viewer-file {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .gesture-hints {
    gap: 12px;
  }
}
@media (max-width: 600px) {
  .live-viewer {
    width: 100%;
    margin-top: 36px;
  }
  .viewer-intro {
    font-size: 11px;
  }
  .viewer-stage {
    height: 310px;
  }
  .viewer-track {
    gap: 24px;
  }
  .viewer-window {
    border-radius: 9px;
  }
  .viewer-toolbar {
    grid-template-columns: 1fr 1fr;
    column-gap: 8px;
    row-gap: 8px;
    margin: 0 20px;
    padding: 0;
  }
  .viewer-file {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 12px;
  }
  .viewer-navigation {
    gap: 0;
  }
  .viewer-zoom {
    gap: 0;
  }
  .viewer-toolbar .round-button {
    width: 38px;
    height: 44px;
  }
  .viewer-toolbar .dot {
    width: 22px;
  }
  .viewer-toolbar .reset-button {
    min-width: 42px;
  }
  .gesture-hints {
    gap: 4px;
    margin: 26px 12px 0;
  }
  .ghost-scene {
    width: 82px;
    height: 82px;
    margin-bottom: 5px;
  }
  .gesture-cue {
    padding-inline: 4px;
  }
  .gesture-cue strong {
    max-width: 105px;
    font-size: 12px;
    line-height: 1.5;
  }
  .gesture-cue > span:last-child {
    max-width: 105px;
    font-size: 10px;
    line-height: 1.6;
    margin-top: 5px;
  }
  .viewer-help {
    font-size: 11px;
    margin: 14px 24px 0;
  }
  .viewer-help > span:not(.sr-only) {
    font-size: 10px;
  }
  .swipe-trail {
    width: 66px;
    left: 8px;
    top: 17px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .viewer-photo,
  .viewer-window,
  .viewer-window img,
  .ghost-hand {
    animation: none !important;
    transition: none !important;
  }
}
