* {
    border: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap');
* {
    box-sizing: border-box;
}

body {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* background-image: radial-gradient( circle farthest-corner at 10% 20%, rgba(0, 152, 155, 1) 0.1%, rgba(0, 94, 120, 1) 94.2%);
    background-size: 100%; */
    font-family: 'Montserrat', sans-serif;
    overflow: hidden;
}

.loading-container {
    width: 100%;
    max-width: 520px;
    text-align: center;
    color: #fff;
    position: relative;
    margin: 0 32px;
    &:before {
        content: '';
        position: absolute;
        width: 100%;
        height: 3px;
        background-color: #fff;
        bottom: 0;
        left: 0;
        border-radius: 10px;
        animation: movingLine 2.4s infinite ease-in-out;
    }
}

@keyframes movingLine {
    0% {
        opacity: 0;
        width: 0;
    }
    33.3%,
    66% {
        opacity: 0.8;
        width: 100%;
    }
    85% {
        width: 0;
        left: initial;
        right: 0;
        opacity: 1;
    }
    100% {
        opacity: 0;
        width: 0;
    }
}

.loading-text {
    font-size: 5vw;
    line-height: 64px;
    letter-spacing: 10px;
    margin-bottom: 32px;
    display: flex;
    justify-content: space-evenly;
    span {
        animation: moveLetters 2.4s infinite ease-in-out;
        transform: translatex(0);
        position: relative;
        display: inline-block;
        opacity: 0;
        text-shadow: 0px 2px 10px rgba(46, 74, 81, 0.3);
    }
}

@for $i from 1 through 7 {
    .loading-text span:nth-child(#{$i}) {
        animation-delay: $i * 0.1s;
    }
}

@keyframes moveLetters {
    0% {
        transform: translateX(-15vw);
        opacity: 0;
    }
    33.3%,
    66% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(15vw);
        opacity: 0;
    }
}

.socials {
    position: fixed;
    bottom: 16px;
    right: 16px;
    display: flex;
    align-items: center;
}

.social-link {
    color: #fff;
    display: flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    margin-right: 12px;
}

:root {
    --hue: 223;
    --bg: hsl(var(--hue), 90%, 90%);
    --fg: hsl(var(--hue), 90%, 10%);
    --primary: hsl(var(--hue), 90%, 50%);
    --trans-dur: 0.3s;
    font-size: calc(16px + (32 - 16) * (100vw - 320px) / (2560 - 320));
}

body {
    background-color: var(--bg);
    color: var(--fg);
    display: flex;
    font: 1em/1.5 sans-serif;
    height: 100vh;
    transition: background-color var(--trans-dur), color var(--trans-dur);
}

.bike {
    display: block;
    margin: auto;
    width: 16em;
    height: auto;
}

.bike__body,
.bike__front,
.bike__handlebars,
.bike__pedals,
.bike__pedals-spin,
.bike__seat,
.bike__spokes,
.bike__spokes-spin,
.bike__tire {
    animation: bikeBody 3s ease-in-out infinite;
    stroke: var(--primary);
    transition: stroke var(--trans-dur);
}

.bike__front {
    animation-name: bikeFront;
}

.bike__handlebars {
    animation-name: bikeHandlebars;
}

.bike__pedals {
    animation-name: bikePedals;
}

.bike__pedals-spin {
    animation-name: bikePedalsSpin;
}

.bike__seat {
    animation-name: bikeSeat;
}

.bike__spokes,
.bike__tire {
    stroke: currentColor;
}

.bike__spokes {
    animation-name: bikeSpokes;
}

.bike__spokes-spin {
    animation-name: bikeSpokesSpin;
}

.bike__tire {
    animation-name: bikeTire;
}


/* Dark theme */

@media (prefers-color-scheme: dark) {
     :root {
        --bg: hsl(var(--hue), 90%, 10%);
        --fg: hsl(var(--hue), 90%, 90%);
    }
}


/* Animations */

@keyframes bikeBody {
    from {
        stroke-dashoffset: 79;
    }
    33%,
    67% {
        stroke-dashoffset: 0;
    }
    to {
        stroke-dashoffset: -79;
    }
}

@keyframes bikeFront {
    from {
        stroke-dashoffset: 19;
    }
    33%,
    67% {
        stroke-dashoffset: 0;
    }
    to {
        stroke-dashoffset: -19;
    }
}

@keyframes bikeHandlebars {
    from {
        stroke-dashoffset: 10;
    }
    33%,
    67% {
        stroke-dashoffset: 0;
    }
    to {
        stroke-dashoffset: -10;
    }
}

@keyframes bikePedals {
    from {
        animation-timing-function: ease-in;
        stroke-dashoffset: -25.133;
    }
    33%,
    67% {
        animation-timing-function: ease-out;
        stroke-dashoffset: -21.991;
    }
    to {
        stroke-dashoffset: -25.133;
    }
}

@keyframes bikePedalsSpin {
    from {
        transform: rotate(0.1875turn);
    }
    to {
        transform: rotate(3.1875turn);
    }
}

@keyframes bikeSeat {
    from {
        stroke-dashoffset: 5;
    }
    33%,
    67% {
        stroke-dashoffset: 0;
    }
    to {
        stroke-dashoffset: -5;
    }
}

@keyframes bikeSpokes {
    from {
        animation-timing-function: ease-in;
        stroke-dashoffset: -31.416;
    }
    33%,
    67% {
        animation-timing-function: ease-out;
        stroke-dashoffset: -23.562;
    }
    to {
        stroke-dashoffset: -31.416;
    }
}

@keyframes bikeSpokesSpin {
    from {
        transform: rotate(0);
    }
    to {
        transform: rotate(3turn);
    }
}

@keyframes bikeTire {
    from {
        animation-timing-function: ease-in;
        stroke-dashoffset: 56.549;
        transform: rotate(0);
    }
    33% {
        stroke-dashoffset: 0;
        transform: rotate(0.33turn);
    }
    67% {
        animation-timing-function: ease-out;
        stroke-dashoffset: 0;
        transform: rotate(0.67turn);
    }
    to {
        stroke-dashoffset: -56.549;
        transform: rotate(1turn);
    }
}