:root { color-scheme: dark; background: var(--motion-canvas); }
body { background: var(--motion-canvas); }
.gallery {
  min-height: 100svh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#viewer { width: min(100%, calc((100svh - 106px) * 1.6)); }
header, footer { display: flex; align-items: center; padding-inline: clamp(12px, 2vw, 26px); }
header { height: 60px; }
h1 { font-size: var(--motion-text-title); line-height: var(--motion-leading-tight); font-weight: var(--motion-weight-semibold); margin: 0; }
#surface { position: relative; aspect-ratio: 16 / 10; overflow: hidden; outline-offset: -2px; touch-action: none; user-select: none; -webkit-user-select: none; }
#viewer[data-state="ready"] #surface { cursor: grab; }
#viewer[data-state="ready"] #surface.dragging { cursor: grabbing; }
.poster { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
#world { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 100%; height: 100%; visibility: hidden; }
#viewer[data-state="ready"] #world { visibility: visible; }
footer { min-height: 46px; gap: var(--motion-space-12); color: var(--motion-muted); font-size: var(--motion-text-sm); }
#instructions { flex: auto; }
#status { min-width: 0; }
#status:empty, [hidden] { display: none !important; }
.touch { display: none; }
@media (hover: none), (pointer: coarse) {
  .desktop { display: none; }
  .touch { display: inline; }
}
@media (max-aspect-ratio: 4 / 5) {
  #viewer { width: 100%; }
  #surface { aspect-ratio: 4 / 5; max-height: calc(100svh - 106px); }
  #world { width: auto; aspect-ratio: 16 / 10; min-width: 100%; }
}
@media (max-height: 480px) and (orientation: landscape) {
  #viewer { width: min(100%, calc((100svh - 64px) * 1.6)); }
  header, footer { height: 32px; min-height: 32px; }
  h1 { font-size: var(--motion-text-heading); }
}
