* {
  box-sizing: border-box;
}

:root {
  --background: #fff;
  --foreground: #111;
  --card-size: 390px;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--background);
  color: var(--foreground);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  overflow-x: hidden;
}

button,
a {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

#stage {
  position: relative;
  width: 100%;
  min-height: 3000px;
  overflow: hidden;
}

.work {
  position: absolute;
  width: var(--card-size);
  height: var(--card-size);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform:
    translateY(var(--start-y))
    rotate(var(--rotation));
  transition: transform 0.22s linear;
}

.work.is-visible {
  transform:
    translateY(0)
    rotate(var(--rotation));
}

.work img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

.about {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 20;
  width: min(300px, calc(100vw - 44px));
  font-size: 13px;
  line-height: 1.6;
}

.about h1 {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.6;
}

.about p {
  margin: 0 0 14px;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  background: transparent;
}

.viewer.is-open {
  display: block;
}

#viewerImage {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: auto;
  height: auto;
  max-width: min(68vw, 1000px);
  max-height: min(82vh, 900px);
  object-fit: contain;
  transform: translate(-50%, -50%);
}

.viewer-info {
  position: absolute;
  right: 22px;
  top: 18px;
  width: min(320px, calc(100vw - 44px));
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
}

.viewer-info h2 {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.6;
}

.viewer-info p {
  margin: 0 0 14px;
  white-space: pre-line;
}

@media (max-width: 760px) {
  .about {
    left: 16px;
    bottom: 16px;
    width: min(280px, calc(100vw - 32px));
  }

  .viewer {
    overflow: hidden;
  }

  #viewerImage {
    position:absolute;
    left:50%;
    top:50%;
    transform:translate(-50%,-50%);
    max-width:calc(100vw - 32px);
    max-height:68vh;
    margin:0;
  }

  .viewer-info {
    position:absolute;
    right:16px;
    top:16px;
    width:min(240px,calc(100vw - 32px));
    margin:0;
    text-align:right;
  }
}
