/*
    The drawings (_Scene), on the public pages and in the app alike. Their movement waits for the class "js" on the page, which each
    layout sets before anything is drawn, and for drawings.js to say each one has been seen.
*/
/*
    The drawings (_Scene): small tiles beside the front page's lines, and a wide scene under a guide's title. Each is a picture with
    its own sky or wall, so it reads the same on a light page as on a dark one. When one comes into view it settles in once: its light
    comes up, then its line of gold is drawn. drawings.js says when it has been seen. Anyone who asked for less movement sees it whole.
*/
.drawing { margin: 0; overflow: hidden; }
.drawing svg { display: block; width: 100%; height: 100%; }
.drawing-tile { width: 64px; height: 64px; border-radius: 12px; box-shadow: 0 6px 18px rgb(0 0 0 / .32); }
.drawing-wide { max-width: 34rem; aspect-ratio: 360 / 170; margin: 0 0 1.4rem; border-radius: 16px; box-shadow: 0 14px 34px rgb(0 0 0 / .32); }

/* Beside a section of a guide (_Beside): floated beside the section's first lines, so that it takes no room of its own. */
.drawing-beside { float: right; width: 56px; height: 56px; margin: .3rem 0 .5rem 1rem; border-radius: 12px; box-shadow: 0 6px 18px rgb(0 0 0 / .32); }
@media (prefers-reduced-motion: no-preference) {
    .js .drawing .drawing-glow { transition: opacity 1.2s ease-out .15s; }
    .js .drawing:not(.is-seen) .drawing-glow { opacity: 0; }
    /* A dash as long as the line and a gap twice as long, held a little past its start: no dash end touches the line, so its round
       cap shows no dot before the line is drawn. */
    .js .drawing .drawing-pen { stroke-dasharray: 1 2; stroke-dashoffset: 1.02; transition: stroke-dashoffset 1.7s cubic-bezier(.45, 0, .3, 1) .45s; }
    .js .drawing.is-seen .drawing-pen { stroke-dashoffset: 0; }
}
@media print {
    .drawing-wide { box-shadow: none; }
}

/*
    One movement for each drawing, played once as it comes into view, after its light comes up: something the feature does,
    never a loop. Each moving part is its own group in _Scene, so that a drawing's own placing (a rotated glass) is left alone.
    Nothing moves for anyone who asked for less movement: every part is drawn where it ends.
*/
@media (prefers-reduced-motion: no-preference) {
    .js .drawing [class*="move-"] { transform-box: fill-box; }

    /* Rise from the floor: bottles standing up, an answer coming in. */
    .js .drawing .move-rise { transform-origin: 50% 100%; }
    .js .drawing:not(.is-seen) .move-rise { transform: scaleY(.35); opacity: 0; }
    .js .drawing.is-seen .move-rise { animation: drawing-rise .9s cubic-bezier(.2, .9, .3, 1.15) both; animation-delay: var(--at, .2s); }

    /* Sweep in from the left: a highlighter going over a line. */
    .js .drawing .move-sweep { transform-origin: 0 50%; }
    .js .drawing:not(.is-seen) .move-sweep { transform: scaleX(0); }
    .js .drawing.is-seen .move-sweep { animation: drawing-sweep .7s cubic-bezier(.5, 0, .3, 1) both; animation-delay: var(--at, .4s); }

    /* Pop: a number in its circle, a ring round a spot. */
    .js .drawing .move-pop { transform-origin: 50% 50%; }
    .js .drawing:not(.is-seen) .move-pop { transform: scale(0); }
    .js .drawing.is-seen .move-pop { animation: drawing-pop .5s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: var(--at, 1s); }

    /* Drop in from above, with a little bounce: the pin on a trip. */
    .js .drawing:not(.is-seen) .move-drop { transform: translateY(-40%); opacity: 0; }
    .js .drawing.is-seen .move-drop { animation: drawing-drop .8s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: var(--at, .5s); }

    /* Fill: wine rising in a glass, a spirit's level. */
    .js .drawing .move-fill { transform-origin: 50% 100%; }
    .js .drawing:not(.is-seen) .move-fill { transform: scaleY(0); }
    .js .drawing.is-seen .move-fill { animation: drawing-fill 1.2s cubic-bezier(.4, 0, .2, 1) both; animation-delay: var(--at, .9s); }

    /* Lean in: two glasses meeting, each from its own side. */
    .js .drawing .move-lean-left { transform-origin: 50% 100%; }
    .js .drawing .move-lean-right { transform-origin: 50% 100%; }
    .js .drawing:not(.is-seen) .move-lean-left { transform: rotate(-14deg); }
    .js .drawing:not(.is-seen) .move-lean-right { transform: rotate(14deg); }
    .js .drawing.is-seen .move-lean-left { animation: drawing-lean-left .7s cubic-bezier(.3, 1.3, .5, 1) both; animation-delay: var(--at, .3s); }
    .js .drawing.is-seen .move-lean-right { animation: drawing-lean-right .7s cubic-bezier(.3, 1.3, .5, 1) both; animation-delay: var(--at, .3s); }

    /* Turn: the table's wheel on the TV, coming to rest. */
    .js .drawing .move-turn { transform-origin: 50% 50%; }
    .js .drawing.is-seen .move-turn { animation: drawing-turn 1.6s cubic-bezier(.2, .7, .2, 1) both; animation-delay: var(--at, .2s); }

    /* Appear in turn: bottles found on a film, dots typing. */
    .js .drawing:not(.is-seen) .move-show { opacity: 0; }
    .js .drawing.is-seen .move-show { animation: drawing-show .35s ease-out both; animation-delay: var(--at, .3s); }
}

@keyframes drawing-rise { from { transform: scaleY(.35); opacity: 0; } 60% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes drawing-sweep { from { transform: scaleX(0); } to { transform: none; } }
@keyframes drawing-pop { from { transform: scale(0); } to { transform: none; } }
@keyframes drawing-drop { from { transform: translateY(-40%); opacity: 0; } 40% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes drawing-fill { from { transform: scaleY(0); } to { transform: none; } }
@keyframes drawing-lean-left { from { transform: rotate(-14deg); } to { transform: none; } }
@keyframes drawing-lean-right { from { transform: rotate(14deg); } to { transform: none; } }
@keyframes drawing-turn { from { transform: rotate(-200deg); } to { transform: none; } }
@keyframes drawing-show { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/*
    Spirits and beer, drawn: the bottle of spirits at its own level on a spirit's page (_SpiritLevel), and the drawings of a back bar,
    a beer fridge and the bottom of a can (_BarArt). Their movement is the drawings' own (drawings.css), played once when each is
    first seen and never for anyone who has asked for less movement. Nothing here changes a page that does not draw one of them.
*/

/* A spirit's level, at the end of the line that offers to read it from a photo: the bottle as Kept has it, beside the way to put it
   right. The line keeps its link at the start, and the drawing at its end, in room the line already leaves. */
.level-photo:has(> .spirit-level) { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.level-photo > .spirit-level {
    order: 2;
    flex: none;
    width: 32px;
    height: 45px;
    border-radius: 8px;
    box-shadow: 0 5px 14px rgb(0 0 0 / .3);
}

/* The bottom of a can beside "Photograph the date", where it shows where on the can the date is. */
.pack-date-photo:has(> .drawing) { display: flex; align-items: center; gap: .75rem; }
.pack-date-photo > .drawing { flex: none; width: 40px; height: 40px; border-radius: 10px; }

@media print {
    .spirit-level { box-shadow: none; }
}
