/* La Gazzetta pubblica (news.php) arriva lanciata sullo schermo: un foglio minuscolo, in fondo,
   che gira su se stesso, cresce verso chi guarda e si schianta sul vetro. Solo sul sito: nel
   gioco il giornale entra come ogni altra pagina.
   Solo transform: nessuna entrata è il motivo per cui il foglio si vede. */

@keyframes paperThrown {
    0%   { transform: translate(var(--paper-from-x, 34%), var(--paper-from-y, 42%)) rotate(-540deg) scale(.05);
           box-shadow: 0 18px 50px var(--paper-shadow);
           animation-timing-function: cubic-bezier(.12, .62, .32, 1); }
    66%  { transform: translate(0, 0) rotate(-6deg) scale(1.07);
           box-shadow: 0 18px 50px var(--paper-shadow);
           animation-timing-function: cubic-bezier(.5, 0, .9, .6); }
    79%  { transform: translate(0, 0) rotate(1.4deg) scale(.985);
           animation-timing-function: ease-out; }
    90%  { transform: translate(0, 0) rotate(-.4deg) scale(1.006);
           animation-timing-function: ease-in-out; }
    100% { transform: translate(0, 0) rotate(0) scale(1); }
}

/* Il foglio è più alto dello schermo: gira attorno a ciò che si vede, e le misure di
   partenza stanno sullo schermo, non sull'altezza del foglio. */
.nwg.is-thrown {
    --paper-from-x: 30vw;
    --paper-from-y: 38vh;
    --paper-shadow: rgba(58, 42, 24, .4);
    animation: paperThrown .9s backwards;
    transform-origin: 50% 45vh;
}

@media (prefers-reduced-motion: reduce) {
    .nwg.is-thrown { animation: none; }
}
