/* Falling Leaves Animation Styles */
#leaves {
    position: fixed;
    top: -50px;
    left: 0;
    width: 100%;
    text-align: right;
    z-index: 4;
    pointer-events: none;
}

#leaves i {
    display: inline-block;
    width: 200px;
    height: 150px;
    background: linear-gradient(to bottom right, #309900, #005600);
    transform: skew(20deg);
    border-radius: 10% 50% 80% 20%;
    box-shadow: inset 0px 0px 1px #222;
    border: 1px solid #333;
    z-index: 1;
    animation: falling 20s 0s infinite;
    opacity: 0;
}

#leaves i:nth-of-type(2n) { animation: falling2 18s 0s infinite; }
#leaves i:nth-of-type(3n) { animation: falling3 21s 0s infinite; }
#leaves i:nth-of-type(4n) { animation: falling4 25s 0s infinite; }
#leaves i:nth-of-type(5n) { animation: falling5 19s 0s infinite; }

#leaves i:before {
    position: absolute;
    content: '';
    top: 117px;
    right: 9px;
    height: 27px;
    width: 32px;
    transform: rotate(49deg);
    border-radius: 10% 50% 80% 20%;
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
    border-left: 0px solid #222;
    border-right: 1px solid #222;
    background: linear-gradient(to right, rgba(0,100,0,1), #005600);
    z-index: 1;
}

#leaves i:after {
    content: '';
    height: 125px;
    width: 10px;
    background: linear-gradient(to right, rgba(0,0,0,.15), rgba(0,0,0,0));
    display: block;
    transform: rotate(125deg);
    position: absolute;
    left: 85px;
    border-radius: 50%;
}

/* Different leaf sizes */
#leaves i:nth-of-type(6n) { height: 28px; width: 35px; }
#leaves i:nth-of-type(6n):before { width: 8px; height: 6px; top: 20px; right: 2px; }
#leaves i:nth-of-type(6n):after { width: 3px; height: 20px; left: 15px; top: 0px; }

#leaves i:nth-of-type(6n+1) { height: 15px; width: 20px; }
#leaves i:nth-of-type(6n+1):before { width: 5px; height: 4px; top: 10px; right: 1px; }
#leaves i:nth-of-type(6n+1):after { width: 2px; height: 8px; left: 7px; top: 1px; }

#leaves i:nth-of-type(6n+2) { height: 32px; width: 40px; }
#leaves i:nth-of-type(6n+2):before { width: 10px; height: 7px; top: 23px; right: 2px; }
#leaves i:nth-of-type(6n+2):after { width: 3px; height: 22px; left: 17px; top: 0px; }

#leaves i:nth-of-type(6n+3) { height: 12px; width: 15px; }
#leaves i:nth-of-type(6n+3):before { width: 4px; height: 3px; top: 8px; right: 0px; }
#leaves i:nth-of-type(6n+3):after { width: 2px; height: 7px; left: 6px; top: 1px; }

#leaves i:nth-of-type(6n+4) { height: 25px; width: 32px; }
#leaves i:nth-of-type(6n+4):before { width: 7px; height: 5px; top: 18px; right: 1px; }
#leaves i:nth-of-type(6n+4):after { width: 3px; height: 18px; left: 13px; top: 0px; }

#leaves i:nth-of-type(6n+5) { height: 18px; width: 24px; }
#leaves i:nth-of-type(6n+5):before { width: 6px; height: 4px; top: 13px; right: 1px; }
#leaves i:nth-of-type(6n+5):after { width: 2px; height: 12px; left: 10px; top: 0px; }

/* Animation delays */
#leaves i:nth-of-type(n) { animation-delay: 0s; }
#leaves i:nth-of-type(2n) { animation-delay: 2.5s; }
#leaves i:nth-of-type(3n) { animation-delay: 5s; }
#leaves i:nth-of-type(4n) { animation-delay: 1.2s; }
#leaves i:nth-of-type(5n) { animation-delay: 7.5s; }
#leaves i:nth-of-type(6n) { animation-delay: 3.8s; }
#leaves i:nth-of-type(7n) { animation-delay: 6.2s; }
#leaves i:nth-of-type(8n) { animation-delay: 4.5s; }
#leaves i:nth-of-type(9n) { animation-delay: 8.8s; }
#leaves i:nth-of-type(10n) { animation-delay: 1.8s; }
#leaves i:nth-of-type(11n) { animation-delay: 9.2s; }
#leaves i:nth-of-type(12n) { animation-delay: 3.2s; }
#leaves i:nth-of-type(13n) { animation-delay: 5.7s; }
#leaves i:nth-of-type(14n) { animation-delay: 2.1s; }
#leaves i:nth-of-type(15n) { animation-delay: 6.9s; }
#leaves i:nth-of-type(16n) { animation-delay: 4.2s; }
#leaves i:nth-of-type(17n) { animation-delay: 7.8s; }
#leaves i:nth-of-type(18n) { animation-delay: 1.5s; }
#leaves i:nth-of-type(19n) { animation-delay: 8.3s; }
#leaves i:nth-of-type(20n) { animation-delay: 3.6s; }

/* Different green shades */
#leaves i:nth-of-type(n) { background: #4cd137; }
#leaves i:nth-of-type(3n+1) { background: linear-gradient(to bottom right, #4a9900, #1a5600); }
#leaves i:nth-of-type(3n+2) { background: #2f7d32; }
#leaves i:nth-of-type(5n+1) { background: linear-gradient(to bottom right, #228B22, #014421); }
#leaves i:nth-of-type(7n+1) { background: linear-gradient(to bottom right, #3d6b3d, #1a4d1a); }

/* Varying opacity for depth - applied via animation keyframes */
/* Leaves start invisible and fade in during animation */

#leaves i:nth-of-type(n) { transform: rotate(180deg); }
#leaves i:nth-of-type(n) { animation-timing-function: ease-in-out; }

/* Falling animations */
@keyframes falling {
    0% {
        transform: translate3d(500px, 0, 0) rotate(0deg);
        opacity: 0.15;
    }
    100% {
        transform: translate3d(-450px, 1200px, 0) rotate(180deg);
        opacity: 0;
    }
}

@keyframes falling2 {
    0% {
        transform: translate3d(300px, 0, 0) rotate(90deg);
        opacity: 0.15;
    }
    100% {
        transform: translate3d(-550px, 1100px, 0) rotate(-90deg);
        opacity: 0;
    }
}

@keyframes falling3 {
    0% {
        transform: translate3d(200px, 0, 0) rotate(-20deg);
        opacity: 0.15;
    }
    100% {
        transform: translate3d(-380px, 1300px, 0) rotate(-200deg);
        opacity: 0;
    }
}

@keyframes falling4 {
    0% {
        transform: translate3d(400px, 0, 0) rotate(45deg);
        opacity: 0.15;
    }
    100% {
        transform: translate3d(-500px, 1250px, 0) rotate(270deg);
        opacity: 0;
    }
}

@keyframes falling5 {
    0% {
        transform: translate3d(600px, 0, 0) rotate(-45deg);
        opacity: 0.15;
    }
    100% {
        transform: translate3d(-300px, 1150px, 0) rotate(135deg);
        opacity: 0;
    }
}
