:root {
    --background-color: #202020;
    --background-color-gradient: linear-gradient (#202020, #20202000);
    --text-color: #f4f1f2;
    --inactive-text-color: #f4f1f26e;
    --my-gradient: linear-gradient(45deg, #a200ff, #ff0000);  
    --popup-color:#c50451;
    --intro-title-font-size: calc(clamp(1.5rem, 4vw, 2rem) * 1.5);
    --intro-p-font-size: clamp(1.5rem, 4vw, 2rem); 
    --toggle-icon-font-size: clamp(4vh ,5.5vh, 7vh);
    --typewriterSpeed: 6s;
    --typewriterCharacters: 6;
}

html {
    scroll-behavior: smooth;
}

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

/*  universal selector with Pseudo-elements */
*,
*::before,
*::after {
  box-sizing: border-box;
  position: relative;
}

body {
    min-height: 100vh;
    width: 100%;
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Nunito Sans';
    font-weight: 100;
}

/* NAVBAR SECTION */

/* static */
.navbar {
    position: fixed; 
    top: 0; 
    z-index: 500; 
    background: linear-gradient(
        to bottom, 
        #202020 80%,   
        rgba(90, 60, 30, 0) 100%
        );
    padding: 1.5rem;
    width: 100vw;
}

.static-navbar{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

#navLogo {
    max-width: 320px;

    img{
        display: block;
    }
}

.links {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 78px;
}

#static-links{
    display: flex;
}

.links a {
    text-decoration: none;
    color:var(--text-color);
    font-weight: 100;
    margin-left: 1rem;
    font-size: var(--intro-p-font-size);        
    /* position: relative;  */
}

.links a::after {
    content: "";
    width: 0%;
    height: 2px;
    display: block;
    background-color: #fff;
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%); /* Start the underline from the center */
    transition: width 0.3s cubic-bezier(0.215, 0.61, 0.355, 1), 
                left 0.3s cubic-bezier(0.215, 0.61, 0.355, 1); /* Add left to transition */
}

.links a:hover::after {
    width: 100%;
    left: 50%; /* Keep the left position at 50% */
    transform: translateX(-50%); /* Keep the underline centered while expanding */
}

#toggle-sidebar-btn{
    font-size: var(--intro-p-font-size);   /* Same size for both buttons */
    cursor: pointer;
    justify-content: center;  
    align-items: center; 
    display: none;
}

#dropdown-links{
    flex-flow: column;
    background-color: var(--background-color);
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-size: var(--intro-title-font-size);
    display: none;
}

#dropdown-links a:hover{
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 0.5px var(--text-color);
    color: var(--text-color);
}


@media(max-width: 1000px){
    #toggle-sidebar-btn {
        display: block;
    }

    #static-links{
        display: none;
    }
}

@media(max-width: 425px){

    .static-navbar{
        width: 100%;
        height: 42.73px;
   }

   .links{
        height: 42.73px;
   }

    #navLogo {
        max-width: 200px;
    }
}



/* HERO */

#intro{
    animation: fadeUp 0.7s linear;
    flex-flow: column;
    text-align: center;
    justify-content: center;
    margin: 1.5rem;
    display: flex;
    min-height: 100vh;
}

.im-name{
    display: flex;
    flex-flow: row nowrap;
    justify-content: center;
    align-items: baseline;
    margin-bottom: 1rem;
}

#i, #m{
    font-size: 4rem;
    font-weight: 600;    
    color: var(--text-color); 
}

#fn, #ln {
    font-size: var(--intro-p-font-size); 
    overflow: hidden; 
    white-space: nowrap; 
    width: 0;
}

#fn{
    margin-right: 1rem;
    width: 5ch;
    animation: typing 1s steps(4) forwards;
}

#ln{
    width: 7ch;
    animation: typing 1s steps(6) forwards;
}

/* Typing effect - increase width gradually */
@keyframes typing {
    from { width: 0 }
}



.me{
    font-size: var(--intro-p-font-size);    
}

@keyframes fadeUp{
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeDown{
    0% {
        opacity: 1;
        transform: translateY(0); 
    }
    100% {
        opacity: 0;
        transform: translateY(50px);
    }
}

.name {
    font-size: var(--intro-p-font-size);
    background: var(--my-gradient);
    background-size: 200%; 
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: moveGradient 10s linear alternate infinite; 
    height: 13.5vh;
    padding: 0.5rem;
}

@keyframes moveGradient {
    from {
        background-position: 0%;
    }
    to{
        background-position: 100%;
    }
}

.hide-animation {
    opacity: 0;
    transform: translateY(0); /* Moving upwards when hiding */
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}

.show-animation {
    opacity: 1;
    transform: translateY(0); /* Returning to normal position */
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}

/* PORTFOLIO */
#projects{
    flex-flow: column;
    margin: 1.5rem;
    display: flex;
    position: relative;
    min-height: 100vh;

    img{
        display: none;
    }
}

