/* The cover and the folded stationery share the same engraved garden. */
#scene:not(.reading) { background: inherit }
.cover-ornament {
  position: absolute;
  inset: 15px;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.cover-ornament::before,
.cover-ornament::after {
  content: "";
  position: absolute;
  width: clamp(216px, 66vw, 405px);
  height: clamp(123px, 24svh, 218px);
  background: url("assets/stationery.webp") no-repeat;
  background-size: 170% auto;
  /* The SVG filter makes the pale paper transparent and retains the engraving. */
  filter: url("#cover-engraving");
}
.cover-ornament::before {
  top: 0; right: 0;
  background-position: right top;
  mask-image: linear-gradient(180deg, #000 66%, transparent 100%);
  opacity: .73;
}
.cover-ornament::after {
  bottom: 0; left: 0;
  background-position: left bottom;
  mask-image: linear-gradient(0deg, #000 70%, transparent 100%);
  opacity: .8;
}
.opening .cover-ornament { opacity: 0; transition: opacity 1.7s .55s ease }
.reading .cover-ornament { display: none }

.cover-heading { gap: 0; margin-inline: -8px }
.cover-heading::before, .cover-heading::after {
  flex: 1 1 clamp(65px, 24vw, 132px);
  max-width: clamp(80px, 24vw, 132px);
  aspect-ratio: 260 / 89;
  top: .33rem;
  height: auto;
  filter: drop-shadow(0 1px .65px #76463080);
}
.cover-heading::after  { transform: translateX(2px) scaleY(1.28) rotate(8deg) }
.cover-heading::before { transform: translateX(-2px) scale(-1,1.28) rotate(8deg) }

#cover-sound {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  inset-block-start: max(27px, env(safe-area-inset-top));
  min-height: 44px;
  margin: 0;
  padding: 4px 7px 4px 14px;
  border: 1px solid #814f4c;
  border-radius: 999px;
  background: linear-gradient(160deg, #f0d7c3, #e3bdaa);
  color: #4b2c31;
  box-shadow: inset 0 0 0 1px #f9e3cbb3, 0 2px 5px #663c3e35;
  font: 14px/1.6 Tahoma, Arial, sans-serif;
  white-space: nowrap;
  touch-action: manipulation;
}
#cover-sound .sound-symbol {
  display: grid;
  place-items: center;
  padding: 0;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  color: #ffe5ad;
  background: #764652;
}
#cover-sound .sound-symbol svg { display: block }
#cover-sound .sound-label { flex: 0 0 auto }
#cover-sound:active { background: #e1b5a2; box-shadow: inset 0 1px 3px #71404a55 }
#cover-sound:focus-visible { outline: 2px solid #542f39; outline-offset: 3px }
@media (max-width: 360px) {
  #scene #cover-tilt, #scene #cover-sound {
    font-size: 12px;
    gap: 6px;
    padding-inline-end: 10px;
  }
  #scene #cover-tilt { inset-inline-end: 20px }
  #scene #cover-sound { inset-inline-start: 20px }
}
@media (max-height: 580px) {
  .cover-ornament::before, .cover-ornament::after { width: 190px; height: 100px }
}
@media (max-height: 520px) and (orientation: landscape) {
  #scene:not(.reading) { padding-top: 84px }
  .cover-ornament::before, .cover-ornament::after { width: 220px; height: 130px }
}
