:root {
  color-scheme: dark;
  background: #080e14;
  font-family: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { width: 100%; min-height: 100%; margin: 0; }

body { overflow: hidden; }

.stage {
  --art-height: min(30.25vw, calc(90dvh - 79.2px));
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #0b141a;
}

.artwork {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  background: #0b141a;
}

.fallback {
  position: absolute;
  inset: 0;
  background: linear-gradient(#040c13d6, #040c13d6), url("assets/mosaic.webp") center / max(100vw, 1248px) auto repeat;
  user-select: none;
  pointer-events: none;
}

.fallback img {
  position: absolute;
  top: calc((100% - 88px - var(--art-height)) / 2);
  left: 2%;
  display: block;
  width: 96%;
  height: var(--art-height);
  object-fit: contain;
}

.mosaic {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  cursor: grab;
}

.is-ready .mosaic { opacity: 1; pointer-events: auto; }
.is-ready .fallback { visibility: hidden; }
.is-dragging .mosaic { cursor: grabbing; }
.mosaic:focus-visible { outline: 2px solid #9ebebd; outline-offset: -4px; }

.resource-links {
  position: absolute;
  z-index: 1;
  top: calc((100% - 88px + var(--art-height)) / 2 + 8px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.4vw, 20px);
  transform: translateX(-50%);
}

.resource-link {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid #ffffff30;
  border-radius: 50%;
  background: #0b131bc9;
  box-shadow: 0 5px 18px #0003;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.resource-link img { display: block; }
.resource-link:hover { transform: translateY(-3px); background: #263340ed; border-color: #ffffff8c; }
.resource-link:focus-visible { outline: 2px solid #c5d8e7; outline-offset: 5px; }
.resource-link:active { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .resource-link { transition: none; }
  .resource-link:hover { transform: none; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