#projects a{
    text-decoration: none;
    color: var(--text-color);
    position: relative;
    z-index: 10;
}

.trHead, .trBody {
    display: grid;
    grid-template-columns: 45% 30% 25%;
    padding: 1rem 0;
    border-bottom: 1px solid var(--inactive-text-color);
}

.trHead{
    padding-bottom: 2.5rem;
    color: var(--inactive-text-color)
}

.pTitle{
    font-size: 1rem; 
    font-size: clamp(5vw, 2.5vw, 4vw);
    display: flex;
    justify-content: start;
    align-items: center;
    margin: 1rem 0;
    font-weight: 100;
}

.pDescription {
    font-size: 0.75rem; 
    font-size: clamp(1.5vw, 1.7vw, 2vw);
    display: flex;
    justify-content: start;
    align-items: center;
}

.project:hover{
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: var(--popup-color);
    -webkit-text-stroke: 0.5px var(--background-color);
    font-weight: 600;
}

.services {
    margin-right: 2.7rem;
}

.hover-image {
    position: absolute;
    max-width: 40%;
    max-height: 60vh;
    pointer-events: none; 
    transform: translate(-50%, -50%);
    transition: transform 1s ease-in, opacity 1s ease-out, visibility 0.5s linear 0.5s;
    z-index: -1;
}





/* SKILLS */
#tools{
    flex-flow: column;
    text-align: center;
    justify-content: center;
    margin: 1.5rem;
    display: flex;
    min-height: 100vh;
}


/* skill'S grid */
.skills {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.lang {
    position: relative; 
    text-align: center;
    overflow: visible;
}

.lang i {
    font-size: 4em;  
    padding-bottom: 0;
    transition: transform 0.3s ease-out;
}

.lang:hover i{
    transition: transform 0.3s ease-in;
    transform: translateY(-15%) scale(1.2);
}

.lang p {
    position: absolute;
    top: 85%; /* Positioned below the icon */
    left: 50%;
    transform: translateX(-50%) translateY(-20%); /* Start slightly above */
    white-space: nowrap; /* Prevent the text from wrapping */
    opacity: 0; /* Initially hidden */
    transition: transform 0.3s ease-out, opacity 0.3s ease-out; /* Smooth transition */
}

.lang:hover p {
    transform: translateX(-50%) translateY(10%) scale(1.2); /* Moves slightly down */
    opacity: 1; /* Fades in */
    font-size: 1.25rem;
    background-size: 200%; 
    background: var(--my-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: moveGradient 10s linear alternate infinite;
    transition: transform 0.3s ease-in, opacity 0.3s ease-out;
}

@media (max-width: 425px) {
    .skills {
        grid-template-columns: repeat(3, 1fr); /* Layout for small screens */
        gap: 3.5rem;
    }
    
    .lang p{
        opacity: 1;
        margin-top: 1rem;
        background: var(--my-gradient);
        background-size: 200%; 
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        animation: moveGradient 10s linear alternate infinite;
        transition: transform 0.3s ease-in, opacity 0.3s ease-out;
    }
}



/* CONTACT */
#contact{
    flex-flow: column;
    text-align: center;
    justify-content: center;
    margin: 1.5rem;
    display: flex;
    min-height: 80vh ;
    position: relative;
    align-items: center;
}
.hola{
    margin: .5rem;
}

.contact-info{
    font-size: var(--intro-p-font-size);
    margin: 1rem;
}

.connect{
    font-size: var(--intro-p-font-size);
    margin-top: 1rem;
    margin: 1rem;
    background: var(--my-gradient);
    background-size: 200%; 
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: moveGradient 10s linear alternate infinite; 
}


.socials{
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1rem; 
    font-size: var(--intro-p-font-size);
}

.socials p{
    transition: .3s ease-out;
}

.socials i:hover{
    scale: 1.5;
    transition: .1s ease-in;
    color: var(--popup-color);
}

#hi{
    animation: hi 1.5s ease-in-out alternate infinite;
    font-size: 12vh;
    position: relative;
    color: var(--popup-color);
}

@keyframes hi{

    from {
        transform: rotate(-20deg);
      }
    
      to {
        transform: rotate(15deg);
      }
}

/* FOOTER */
footer {
    display: flex;
    padding: 1.5rem;
    justify-content: end;
    font-size: 4vh;
    flex-flow: column;
    align-items: end;
}
