/* =====================================================================
   Movimento extra: transições, entradas, vida parada e toques.
   Tudo respeita "Calmo (sem animações)" (html[data-calmo=on], regra em style.css)
   e o "reduzir movimento" do iPad (regra em style.css).
   Dica: só usa as propriedades translate/scale/rotate (não mexe no transform dos cartões inclinados).
   ===================================================================== */
:root{--spring:cubic-bezier(.3,1.5,.5,1);--soft:cubic-bezier(.25,.8,.3,1)}

/* ---------- menu lateral ---------- */
@keyframes navin{from{translate:-40px 0;opacity:0}}
.nav.intro-nav{animation:navin .55s var(--spring) backwards;animation-delay:calc(var(--i,0)*45ms)}
.nav{transition:background .2s,translate .3s var(--spring),box-shadow .25s,transform .3s var(--spring)}
.nav .ic{transition:rotate .35s var(--spring),scale .35s var(--spring)}
@media (hover:hover){
  .nav:not(.on):hover{translate:5px 0;background:rgba(255,255,255,.1)}
  .nav:hover .ic{rotate:-12deg;scale:1.12}
}
.nav:active .ic{scale:.85}
@keyframes wig{0%,100%{rotate:-6deg}50%{rotate:6deg}}
.nav.on .ic{animation:wig 3.4s ease-in-out infinite}
.brand b{transition:rotate .3s var(--spring)}
.brand:hover b{rotate:4deg}

/* ---------- entrada de cada tela ---------- */
@keyframes headin{from{translate:-24px 0;opacity:0;scale:.96}}
.enter .head h1{animation:headin .55s var(--spring) backwards}
.enter .head .sub{animation:headin .6s var(--spring) .08s backwards}
.enter .head-actions{animation:headin .6s var(--spring) .15s backwards}
@keyframes slidein{from{translate:0 14px;opacity:0}}
.enter .item,.enter .kd,.enter .indice-grid>*,.enter .estante>*,.enter .papeis>*{animation:slidein .45s var(--spring) backwards}
.enter .item:nth-child(2),.enter .kd:nth-child(2),.enter .estante>:nth-child(2),.enter .indice-grid>:nth-child(2),.enter .papeis>:nth-child(2){animation-delay:.05s}
.enter .item:nth-child(3),.enter .kd:nth-child(3),.enter .estante>:nth-child(3),.enter .indice-grid>:nth-child(3),.enter .papeis>:nth-child(3){animation-delay:.1s}
.enter .item:nth-child(4),.enter .kd:nth-child(4),.enter .estante>:nth-child(4),.enter .indice-grid>:nth-child(4),.enter .papeis>:nth-child(4){animation-delay:.15s}
.enter .item:nth-child(n+5),.enter .kd:nth-child(n+5),.enter .estante>:nth-child(n+5),.enter .indice-grid>:nth-child(n+5),.enter .papeis>:nth-child(n+5){animation-delay:.2s}
@keyframes grow{from{scale:0 1}}
.enter .bar i{transform-origin:left center;animation:grow .9s var(--soft) .25s backwards}
.enter .ring-fg{transition:none}

/* ---------- vida parada ---------- */
@keyframes bobh{0%,100%{translate:0 0}50%{translate:0 -4px}}
.head h1{animation:bobh 5s ease-in-out infinite}
@keyframes lights{0%,100%{filter:drop-shadow(0 0 5px rgba(255,255,255,.28)) brightness(1)}50%{filter:drop-shadow(0 0 13px rgba(255,255,255,.75)) brightness(1.25)}}
.main::before{animation:lights 3.2s ease-in-out infinite}
@keyframes floaty{0%,100%{translate:0 0;rotate:-1deg}50%{translate:0 -8px;rotate:1deg}}
.capa-btn .mole{animation:floaty 5.5s ease-in-out infinite}
@keyframes swing{0%,100%{rotate:5deg}50%{rotate:-5deg}}
.mole .fita{transform-origin:50% 0;animation:swing 3.4s ease-in-out infinite}
.ed-livro::after{transform-origin:50% 0;animation:swing 3.8s ease-in-out infinite}
@keyframes shine{0%,70%{background-position:-120% 0}100%{background-position:220% 0}}
.capa-btn .mole .rot{background-image:linear-gradient(105deg,transparent 40%,rgba(255,255,255,.7) 50%,transparent 60%);background-size:60% 100%;background-repeat:no-repeat;background-position:-120% 0;animation:shine 5s ease-in-out infinite}
.hero h2{transition:rotate .3s var(--spring)}

