.case-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
}
.case-toggle {
  font-family: var(--sans);
  background: #f8f8f111;
  border: 1px solid #bdbfb3;
  border-radius: 15px;
  display: none;
  align-items: center;
  padding: 5px 11px;
  gap: 6px;
  font-size: 11px;
  color: #474b40;
  cursor: pointer;
}
.js .case-toggle {
  display: inline-flex;
}
.case-toggle:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: #fdfcf6;
}
#book-shell,
.case-assembly {
  position: relative;
}
.case-assembly {
  transform-origin: 75% 50%;
  transition: transform 0.9s cubic-bezier(0.43, 0.04, 0.24, 0.99);
}
.case-assembly.resting {
  transform: perspective(1700px) translateX(-24.7%) rotateY(-6deg) rotateX(3deg)
    rotateZ(-2.2deg);
}
.case-plane {
  position: absolute;
  inset: 0;
  z-index: 10;
  perspective: 1900px;
  perspective-origin: 50% 45%;
  pointer-events: none;
}
.case-hinge {
  position: absolute;
  inset: 0 50% 0 0;
  transform-origin: 100% 50%;
  transform-style: preserve-3d;
  transition: transform 0.96s cubic-bezier(0.38, 0.035, 0.23, 1);
}
.case-assembly.resting .case-hinge {
  transform: rotateY(180deg);
}
.case-inside,
.case-front {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 5px 0 0 5px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.case-inside {
  transform: translateZ(2px);
  border: 3px solid #37465b;
  border-right: 0;
  background: var(--paper);
}
.case-inside > .leaf {
  width: 100%;
  height: 100%;
  min-height: 0;
}
.case-front {
  transform: rotateY(180deg) translateZ(3px);
  background-color: #293a66;
  border: 1px solid #1a2b4d;
  border-left: 6px solid #253453;
  border-radius: 2px 9px 8px 2px;
  box-shadow:
    inset 2px 0 1px #c2bfac6b,
    inset 7px 0 0 #18264655,
    inset 11px 0 2px #71819a57,
    inset 14px 0 1px #19244288,
    3px 5px 1px #c7bda4,
    5px 6px 2px #1e2940;
  background-image:
    repeating-linear-gradient(15deg, transparent 0 2px, #d8dddf13 2px 2.6px),
    repeating-linear-gradient(106deg, transparent 0 2px, #1723454f 2px 2.8px);
  color: #f0d9a4;
}
.case-front:before {
  content: "";
  position: absolute;
  inset: 15px 15px 16px 26px;
  border: 1px solid #dcc2848f;
  pointer-events: none;
}
.case-content {
  inset: 6.6% 9% 18% 13%;
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  color: #f1dfb1;
}
.case-meta {
  font: 9px var(--mono);
  letter-spacing: 0.15em;
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.case-content h2 {
  font: 400 clamp(56px, 6.6vw, 97px)/0.88 var(--serif);
  letter-spacing: -0.035em;
  text-shadow: 0 1px 1px #101a2a;
  margin-top: 20px;
  z-index: 1;
}
.case-content h2 em {
  font-weight: 400;
}
.case-content > img {
  width: 80%;
  height: 42%;
  object-fit: contain;
  align-self: center;
}
.case-assembly.clipped > .binding {
  clip-path: inset(-9px -10px -26px 49.9%);
  box-shadow: none;
}
.case-assembly.clipped:before {
  content: "";
  position: absolute;
  inset: 6% 1% 0.4% 50%;
  border-radius: 5px;
  background: #2429324f;
  filter: blur(14px);
  transform: translate(6px, 13px);
}
.case-plane[hidden] {
  display: none;
}
.case-reopen {
  display: none;
  position: absolute;
  z-index: 12;
  inset: 0 0 0 50%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  align-items: flex-end;
  justify-content: center;
}
.case-assembly.resting .case-reopen {
  display: flex;
}
.case-reopen span {
  margin-bottom: 8%;
  border: 1px solid #dfcfaaa1;
  border-radius: 15px;
  background: #202f54;
  color: #f4dfba;
  font: 11px var(--sans);
  padding: 6px 11px;
}
html.reader-closed .reading-tools .progress,
html.reader-closed .reading-tools .pager {
  visibility: hidden;
}
html.reader-closed .case-toggle {
  background: #2b409a;
  color: white;
  border-color: #2b409a;
}
@media (max-width: 700px) {
  .case-toolbar {
    gap: 8px;
  }
  .case-toolbar .desk-right {
    display: none;
  }
  .case-toggle {
    font-size: 10px;
    padding: 4px 8px;
  }
  .case-assembly.resting {
    transform: perspective(1450px) scale(0.92) rotateY(-5deg) rotateX(3deg)
      rotateZ(-2deg);
  }
  .case-assembly.clipped > .binding {
    opacity: 0;
    clip-path: none;
  }
  .case-assembly.clipped:before {
    inset: 3% 0 0;
  }
  .case-hinge {
    inset: 0;
    transform-origin: 0 50%;
    transform: rotateY(-95deg);
  }
  .case-assembly.resting .case-hinge {
    transform: rotateY(0);
  }
  .case-inside {
    display: none;
  }
  .case-front {
    transform: translateZ(2px);
  }
  .case-reopen {
    inset: 0;
  }
  .case-content h2 {
    font-size: 65px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .case-assembly,
  .case-hinge {
    transition: none;
  }
}

html.cover-boot #book-shell { visibility: hidden; }
.case-assembly.cover-instant,
.case-assembly.cover-instant .case-hinge { transition: none !important; }

@media (max-width: 700px) and (max-height: 700px) {
  .case-assembly.resting { max-height: max(305px, calc(100svh - 157px)); }
  .case-assembly.resting .case-content > img { min-height: 0; height: 35%; }
  .case-assembly.resting .case-content h2 { font-size: clamp(45px, 13vw, 61px); margin-top: 9px; }
  .case-assembly.resting .case-reopen span { margin-bottom: 5.5%; }
}

/* A cloth cover with the exhibit names stamped on its lower edge. The large
   title hit area stops above the separate, visible exhibit shortcuts. */
.case-scenes { display: none; }
.case-assembly.resting .case-scenes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  position: absolute;
  z-index: 13;
  left: 55.5%;
  right: 4.5%;
  bottom: max(23px, 4%);
  margin: 0;
  border-top: 1px solid #dcbe873d;
  color: #f0deb7;
}
.case-scenes a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  min-height: 42px;
  min-width: 0;
  color: inherit;
  font: 500 clamp(10px, .9vw, 13px)/1.2 var(--sans);
  text-align: center;
  text-decoration: none;
}
.case-scenes a:hover, .case-scenes a:focus-visible {
  color: #fff6dc;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.case-scenes a:focus-visible { outline: 1px solid #efd7a5; outline-offset: -2px; }
.case-scenes a + a { border-left: 1px solid #dcbe8726; }
.case-assembly.resting .case-reopen { bottom: max(70px, 13%); }
.case-assembly.resting .case-reopen span { margin-bottom: 0; min-height: 33px; padding: 7px 16px; }
.case-front .case-content { bottom: 24%; }
@media (min-width: 701px) {
  .case-assembly.resting {
    transform: perspective(2000px) translateX(-24.7%) rotateY(-6deg) rotateX(3deg) rotateZ(-1.7deg);
  }
  .case-content h2 { font-size: clamp(68px, 7.4vw, 124px); }
}
@media (max-width: 700px) {
  .case-assembly.resting {
    height: clamp(355px, min(178vw, 100svh - 151px), 720px);
    max-height: none;
    transform: perspective(1500px) scale(.965) rotateY(-4deg) rotateX(2deg) rotateZ(-1.5deg);
  }
  .case-assembly.resting > .binding { height: 100%; overflow: hidden; }
  .case-assembly.resting .case-scenes { left: 8%; right: 7%; bottom: max(15px, 4%); }
  .case-scenes a { min-height: 44px; font-size: 11px; }
  .case-assembly.resting .case-content h2 { font-size: clamp(62px, 17vw, 100px); }
  .case-assembly.resting .case-reopen span { min-height: 32px; }
}
