:where(.paper-stage, .wire-stage, #zoom-stage) {
  position: relative;
  isolation: isolate;
  --paper-edges:
    1px 1px 0 #b59e7b,
    2px 2px 0 #f6ebd7,
    3px 3px 0 #af997a,
    4px 4px 0 #e9dbc4,
    5px 5px 0 #a99679,
    6px 8px 8px #4a382e3d,
    11px 17px 25px #5843302d;
}

.folio, .wire-art > :first-child, .zoom-art > :first-child {
  box-shadow: var(--paper-edges);
}

.wire-art { filter: none; }
.reader-visual { align-self: start; }

.folio::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #533f2916, transparent 2.8%, transparent 97%, #fffdf122);
  box-shadow: inset 0 0 0 1px #a28c6e45;
}

.paper-in-motion .folio { background: transparent; box-shadow: none; }
.paper-in-motion .folio::after, .paper-turn-hidden { visibility: hidden; }

.paper-turn-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.paper-turn-base {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
}

.paper-turn-base > .folio-art { max-width: 100%; box-shadow: var(--paper-edges); }
.paper-turn-base > .zoom-art { width: 100%; align-self: start; }

.paper-turn-shadow {
  position: absolute;
  opacity: 0;
  background: #3d301f;
  filter: blur(13px);
}

.paper-turn-canvas { position: absolute; top: 0; left: 0; display: block; }
.paper-turn-model { position: absolute; transform-origin: left center; transform-style: preserve-3d; }
.paper-turn-front, .paper-turn-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.paper-turn-back {
  transform: rotateY(180deg);
  background: var(--grain), linear-gradient(90deg, #d9c7a8, #eee3cd);
}

@media (max-width: 700px) {
  :where(.paper-stage, .wire-stage, #zoom-stage) {
    --paper-edges: 1px 1px 0 #b49e7d, 2px 2px 0 #f1e4cc, 3px 3px 0 #ab9676, 5px 8px 12px #55412c36;
  }
}

@media (min-width: 701px) and (max-width: 1020px) {
  .paper-stage { min-height: 395px; }
}

@media (max-width: 700px) {
  .paper-stage { min-height: 375px; }
}
