.frame {
  position: relative;
  z-index: 1;
}

button {
  touch-action: manipulation;
}

.cursor-symbols {
  --dot-unit: 2px;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.cursor-symbol {
  position: absolute;
  display: grid;
  grid-template-columns: repeat(var(--grid-size), var(--dot-unit));
  grid-template-rows: repeat(var(--grid-size), var(--dot-unit));
  width: calc(var(--grid-size) * var(--dot-unit));
  height: calc(var(--grid-size) * var(--dot-unit));
  opacity: 1;
  user-select: none;
  transform: translate(-50%, -50%);
}

.cursor-pixel {
  display: block;
  width: var(--dot-unit);
  height: var(--dot-unit);
  background: currentColor;
}

.cursor-symbol[data-tone="a"] {
  color: var(--line-a);
}

.cursor-symbol[data-tone="b"] {
  color: var(--line-b);
}

#works-image {
  width: 100%;
  height: calc(100dvh - 170px);
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  border: 0;
}

#works-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  box-sizing: border-box;
  border: 2px solid var(--line-b);
  object-fit: contain;
}

.works-thumb {
  overflow: hidden;
}

.works-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.step-btn:disabled {
  opacity: .3;
  cursor: default;
}

.theme-toggle {
  z-index: 2;
  right: clamp(22px, 5vw, 64px);
  bottom: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line-b) 55%, transparent);
  background: transparent;
  color: var(--text);
  line-height: 1;
  opacity: 1;
}

.theme-toggle:hover {
  border-color: var(--line-b);
  opacity: 1;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--line-a);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  #works-image {
    width: min(100%, 58svh);
    height: 58svh;
    max-height: 58svh;
  }

  .theme-toggle {
    right: 18px;
    bottom: 37px;
  }
}
