:root {
  color-scheme: light;
  --paper: #fffaf0;
  --ink: #493a36;
  --green: #274a47;
  --wash: #fbf5ea;
  font: 1rem/1.4 system-ui, sans-serif;
  background: var(--wash);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; height: 100svh; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.site-header { min-height: 48px; padding: .4rem clamp(.6rem, 2.2vw, 1.3rem); display: flex; justify-content: flex-end; align-items: center; }
.purchase {
  display: inline-grid; place-items: center; min-height: 34px; padding: .3rem .72rem;
  border: 1px solid var(--green); border-radius: 999px; background: var(--green);
  color: #fff; font: 650 .875rem/1.1 system-ui, sans-serif; text-decoration: none;
}
.purchase.pending { background: #fffaf0a8; border-color: #63807365; color: #38534b; }
main, .reader { min-height: 0; height: 100%; position: relative; }
.reader { padding-inline: clamp(0px, calc((100vw - 600px) / 7), 58px); container-type: size; }
.spread { width: 100%; height: 100%; margin: 0; display: grid; place-items: center; touch-action: pan-y pinch-zoom; }
.book-leaves { position: relative; width: min(100%, 200cqh); aspect-ratio: 2; }
.book-leaves img { width: 100%; height: 100%; object-fit: contain; user-select: none; display: block; }
.spread[data-open="true"] .book-leaves::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 50%;
  width: clamp(12px, 4%, 47px);
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, #493a3610 37%, #493a3644 49%, #493a3629 51%, #493a360a 67%, transparent);
  mask-image: linear-gradient(transparent, #000 13%, #000 87%, transparent);
  pointer-events: none;
}
.page-controls { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; padding-inline: clamp(.15rem, 1.3vw, 1rem); pointer-events: none; }
.page-arrow {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; pointer-events: auto;
  border: 1px solid #274a474d; border-radius: 50%; background: #fffaf0e8; color: var(--green); cursor: pointer;
}
.page-arrow::before { content: ""; width: .65rem; height: .65rem; border: solid currentColor; border-width: 0 2px 2px 0; }
.previous::before { transform: translateX(2px) rotate(135deg); }
.next::before { transform: translateX(-2px) rotate(-45deg); }
.page-arrow:hover:enabled { background: var(--green); color: #fff; border-color: var(--green); }
.page-arrow:disabled { visibility: hidden; }
:focus-visible { outline: 3px solid #8b4f2b; outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.noscript { position: absolute; bottom: 0; background: var(--paper); margin: .5rem; padding: .5rem; }
@media (max-width: 600px) {
  .page-arrow { width: 44px; height: 44px; border-color: transparent; background: #fffaf0bf; }
}
