/*===== GOOGLE FONTS =====*/
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700&display=swap');

/*===== VARIABLES CSS =====*/
:root{
    --header-height: 3rem;
    --font-medium: 500;
}
/*===== Colores =====*/
:root{
    --first-color: #5361FF;
    --white-color: #FAFAFF;
    --dark-color: #2a3b47;
    --text-color: #697477;
}
/*===== Fuente y tipografia =====*/
:root{
    --body-font: 'Montserrat', sans-serif;

    --big-font-size: 6.25rem;
    --h2-font-size: 1.25rem;
    --normal-font-size: .938rem;
    --small-font-size: .813rem;

    @media screen and (min-width: 768px){
        --big-font-size: 10.5rem;
        --h2-font-size: 2rem;
        --normal-font-size: 1rem;
        --small-font-size: .875rem;
    }
}
/*===== Margenes =====*/
:root{
    --mb-1: 0.5rem;
    --mb-2: 1rem;
    --mb-3: 1.5rem;
    --mb-4: 2rem;
}
/*===== z index =====*/
:root{
    --z-fixed: 100;
}

/*===== BASE =====*/
*,::before,::after{
    box-sizing: border-box;
}
html{
    scroll-behavior: smooth;
}
body{
    margin: var(--header-height) 0 0 0;
    font-family: var(--body-font);
    font-size: var(--normal-font-size);
    font-weight: var(--font-medium);
    color: var(--text-color);
    line-height: 1.6;
}
h1,h2,p{
    margin: 0;  
}
ul{
    margin: 0;
    padding: 0;
    list-style: none;
}
a{
    text-decoration: none;
    color: var(--text-color);
}
img{
    max-width: 100%;
    height: auto;
    display: block;
}

/*===== CLASS CSS ===== */
.section{
    padding: 3rem 0;

    &-title{
        position: relative;
        font-size: var(--h2-font-size);
        color: var(--dark-color);
        margin: var(--mb-4) 0;
        text-align: center;
    
        &::after{
            position: absolute;
            content: '';
            width: 32px;
            height: .18rem;
            left: 0;
            right: 0;
            margin: auto;
            top: 2rem;
            background-color: var(--first-color);
        }
    }
}
/*===== LAYOUT =====*/
.bd-grid{
    max-width: 1024px;
    display: grid;
    grid-template-columns: 100%;
    grid-column-gap: 2rem;
    width: calc(100% - 2rem);
    margin-left: var(--mb-2);
    margin-right: var(--mb-2);
}
.l-header{
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-fixed);
    background-color: var(--first-color);
}

/*===== NAV =====*/
.nav{
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;

    &__menu{
        @media screen and (max-width: 768px){
            position: fixed;
            top: var(--header-height);
            right: -100%;
            width: 80%;
            height: 100%;
            padding: 2rem;
            background: rgba(255, 255, 255, 0.3);
            transition: .5s;
            backdrop-filter: blur(10px);
        }
    }
    &__item{
        margin-bottom: var(--mb-4);
    }
    &__link{
        position: relative;
        color: var(--dark-color);

        &:hover{
            color: var(--first-color);
        }
    }
    &__logo{
        color: var(--white-color);
    }
    &__toggle{
        color: var(--white-color);
        font-size: 1.5rem;
        cursor: pointer;
    }
}

/*=== Show menu ===*/
.show{
    right: 0;
}
/*Active menu*/
.active::after{
    position: absolute;
    content: '';
    width: 100%;
    height: 0.18rem;
    left: 0;
    top: 2rem;
    background-color: var(--first-color);
}

/*===== HOME =====*/
.home{
    position: relative;
    background-color: var(--first-color);
    overflow: hidden;
    
    &__container{
        height: calc(100vh - var(--header-height));
        row-gap: 5rem;
    }
    &__title{
        align-self: flex-end;
        font-size: var(--big-font-size);
        color: var(--white-color);
        line-height: .8;

        & span{
            text-shadow: 0 20px 25px rgba(0, 0, 0, .5);
        }
    }
    &__scroll{
        align-self: flex-end;
        padding-bottom: var(--mb-4);

        &-link{
            writing-mode: vertical-lr;
            transform: rotate(-180deg);
            color: var(--white-color);
        }
    }

    &__img{
        position: absolute;
        right: 0;
        bottom: 0;
        width: 295px;
    }
}

