:root {
    --background-color: #060612;
    --text-color: #d1def5;
    --secondary-text-color: #849ecd;
    --accent-color: #0f1452;
}

html {
    overflow-x: hidden;
    width: 100vw;
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
    font-family: "Space Grotesk", sans-serif;
    color: var(--text-color);
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100vw;
}

/* Common style to all sections */

.gradientBorder::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 30px;
    padding: 1px;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.25),
        rgba(255, 255, 255, 0.1)
    );
    mask:
        linear-gradient(white 0 0) content-box,
        linear-gradient(white 0 0);
    -webkit-mask:
        linear-gradient(white 0 0) content-box,
        linear-gradient(white 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    pointer-events: none;
    z-index: -1;
}

.gradientText {
    background: linear-gradient(
        to bottom,
        var(--text-color),
        var(--secondary-text-color)
    );
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    line-height: 1;
}

i {
    margin-left: 8px;
    color: inherit;
}

/* Navbar */

nav {
    background-color: transparent;
    backdrop-filter: blur(25px);
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    height: 60px;
    width: 60vw;
    border-radius: 30px;
    z-index: 1000;
    margin: 0 auto;
}

.navList {
    position: relative;
    list-style: none;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 10px 30px;
    gap: 5vw;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2vw;
}

nav li {
    font-size: 16px;
    font-weight: bold;
}

nav li > a {
    text-decoration: none;
}

li a:hover {
    text-decoration: underline;
}

.navList > li:first-child {
    margin-right: auto;
    font-size: 24px;
    font-weight: bolder;
}

.navList > li:first-child > a:hover {
    text-decoration: none;
}

.navList > li:last-child {
    position: relative;
    right: -1em;
    margin-left: auto;
}

.navList > li:last-child a {
    position: relative;
    color: black;
    padding: 0.5em 1em;
    border-radius: 30px;
    background: linear-gradient(var(--text-color), var(--secondary-text-color));
    overflow: hidden;
    transition: color 0.3s ease-in-out;
    z-index: 2000;
    white-space: nowrap;
}

.navList > li:last-child a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 30px;
    background-color: var(--text-color);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: -1;
}

.navList > li:last-child a:hover::after {
    opacity: 1;
}

.navList > li:last-child a:hover {
    color: black;
    text-decoration: none;
    z-index: 2001;
}

.navLinks li:last-child {
    display: none;
}

/* Sections in general */

header,
section,
footer {
    padding: 0 20px;
    max-width: 100vw;
    overflow-x: hidden;
}

.sectionTitle {
    font-size: 32px;
    font-weight: bold;
    margin: 0;
}

/* Hero section */

#hero {
    width: 100vw;
    height: 100vh;
}

.mainTexts {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.mainTexts h1 {
    font-size: 100px;
    font-weight: bold;
    letter-spacing: -6px;
    text-align: center;
    margin: 0;
    margin-bottom: 5px;
    max-width: 90vw;
    word-wrap: break-word;
}

.mainTexts h2 {
    color: var(--secondary-text-color);
    font-size: 24px;
    font-weight: 500;
    text-transform: uppercase;
    margin: 0;
}

.ctaAbout {
    opacity: 0.8;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    text-decoration: none;
}

.ctaAbout p {
    font-weight: 500;
    font-size: 16px;
}

.ctaAbout svg {
    fill: var(--text-color);
    animation: ctaArrowDown 0.5s infinite alternate;
}

@keyframes ctaArrowDown {
    from {
        transform: translateY(0) rotate(90deg);
    }
    to {
        transform: translateY(-5px) rotate(90deg);
    }
}

/* About section */

#about {
    position: relative;
    width: 100vw;
    height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    scroll-margin-top: calc(50vh - 35vh);
}

.aboutText {
    position: relative;
    border-radius: 20px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.25);
    padding: 50px;
    height: 400px;
    max-width: 550px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(25px);

    transition: all 0.3s ease;
}

.aboutText p {
    font-size: 16px;
    margin: 0;
}

.aboutText p:last-of-type {
    align-self: start;
}

