
.stack {
  position: relative;
  width: 40%;
  height: auto;
  margin-left: 29%
}

.stack > .sheet {
  position: absolute;
  transition: all 300ms ease-in-out;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2%; /* Use percentage padding instead of fixed pixels */
  background: transparent;
  width: 100%;
  height: auto; /* Let height be proportional */
  aspect-ratio: 1 / 1.2; /* Maintain consistent aspect ratio */
  left: 0;
  overflow: hidden;
}
.stack > .sheet img {
  width: 100%;
  height: auto;
  object-fit: contain;
}