.page-timeline {
    padding-bottom: 72px;
    overflow-x: hidden;
    overflow-x: clip;

    > .floating-elements {
        z-index: 1;
    }

    > .container {
        position: relative;
        z-index: 2;
    }
}

.shots-counter {
    display: none;

    /* Rests just under the h1; JS docks the pill to the bottom of the screen once you start scrolling */
    @media (min-width: 960px) {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 14px;
        margin: 0 0 40px;
    }
}

.shots-counter-hint {
    max-width: 420px;
    margin: 0;
    text-align: center;
    font-family: var(--font-lapture);
    font-size: 1.25rem;
    line-height: 1.3;
    color: var(--color-cream);
    transition: opacity 0.4s ease;

    .shots-counter.is-docked & {
        opacity: 0;
    }
}

.shots-counter-pill {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 40px;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);

    .shots-counter.is-docked & {
        position: fixed;
        z-index: 3;
        bottom: 24px;
        left: 0;
        right: 0;
        width: fit-content;
        margin: 0 auto;
    }
}

.shots-counter-label {
    margin: 0;
    padding: 0;
    text-align: center;
    font-size: 1.5rem;
}

.shots-counter-value {
    font-family: var(--font-courier);
    font-size: 3rem;
    line-height: 1;
    color: var(--color-red);
}

