*,
*::before,
*::after {
  box-sizing: inherit;
}

html {
    font-family: 'Open Sans', sans-serif;
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

main {
  height: inherit;
  width: inherit;
  flex-flow: column;

  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url("../jpg/background.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.cards__wrapper {
  aspect-ratio: 1000 / 716;
  width: auto;
  max-height: 60vh;
  max-width: min(80vw, 750px);
  cursor: pointer;
}

.card-inner {
  display: grid;
  grid-template-areas: "card";
  height: 100%;

  perspective: 2500px;

  --move: min(calc((100vw - 100%) / 4), 50%);
  transition: transform 1s ease-out;
}

.card-inner.open {
  transform: translateX(var(--move));
}
img {
  display: block;
}
p {
    max-width: 40ch;
}
.card-message,
.card-flippable {
  grid-area: card;
}


.cards__wrapper:hover .card-flippable {
  --progress: 0.2;
}

.open .card-flippable {
  --progress: 1 !important;
}

.card-flippable {
  position: relative;
  transform:  translateX(calc(1px * var(--progress, 0))) rotateY(calc(-180deg * var(--progress, 0)));
  transform-origin: left;
  transform-style: preserve-3d;
  transition: transform 1s ease-out;
}

.flippable-front {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flippable-back {
  transform: rotateY(-180deg);
}

.flippable {
  position: absolute;
  top: 0;
  left: 0;

  background-color: white;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.open-button {
  font-size: 1.125rem;
  padding: 0.75rem 1.5rem;
  margin-top: 5vh;
  background-color: transparent;
  text-shadow: 0 0 5px #c40e0f;
  border: 3px solid white;
  color: white;
  cursor: pointer;
  text-align: center;
  width: 105px;
}

.open-button:hover {
  text-shadow: none;
  color: #c40e0f;
  background-color: white;
}

.cards__wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@media screen and (max-height: 500px) {
  button {
    display: none;
  }

  .cards__wrapper {
    max-height: 80vh;
  }

}
