
:root {
    --page-bg: #949c9c;
    --main-flower-bg: #2c3c54;
    --flower-bg: #ecef6c;
}

body {
    font-family:'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    color: white;
    background-color: var(--page-bg);
    overflow: hidden;
}

.flower {
    position: absolute;
    overflow: visible;
    border-radius: 50%;
    background-color: var(--flower-bg);
    width: 50px;
    height: 50px;
}

.petal {
    position: absolute;
    left: 50%;
    top: 50%;
}

.petal:nth-of-type(2) {
    rotate: 300deg;
}

.petal:nth-of-type(3) {
    rotate: 240deg;
}

.petal:nth-of-type(4) {
    rotate: 180deg;
}

.petal:nth-of-type(5) {
    rotate: 120deg;
}

.petal:nth-of-type(6) {
    rotate: 60deg;
}

.stem {
    position: absolute;
    left: 24px;
    top: -5px;
    width: 6px;
    height: 10px;
    background: 
        radial-gradient(closest-corner circle at top, transparent 100%, var(--flower-bg) 100% 200%, transparent 200%),
        radial-gradient(closest-corner circle at bottom, transparent 100%, var(--flower-bg) 100% 200%, transparent 200%)
    ;
}

.leaf {
    position: absolute;
    border-radius: 50%;
    left: 30px;
    top: -19px;
    width: 38px;
    height: 38px;
    background-color: var(--flower-bg);
}

@keyframes main-flower-sway {
    from {
        transform: translateX(-5%) rotate(-2deg);
    }
    to {
        transform: translateX(5%) rotate(2deg);
    }
}

main.flower {
    text-align: center;
    background-color: var(--main-flower-bg);
    color: white;
    width: 32vw;
    height: 32vw;
    left: 34vw;
    top: calc(50dvh - 16vw);
    font-size: 1.2rem;
    font-weight: bold;
    animation: 4s ease-in-out alternate infinite main-flower-sway;
}

main > .petal > .stem {
    left: 15.6vw;
    top: -3vw;
    width: 4vw;
    height: 6vw;
    background: 
        radial-gradient(closest-corner circle at top, transparent 100%, var(--main-flower-bg) 100% 200%, transparent 200%),
        radial-gradient(closest-corner circle at bottom, transparent 100%, var(--main-flower-bg) 100% 200%, transparent 200%)
    ;
}

main > .petal > .leaf {
    left: 19.4vw;
    top: -12vw;
    width: 24vw;
    height: 24vw;
    background-color: var(--main-flower-bg);
    transition: 0.5s;
}

main > .petal > .leaf:hover {
    background-color: yellowgreen;
    color: black;
}

a {
    color: azure;
    font-style: italic;
}

@keyframes petal-1-anim {
    from {
        rotate: 0deg;
    }
    to {
        rotate: 300deg;
    }
}

@keyframes petal-2-anim {
    from {
        rotate: 0deg;
    }
    to {
        rotate: 240deg;
    }
}

@keyframes petal-3-anim {
    from {
        rotate: 0deg;
    }
    to {
        rotate: 180deg;
    }
}

@keyframes petal-4-anim {
    from {
        rotate: 0deg;
    }
    to {
        rotate: 120deg;
    }
}

@keyframes petal-5-anim {
    from {
        rotate: 0deg;
    }
    to {
        rotate: 60deg;
    }
}

main > .petal {
    animation-timing-function: ease-out;
    animation-fill-mode: forwards;
}

main > .petal:nth-of-type(2) {
    animation-duration: 1s;
    animation-name: petal-1-anim;
}

main > .petal:nth-of-type(2) > .leaf {
    rotate: -300deg;
}

main > .petal:nth-of-type(3) {
    animation-duration: 0.8s;
    animation-name: petal-2-anim;
}

main > .petal:nth-of-type(3) > .leaf {
    rotate: -240deg;
}

main > .petal:nth-of-type(4) {
    animation-duration: 0.6s;
    animation-name: petal-3-anim;
}

main > .petal:nth-of-type(4) > .leaf {
    rotate: -180deg;
}

main > .petal:nth-of-type(5) {
    animation-duration: 0.4s;
    animation-name: petal-4-anim;
}

main > .petal:nth-of-type(5) > .leaf {
    rotate: -120deg;
}

main > .petal:nth-of-type(6) {
    animation-duration: 0.2s;
    animation-name: petal-5-anim;
}

main > .petal:nth-of-type(6) > .leaf {
    rotate: -60deg;
}

#flower-field {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 40dvh;
    width: 100%;
    z-index: -1;
    /* animation: 4s ease-in-out alternate infinite flower-sway; */
}

#flower-field > .flower {
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    animation-delay: -3s;
    animation-name: main-flower-sway;
}

#flower-field > .flower:first-of-type {
    animation-duration: 3s;
}

