/* floating: water, poops and the ship (site/js/floating.js) */
.water {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    transition: transform 2.5s linear;
}

.water-back {
    z-index: -3;
}

.water-front {
    z-index: -1;
}

.wave {
    height: 40px;
    background-repeat: repeat-x;
    background-size: 1200px 40px;
    animation: wave-scroll 14s linear infinite;
}

.water-front .wave {
    animation-duration: 9s;
    animation-direction: reverse;
}

.water-body {
    height: 100%;
}

@keyframes wave-scroll {
    to {
        background-position-x: -1200px;
    }
}

.poop {
    position: fixed;
    z-index: -2;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    animation: bob var(--bob, 3s) ease-in-out var(--bob-delay, 0s) infinite alternate;
}

@keyframes bob {
    from {
        translate: 0 -5px;
        rotate: -6deg;
    }
    to {
        translate: 0 5px;
        rotate: 6deg;
    }
}

/* The ship sails along the surface, between the water layers like the poops */
.ship {
    position: fixed;
    z-index: -2;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    animation: pitch 5s ease-in-out infinite alternate;
}

@keyframes pitch {
    from {
        translate: 0 -4px;
        rotate: -2deg;
    }
    to {
        translate: 0 4px;
        rotate: 2deg;
    }
}

/* Smoke from the ship's funnel: a clump of black and grey circle emoji (see puff() in floating.js) */
.smoke {
    position: fixed;
    z-index: -2;
    width: 0;
    height: 0;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    animation: smoke-move var(--life, 30s) ease-out forwards, smoke-fade var(--life, 30s) linear forwards;
}

.smoke i {
    position: absolute;
    font-style: normal;
    transform: translate(-50%, -50%);
}

/* there is no grey circle emoji, so dim the white one */
.smoke i.grey {
    filter: brightness(0.55);
}

/* A cloud pushed out by newer ones fades away rather than vanishing (time: smoke.fadeOut in floating.js) */
.smoke i {
    transition: opacity 2.5s ease-out;
}

.smoke.leaving i {
    opacity: 0 !important;
}

/* Movement (position and size) and fading are separate so a cloud can hang about at full strength */
@keyframes smoke-move {
    from {
        transform: translate(0, 0) scale(0.3);
    }
    to {
        transform: translate(var(--drift, 100px), calc(var(--rise, 200px) * -1)) scale(var(--grow, 2));
    }
}

@keyframes smoke-fade {
    0% {
        opacity: 0;
    }
    10%,
    60% {
        opacity: var(--peak, 0.6);
    }
    100% {
        opacity: 0;
    }
}

/* animation toggle */
.motion-toggle {
    float: right;
    font: inherit;
    font-weight: normal;
    font-size: 0.85em;
    padding: 0.2em 0.6em;
    cursor: pointer;
    margin-top: 13px;
}
