/*===== VARIABLES CSS =====*/
:root{
    --header-height: 3rem;
    --font-medium: 500;
}

/*===== Colores =====*/
:root{
    --first-color: #c3c4d2;
    --white-color: #f9f9f9;
    --dark-color: #95b2c0;
    --text-color: #000808;
}

/*===== 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){
    :root{
        --big-font-size: 10.5rem;
        --h2-font-size: 2rem;
        --normal-font-size: 1rem;
        --small-font-size: .875rem;
    }
}

/*===== Margenes =====*/
:root{
    --mb-1: .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;
}
.section-title{
    position: relative;
    font-size: var(--h2-font-size);
    color: var(--dark-color);
    margin: var(--mb-4) 0;
    text-align: center;
}
.section-title::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);
}

/* Navbar Gradient Background & Animation */
.l-header {
    background: linear-gradient(90deg, #ff6a00, #ee0979, #2196f3, #23d160);
    background-size: 400% 400%;
    animation: gradientBG 10s ease infinite;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: background 0.5s;
}

@keyframes gradientBG {
    0% {background-position: 0% 50%;}
    50% {background-position: 100% 50%;}
    100% {background-position: 0% 50%;}
}

/* Navbar Links Animation */
.nav__link {
    color: #fff;
    font-weight: bold;
    position: relative;
    transition: color 0.3s;
}

.nav__link::after {
    content: '';
    display: block;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6a00, #ee0979, #2196f3, #23d160);
    transition: width 0.3s;
    position: absolute;
    left: 0;
    bottom: -5px;
    border-radius: 2px;
}

.nav__link:hover,
.nav__link.active {
    color: #ffd700;
}

.nav__link:hover::after,
.nav__link.active::after {
    width: 100%;
}

/* Navbar Toggle Animation */
.nav__toggle {
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.nav__toggle:active {
    transform: rotate(90deg) scale(1.2);
}

/* Navbar background on scroll */
.l-header.scrolled {
    background: linear-gradient(90deg, #23d160, #2196f3, #ee0979, #ff6a00);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/*===== NAV =====*/
.nav{
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
@media screen and (max-width: 768px){
    .nav__menu{
        position: fixed;
        top: var(--header-height);
        right: -100%;
        width: 80%;
        height: 100%;
        padding: 2rem;
        background-color: rgba(255,255,255,.3);
        transition: .5s;
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
}
.nav__item{
    margin-bottom: var(--mb-4);
}
.nav__link{
    position: relative;
    color: var(--dark-color);
}
.nav__link:hover{
    color: var(--first-color);
}
.nav__logo{
    color: var(--white-color);
}
.nav__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: .18rem;
    left: 0;
    top: 2rem;
    background-color: var(--first-color);
}

/*===== HOME =====*/
.home{
    position: relative;
    background-color: var(--first-color);
    overflow: hidden;
}
.home__container{
    height: calc(100vh - var(--header-height));
    row-gap: 5rem;
}
.home__title{
    align-self: flex-end;
    font-size: var(--big-font-size);
    color: var(--white-color);
    line-height: .8;
}
.home__title span{
    text-shadow: 0 20px 25px rgba(0,0,0,.5);
}
.home__scroll{
    align-self: flex-end;
    padding-bottom: var(--mb-4);
}
.home__scroll-link{
    writing-mode: vertical-lr;
    transform: rotate(-180deg);
    color: var(--white-color);
}
.home__img{
    position: absolute;
    right: 0;
    bottom: 0;
    width: 295px;
}

/* Home Section Flex Alignment */
.home-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    min-height: 420px;
}

.home__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

.home__text-card {
    background: linear-gradient(120deg, #ffecd2 0%, #fcb69f 100%);
    background-size: 200% 200%;
    animation: gradientMove 4s ease-in-out infinite alternate;
    padding: 2rem 2.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 6px 32px rgba(30,30,60,0.10);
    max-width: 420px;
    text-align: left;
    border-left: 6px solid #2196f3;
    transition: box-shadow 0.3s;
}

@keyframes gradientMove {
    0% {background-position: 0% 50%;}
    100% {background-position: 100% 50%;}
}

.home__title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    color: #1572b6;
}

.home__btn {
    padding: 0.7rem 2rem;
    background: linear-gradient(90deg, #ff6a00, #ee0979, #2196f3, #23d160);
    color: #fff;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(33,150,243,0.15);
    transition: background 0.3s, transform 0.2s;
    border: none;
    display: inline-block;
    margin-top: 1rem;
}
.home__btn:hover {
    transform: scale(1.05);
    background-position: right center;
}

/* Circular Ring Wrapper */
.circular-ring-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 320px;
}

.circular-ring {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 0 auto;
    animation: rotateRing 12s linear infinite;
    border-radius: 50%;
    background: transparent;
}

@keyframes rotateRing {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}

/* Position icons in a circle */
.ring-icon {
    position: absolute;
    left: 50%; top: 50%;
    transform: rotate(calc(36deg * var(--i))) translate(0, -140px) rotate(calc(-36deg * var(--i)));
    /* 10 icons: 360/10 = 36deg */
    transition: transform 0.3s;
    z-index: 2;
}

/* ===== ABOUT =====*/
.about__container{
    justify-items: center;
    row-gap: 2rem;
    text-align: center;
}
.about__img{
    display: flex;
    justify-content: center;
    padding-top: 1rem;
    width: 150px;
    height: 150px;
    background-color: var(--first-color);
    border-radius: 80%;
    overflow: hidden;
}
.about__img img{
    width: 200px;
}
.about__subtitle{
    font-size: var(--h2-font-size);
    color: var(--first-color);
    margin-bottom: var(--mb-1);
}
.about__text{
    margin-bottom: var(--mb-4);
}
.about__profession{
    display: block;
    margin-bottom: var(--mb-4);
}
.about__social-icon{
    font-size: 1.4rem;
    margin: 0 var(--mb-1);
}
.about__social-icon:hover{
    color: var(--first-color);
}

/* ===== SKILLS =====*/
.skills__container{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.skills__group {
    background: linear-gradient(135deg, #f2c81122 0%, #3776ab11 100%);
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(55, 118, 171, 0.10);
    padding: 1.5rem 1.2rem 1.2rem 1.2rem;
    min-width: 220px;
    transition: transform 0.18s, box-shadow 0.18s;
}
.skills__group:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 8px 24px rgba(55, 118, 171, 0.16);
}
.skills__group-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #3776ab;
    margin-bottom: 0.7em;
    display: flex;
    align-items: center;
    gap: 0.5em;
}
.skills__list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.skills__list li {
    margin-bottom: 0.5em;
    font-size: 1.02em;
    display: flex;
    align-items: center;
    gap: 0.5em;
    color: #222;
}
.skills__list i,
.skills__list img {
    font-size: 1.2em;
    vertical-align: middle;
}

/* ===== PORTFOLIO =====*/
.portfolio{
    background-color: var(--white-color);
}
.portfolio__container{
    justify-items: center;
    row-gap: 2rem;
}
.portfolio__img{
    position: relative;
    overflow: hidden;
}
.portfolio__img img{
    border-radius: .5rem;
}
.portfolio__link{
    position: absolute;
    bottom: -100%;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255,255,255,.3);
    border-radius: .5rem;
    cursor: pointer;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: .3s;
}
.portfolio__img:hover .portfolio__link{
    bottom: 0;
}
.portfolio__link-name{
    color: var(--dark-color);
}

/* ===== CONTACT =====*/
.contact__container{
    row-gap: 2rem;
}
.contact__subtitle{
    font-size: var(--normal-font-size);
    color: var(--first-color);
}
.contact__text{
    display: inline-block;
    margin-bottom: var(--mb-2);
}
.contact__inputs{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 1rem;
}
.contact__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;
}
.contact__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);
}
.footer__container{
    row-gap: 2rem;
}
.footer__title{
    font-size: var(--normal-font-size);
    color: var(--white-color);
    margin-bottom: var(--mb-2);
}
.footer__link{
    padding: .25rem 0;
}
.footer__link:hover{
    color: var(--first-color);
}
.footer__social{
    font-size: 1.4rem;
    margin-right: var(--mb-1);
}
.footer__social: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;
    }
    .section-title{
        margin-bottom: 3rem;
    }
    .section-title::after{
        width: 64px;
        top: 3rem;
    }

    .nav{
        height: calc(var(--header-height) + 1rem);
    }
    .nav__list{
        display: flex;
    }
    .nav__item{
        margin-left: var(--mb-4);
        margin-bottom: 0;
    }
    .nav__toggle{
        display: none;
    }
    .nav__link{
        color: var(--white-color);
    }
    .nav__link: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;
    }
    .home__img{
        width: 524px;
        right: 10%;
    }

    .about__container{
        grid-template-columns: repeat(2, 1fr);
        align-items: center;
        text-align: initial;
        padding: 4rem 0;
    }
    .about__img{
        width: 200px;
        height: 200px;
    }
    .about__img 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;
    }
    .contact__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;
    }
    .home__img {
        width: 500px;
        right: 24%;
    }
}

/* Responsive for mobile */
@media (max-width: 900px) {
    .home-flex {
        flex-direction: column;
        gap: 1.5rem;
    }
    .home__text {
        align-items: center;
    }
    .circular-ring-wrapper {
        min-width: 0;
        align-items: center;
    }
    .home__text-card {
        max-width: 100%;
        text-align: center;
        border-left: none;
        border-top: 6px solid #2196f3;
    }
}