/* ---------- toque e mouse ---------- */
.card,.media,.ix,.papel,.tema,.item{transition:translate .28s var(--spring),scale .28s var(--spring),background .2s,border-color .2s}
.btn,.chip,.eb,.swatch,.star,.hab,.chk{transition:translate .22s var(--spring),scale .22s var(--spring),transform .08s,box-shadow .08s,background .2s}
@media (hover:hover){
  .card:hover{translate:0 -5px}
  .media:hover,.ix:hover,.papel:hover,.tema:hover{translate:0 -4px;scale:1.03}
  .btn:hover,.eb:hover{translate:0 -2px}
  .chip:hover,.swatch:hover,.star:hover,.hab:hover,.chk:hover{scale:1.1}
}
.chip:active,.swatch:active,.star:active,.hab:active,.papel:active,.media:active{scale:.92}
.tap-ring{position:fixed;width:20px;height:20px;margin:-10px 0 0 -10px;border-radius:50%;border:3px solid rgba(255,255,255,.9);
  box-shadow:0 0 0 2px rgba(29,10,58,.35);pointer-events:none;animation:ring .55s ease-out forwards}
@keyframes ring{from{scale:.4;opacity:.95}to{scale:3.4;opacity:0}}
@keyframes spop{from{scale:.5;opacity:0}}
#toast.show{animation:spop .35s var(--spring)}
.bubble{transition:scale .2s var(--spring)}
.mascot-btn{transition:scale .25s var(--spring),rotate .25s var(--spring)}
@media (hover:hover){.mascot-btn:hover{scale:1.05;rotate:2deg}}
.mascot-btn:active{scale:.94}

/* ---------- Cadernos: capas e abertura ---------- */
.cad-capa{transition:translate .3s var(--spring),rotate .3s var(--spring),scale .3s var(--spring)}
@media (hover:hover){.cad:hover .cad-capa{translate:0 -10px;rotate:-2deg}.cad:hover .cad-boneco{animation:hop .7s var(--spring)}}
.cad:active .cad-capa{scale:.95}
@keyframes hop{30%{translate:0 -16px;scale:1.04 .96}60%{translate:0 0;scale:.97 1.03}100%{translate:0 0}}
.cad-boneco{animation:idle 4.2s ease-in-out infinite}
@keyframes idle{0%,100%{translate:0 0}50%{translate:0 -3px}}
.cad.abrindo .cad-capa,.capa-btn.abrindo .mole{animation:abrir .32s ease-in forwards}
@keyframes abrir{to{scale:1.25;rotate:-5deg;opacity:0;translate:0 -20px}}

/* ---------- editor: entrada, barra, painéis e virar de página ---------- */
@keyframes edin{from{opacity:0;scale:.92}}
#ed-root .ed{animation:edin .4s var(--soft)}
@keyframes livroin{from{opacity:0;scale:.78;rotate:-4deg;translate:0 40px}}
.ed-livro{perspective:1800px;animation:livroin .6s var(--spring) .05s backwards}
@keyframes barin{from{translate:0 -100%;opacity:0}}
.ed-bar{animation:barin .45s var(--spring) backwards}
@keyframes panin{from{opacity:0;scale:.92;translate:24px -8px}}
.ed-painel:not([hidden]){animation:panin .32s var(--spring)}
@keyframes flipn{from{transform:rotateY(-105deg);filter:brightness(.6)}to{transform:rotateY(0);filter:none}}
@keyframes flipa{from{transform:rotateY(105deg);filter:brightness(.6)}to{transform:rotateY(0);filter:none}}
.ed-livro.flip-prox .pgwrap:last-child .pg{transform-origin:left center;animation:flipn .55s var(--soft)}
.ed-livro.flip-ant .pgwrap:first-child .pg{transform-origin:right center;animation:flipa .55s var(--soft)}
.ed-livro.flip-nova .pgwrap:last-child .pg{transform-origin:left center;animation:flipn .65s var(--soft)}
.ec{transition:scale .2s var(--spring)}
.ec.on{scale:1.2}
.ee{transition:scale .2s var(--spring),background .2s}
.ee.on{scale:1.08}
.pg-ink,.pg-txt{transition:none}

/* =====================================================================
   Celular e tablet: menos movimento "de enfeite" (bateria e fluidez),
   toques maiores e entradas mais rápidas. O que é feedback de toque continua.
   ===================================================================== */
@media (pointer:coarse),(max-width:899px){
  .head h1,.main::before,.capa-btn .mole,.capa-btn .mole .rot,.cad-boneco,.nav.on .ic{animation:none}
  .mole .fita,.ed-livro::after{animation-duration:6s}
  .main::before{filter:drop-shadow(0 0 6px rgba(255,255,255,.35))}
  .enter .item,.enter .kd,.enter .indice-grid>*,.enter .estante>*,.enter .papeis>*{animation-duration:.3s;animation-delay:0s!important}
  .enter .bar i{animation-duration:.5s}
  .tap-ring{animation-duration:.45s}
}
@media (max-width:899px){
  @keyframes navin{from{translate:0 24px;opacity:0}}
  .nav.intro-nav{animation-delay:calc(var(--i,0)*25ms)}
  #ed-root .ed{animation-duration:.28s}
  .ed-livro{animation-duration:.4s}
}
/* sem mouse: nada de efeito "preso" do hover depois do toque */
@media (hover:none){
  .card:hover,.media:hover,.ix:hover,.papel:hover,.tema:hover,.btn:hover,.eb:hover,.chip:hover,.swatch:hover,.nav:hover,.cad:hover .cad-capa{translate:none;scale:none;rotate:none}
}