#flower-field > .flower:nth-of-type(2) {
    left: 10vw;
    top: 50px;
    animation-duration: 2s;
}

#flower-field > .flower:nth-of-type(3) {
    left: 20vw;
    bottom: 50px;
    animation-duration: 2.3s;
}

#flower-field > .flower:nth-of-type(4) {
    left: 40vw;
    top: 100px;
    animation-duration: 2.9s;
}

#flower-field > .flower:nth-of-type(5) {
    left: 55vw;
    bottom: 100px;
    animation-duration: 2.7s;
}

#flower-field > .flower:nth-of-type(6) {
    left: 70vw;
    top: 150px;
    animation-duration: 2.2s;
}

#flower-field > .flower:nth-of-type(7) {
    left: 70vw;
    bottom: 0;
    animation-duration: 3.1s;
}

#flower-field > .flower:nth-of-type(8) {
    left: 90vw;
    top: 50px;
    animation-duration: 2.4s;
}

#flower-field > .flower:nth-of-type(9) {
    left: 100vw;
    bottom: 50px;
    animation-duration: 2.8s;
}

#flower-field > .flower:nth-of-type(10) {
    left: 30vw;
    top: 150px;
    animation-duration: 3.3s;
}

#flower-field > .flower:nth-of-type(11) {
    left: 60vw;
    top: 0;
    animation-duration: 2s;
}

#flower-field > .flower:nth-of-type(12) {
    left: 0;
    bottom: 0;
    animation-duration: 2.6s;
}

#flower-field > .flower:nth-of-type(13) {
    left: 85vw;
    bottom: 100px;
    animation-duration: 2.1s;
}

#flower-field > .flower:nth-of-type(14) {
    left: 45vw;
    top: 0;
    animation-duration: 3s;
}

#flower-field > .flower:nth-of-type(15) {
    left: 75vw;
    top: 0;
    animation-duration: 2.9s;
}

#flower-field > .flower:nth-of-type(16) {
    left: 25vw;
    top: 0;
    animation-duration: 3.2s;
}

#plainbow-dial {
    position: absolute;
    z-index: -10;
    border-radius: 50%;
    width: 25dvh;
    height: 25dvh;
    left: 3vw;
    top: 2dvh;
    overflow: hidden;
    box-shadow: inset 0 0 0 5x var(--page-bg);
}

#plainbow-dial > div {
    position: absolute;
    width: 50%;
    height: 50%;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-duration: 5s;
}

#plainbow-dial > div:first-child {
    height: 100%;
    background: radial-gradient(closest-corner circle at 100% 50%, transparent 40%, black 40% 60%, transparent 60% 80%, black 80% 99%, transparent 99%);
    z-index: -11;
    animation-name: plainbow-z-motion;
}

@keyframes plainbow-z-motion {
    0%, 30% {
        z-index: -11;
    }

    40%, 100% {
        z-index: -7;
    }
}

#plainbow-dial > div:nth-child(2) {
    height: 100%;
    right: 0;
    background: radial-gradient(closest-corner circle at 0 50%, transparent 40%, black 40% 60%, transparent 60% 80%, black 80% 99%, transparent 99%);
    z-index: -9;
}

#plainbow-dial > div:nth-child(3) {
    background: var(--page-bg);
    z-index: -10;
    left: 50%;
    border: 10px solid var(--page-bg);
    transform-origin: bottom left;
    animation-name: plainbow-rotor;
}

@keyframes plainbow-rotor {
    0% {
        transform: rotate(0);
        z-index: -10;
    }

    10% {
        z-index: -10;
    }

    20% {
        z-index: -8;
    }

    50% {
        transform: rotate(-450deg);
        z-index: -8;
    }

    51% {
        transform: rotate(-450deg);
        z-index: -10;
    }

    60%, 100% {
        transform: rotate(-360deg);
    }
}

@keyframes plainbow-rotor-2 {
    0% {
        transform: rotate(0);
        z-index: -10;
    }

    20%, 60% {
        transform: rotate(-180deg);
        z-index: -10;
    }

    60% {
        z-index: -8;
    }

    90% {
        transform: rotate(-450deg);
        z-index: -8;
    }

    91% {
        transform: rotate(-450deg);
        z-index: -10;
    }

    100% {
        transform: rotate(-360deg);
    }
}

/* 

desktop css overrides 

*/
@media only screen and (min-width: 768px) {
    main.flower {
        width: 16vw;
        height: 16vw;
        left: 42vw;
        top: calc(50dvh - 8vw);
        font-size: 2rem;
        font-weight: bold;
    }
    
    main > .petal > .stem {
        left: 7.8vw;
        top: -1.5vw;
        width: 2vw;
        height: 3vw;
    }
    
    main > .petal > .leaf {
        left: 9.6vw;
        top: -6vw;
        width: 12vw;
        height: 12vw;
    }
}
