:root {
  color-scheme: light;
  background: transparent;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  min-width: 0;
  height: 64px;
  margin: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
}

body {
  user-select: none;
  -webkit-user-select: none;
}

.artwork-nav {
  width: 100%;
  height: 64px;
  overflow-x: hidden;
  overflow-y: hidden;
  scrollbar-width: none;
}

.artwork-nav::-webkit-scrollbar {
  display: none;
}

.icon-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 100%;
  height: 100%;
  padding: 2px 6px 0;
}

.artwork-icons {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(5px, 1.1vw, 12px);
  min-width: max-content;
  height: 62px;
}

.icon-link {
  --delay: 0s;
  position: relative;
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 60px;
  place-items: end center;
  border: 0;
  outline: 0;
  background: transparent;
  text-decoration: none;
  animation: portal-drift 3.644s steps(24, end) var(--delay) infinite;
}

.icon-link:nth-child(2) { --delay: -.58s; }
.icon-link:nth-child(3) { --delay: -1.16s; }
.icon-link:nth-child(4) { --delay: -1.74s; }
.icon-link:nth-child(5) { --delay: -2.32s; }
.icon-link:nth-child(6) { --delay: -2.90s; }
.icon-link:nth-child(7) { --delay: -3.48s; }
.icon-link:nth-child(8) { --delay: -4.06s; }

.icon-link canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  image-rendering: pixelated;
  filter: grayscale(1) contrast(1.45) brightness(.68) drop-shadow(3px 3px 0 rgba(0, 0, 0, .24));
  opacity: 1;
  transition: filter 120ms steps(2, end), transform 120ms steps(2, end);
}

.icon-link::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 6px solid #777;
  opacity: 0;
  transform: translateX(-50%);
}

.icon-link.active canvas,
.icon-link:hover canvas,
.icon-link:focus-visible canvas {
  filter: saturate(1.08) contrast(1.04) drop-shadow(3px 3px 0 rgba(0, 0, 0, .24));
  transform: translateY(-4px);
}

.icon-link.active::after {
  opacity: 1;
}

.icon-link:hover,
.icon-link:focus-visible,
.icon-link.active {
  animation-play-state: paused;
}

.icon-link:focus-visible {
  outline: 2px dotted #777;
  outline-offset: 0;
}

@keyframes portal-drift {
  0%, 50%, 100% { transform: translateY(0); }
  25% { transform: translateY(3px); }
  75% { transform: translateY(-3px); }
}

@media (max-width: 650px) {
  html,
  body,
  .artwork-nav {
    height: 58px;
  }

  .icon-row {
    justify-content: center;
    width: 100%;
    min-width: 0;
    padding: 1px 4px 0;
  }

  .artwork-icons {
    width: 100%;
    min-width: 0;
    gap: 2px;
    height: 56px;
  }

  .icon-link {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: 40px;
    height: 54px;
  }

  .icon-link canvas {
    width: clamp(32px, 9.4vw, 38px);
    height: clamp(32px, 9.4vw, 38px);
    margin-bottom: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .icon-link {
    animation: none;
  }
}