.aboutImgWrapper {
    position: relative;
    width: 402px;
    height: 402px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.25);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;

    transition: all 0.3s ease;
}

.aboutText:hover,
.aboutImgWrapper:hover {
    transform: scale(1.05);
}

.aboutImg {
    width: 400px;
    height: 400px;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.aboutImg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Skills section */

#skills {
    position: relative;
    width: 100vw;
    height: 30vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 50px;
    scroll-margin-top: calc(50vh - 15vh);
}

.infiniteCarousel {
    max-width: 600px;
}

.carouselContainer {
    display: flex;
    gap: 64px;
    padding-block: 1em;
    flex-wrap: wrap;
}

.carouselEl {
    gap: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carouselLabel {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.infiniteCarousel[data-animated = true] {
    overflow: hidden;
    mask: linear-gradient(to right,
        transparent,
        white 20%,
        white 80%,
        transparent);
    -webkit-mask: linear-gradient(to right,
        transparent,
        white 20%,
        white 80%,
        transparent);
}

.infiniteCarousel[data-animated = true] .carouselContainer {
    width: fit-content;
    flex-wrap: nowrap;
    animation: scroll 30s linear infinite;
}

@keyframes scroll {
    to {
        transform: translate(calc(-50% - 32px));
    }
}

/* Projects section */

#projects {
    position: relative;
    width: 100vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 50px;
    scroll-margin-top: calc(50vh - 45vh);
}

.projectsCtn {
    display: flex;
    gap: 50px;
}

.projectCard {
    background: transparent;
    backdrop-filter: blur(25px);
    min-height: 400px;
    width: 450px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.25);
    padding: 20px;
    padding-bottom: 35px;
    border-radius: 30px;
    overflow: hidden;

    transition: all 0.3s ease;
}

.projectCard:hover {
    transform: scale(1.05);
}

.projectImg {
    background-size: cover;
    height: 55%;
    width: 100%;
    border-radius: 10px;
}

.projectInfos {
    height: 50%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.projectTitle {
    margin: 16px 0 8px 0;
}

.projectDesc {
    margin: 0;
    flex-grow: 1;
    margin-bottom: 10px
}

.projectButtons {
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.projectButtons a {
    text-decoration: none;
}

.projectLiveDemo {
    color: #4182D1;
}

.projectLiveDemo:hover {
    color: #63a2ee;
}

.projectDetails {
    background: rgb(67, 67, 86, 0.25);
    padding: 0.5em 1em;
    border-radius: 10px;
    outline: 0px solid rgb(67, 67, 86, 0.25);
}

.projectButton,
.projectButton i {
    transition: all 0.2s ease;
}

.projectDetails:hover {
    transform: scale(1.05);
    background: rgba(67, 69, 86, 0.5);
    outline: 0px solid rgba(67, 69, 86, 0.5);
}

/* Contact section */

#contact {
    position: relative;
    width: 100vw;
    height: 20vh;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 200px;
    overflow: hidden;
}

.contact-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1em;
}

.contact-main h3 {
    margin: 0;
}

.contact-mail {
    font-size: 40px;
    font-weight: bolder;
    text-decoration-color: var(--secondary-text-color);
    cursor: pointer;
    background: linear-gradient(
        to bottom,
        var(--text-color) 0%,
        var(--text-color) 50%,
        var(--secondary-text-color) 100%
        );
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
        background-size: 100% 200%;
        background-position: bottom;
        margin: 0;

        transition: all 0.3s ease;
    }
    
.contact-mail:hover {
    background-position: top;
    text-decoration-color: var(--text-color);
}

.contact-main p {
    color: var(--secondary-text-color);
    font-weight: 600;
    margin: 0;
}

.contact-link {
    animation-duration: 0.3s;
    animation-fill-mode: both;
}

.contact-link:hover {
    animation-name: contactLinkHover;
}

.contact-link:not(:hover) {
    animation-name: contactLinkHoverOut;
}

@keyframes contactLinkHover {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.25);
    }
}

@keyframes contactLinkHoverOut {
    from {
        transform: scale(1.25);
    }
    to {
        transform: scale(1);
    }
}