/* 3D model viewer. Flat, square, no borders. Colours come from the site tokens with fallbacks. */
.viewer {
  margin: 0;
  color: var(--ink, #101010);
}
.viewer__stage {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface, #e8e4d9);
}
.viewer__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  cursor: grab;
}
.viewer__canvas:active { cursor: grabbing; }
.viewer__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.viewer__status {
  position: absolute;
  left: 0;
  bottom: 0;
  max-width: 100%;
  margin: 0;
  padding: 10px 14px;
  background: var(--ink, #101010);
  color: var(--bg, #f3f0e8);
  font-size: 0.875rem;
  line-height: 1.35;
}
.viewer__status[hidden] { display: none; }

.viewer__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.viewer__controls[hidden] { display: none; }
.viewer__btn {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: var(--surface, #e8e4d9);
  color: var(--ink, #101010);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.viewer__btn:hover { background: var(--ink, #101010); color: var(--bg, #f3f0e8); }
.viewer__btn:focus-visible { outline: 3px solid var(--accent, #0b3bff); outline-offset: 2px; }
.viewer__btn[aria-pressed="true"],
.viewer__btn--primary { background: var(--accent, #0b3bff); color: var(--accent-ink, #fff); }
.viewer__btn--primary:hover { background: var(--ink, #101010); color: var(--bg, #f3f0e8); }

.viewer figcaption { margin-top: 10px; }

@media (max-width: 640px) {
  .viewer__stage { aspect-ratio: 1 / 1; }
  .viewer__btn { flex: 1 1 calc(50% - 4px); padding: 0 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  .viewer__btn { transition: background-color 0.12s, color 0.12s; }
}
