/* Base config */
:root {
    --color-dark: #0b001a;
    --color-light: #e9deff;
    --color-purple: #1e0044;
}

/* Fonts */
@font-face {
    font-family: 'Crimson Text';
    src: url('./assets/CrimsonText-Italic.ttf') format('truetype');
    font-weight: 100 900;
    font-style: italic;
}

@font-face {
    font-family: 'Montserrat';
    src: url('./assets/Montserrat-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
}

body {
    font-family: 'Montserrat', sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

.body {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 2.4rem;
    line-height: 120%;
    letter-spacing: -0.04em;
}

em {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    font-weight: 400;
}

h1 {
    font-weight: 500;
    font-size: 10rem;
    line-height: 105%;
    letter-spacing: -0.05em;
    margin: 0;
}

p {
    margin: 0;
}

h2 {
    font-size: 5rem;
    font-weight: 500;
    line-height: 120%;
    letter-spacing: -0.04em;
    margin: 0;
}

a,
button,
.label {
    color: var(--color-light);
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0;
    font-size: 1.4rem;
    font-weight: 500;
}

/* Basic layout */
html {
    background: var(--color-dark);
    color: var(--color-light);
    font-size: clamp(10px, 0.625vw + 1px, 13px);
}

@media (min-width: 1920px) {
    html {
        font-size: max(13px, calc(0.2586vw + 8.0345px));
    }
}

@media (max-width: 1440px) {
    html {
        font-size: clamp(8px, 0.5556vw + 0px, 10px);
    }
}

body {
    overflow: hidden;
    background: var(--color-purple);
    border-radius: 2rem;
    padding: 2rem 4rem;
    margin: 2rem;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 5rem;
    padding-bottom: 1rem;
}

main {
    height: calc(100vh - 8rem - 6rem); /* padding - header */
    display: grid;
    grid-template-rows: 1fr auto;
}

footer {
    display: flex;
    align-items: end;
    justify-content: space-between;
    padding-bottom: 1rem;
}

/* Header styling */
.logo {
    font-size: 2.2rem;
    width: fit-content;
    position: relative;

    &::before {
        content: '';
        position: absolute;
        border: 3px solid transparent;
        width: 125%;
        width: 115%;
        height: 0.75rem;
        left: -0.75rem;
        bottom: -1rem;
        border-radius: 50%;
        border-top-color: var(--color-light);
    }
}

nav {
    display: flex;
    gap: 2.4rem;

    a::after {
        content: '';
        display: inline-block;
        width: 1rem;
        height: 1rem;
        margin-left: 0.5rem;
        background-image: url('./assets/arrow.svg');
        background-size: contain;
        background-repeat: no-repeat;
    }
}

header button {
    cursor: pointer;
    box-shadow: 0px 0px 19px 9px rgba(162, 45, 247, 0.1),
        0px 0px 46.8519px rgba(162, 45, 247, 0.1),
        0px 0px 25.4815px rgba(162, 45, 247, 0.1),
        0px 0px 13px rgba(162, 45, 247, 0.1),
        0px 0px 6.51852px rgba(162, 45, 247, 0.1),
        0px 0px 3.14815px rgba(162, 45, 247, 0.1);
    border-radius: 2rem;
    padding: 1rem 1.5rem;
    text-transform: uppercase;
    outline: none;
    border: 0.1rem solid transparent;
    background: linear-gradient(var(--color-purple), var(--color-purple))
            padding-box,
        linear-gradient(90deg, #8338ec, #b923ff) border-box;

    &::after {
        content: '';
        display: inline-block;
        width: 1.2rem;
        height: 1.2rem;
        margin-left: 1rem;
        background-image: url('./assets/arrow.svg');
        background-size: contain;
        background-repeat: no-repeat;
    }
}

/* Hero section */
section {
    padding-top: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;

    .image-container {
        width: 45rem;
        height: 45rem;
        object-fit: cover;
        border-radius: 50%;
        margin: 0 auto;
        position: relative;
        overflow: hidden;

        img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        &::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            box-shadow: inset 5rem 5rem 5rem rgba(228, 206, 255, 0.5),
                inset -1rem -1rem 5rem rgba(30, 0, 68, 0.9);
        }
    }

    article {
        width: 50%;
    }

    em {
        background: linear-gradient(90deg, #8338ec, #b923ff);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        font-size: 11rem;
    }

    h1 {
        margin-bottom: 2.4rem;
    }
}

/* Footer section */
.music {
    cursor: pointer;
    position: relative;
    z-index: 2;

    img {
        width: 9rem;
        height: 9rem;
    }

    img:first-of-type {
        display: none;
    }

    &.active {
        img:last-of-type {
            display: none;
        }
        img:first-of-type {
            display: block;
        }
    }
}

/* Stars */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    mix-blend-mode: screen;
    opacity: 0;
    transform: translateY(-2rem) scale(1.1);
    transition: opacity 500ms, transform 500ms;
    visibility: hidden;

    &.active {
        opacity: 1;
        transform: translateY(0) scale(1);
        visibility: visible;
    }

    &.animate-out {
        transition: opacity 500ms, transform 500ms, visibility 500ms;
    }

    &.animate-in {
        animation: pulse 4s ease-in-out infinite alternate,
            float 8s ease-in-out infinite alternate;
    }
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0.005;
    }
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0) scale(1);
    }
    25% {
        transform: translateY(-1.5rem) translateX(1rem) scale(1.02);
    }
    50% {
        transform: translateY(-3rem) translateX(-0.5rem) scale(1.05);
    }
    75% {
        transform: translateY(-1.5rem) translateX(-2rem) scale(1.03);
    }
    100% {
        transform: translateY(0) translateX(0) scale(1);
    }
}

/* Mobile  */
@media (max-width: 850px) {
    html {
        font-size: calc(1vw + 3px);
    }

    nav {
        display: none;
    }

    .hero {
        article {
            width: 90%;
            position: relative;
            z-index: 1;
            top: -25%;
        }

        .image-container {
            position: absolute;
            bottom: 15%;
            left: 50%;
            transform: translateX(-50%);
        }
    }
}
