body { margin: 0; background: #353535; color: #ece7dc; font-family: Georgia, serif; }
main { max-width: 1680px; margin: 0 auto; padding: 16px 16px 28px; text-align: center; }
h1 { font-size: 34px; font-weight: normal; margin: 4px 0 6px; }
nav { display: flex; align-items: center; justify-content: center; gap: 32px; }
button { border: 1px solid #5c5c5c; border-radius: 3px; background: #2a2a2a; color: #ece7dc; padding: 11px 18px; font-family: Georgia, serif; font-size: 15px; cursor: pointer; }
button:disabled { opacity: 0.35; cursor: default; }
output { font-size: 14px; }
.hint { font-family: sans-serif; font-size: 12px; color: #a49d90; margin-top: 18px; }
.fallback { font-size: 14px; }
.quiet { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pages { display: flex; flex-direction: column; gap: 20px; align-items: center; margin-top: 24px; }
.pages img { width: 100%; max-width: 1100px; height: auto; }
[hidden] { display: none; }

/* The book. The canvas is transparent; behind it sit a cloth cover and the
   cream edges of a stack of pages. The canvas draws the page itself at
   2160 by 1215 of its 2400 by 1500, so 5% in from the sides and 9.5% from
   top and bottom. Those percentages must match PAGE_WIDTH and PAGE_HEIGHT
   in src/main.rs. */
.reading { position: relative; width: min(100%, calc(80vh * 1.6)); aspect-ratio: 16 / 10; margin: 0 auto; }
canvas { position: relative; z-index: 1; display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; outline: none; }
.cover { position: absolute; left: 3.2%; right: 3.2%; top: 6.6%; bottom: 6.6%; border-radius: 6px; background: linear-gradient(160deg, #5a3b2b, #3b261c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 14px 30px rgba(0, 0, 0, 0.45); outline: 3px solid transparent; outline-offset: 4px; transition: outline-color 0.15s; }
.stack { position: absolute; left: 5%; right: 5%; top: 9.5%; bottom: 9.5%; background: #353535; box-shadow: 1px 1px 0 #f2ecdf, 2px 2px 0 #d6cdb9, 3px 3px 0 #f2ecdf, 4px 4px 0 #d6cdb9, 5px 5px 0 #efe8d9, 6px 6px 0 #c9bfa9; }
/* Keyboard focus outlines the book itself, not the wider canvas. */
.reading:has(canvas:focus-visible) .cover { outline-color: #e3b062; }
@media (prefers-reduced-motion: reduce) { .cover { transition: none; } }