/* ===== ABOUT =====*/
.about{
    &__container{
        justify-items: center;
        row-gap: 2rem;
        text-align: center;
    }
    &__img{
        display: flex;
        justify-content: center;
        padding-top: 1rem;
        width: 120px;
        height: 120px;
        background-color: var(--first-color);
        border-radius: 50%;
        overflow: hidden;

        & img{
            width: 100px;
        }
    }
    &__subtitle{
        font-size: var(--h2-font-size);
        color: var(--first-color);
        margin-bottom: var(--mb-1);
    }
    &__text{
        margin-bottom: var(--mb-4);
    }
    &__profession{
        display: block;
        margin-bottom: var(--mb-4);
    }
    &__social{
        &-icon{
            font-size: 1.4rem;
            margin: 0 var(--mb-1);

            &:hover{
                color: var(--first-color);
            }
        }
    }
}
/* ===== SKILLS =====*/
.skills{
    &__container{
        row-gap: 2rem;
    }
    &__subtitle{
        color: var(--first-color);
        margin-bottom: var(--mb-3);
    }
    &__name{
        display: inline-block;
        font-size: var(--small-font-size);
        margin-right: var(--mb-2);
        margin-bottom: var(--mb-3);
        padding: .25rem .5rem ;
        background-color: var(--white-color);
        border-radius: .25rem;

        &:hover{
            background-color: var(--first-color);
            color: var(--white-color);
        }
    }
    &__img{
        & img{
            border-radius: .5rem;
        }
    }
}
/* ===== PORTFOLIO =====*/
.portfolio{
    background-color: var(--white-color);

    &__container{
        justify-items: center;
        row-gap: 2rem;
    }
    &__img{
        position: relative;
        overflow: hidden;
        
        & img{
            border-radius: .5rem;
        }
        
        &:hover .portfolio__link{
            bottom: 0;
        }
    }

    &__link{
        position: absolute;
        bottom: -100%;
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        background: rgba(255, 255, 255, 0.3);
        border-radius: .5rem;
        cursor: pointer;
        backdrop-filter: blur(10px);
        transition: .3s;

        &-name{
            color: var(--dark-color);
        }
    }
}
/* ===== CONTACT =====*/
.contact{
    &__container{
        row-gap: 2rem;
    }
    &__subtitle{
        font-size: var(--normal-font-size);
        color: var(--first-color);
    }
    &__text{
        display: inline-block;
        margin-bottom: var(--mb-2);
    }
    &__inputs{
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        column-gap: 1rem;
    }
    &__input{
        width: 100%;
        padding: .8rem;
        outline: none;
        border: 1.5px solid var(--dark-color);
        font-size: var(--normal-font-size);
        margin-bottom: var(--mb-4);
        border-radius: .5rem;
    }
    &__button{
        display: block;
        background-color: var(--first-color);
        color: var(--white-color);
        padding: .75rem 2.5rem;
        margin-left: auto;
        border-radius: .5rem; 
        border: none;
        outline: none;
        font-size: var(--normal-font-size);
        cursor: pointer;
    }
}
/* ===== FOOTER=====*/
.footer{
    background-color: var(--dark-color);

    &__container{
        row-gap: 2rem;
    }
    &__title{
        font-size: var(--normal-font-size);
        color: var(--white-color);
        margin-bottom: var(--mb-2);
    }
    &__link{
        padding: .25rem 0;

        &:hover{
            color: var(--first-color);
        }
    }
    &__social{
        font-size: 1.4rem;
        margin-right: var(--mb-1);

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

/* ===== MEDIA QUERIES=====*/
/* For small devices */
@media screen and (max-width: 320px) {
    .home__img{
        width: 230px;
    }
}

@media screen and(min-width: 768px){
    body{
        margin: 0;
    }
    .section{
        padding-top: 4rem;

        &-title{
            margin-bottom: 3rem;
            
            &::after{
                width: 64px;
                top: 3rem;
            }
        }
    }

    .nav{
        height: calc(var(--header-height) + 1rem);

        &__list{
            display: flex;
        }
        &__item{
            margin-left: var(--mb-4);
            margin-bottom: 0;
        }
        &__toggle{
            display: none;
        }
        &__link{
            color: var(--white-color);

            &:hover{
                color: var(--white-color);
            }
        }
    }
    .active::after{
        background-color: var(--white-color);
    }

    .home{
        &__container{
            height: 100vh;
            grid-template-rows: 1.7fr 1fr;
            row-gap: 0;
        }
        &__img{
            width: 524px;
            right: 10%;
        }
    }

    .about{
        &__container{
            grid-template-columns: repeat(2, 1fr);
            align-items: center;
            text-align: initial;
            padding: 4rem 0;
        }
        &__img{
            width: 200px;
            height: 200px;
    
            & img{
                width: 165px;
            }
        }
    }
    .skills{
        &__container{
            grid-template-columns: repeat(2,1fr);
            align-items: center;
        }
    }

    .portfolio{
        &__container{
            grid-template-columns: repeat(3,1fr);
            grid-template-rows: repeat(2, 1fr);
            column-gap: 2rem;
        }
    }

    .contact{
        &__container{
            grid-template-columns: repeat(2,1fr);
            justify-items: center;
        }
        &__form{
            width: 380px;
        }
    }
    .footer{
        &__container{
            grid-template-columns: repeat(3,1fr);
            justify-items: center;
        }
    }
}

@media screen and(min-width: 1024px){
    .bd-grid{
        margin-left: auto;
        margin-right: auto;
    }
}

/* For tall screens on mobiles y desktop*/
@media screen and (min-height: 721px) {
    .home{
        &__container{
            height: 640px;
        }
        &__img{
            width: 500px;
            right: 24%;
        }
    }
}
