:root {
    --cat-size: 20vw;
    --cat-color: rgba(20, 20, 20, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    position: relative;
    margin: 0;
    background-color: #233333;
    overflow: hidden;
}

.cat {
    position: absolute;
    bottom: 0;
    left: calc(50% - var(--cat-size) / 2);
    width: var(--cat-size);
    height: var(--cat-size);
}

.tail {
    position: absolute;
    bottom: -32%;
    left: 55%;
    width: 60%;
    height: 60%;
    border-radius: 50%;
    border-top: calc(var(--cat-size) / 10) solid var(--cat-color);
    border-right: calc(var(--cat-size) / 10) solid rgba(0, 0, 0, 0);
    transform-origin: left center;
    animation: tail 2s ease-in-out infinite alternate-reverse;
}

.tail:hover {
    -webkit-animation-play-state: paused;
    animation-play-state: paused;
}

.tail::after {
    content: '';
    position: absolute;
    top: 2.5%;
    left: 88%;
    width: calc(var(--cat-size) / 10);
    height: calc(var(--cat-size) / 20);
    background-color: var(--cat-color);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    transform: rotate(135deg);
}

@-webkit-keyframes tail {
    from {
        transform: rotate(0deg);
    }
    to {
        left: 45%;
        transform: rotate(-180deg) scaleY(-1);
    }
}

@keyframes tail {
    from {
        transform: rotate(0deg);
    }
    to {
        left: 45%;
        transform: rotate(-180deg) scaleY(-1);
    }
}

.body {
    position: absolute;
    bottom: -1%;
    left: 27.5%;
    width: 45%;
    height: 70%;
    background-color: var(--cat-color);
    border-radius: 50% / 85% 85% 15% 15%;
}

.head {
    position: absolute;
    bottom: 63%;
    left: 22.5%;
    width: 55%;
    height: 50%;
    background-color: var(--cat-color);
    border-radius: 50% / 60% 60% 40% 40%;
}

.ear-l,
.ear-r {
    position: absolute;
    bottom: 58%;
    width: 45.454545%;
    height: 50%;
    background-color: var(--cat-color);
}

.ear-l {
    left: -4.545454%;
    border-radius: 0 100% 0 30% / 0 30% 0 100%;
}

.ear-r {
    right: -4.545454%;
    border-radius: 100% 0 30% 0 / 30% 0 100% 0;
}

.ear-l:hover {
    transform-origin: right bottom;
    -webkit-animation: ear-l 4s ease-out infinite;
    animation: ear-l 4s ease-out infinite;
}
.ear-r:hover {
    transform-origin: left bottom;
    -webkit-animation: ear-r 4s ease-out infinite;
    animation: ear-r 4s ease-out infinite;
}

@-webkit-keyframes ear-l {
    from,
    5% {
        transform: rotate(0);
    }
    2.5% {
        transform: rotate(5deg);
    }
    1.25%,
    3.75% {
        transform: rotate(-5deg);
    }
}

@keyframes ear-l {
    from,
    5% {
        transform: rotate(0);
    }
    2.5% {
        transform: rotate(5deg);
    }
    1.25%,
    3.75% {
        transform: rotate(-5deg);
    }
}

@-webkit-keyframes ear-r {
    from,
    5% {
        transform: rotate(0);
    }
    2.5% {
        transform: rotate(-5deg);
    }
    1.25%,
    3.75% {
        transform: rotate(5deg);
    }
}

@keyframes ear-r {
    from,
    5% {
        transform: rotate(0);
    }
    2.5% {
        transform: rotate(-5deg);
    }
    1.25%,
    3.75% {
        transform: rotate(5deg);
    }
}

.eye-l {
    left: 9.090909%;
}

.eye-r {
    left: 54.545454%;
}

.eye-l,
.eye-r {
    position: absolute;
    bottom: 30%;
    width: 36.363636%;
    height: 40%;
    background-color: rgba(245, 245, 245, 1);
    border-radius: 50%;
}

.eye-l::before,
.eye-r::before {
    content: '';
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background-color: var(--cat-color);
    border-radius: 0 0 50% 50% / 0;
    transition: height 0.1s ease-out, border-radius 0.1s ease-out;
}

.eye-l:hover::before,
.eye-r:hover::before {
    height: calc(100% + 1px);
    border-radius: 0 0 50% 50% / 0 0 30% 30%;
}

.eye-l::after,
.eye-r::after {
    content: '';
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--cat-color);
    -webkit-animation: wink 5s linear infinite;
    animation: wink 5s linear infinite;
}

@-webkit-keyframes wink {
    from,
    96%,
    to {
        height: 0;
        border-radius: 0 0 50% 50% / 0;
    }
    98% {
        height: 100%;
        border-radius: 0 0 50% 50% / 0 0 30% 30%;
    }
}

@keyframes wink {
    from,
    96%,
    to {
        height: 0;
        border-radius: 0 0 50% 50% / 0;
    }
    98% {
        height: 100%;
        border-radius: 0 0 50% 50% / 0 0 30% 30%;
    }
}

.pupil {
    position: absolute;
    top: 20%;
    left: 20%;
    width: 60%;
    padding-top: 60%;
    background-color: rgba(0, 0, 0, 1);
    border-radius: 50%;
    transform: translate3d(-25%, -25%, 0);
    transition: transform 0.1s ease-out;
}

.nose {
    position: absolute;
    left: 45.454545%;
    bottom: 30%;
    width: 9.090909%;
    height: 4%;
    background-color: rgba(255, 192, 203, 1);
    border-radius: 50% / 10% 10% 90% 90%;
}

.nose:hover {
    -webkit-animation: nose 0.8s ease-in-out infinite;
    animation: nose 0.8s ease-in-out infinite;
}

@-webkit-keyframes nose {
    from,
    25%,
    50%,
    to {
        transform: translate3d(0, 0, 0);
    }
    12.5%,
    37.5% {
        transform: translate3d(0, 20%, 0);
    }
}

@keyframes nose {
    from,
    25%,
    50%,
    to {
        transform: translate3d(0, 0, 0);
    }
    12.5%,
    37.5% {
        transform: translate3d(0, 20%, 0);
    }
}
