body:has(.cover-edition) {
  --cover-ink: #211f23;
  --cover-muted: #65616a;
  background: #faf9fb;
}
body:has(.cover-edition) .site-header {
  background: #fff;
  border-bottom-color: #e8e6e9;
}
body:has(.cover-edition) .header-inner { min-height: 60px; }
body:has(.cover-edition) .brand img { width: 31px; height: 31px; }
body:has(.cover-edition) .brand span { font: 650 17px/1 var(--sans); }

.cover-edition {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: clamp(620px, calc(100svh - 140px), 850px);
  padding: clamp(25px, 5vh, 64px) 0 24px;
  color: var(--cover-ink);
}
.cover-edition .cover-copy,
.cover-edition .cover-entry { text-align: center; }
.cover-edition h1 {
  font-family: var(--sans);
  font-size: clamp(52px, 5.8vw, 88px);
  font-weight: 700;
  letter-spacing: -.07em;
  line-height: 1.15;
  padding-right: .07em;
}
.cover-edition .lead {
  margin: 12px 0 0;
  color: var(--cover-muted);
  font-size: clamp(16px, 1.5vw, 21px);
  font-weight: 450;
  letter-spacing: -.02em;
}
.cover-volume {
  width: min(100%, 650px);
  position: relative;
  margin-block: 4px 0;
}
.book-view {
  width: 100%;
  height: clamp(235px, 36svh, 364px);
  display: grid;
  place-items: center;
  perspective: 1050px;
  perspective-origin: 50% 32%;
}
.folio-shadow {
  position: absolute;
  width: 64%;
  height: 13%;
  bottom: 8%;
  border-radius: 50%;
  background: #463144;
  opacity: .14;
  filter: blur(16px);
  transform: rotate(-4deg);
}
.folio {
  position: relative;
  width: min(76%, 60svh, 490px);
  aspect-ratio: 1.96;
  transform: translateY(-1%) rotateX(28deg) rotateY(-11deg) rotateZ(-6deg);
  transform-style: preserve-3d;
}
.folio-board {
  position: absolute;
  inset: 0 -1.3% -5.2% -1.3%;
  border-radius: 3% 4% 4% 3% / 5% 6% 6% 5%;
  background: linear-gradient(100deg, #a54d70 0, #83425b 48%, #5b3247 49.5%, #884b64 51%, #ac6380 91%, #793c59 100%);
  border-bottom: 3px solid #643348;
  transform: translateZ(-7px);
  box-shadow: 0 4px 5px #4b30412b;
}
.folio-edges {
  position: absolute;
  inset: 1.1% -.25% -2.3%;
  border-radius: 2% 3% 3% 2% / 4%;
  background: repeating-linear-gradient(0deg, #d3c7c3 0 1px, #f8f0e7 1px 3px);
  transform: translateZ(-3px);
}
.folio-bookmark {
  position: absolute;
  width: 4%;
  height: 15%;
  left: 75%;
  top: 96%;
  transform: rotate(-4deg) translateZ(-4px);
  transform-origin: top;
  background: linear-gradient(90deg, #994866, #c57992 44%, #9c536c);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 52% 78%, 0 100%);
}
.folio-page, .turning-leaf {
  position: absolute;
  width: 50%;
  height: 100%;
  top: 0;
}
.folio-left, .leaf-back {
  border-radius: 5% 0 0 4% / 4%;
  background: linear-gradient(90deg, #ede1d9 0%, #fff9ef 4%, #faf4ea 67%, #e9ded5 90%, #d9cabc 100%);
}
.folio-right, .leaf-front {
  border-radius: 0 6% 4% 0 / 5%;
  background: linear-gradient(90deg, #e7dbd0 0%, #fffaf1 11%, #fffaf2 50%, #f6eade 100%);
}
.folio-left { left: 0; }
.folio-right, .turning-leaf { left: 50%; }
.folio-print {
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
  font-family: var(--sans);
}
.folio-age {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  fill: #7c3d54;
  font-size: 107px;
  font-weight: 500;
  letter-spacing: -8px;
}
.folio-unit { fill: #6c3a4c; font-size: 17px; font-weight: 550; }
.folio-rule { stroke: #a67783; stroke-width: 1.5; }
.folio-chapter { fill: #60434c; font-size: 14px; font-weight: 550; letter-spacing: .06em; }
.folio-destinations { font-size: 16px; font-weight: 550; }
.folio-spine {
  position: absolute;
  top: .7%;
  bottom: -.4%;
  left: 49.4%;
  width: 1.3%;
  background: #b6a398;
  transform: translateZ(-1px);
}
.turning-leaf {
  display: none;
  transform-origin: left center;
  transform-style: preserve-3d;
}
.leaf-side {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.leaf-back { transform: rotateY(180deg); }
.folio-page:not(.edition-0) { visibility: hidden; }
.cover-still, .cover-motion-switch { display: none; }

.cover-edition .cover-actions { justify-content: center; gap: 12px; }
.cover-edition .primary,
.cover-edition .era {
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font: 560 15px/1.25 var(--sans);
  letter-spacing: 0;
  gap: 8px;
  padding: 12px 21px;
  white-space: nowrap;
}
.cover-edition .primary { border: 1px solid #29252b; background: #29252b; color: white; }
.cover-edition .primary:hover { background: #463e48; }
.cover-edition .era { color: #3e3942; border: 1px solid #c8c4ca; background: transparent; }
.cover-edition .era:hover { background: #f1edf1; }
.cover-edition .cover-guest-note,
.cover-edition .resume-note { color: var(--cover-muted); font-size: 12px; margin-top: 15px; }
.cover-edition .cover-account { justify-content: center; margin-top: 0; font-size: 13px; gap: 7px; }
.cover-edition .cover-account a { color: #88415a; }
.cover-edition .cover-account a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: no-preference) {
  .cover-edition[data-enter] .cover-copy { animation: title-settles 420ms ease-out; }
  .cover-still { display: block; }
  .cover-motion-switch {
    display: grid;
    place-items: center;
    position: absolute;
    right: 1%;
    bottom: 9%;
    width: 44px;
    height: 44px;
    color: #56515a;
    cursor: pointer;
  }
  .cover-motion-switch > span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #ccc6cb;
  }
  .cover-motion-switch:hover > span { background: #fff; }
  .cover-motion-switch .cover-play,
  .cover-still:checked ~ .cover-motion-switch .cover-pause { display: none; }
  .cover-still:checked ~ .cover-motion-switch .cover-play { display: grid; }
  .cover-still:focus-visible ~ .cover-motion-switch > span { outline: 2px solid #833a55; outline-offset: 3px; }
  .folio { animation: folio-drift 9s ease-in-out infinite alternate; }
  .edition-0 { --edition-delay: -2s; }
  .edition-1 { --edition-delay: -12s; }
  .edition-2 { --edition-delay: -7s; }
  .folio-left { animation: spread-left 15s var(--edition-delay) linear infinite; }
  .folio-right { animation: spread-right 15s var(--edition-delay) linear infinite; }
  .turning-leaf {
    display: block;
    animation: folio-turn 15s var(--edition-delay) linear infinite;
  }
  .leaf-front::after, .leaf-back::after {
    position: absolute;
    content: '';
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(90deg, #54364936, transparent 82%);
    animation: fold-shadow 15s var(--edition-delay) linear infinite;
  }
  .cover-still:checked ~ .book-view *,
  .cover-still:checked ~ .book-view *::after { animation-play-state: paused; }

  @keyframes folio-drift {
    to { transform: translateY(-3%) rotateX(24deg) rotateY(-6deg) rotateZ(-4deg); }
  }
  @keyframes title-settles {
    from { opacity: .6; transform: translateY(5px); }
    to { opacity: 1; transform: none; }
  }
  @keyframes spread-left {
    0%, 33.32% { visibility: visible; }
    33.33%, 100% { visibility: hidden; }
  }
  @keyframes spread-right {
    0%, 21% { visibility: visible; }
    21.01%, 87.66% { visibility: hidden; }
    87.67%, 100% { visibility: visible; }
  }
  @keyframes folio-turn {
    0%, 17.9% { visibility: hidden; transform: translateZ(.6px) rotateY(0deg); }
    18% { visibility: visible; transform: translateZ(.6px) rotateY(0deg); animation-timing-function: ease-in; }
    22% { visibility: visible; transform: translateZ(.6px) rotateY(-19deg); animation-timing-function: ease-in-out; }
    29% { visibility: visible; transform: translateZ(.6px) rotateY(-159deg); animation-timing-function: ease-out; }
    33.33% { visibility: visible; transform: translateZ(.6px) rotateY(-180deg); }
    33.34%, 100% { visibility: hidden; transform: translateZ(.6px) rotateY(-180deg); }
  }
  @keyframes fold-shadow {
    0%, 18%, 33.33%, 100% { opacity: 0; }
    25% { opacity: .9; }
  }
}
@media (max-width: 760px) {
  .cover-edition {
    min-height: clamp(440px, calc(100svh - 146px), 680px);
    padding: 20px 0 24px;
  }
  .cover-edition h1 { font-size: clamp(42px, 10.6vw, 59px); }
  .cover-edition .lead { font-size: 15px; margin-top: 10px; }
  .cover-volume { margin: 8px 0 6px; }
  .book-view { height: clamp(170px, 28svh, 260px); perspective: 800px; }
  .folio { width: min(78%, 45svh, 375px); }
  .cover-motion-switch { right: -4px; bottom: -2%; }
  .cover-edition .cover-actions { gap: 8px; }
  .cover-edition .primary, .cover-edition .era { min-height: 46px; padding: 12px 17px; font-size: 14px; }
  .cover-edition .cover-guest-note { text-wrap: balance; margin-top: 12px; }
}
@media (max-width: 375px) {
  body:has(.cover-edition) .brand { gap: 6px; }
  body:has(.cover-edition) .brand span { font-size: 15px; }
  body:has(.cover-edition) .site-header nav { gap: 0; }
  body:has(.cover-edition) .site-header nav a { padding-inline: 9px; }
}
