@import url('https://fonts.googleapis.com/css2?family=Montserrat&family=Rubik&display=swap');
@import './_variables.css';
@import './_animations.css';

@media (prefers-color-scheme: dark) {

    a:hover {
        color: #747bff;
    }

    button {
        background-color: #f9f9f9;
    }
}

@media (prefers-color-scheme: light) {

    a:hover {
        color: var(--hover-color);
    }

    button {
        background: var(--bg-color);
    }
}

:root {
    font-family: 'Rubik', sans-serif;
    line-height: 1.5;
    font-weight: 400;
    color-scheme: light dark;
    color: rgba(255, 255, 255, 0.87);
    background: linear-gradient(90deg, #020024 0%, #242424 100%);
    background: var(--bg-color);
    color-scheme: light dark;
}

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

html {
    scroll-behavior: smooth;
}

body {
    width: 100%;
    height: 100%;

    &.loaded {
        overflow: visible;

        .loading {
            animation: hide var(--hide-speed) linear forwards;
        }
    }

    .loading {
        width: 100vw;
        height: 100vh;
        position: absolute;
        background: var(--secondary-dark);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 2;
        display: none;

        &::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            border-radius: 50%;
            background: var(--loading-bg);
            box-shadow: var(--loading-box-shadow);
            animation: light var(--light-speed) linear infinite;
        }

        .start-btn {
            padding: 15px 3ch;
            background: transparent;
            border: 2px solid var(--primary);
            color: var(--primary);
            border-radius: var(--btn-border-radius);
            font-size: 20px;
            font-weight: 500;

            &:hover {
                background: var(--primary-dark);
                color: var(--secondary);
                border: 2px solid var(--secondary);
            }
        }
    }

    .neon {
        transition-duration: .3s;
        transition-timing-function: cubic-bezier(.4, 0, .2, 1);
        inset: 0;
        position: absolute;
        pointer-events: none;
        z-index: 5;
    }

    .btn {
        min-width: 100px;
        width: auto;
        border-radius: var(--btn-border-radius);
        display: flex;
        justify-content: center;
        align-items: center;
        background: none;
        font-size: 16px;
        font-weight: 600;
        color: var(--secondary);
        text-decoration: inherit;
        position: relative;
        padding: 0.25rem 0.75rem;
        opacity: 0;
        text-wrap: nowrap;

        &.cta {
            overflow: hidden;
            position: relative;
            background: var(--bg-btn-animation);
            transition-duration: 300ms;
            transition-property: all;
            transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
            border: var(--border-cta);
            padding: 0.5rem 0.75rem;

            span {
                z-index: 1;
            }

            &:hover {
                color: var(--secondary-dark);
                border: 1px solid var(--hover-color);
                background: var(--bg-btn-animation__hover);

                &::after {
                    display: none;
                }

                .bg-mask {
                    background: var(--bg-btn-animation__hover);
                }

                .border-animation__container {
                    .border-animation__box {
                        .border-animation__star {
                            background: var(--bg-btn-animation-star__hover)
                        }
                    }
                }
            }

            .bg-mask {
                position: absolute;
                background: var(--bg-btn-animation);
                border-radius: 100px;
                inset: 0.1em;
            }

            .border-animation__container {
                position: absolute;
                inset: 0px;
                container-type: size;

                .border-animation__box {
                    position: absolute;
                    inset: 0px;
                    height: 100cqh;
                    animation: slide var(--btn-cta-speed) ease-in-out infinite alternate;
                    aspect-ratio: 1;

                    .border-animation__star {
                        position: absolute;
                        width: auto;
                        inset: -100%;
                        transform: translate(0, 0) rotate(0deg) skewX(0) skewY(0) scaleX(1) scaleY(1);
                        background: var(--bg-btn-animation-star);
                        translate: 0 0;
                        animation: spin calc(var(--btn-cta-speed) * 2) linear infinite;
                    }
                }
            }
        }

        a {
            font-weight: 600;
            color: var(--primary);
        }
    }

    h2 {
        font-size: 2em;
        text-align: center;
        width: max-content;
        position: absolute;
        transform-style: preserve-3d;
    }

    section:nth-child(even) h2 {
        right: 0;
    }

    header {
        height: 35vh;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        flex-direction: column;
        width: 100%;
        position: relative;

        .logo {
            width: 200px;
            opacity: 0;
            animation: show var(--show-speed) 0.3s linear forwards;

            svg {
                fill: var(--secondary);
            }
        }

        nav {
            width: 100%;

            ul {
                text-decoration: none;
                display: flex;
                justify-content: center;
                align-items: center;
                width: 100%;
                gap: 5%;
                flex-wrap: wrap;

                li {
                    list-style: none;
                    width: 40%;
                    margin: 10px;

                    a {
                        &.active {
                            color: var(--primary-dark);

                            &::after {
                                content: '';
                                background: var(--primary);
                            }
                        }

                        &::after {
                            content: '';
                            position: absolute;
                            width: 0;
                            height: 2px;
                            background: var(--hover-color);
                            bottom: 0;
                            transition: width 0.5s;
                        }

                        &:hover {
                            color: var(--hover-color);

                            &::after {
                                width: 50%;
                            }
                        }
                    }
                }
            }
        }

        ul li:nth-child(1) .btn {
            animation: show var(--show-speed) 0.4s linear forwards;
        }

        ul li:nth-child(2) .btn {
            animation: show var(--show-speed) 0.5s linear forwards;
        }

        ul li:nth-child(3) .btn {
            animation: show var(--show-speed) 0.6s linear forwards;
        }

        ul li:nth-child(4) .btn {
            animation: show var(--show-speed) 0.7s linear forwards;
        }

        ul li:nth-child(5) .btn {
            animation: show var(--show-speed) 0.8s linear forwards;
        }

        .theme {
            opacity: 0;
            display: none;
            animation: show var(--show-speed) 0.9s linear forwards;

            label{
                position: relative;
                width: 60px;
                height: 30px;
                display: block;
                background: #dadada;
                border-radius: 100px;
                cursor: pointer;
                box-shadow: inset 0px 1.5px 0px rgba(0,0,0,0.3), inset 0px -1.5px 0px rgba(255,255,255,0.3);
            }

            label:after{
                content: '';
                position: absolute;
                height: 26px;
                width: 26px;
                background: linear-gradient(180deg,var(--primary-dark),#3a3a3a);
                border-radius: 100px;
                top: 2px;
                left: 2px;
                transition: 0.5s;
                box-shadow: 0 5px 10px rgba(0,0,0,0.2);
            }

            input:checked ~ label:after{
                left: 58px;
                transform: translateX(-100%);
                background: linear-gradient(180deg, var(--secondary),#3a3a3a);
            }

            input:checked ~ label{
                background: var(--primary-dark);
            }

            input{
                display: none;
            }
        }
    }

    .about {
        padding: 0.625rem 1.875rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-direction: column;
        opacity: 0;
        height: 65vh;
        animation: show var(--show-speed) 1s linear forwards;

        .presentation-box {
            width: 100%;

            h1 {
                margin: 10px 0;
                text-align: center;
                font-size: 2rem;

                strong {
                    color: var(--primary);
                }
            }

            p {
                width: 100%;
                font-size: 1.3rem;
            }
        }


        span {
            border: 2px solid var(--secondary);
            border-radius: 20px;
            padding: 15px 10px;

            svg {
                stroke: var(--secondary);
                animation: indicator var(--indicator-speed) ease-in-out infinite;
            }
        }
    }

    #jobs {
        width: 100%;
        height: auto;
        min-height: 50%;

        .jobs-panel {
            width: 100%;
            margin-top: 2rem;
            overflow: hidden;
            position: relative;

            .jobs-list {
                width: 100%;
                display: flex;
                justify-content: center;
                align-items: center;
                gap: 30px;
                padding: 5rem 1rem 3rem;

                .jobs-list-item {
                    width: 100%;
                    list-style: none;
                    max-width: 600px;

                    .job-container {
                        display: block;
                        width: 100%;
                        height: 100%;
                        transition: .5s;
                        position: relative;
                        border: 2px solid var(--secondary);
                        background: rgba(246, 246, 246, 0.2);
                        border-radius: 16px;
                        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
                        text-decoration: none;

                        &:hover {
                            transform: scale(1.1);
                        }

                        &::before {
                            content: '';
                            display: block;
                            position: absolute;
                            width: calc(100% - 4px);
                            height: calc(100% - 4px);
                            border: 2px solid var(--secondary);
                            background: rgb(0, 0, 0);
                            border-radius: 14px;
                            box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
                            z-index: -1;
                        }

                        .job-card {
                            display: flex;
                            flex-direction: column;
                            position: relative;
                            width: 100%;
                            height: 100%;
                            color: var(--primary-dark);

                            .job-info {
                                width: 100%;
                                padding: 1.5rem;
                                border-radius: 16px 16px 0 0;
                                background: var(--secondary);

                                h3 {
                                    font-size: 1.5rem;
                                    margin-bottom: 0.5rem;
                                    color: var(--primary-dark);
                                }

                                p {
                                    font-size: 1rem;
                                    color: var(--secondary-dark);
                                }
                            }


                            .skills-section {
                                width: 100%;
                                height: 45vh;
                                border-radius: 0 0 16px 16px;
                                overflow: hidden;
                                background: var(--bg-color);
                                position: relative;
                                display: flex;
                                align-items: center;

                                .job-skills {
                                    width: 100%;
                                    height: 85vh;
                                    position: absolute;
                                    display: flex;
                                    flex-wrap: wrap;
                                    align-items: center;
                                    align-content: flex-end;
                                    padding: 0 20px;

                                    .skill {
                                        display: flex;
                                        align-items: center;
                                        text-align: left;
                                        position: relative;
                                        padding: 5px 20px;
                                        color: var(--secondary);
                                        border: 1px solid var(--secondary);
                                        border-radius: 3PX;
                                        background: rgba(255, 255, 255, 0.2);
                                        top: -20%;
                                        position: absolute;
                                        animation: skills var(--skills-speed) linear infinite;
                                        width: 35%;

                                        &:nth-child(even) {
                                            left: 0;
                                            border-left: transparent;
                                            border-radius: 0 20px 20px 0;
                                            text-align: right;
                                            justify-content: right;
                                        }
                                        &:nth-child(odd) {
                                            right: 0;
                                            border-right: transparent;
                                            border-radius: 20px 0 0 20px;
                                        }


                                        &:nth-child(1) {
                                            animation-delay: calc(var(--skills-delay) * 1.5)  ;
                                        }
                                        &:nth-child(2) {
                                            animation-delay: calc(var(--skills-delay) * 1.4)  ;
                                        }
                                        &:nth-child(3) {
                                            animation-delay: calc(var(--skills-delay) * 1.3)  ;
                                        }
                                        &:nth-child(4) {
                                            animation-delay: calc(var(--skills-delay) * 1.2)  ;
                                        }
                                        &:nth-child(5) {
                                            animation-delay: calc(var(--skills-delay) * 1.1)  ;
                                        }
                                        &:nth-child(6) {
                                            animation-delay: calc(var(--skills-delay) * 0.9)  ;
                                        }
                                        &:nth-child(7) {
                                            animation-delay: calc(var(--skills-delay) * 0.8)  ;
                                        }
                                        &:nth-child(8) {
                                            animation-delay: calc(var(--skills-delay) * 0.7)  ;
                                        }
                                        &:nth-child(9) {
                                            animation-delay: calc(var(--skills-delay) * 0.6)  ;
                                        }
                                        &:nth-child(10) {
                                            animation-delay: calc(var(--skills-delay) * 0.5)  ;
                                        }
                                        &:nth-child(11) {
                                            animation-delay: calc(var(--skills-delay) * 0.4)  ;
                                        }
                                        &:nth-child(12) {
                                            animation-delay: calc(var(--skills-delay) * 0.3)  ;
                                        }
                                        &:nth-child(13) {
                                            animation-delay: calc(var(--skills-delay) * 0.2)  ;
                                        }
                                        &:nth-child(14) {
                                            animation-delay: calc(var(--skills-delay) * 0.1)  ;
                                        }
                                    }
                                }

                                .falling-star {
                                    pointer-events: none;
                                    position: absolute;
                                    height: .125rem;
                                    width: .125rem;
                                    transform: translate(0, 0) rotate(215deg) skewX(0) skewY(0) scaleX(1) scaleY(1);
                                    animation: fallingStar 0s linear infinite;
                                    border-radius: 9999px;
                                    background-color: rgb(100 116 139/1);
                                    top: 100px;
                                    left: 100px;

                                    &:nth-of-type(1) {
                                        top: 150px;
                                        left: 150px;
                                        animation-duration: 2s;
                                        animation-delay: 0.2s;

                                        &::after {
                                            animation-duration: 2s;
                                            animation-delay: 0.2s;
                                        }
                                    }

                                    &:nth-of-type(2) {
                                        top: 10px;
                                        left: 10px;
                                        animation-duration: 4s;
                                        animation-delay: 0.1s;

                                        &::after {
                                            animation-duration: 4s;
                                            animation-delay: 0.1s;
                                        }
                                    }

                                    &:nth-of-type(3) {
                                        top: 250px;
                                        left: 70px;
                                        animation-duration: 5s;
                                        animation-delay: 0.25s;

                                        &::after {
                                            animation-duration: 5s;
                                            animation-delay: 0.25s;
                                        }
                                    }

                                    &:nth-of-type(4) {
                                        top: 100px;
                                        left: 100px;
                                        animation-duration: 6s;
                                        animation-delay: 0.2s;

                                        &::after {
                                            animation-duration: 6s;
                                            animation-delay: 0.2s;
                                        }
                                    }

                                    &:nth-of-type(5) {
                                        top: 150px;
                                        left: 50px;
                                        animation-duration: 3s;
                                        animation-delay: 0.3s;

                                        &::after {
                                            animation-duration: 3s;
                                            animation-delay: 0.3s;
                                        }
                                    }

                                    &:nth-of-type(6) {
                                        top: 20px;
                                        left: 150px;
                                        animation-duration: 1.5s;
                                        animation-delay: 0.5s;

                                        &::after {
                                            animation-duration: 1.5s;
                                            animation-delay: 0.5s;
                                        }
                                    }

                                    &::after {
                                        content: '';
                                        pointer-events: none;
                                        position: absolute;
                                        top: 50%;
                                        z-index: -10;
                                        height: 1px;
                                        width: 50px;
                                        transform: translate(0, -50%) rotate(0) skewX(0) skewY(0) scaleX(1) scaleY(1);
                                        background-image: linear-gradient(to right, #888b64, transparent);
                                        animation: trail var(--trail-speed) linear infinite;
                                    }
                                }

                                .stars {
                                    background: transparent;
                                    position: absolute;
                                    animation: stars var(--stars-speed) linear infinite;

                                    &::after {
                                        content: '';
                                        position: absolute;
                                        left: 300px;
                                        background: transparent;
                                    }

                                    &:nth-of-type(7) {
                                        width: 0.5px;
                                        height: 0.5px;
                                        box-shadow: 10px 70px #FFF, 103px -138px #FFF, 290px -104px #FFF, 165px -200px #FFF, 15px -84px #FFF, -10px -70px #FFF, -103px 138px #FFF, -290px 104px #FFF, -165px 200px #FFF, -15px 84px #FFF;

                                        &::after {
                                            width: 0.5px;
                                            height: 0.5px;
                                            left: -200px;
                                            box-shadow: 130px 100px #FFF, 33px -178px #FFF, 219px -134px #FFF, 225px 50px #FFF, 274px -194px #FFF, -130px -100px #FFF, -33px 178px #FFF, -219px 134px #FFF, -225px -50px #FFF, -274px 194px #FFF;
                                        }
                                    }

                                    &:nth-of-type(8) {
                                        width: 1.5px;
                                        height: 1.5px;
                                        box-shadow: 80px 50px #FFF, 33px 182px #FFF, 189px 146px #FFF, 235px -50px #FFF, 264px 176px #FFF, -80px -50px #FFF, -33px -182px #FFF, -189px -146px #FFF, -235px 50px #FFF, -264px -176px #FFF;

                                        &::after {
                                            width: 2px;
                                            height: 2px;
                                            top: -200px;
                                            box-shadow: 10px 70px #FFF, 103px -138px #FFF, 290px -104px #FFF, 165px -200px #FFF, 15px -84px #FFF, -10px -70px #FFF -103px 138px #FFF, -290px 104px #FFF, -165px 200px #FFF, -15px 84px #FFF;
                                        }
                                    }

                                    &:nth-of-type(9) {
                                        width: 2px;
                                        height: 2px;
                                        box-shadow: 130px 100px #FFF, 33px -178px #FFF, 219px -134px #FFF, 225px 50px #FFF, 274px -194px #FFF, -130px -100px #FFF, -33px 178px #FFF, -219px 134px #FFF, -225px -50px #FFF, -274px 194px #FFF;

                                        &::after {
                                            width: 2px;
                                            height: 2px;
                                            bottom: 200px;
                                            box-shadow: 40px 100px #FFF, 63px 152px #FFF, 249px 116px #FFF, 125px 0px #FFF, 154px 196px #FFF, -40px -100px #FFF, -63px -152px #FFF, -249px -116px #FFF, -125px 0px #FFF, -154px -196px #FFF;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                li:first-child a:hover {
                    transform: scale(1.1) translate(10%);
                }

                li:last-child a:hover {
                    transform: scale(1.1) translate(-10%);
                }

            }
        }
    }

    #services {
        padding: 0.625rem 1rem;
        overflow: hidden;
        position: relative;

        .skills-panel {
            margin-top: 5rem;
            display: grid;
            grid-gap: 1px;
            grid-template-columns: 1fr 1fr;
            background: radial-gradient(circle, rgba(246, 246, 246, 0.6) 0%, rgba(0, 0, 0, 0) 60%);

            .skill-item {
                width: 100%;
                padding: 10px;
                position: relative;
                background-color: var(--bg-color);
                display: flex;
                align-items: center;
                justify-content: center;

                svg {
                    height: 90%;
                }
            }
        }
    }
}

@media screen and (min-width: 1200px) {
    body {
        .cursor-wrap {
            flex-direction: column;
            justify-content: center;
            align-items: center;
            display: flex;
            position: fixed;
            top: 0%;
            bottom: 0%;
            left: 0%;
            right: 0%;
            pointer-events: none;
        }

        h2 {
            font-size: 5em;
        }

        header {
            height: 80px;
            padding: 20px 80px;
            justify-content: space-between;
            flex-direction: row;

            nav {
                width: auto;

                ul {
                    width: 50%;
                    justify-content: space-between;
                    flex-wrap: nowrap;

                    li {
                        width: auto;
                    }
                }
            }
        }

        .about {
            padding: 20px 80px;
            width: 100%;
            height: calc(100vh - 80px);

            .presentation-box {
                h1 {
                    margin-top: 15rem;
                    font-size: 5rem;
                    text-align: left;
                }

                p {
                    font-size: 2rem;
                    width: 60%;
                }
            }

        }

        #jobs {
            .jobs-panel {
                .jobs-list {
                    width: 100%;
                    height: 70vh;
                    padding: 10rem 3.75rem 3.75rem;

                    .jobs-list-item {
                        width: 70vw;
                        height: auto;
                        max-width: 100%;

                        .job-container {
                            .job-card {
                                flex-direction: row-reverse;

                                .job-info {
                                    width: 60%;
                                    padding: 30px;
                                    border-radius: 0 16px 16px 0;

                                    h3 {
                                        font-size: 2rem;
                                    }

                                    p {
                                        font-size: 1.2rem;
                                    }
                                }

                                .skills-section {
                                    width: 40%;
                                    max-height: 45vh;
                                    border-radius: 16px 0 0 16px;

                                    .job-skills  {
                                        height: 45vh;

                                        .skill {
                                            width: 45%;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        #services {
            .skills-panel {
                margin: 8rem 0 5rem;
                padding: 0 20rem;
                grid-template-columns: 1fr 1fr 1fr 1fr;
            }
        }
    }

    .btn {
        font-size: 18px;
    }
}