/* Leitor da Coleção Júnior Santos (flipbook). Cada livro define --palco, --palco2, --destaque, --tinta no <body>. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Arimo", system-ui, sans-serif; color: var(--tinta); overflow: hidden;
  background: radial-gradient(120% 90% at 50% 35%, var(--palco2) 0%, var(--palco) 62%, var(--borda, #050f0d) 100%);
  -webkit-tap-highlight-color: transparent;
}
body::after { /* textura */
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.topo {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(14px, 3vw, 32px); gap: 12px;
}
.topo .marca { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: inherit; }
.topo .marca img { height: 30px; flex: none; }
.topo .marca span { font: 600 11px/1.3 "Titillium Web", sans-serif; letter-spacing: .28em; text-transform: uppercase; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo .acoes { display: flex; gap: 8px; }
.btn {
  appearance: none; border: 1px solid color-mix(in srgb, var(--tinta) 28%, transparent); background: color-mix(in srgb, var(--tinta) 6%, transparent);
  color: var(--tinta); border-radius: 999px; height: 38px; min-width: 38px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 12px "Titillium Web", sans-serif; letter-spacing: .08em; cursor: pointer; text-decoration: none;
  transition: background .2s ease, transform .15s ease, border-color .2s ease;
}
.btn:hover { background: color-mix(in srgb, var(--tinta) 14%, transparent); border-color: color-mix(in srgb, var(--destaque) 70%, transparent); }
.btn:active { transform: scale(.96); }
.btn svg { width: 17px; height: 17px; }
.btn.redondo { padding: 0; width: 46px; height: 46px; }

/* palco do livro */
.palco { position: fixed; inset: 70px 0 84px; display: flex; align-items: center; justify-content: center; padding: 0 clamp(8px, 4vw, 60px); }
.livro-wrap { width: 100%; max-width: 1240px; opacity: 0; transform: translateY(18px) scale(.97); transition: opacity .9s ease, transform 1.1s cubic-bezier(.2, .8, .2, 1); }
.pronto .livro-wrap { opacity: 1; transform: none; }
.livro { margin: 0 auto; filter: drop-shadow(0 30px 40px rgba(0,0,0,.45)); }
.pagina-img { background: #fbfaf6; overflow: hidden; }
.pagina-img img { width: 100%; height: 100%; display: block; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.pagina-img.capa-dura { background: #10302a; }

/* dica de uso */
.dica {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 9;
  font: 600 12px "Titillium Web", sans-serif; letter-spacing: .14em; text-transform: uppercase; opacity: 0; transition: opacity .6s ease;
  pointer-events: none; white-space: nowrap;
}
.pronto .dica.mostra { opacity: .7; }

/* barra de baixo */
.base { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px; }
.contador { font: 600 13px "Titillium Web", sans-serif; letter-spacing: .12em; min-width: 92px; text-align: center; opacity: .85; font-variant-numeric: tabular-nums; }
.progresso { position: fixed; left: 0; bottom: 0; height: 3px; background: var(--destaque); width: 0; transition: width .5s ease; z-index: 11; }

/* índice */
.indice {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); z-index: 20; background: color-mix(in srgb, var(--palco) 92%, black);
  border-left: 1px solid color-mix(in srgb, var(--tinta) 15%, transparent); transform: translateX(100%); transition: transform .45s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column; box-shadow: -30px 0 60px rgba(0,0,0,.35);
}
.indice.aberto { transform: none; }
.indice header { padding: 22px 22px 14px; display: flex; justify-content: space-between; align-items: center; }
.indice h2 { font: 700 22px "Titillium Web", sans-serif; }
.indice ol { list-style: none; overflow: auto; padding: 0 12px 24px; }
.indice li button {
  width: 100%; text-align: left; background: none; border: 0; color: inherit; cursor: pointer; padding: 11px 10px; border-radius: 10px;
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; transition: background .2s ease;
}
.indice li button:hover { background: color-mix(in srgb, var(--tinta) 8%, transparent); }
.indice li small { grid-column: 1 / -1; font: 700 10px "Titillium Web", sans-serif; letter-spacing: .26em; text-transform: uppercase; color: var(--destaque); }
.indice li span { font: 400 14px/1.35 "Arimo", sans-serif; }
.indice li i { font: 600 12px "Titillium Web", sans-serif; font-style: normal; opacity: .55; align-self: center; }
.veu { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 19; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.veu.aberto { opacity: 1; pointer-events: auto; }

/* carregando */
.carregando { position: fixed; inset: 0; display: grid; place-items: center; z-index: 30; transition: opacity .6s ease; }
.pronto .carregando { opacity: 0; pointer-events: none; }
.carregando div { text-align: center; }
.carregando img { width: 74px; opacity: .9; animation: respira 2.4s ease-in-out infinite; }
.carregando p { margin-top: 14px; font: 600 11px "Titillium Web", sans-serif; letter-spacing: .3em; text-transform: uppercase; opacity: .7; }
.carregando .barra { width: 140px; height: 2px; background: color-mix(in srgb, var(--tinta) 15%, transparent); margin: 14px auto 0; overflow: hidden; }
.carregando .barra i { display: block; height: 100%; width: 0; background: var(--destaque); transition: width .2s ease; }
@keyframes respira { 0%, 100% { transform: scale(.94); opacity: .7; } 50% { transform: scale(1); opacity: 1; } }

@media (max-width: 640px) {
  .topo .marca span { display: none; }
  .btn .txt { display: none; }
  .palco { inset: 62px 0 76px; }
  .dica { bottom: 82px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .livro-wrap, .carregando img { transition: none; animation: none; } }
/* ampliar: página em tela cheia, com rolagem e zoom de pinça */
.zoom { position: fixed; inset: 0; z-index: 25; background: color-mix(in srgb, var(--palco) 96%, black); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.zoom.aberto { opacity: 1; pointer-events: auto; }
.zoom-rolo { position: absolute; inset: 0; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; padding: 64px 12px 24px; }
.zoom-rolo img { display: block; width: min(100%, 900px); margin: 0 auto 14px; box-shadow: 0 20px 40px rgba(0,0,0,.35); }
#fechazoom { position: absolute; top: 12px; right: 12px; z-index: 2; }
.logo-simbolo { display: none; }
@media (max-width: 640px) { .logo-grande { display: none; } .logo-simbolo { display: block; height: 32px !important; } }
@media (max-width: 640px) { .zoom-rolo img { width: 680px; max-width: none; } }
