/* Script used: https://www.jqueryscript.net/demo/book-page-flip-effect/ */

/* Height adjustments */

@media (min-height: 750px) and (max-height: 800px) {
  .scene {
    width: 46%;
  }
}

@media (min-height: 801px) and (max-height: 850px) {
  .scene {
    width: 50%;
  }
}

/* Height AND Width adjustments */

@media (min-width: 375px) and (max-height: 812px) {
  .scene {
    width: 88%;
    margin: 2% 2% 2% 2%;
  }
}

@media (min-width: 390px) and (max-height: 844px) {
  .scene {
    width: 88%;
    margin: 2% 2% 2% 2%;
  }
}

@media (min-width: 600px) and (max-height: 960px) {
  .scene {
    width: 90%;
  }
}

@media (min-width: 1024px) and (max-height: 768px) {
  .scene {
    width: 58%;
    margin-top: 3%;
  }
}

@media (min-width: 1440px) and (max-height: 500px) {
  .scene {
    width: 25%;
  }
}

@media (min-width: 1440px) and (max-height: 600px) {
  .scene {
    width: 30%;
  }
}

@media (min-width: 1440px) and (max-height: 700px) {
  .scene {
    width: 36%;
  }
}

@media (min-width: 1440px) and (max-height: 800px) {
  .scene {
    width: 40%;
  }
}

@media (min-width: 1440px) and (max-height: 950px) {
  .scene {
    width: 44%;
  }
}

*/ html {
  height: 100%;
  overflow: hidden;
}
body {
  background: #101214;
  margin: 0;
  width: 100%;
  height: 100%;
}

.instruction {
  display: block !important;
}

.instruction {
  position: absolute;
  top: 42%;
  left: 50%;
}

.instruction {
  left: calc(50% - 310px);
}

.instruction img {
  width: 270px;
  height: auto;
}

.scene {
  width: 39%;
  /* height: 90%; */
  margin: 2% 0 0 50%;
  perspective: 1000px;
}

.book {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

img {
  width: 100%;
  height: auto;
}

.page {
  cursor: pointer;
  position: absolute;
  width: 90%;
  height: auto;
  transition: 1.5s transform;
  transform-style: preserve-3d;
  transform-origin: left center;
}
.front,
.back {
  position: absolute;
  width: 90%;
  height: auto;
  /* margin: 2% 0; */
  box-sizing: border-box;
  backface-visibility: hidden;
}
.back {
  transform: rotateY(180deg);
}

.page.active {
  z-index: 1;
}
.page.flipped {
  transform: rotateY(-180deg);
}
.page.flipped:last-of-type {
  z-index: 1;
}

@media screen and (max-width: 1023px) {
  html {
    height: auto;
    overflow: visible;
  }
  .instruction {
    display: none !important;
  }

  .scene {
    width: 88%;
    height: auto;
    margin: 2% 2% 2% 2%;
    perspective: none;
  }

  .book {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: flat;
  }

  img {
    width: 100%;
    height: auto;
  }

  .page {
    cursor: default;
    position: relative;
    width: 100%;
    height: auto;
    transition: 1.5s transform;
    transform-style: flat;
    transform-origin: center;
  }
  .front,
  .back {
    position: relative;
    width: 100%;
    height: auto;
    /* margin: 2% 0; */
    box-sizing: border-box;
    backface-visibility: hidden;
    margin-bottom: 10px;
  }
  .back {
    transform: none;
  }

  .page.active {
    z-index: 1;
  }
  .page.flipped {
    transform: none;
  }
  .page.flipped:last-of-type {
    z-index: 1;
  }
}

/* ----------- iPad Pro ----------- */

/* Portrait */
@media only screen and (min-width: 1024px) and (max-height: 1366px) and (orientation: portrait) and (-webkit-min-device-pixel-ratio: 2) {
  .scene {
    width: 58%;
    margin: 6% 0 0 50%;
  }

  .instruction {
    top: 26%;
    left: calc(50% - 410px);
  }
}

/* Landscape */
@media only screen and (min-width: 1024px) and (max-height: 1366px) and (orientation: landscape) and (-webkit-min-device-pixel-ratio: 2) {
  .scene {
    width: 46%;
    margin-top: 2%;
  }

  .instruction {
    top: 46%;
    left: calc(50% - 410px);
  }
}
