/* pageturn: the turning leaf (pageturn.js). A page wide and high: the app sets --page-w and
   --page-h, and puts the leaf's layer under a perspective. The shading's colours can be set
   with --pt-shade-1 (darkest, at the fold), --pt-shade-2 and --pt-shade-3 (the far edge). */

.leaf {
  position: absolute;
  top: 0;
  width: var(--page-w);
  height: var(--page-h);
  transform-style: preserve-3d;
  will-change: transform;
  z-index: 1;
}
.leaf.origin-left { transform-origin: 0 50%; }
.leaf.origin-right { transform-origin: 100% 50%; }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face.back { transform: rotateY(180deg); }
.shade {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(90deg, var(--pt-shade-1, rgba(40, 22, 6, 0.55)), var(--pt-shade-2, rgba(40, 22, 6, 0.15)) 60%,
    var(--pt-shade-3, rgba(255, 240, 210, 0.15)));
}
.face.back .shade {
  background: linear-gradient(270deg, var(--pt-shade-1, rgba(40, 22, 6, 0.55)), var(--pt-shade-2, rgba(40, 22, 6, 0.15)) 60%,
    var(--pt-shade-3, rgba(255, 240, 210, 0.15)));
}
