/* Welisa interactive flipbook (embedded) */
.flipbook-section {
  background: #171c29;
  padding: 4rem var(--pad) 5rem;
}
.flipbook {
  width: min(100vw, 1100px);
  margin: 0 auto;
  padding: clamp(12px, 3vw, 30px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.flipbook button { color: #d9dce5; font: inherit; cursor: pointer; }
.toolbar, .controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.brand { font-weight: 750; letter-spacing: .22em; font-size: 12px; color: #d9dce5; }
.hint, #pageCount { color: #aeb5c4; font-size: 12px; text-align: center; }
.fullscreen, .controls button { background: #252c3b; border: 1px solid #3b4354; border-radius: 999px; padding: 9px 14px; color: #d9dce5; }
.controls button:disabled { opacity: .35; cursor: default; }
.book-shell { width: 100%; display: grid; place-items: center; perspective: 1800px; }
.book { --book-w: min(86vw, min(900px, calc((100svh - 160px) * 2))); position: relative; width: var(--book-w); aspect-ratio: 2/1; transform-style: preserve-3d; filter: drop-shadow(0 24px 34px #0008); margin: 0 auto; }
.open-book { position: absolute; inset: 0; display: none; transform-style: preserve-3d; }
.left-page, .right-page { position: absolute; top: 0; width: 50%; height: 100%; overflow: hidden; background: #fff; box-shadow: inset 0 0 18px #0000000c; }
.left-page { left: 0; border-radius: 5px 0 0 5px; }
.right-page { right: 0; border-radius: 0 5px 5px 0; }
.left-page img, .right-page img, .turn-front img { display: block; width: 100%; height: 100%; object-fit: fill; }
.turn-sheet { position: absolute; z-index: 5; top: 0; left: 50%; width: 50%; height: 100%; transform-origin: left center; transform-style: preserve-3d; display: none; }
.turn-sheet.flipping { display: block; animation: turnForward .78s cubic-bezier(.22,.68,.18,1) forwards; }
.turn-sheet.backwards { left: 0; transform-origin: right center; animation: turnBack .78s cubic-bezier(.22,.68,.18,1) forwards; }
.turn-front, .turn-back { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; background: #fff; }
.turn-front { border-radius: 0 5px 5px 0; }
.turn-back { transform: rotateY(180deg); border-radius: 5px 0 0 5px; background: #fff; box-shadow: inset -12px 0 18px #00000012; }
.opaque-paper { position: absolute; inset: 0; background: #fff; }
@keyframes turnForward { from { transform: rotateY(0); } to { transform: rotateY(-180deg); } }
@keyframes turnBack { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
.cover-sheet { position: absolute; z-index: 10; top: 0; right: 0; width: 50%; height: 100%; transform-origin: left center; transform-style: preserve-3d; cursor: pointer; transition: transform .9s cubic-bezier(.2,.7,.15,1); }
.cover-sheet.opened { transform: rotateY(-180deg); pointer-events: none; }
.cover-front, .cover-back { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; background: #171c29; }
.cover-front { border-radius: 0 5px 5px 0; }
.cover-front img, .back-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-back { transform: rotateY(180deg); background: #fff; }
.spine-shadow { position: absolute; z-index: 4; top: 0; bottom: 0; left: 50%; width: 10px; transform: translateX(-50%); background: linear-gradient(90deg, #0002, #0000 45%, #0002); pointer-events: none; }
.back-cover { display: none; position: absolute; z-index: 2; right: 0; top: 0; width: 50%; height: 100%; background: #171c29; border-radius: 0 5px 5px 0; overflow: hidden; }
.tap-zone { position: absolute; z-index: 8; top: 0; bottom: 0; width: 50%; border: 0; background: transparent; }
.tap-left { left: 0; cursor: w-resize; }
.tap-right { right: 0; cursor: e-resize; }
.tap-zone:focus-visible, .cover-sheet:focus-visible { outline: 2px solid #9fb7ff; outline-offset: 4px; }
@media (max-width: 600px) {
  .flipbook { gap: 12px; padding: 12px; }
  .book { --book-w: min(94vw, calc((100svh - 150px) * 2)); }
  .toolbar { font-size: 11px; }
  .hint { max-width: 55vw; }
  .controls button { padding: 8px 10px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .cover-sheet { transition: none; }
  .turn-sheet.flipping, .turn-sheet.backwards { animation-duration: .01ms; }
}