.page-template-timeline {
    overflow-x: hidden;
    overflow-x: clip;

    .container {
        max-width: 1300px;

        h1 {
            margin: 0 0 16px;
            text-align: center;

            @media (min-width: 960px) {
                margin-top: 60px;
            }
        }

        .timeline-subtitle {
            margin: 0 0 75px;
            text-align: center;
            font-family: var(--font-lapture);
            font-size: 1.25rem;
            line-height: 1.3;
            color: var(--color-red);
        }

        .date {
            position: relative;
            clear: left;
            margin-bottom: 44px !important;

            @media (min-width: 768px) {
                margin-bottom: 72;
            }

            @media (min-width: 960px) {
                margin-bottom: 136px !important;
            }

            h2 {
                font-family: var(--font-modestolite-expanded);
                font-weight: 400;
                line-height: 0.85;
                font-size: 2rem;
                color: var(--color-yellow);
                margin-bottom: 20px;

                @media (min-width: 768px) {
                    font-size: 2.65rem;
                }

                @media (min-width: 960px) {
                    font-size: 4.375rem;
                    margin-bottom: 38px;
                }
            }

            p {
                font-family: var(--font-modestolite);
                color: var(--color-cream);
                text-transform: uppercase;
                font-size: 1.25rem;
                line-height: 1.15;

                @media (min-width: 768px) {
                    font-size: 1.5rem;
                }

                @media (min-width: 960px) {
                    font-size: 2.675rem;
                }
            }

            .element {
                img,
                video {
                    @media (max-width: 767px) {
                        max-height: 300px;
                        width: auto;
                        margin: 0 auto;
                    }
                }
            }

            &.cigar {
                max-width: 1200px;
                margin-top: 40px;

                @media (min-width: 960px) {
                    margin-top: 20vh;
                }

                > h2,
                > p {
                    position: relative;
                    z-index: 2;
                }

                .element {
                    position: relative;
                    z-index: 1;
                    width: 80%;
                    max-width: 800px;
                    aspect-ratio: 1 / 1;
                    margin: -120px auto 0;

                    @media (min-width: 768px) {
                        margin-top: -225px;
                    }

                    @media (min-width: 960px) {
                        margin-top: -325px;
                    }

                    .smoke-container {
                        position: absolute;
                        inset: 0;
                        overflow: hidden;

                        img {
                            max-height: none !important;
                        }
                    }
                }
            }

            &.prohibition {
                @media (min-width: 960px) {
                    display: flex;
                    flex-direction: row-reverse;
                    gap: 54px;
                }

                .text {
                    max-width: 450px;
                }
                .element {
                    margin-top: 32px;

                    @media (min-width: 960px) {
                        margin-top: 0;
                    }
                }
            }

            &.medicinal {
                @media (min-width: 960px) {
                    display: flex;
                    flex-direction: row;
                    gap: 10%;
                    justify-content: space-evenly;
                }
                .text {
                    max-width: 760px;

                    @media (min-width: 960px) {
                        align-self: center;
                    }
                }

                .element {
                    margin-top: 32px;
                    max-width: 540px;
                    margin: 32px auto 0;

                    @media (min-width: 960px) {
                        margin-top: 0;
                    }
                }

                .swirl:not(.swirl-1) {
                    transform-box: fill-box;
                    transform-origin: center;
                    animation-name: medicinal-swirl-wiggle;
                    animation-timing-function: ease-in-out;
                    animation-iteration-count: infinite;
                    animation-duration: 0.9s;
                    animation-direction: alternate;
                }

                .swirl:not(.swirl-1):nth-child(3n + 1) {
                    animation-duration: 0.75s;
                    animation-delay: -0.15s;
                }

                .swirl:not(.swirl-1):nth-child(3n + 2) {
                    animation-duration: 1.05s;
                    animation-delay: -0.35s;
                    animation-direction: alternate-reverse;
                }

                .swirl:not(.swirl-1):nth-child(3n + 3) {
                    animation-duration: 0.85s;
                    animation-delay: -0.6s;
                }

                .swirl:not(.swirl-1):nth-child(5n + 2) {
                    animation-direction: alternate-reverse;
                }
            }

            &.flag {
                @media (min-width: 960px) {
                    display: flex;
                    flex-direction: row;
                    gap: 5%;
                }
                .text {
                    max-width: 600px;
                }

                .element.stamp {
                    position: relative;
                    margin-top: 32px;
                    transform: rotate(-6deg);

                    @media (min-width: 960px) {
                        margin-top: 0;
                    }
                }
            }

            &.newspaper {
                @media (min-width: 960px) {
                    display: flex;
                    flex-direction: row-reverse;
                    gap: 54px;
                }
                .text {
                    max-width: 700px;
                }

                .element {
                    position: relative;
                    margin-top: 32px;
                    transform: rotate(8deg);

                    @media (min-width: 960px) {
                        margin-top: 0;
                    }
                }
            }

            &.bielzoff {
                @media (min-width: 960px) {
                    display: flex;
                    flex-direction: row;
                    gap: 20%;
                }

                .text {
                    max-width: 800px;

                    @media (min-width: 960px) {
                        align-self: center;
                    }
                }

                .element {
                    position: relative;
                    transform: rotate(-8deg);
                }

                .element.bottle img {
                    transform-origin: 50% 100%;
                    animation: bottle-rock 4s ease-in-out infinite;
                }
            }

            &.purchase {
                @media (min-width: 960px) {
                    display: flex;
                    flex-direction: row;
                    gap: 10%;
                    justify-content: space-between;
                }
                .text {
                    max-width: 820px;
                }

                .element.george {
                    margin-top: 32px;

                    @media (min-width: 960px) {
                        margin-top: 0;
                    }
                }

                .element.george img {
                    filter: brightness(1.6) saturate(0.3);
                    opacity: 0;
                }
            }

            &.marsalle {
                @media (min-width: 960px) {
                    display: flex;
                    flex-direction: row;
                    gap: 10%;
                    justify-content: space-between;
                }
                .text {
                    max-width: 820px;
                }
                .element {
                    position: relative;
                    margin-top: 32px;
                    transform: rotate(6deg);

                    @media (min-width: 960px) {
                        margin-top: 0;
                    }
                }
            }

            &.patricia {
                @media (min-width: 960px) {
                    display: flex;
                    flex-direction: row-reverse;
                    gap: 10%;
                }
                .text {
                    max-width: 650px;
                }

                .element.pat-george {
                    margin-top: 32px;
                    opacity: 0;

                    @media (min-width: 960px) {
                        margin-top: 0;
                    }
                }
            }

            &.wormwood {
                position: relative;

                .element {
                    @media (min-width: 960px) {
                        position: absolute;
                        top: 50%;
                        right: 0;
                        z-index: -1;
                        transform: translateY(-50%);
                    }
                }
            }

            &.sam {
                @media (min-width: 960px) {
                    display: flex;
                    flex-direction: row;
                    gap: 50px;
                }
                .text {
                    max-width: 454px;

                    @media (min-width: 960px) {
                        align-self: flex-end;
                    }
                }
                .element {
                    position: relative;
                    margin-top: 32px;
                    transform: rotate(7deg);
                    max-width: 500px;

                    @media (min-width: 960px) {
                        margin-top: 0;
                    }
                }

                .polaroid-develop {
                    position: absolute;
                    top: 5.5%;
                    left: 5.5%;
                    right: 5.5%;
                    height: 77%;
                    background: var(--color-polaroid);
                    pointer-events: none;
                }
            }

            &.cordial {
                position: relative;

                @media (min-width: 960px) {
                    display: flex;
                    flex-direction: row;
                    gap: 50px;
                }

                .text {
                    max-width: 960px;
                }

                .element {
                    margin-top: 36px;
                    @media (min-width: 960px) {
                        margin-top: 0;
                        height: 100%;
                        z-index: -1;

                        img {
                            height: 100%;
                        }
                    }
                }
            }

            &.distillery {
                .text {
                    max-width: 1000px;
                }
                .element {
                    margin-top: 36px;

                    @media (min-width: 960px) {
                        margin-top: 70px;
                        width: 90%;
                    }
                }
            }

            &.labels {
                position: relative;
                .text {
                    position: relative;
                    z-index: 5;
                    max-width: 700px;
                }
                .element {
                    margin-top: 36px;

                    @media (min-width: 960px) {
                        margin-top: 0;
                        position: absolute;
                        width: 356px;
                        top: -200%;
                        right: 0;
                    }
                }
            }

            &.nation {
                @media (min-width: 960px) {
                    display: flex;
                    flex-direction: row;
                }
                .text {
                    max-width: 672px;
                    flex-shrink: 0;

                    @media (min-width: 960px) {
                        align-self: center;
                    }
                }
                .element {
                    margin-top: 36px;

                    @media (min-width: 960px) {
                        margin-top: 0;
                        flex: 1;
                    }

                    svg {
                        display: block;
                        width: 100%;
                        height: auto;

                        @media (min-width: 960px) {
                            width: 120%;
                            max-width: none;
                        }
                    }

                    .usa-gold {
                        fill: var(--color-cream);
                    }
                }
            }

            &.today {
                .text {
                    max-width: 800px;
                }

                .element {
                    max-width: 1000px;
                    margin: 36px auto 0;

                    @media (min-width: 960px) {
                        margin: 0;
                        margin-left: auto;
                        margin-top: -6vw;
                        position: relative;
                        z-index: -1;
                    }
                }
            }
        }
    }
}

@keyframes bottle-rock {
    0%,
    100% {
        transform: rotate(-8deg);
    }
    50% {
        transform: rotate(8deg);
    }
}

@keyframes medicinal-swirl-wiggle {
    0% {
        transform: rotate(-5deg) scale(1) skew(0deg, 0deg);
    }
    30% {
        transform: rotate(2deg) scale(1.04) skew(2deg, 1deg);
    }
    55% {
        transform: rotate(-2deg) scale(0.98) skew(-1deg, -2deg);
    }
    80% {
        transform: rotate(4deg) scale(1.05) skew(1deg, 2deg);
    }
    100% {
        transform: rotate(5deg) scale(1.02) skew(-2deg, 0deg);
    }
}
