/* Each transition takes place on the print itself, inside the dialog. */
#folio[open], #folio[open] .folio-art img { animation: none; }
#folio[data-passage] { background: transparent; box-shadow: none; }
#folio::backdrop { transition: opacity .38s ease; }
@starting-style { #folio[open]::backdrop { opacity: 0; } }
#folio[data-passage="leave"]::backdrop { opacity: 0; transition-duration: .29s; }
.folio-lifted { opacity: 0; }
.folio-flying-print {
  position: fixed; left: 0; top: 0; z-index: 2; max-width: none;
  pointer-events: none; object-fit: cover; transform-origin: 0 0;
  outline: 1px solid #efe7d159; outline-offset: -1px;
  box-shadow: 0 8px 26px #10212d47;
}
.folio-motion-scene {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  contain: strict;
  pointer-events: none;
}
.folio-motion-scene svg, .proof-negative, .proof-register, .map-ground, .map-spread {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.folio-motion-scene svg {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* An unexposed sheet and its four registration marks lift off the cyanotype. */
.proof-negative {
  background-color: #e2dfcf;
  background-image:
    linear-gradient(90deg, #3e566a26 1px, transparent 1px),
    linear-gradient(#3e566a26 1px, transparent 1px),
    repeating-linear-gradient(107deg, #e5decd8c 0 1px, transparent 1px 4px);
  background-size: 24px 24px, 24px 24px, auto;
  animation: proof-develop 740ms cubic-bezier(.43,.04,.16,1) both;
}
.proof-negative img {
  filter: grayscale(1) contrast(1.35);
  mix-blend-mode: multiply;
  opacity: .29;
}
.proof-register {
  --rule: #24435b;
  --horizontal: linear-gradient(var(--rule), var(--rule)) no-repeat;
  --vertical: linear-gradient(var(--rule), var(--rule)) no-repeat;
  inset: 8%;
  width: auto;
  height: auto;
  background:
    var(--horizontal) left 0 top 0 / 20px 1px, var(--vertical) left 5px top 0 / 1px 15px,
    var(--horizontal) right 0 top 0 / 20px 1px, var(--vertical) right 5px top 0 / 1px 15px,
    var(--horizontal) left 0 bottom 0 / 20px 1px, var(--vertical) left 5px bottom 0 / 1px 15px,
    var(--horizontal) right 0 bottom 0 / 20px 1px, var(--vertical) right 5px bottom 0 / 1px 15px;
}
.proof-pencil {
  stroke: #a13226;
  stroke-width: 4;
  animation: proof-dry 1050ms linear both;
}
.proof-pencil path, .map-journey path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: folio-draw 290ms cubic-bezier(.38,.06,.34,1) both;
}
.proof-pencil .proof-underline { animation-delay: 360ms; }
.proof-pencil .proof-circle { animation-delay: 490ms; }
.proof-pencil .proof-tail { stroke-width: 2.5; animation-delay: 590ms; animation-duration: 180ms; }
@keyframes proof-develop {
  0%, 8% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  58% { clip-path: polygon(0 52%, 100% 39%, 100% 100%, 0 100%); }
  100% { clip-path: polygon(0 101%, 100% 101%, 100% 101%, 0 101%); }
}
@keyframes proof-dry {
  0%, 74% { opacity: 1; }
  100% { opacity: 0; }
}

/* Six pieces of the same landscape share one crop and hinge from the spine. */
.map-ground {
  background: radial-gradient(ellipse at center, #79512f, #402d23 68%, #251f1b);
  animation: map-release 800ms ease-out both;
}
.map-spread { display: flex; perspective: 950px; }
.map-leaf {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  transform-origin: 0 50%;
  animation: map-hinge 530ms var(--fold-delay) cubic-bezier(.23,.7,.22,1) both;
  --hinge: 84deg;
  --drift: 7%;
}
.map-leaf:nth-child(-n + 3) {
  transform-origin: 100% 50%;
  --hinge: -84deg;
  --drift: -7%;
}
#folio .map-leaf img {
  position: absolute;
  inset: 0 auto auto var(--slice-start);
  width: 600%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.map-leaf::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f9e1a5a8, #bc95624d 36%, #362519b8 100%);
  animation: map-crease 550ms var(--fold-delay) ease-out both;
}
.map-leaf:nth-child(even)::after { transform: scaleX(-1); }
.map-journey {
  animation: map-ink 1060ms linear both;
}
.map-journey .map-river-halo, .map-journey .map-river {
  animation-delay: 250ms;
  animation-duration: 510ms;
}
.map-river-halo { stroke: #533220; stroke-width: 6; }
.map-river { stroke: #ffe2a0; stroke-width: 2.6; }
.map-journey .map-road {
  stroke: #9e341f;
  stroke-width: 3.8;
  animation-delay: 410ms;
  animation-duration: 310ms;
}
.map-journey .map-seal {
  stroke: #8d271e;
  stroke-width: 3;
  animation-delay: 635ms;
  animation-duration: 150ms;
}
@keyframes map-hinge {
  0% { transform: translateX(var(--drift)) rotateY(var(--hinge)); opacity: .15; }
  23% { opacity: .97; }
  100% { transform: translateX(0) rotateY(0); opacity: 1; }
}
@keyframes map-crease { 0%, 17% { opacity: .95; } 100% { opacity: 0; } }
@keyframes map-release { 0%, 56% { opacity: 1; } 100% { opacity: 0; } }
@keyframes map-ink { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes folio-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.folio-ink-wash {
  background: #f2e8d1;
  animation: folio-wash 310ms ease-out both;
}
@keyframes folio-wash { from { opacity: .55; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .folio-motion-scene { display: none; }
}
