:root {
  color-scheme: dark;
  background: #111;
  --gallery-header-height: 69px;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  scroll-behavior: auto;
}

.design-challenge-page {
  background: #111;
}

.design-challenge-page .header {
  padding: 1rem 3rem;
  background: #111;
  border-bottom: 1px solid rgb(255 255 255 / .06);
}

.design-challenge-page .header-logo a:focus-visible,
.design-challenge-page .header-social:focus-visible {
  outline: 2px solid var(--theme-color);
  outline-offset: 5px;
}

.gallery-viewport {
  position: fixed;
  inset: var(--gallery-header-height) 0 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.gallery-viewport.is-dragging { cursor: grabbing; }
.gallery-viewport:focus { outline: none; }

.gallery-world {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.gallery-artwork {
  position: absolute;
  display: block;
  width: 250px;
  aspect-ratio: 3 / 4;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  corner-shape: squircle;
  overflow: hidden;
  background: #eee;
  cursor: inherit;
  user-select: none;
  -webkit-user-select: none;
}

.gallery-artwork img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.gallery-artwork:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.gallery-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  --shade: 0;
  background: rgb(17 17 17 / var(--shade));
  overflow: hidden;
  cursor: zoom-out;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.gallery-dialog::backdrop { background: transparent; }

.gallery-dialog img {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  border-radius: 16px;
  corner-shape: squircle;
  transform-origin: 0 0;
  will-change: transform, opacity;
  user-select: none;
  -webkit-user-select: none;
}

@media (max-width: 768px) {
  :root { --gallery-header-height: 61px; }
  .design-challenge-page .header { padding: .75rem 1.5rem; }
}

