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

:root {
  /* Altura del encabezado */
  --header-height: 3rem;
  
  /* Fuente y tipografía fluida */
  --body-font: 'Poppins', sans-serif;
  --font-semi: 600;
  --big-font-size: clamp(2rem, 5vw, 2.75rem);
  --normal-font-size: clamp(0.9rem, 2.5vw, 1rem);
  --h2-font-size: clamp(1.25rem, 4vw, 2rem);

  /*
  --big-font-size: 2rem;
  --normal-font-size: 1rem;
  --h2-font-size: 1.25rem;
  */

  /* Colores */
  --first-color: #5F7FFF;
  --second-color: #0E2431;
  --third-color: white;
  
  /* Márgenes y padding fluidos (ejemplo) */
  --section-padding: clamp(2rem, 8vw, 6rem);

  /* Márgenes */
  --mb-1: 0.5rem;
  --mb-2: 1rem;
  --mb-3: 1.5rem;
  --mb-4: 2rem;
  --mb-5: 2.5rem;
  --mb-6: 3rem;

  /* Z-index */
  --z-back: -10;
  --z-normal: 1;
  --z-tooltip: 10;
  --z-fixed: 100;

  /* Otras */
  --px-1: 10px;
  --px-2: 20px;
  --px-3: 30px;
  --px-4: 40px;
  --px-5: 50px;

}
*,::before,::after{
  box-sizing: border-box;
}
html{
  scroll-behavior: smooth;
}
body{
  margin: 0;
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  color: var(--second-color);
  overflow-x: hidden;
  background-color: var(--third-color);
}
canvas {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-back);
}
h1,h2,p{
  margin: 0;
}
ul{
  margin: 0;
  padding: 0;
  list-style: none;
}
a{
  text-decoration: none;
}
img{
  max-width: 100%;
  height: auto;
  display: block;
}
.section{
  padding: 2rem 0 0 0;
}
.section-title{
  position: relative;
  font-size: 2rem;
  color: var(--first-color);
  margin-top: var(--mb-2);
  margin-bottom: var(--mb-4);
  text-align: center;
}
.section-title{
  font-size: 1.5rem;
}
.section-title::after{
  position: absolute;
  content: "";
  width: 64px;
  height: 0.18rem;
  left: 0;
  right: 0;
  margin: auto;
  top: 2.75rem;
  background-color: var(--first-color);
}
.l-header{
  position: fixed;
  width: auto;  
  top: var(--mb-2);
  left: var(--mb-2); 
  right: var(--mb-2); 
  z-index: var(--z-fixed);  
  background-color: var(--third-color); 
  border: 2px solid var(--first-color);
  border-radius: var(--px-3);   
  box-shadow: 0px 0px 5px 5px rgba(95, 127, 255, 0.5);
}
.l-main{
  padding: clamp(4rem, 10vw, 6rem) 0 2rem 0;
}
.bd-grid{
  max-width: 1024px;
  display: grid;
  grid-template-columns: 100%;
  grid-column-gap: 2rem;
  width: calc(100% - 2rem);
  margin-left: auto;
  margin-right: auto;  
}
/* ==================== NAV ==================== */
.nav{
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: var(--font-semi);
}
.nav__menu {
  position: fixed;
  top: calc(var(--header-height) + var(--mb-3));
  bottom: var(--mb-4);
  right: -100%;
  width: 50%;
  height: 500px;
  padding: 2.5rem;
  background-color: rgba(8, 33, 91, 0.8);
  backdrop-filter: blur(10px);
  transition: right 0.4s ease-in-out;
  border-radius: var(--px-3);
}
.nav__toggle{
  color: var(--second-color);
  font-size: 1.5rem;
  cursor: pointer;
}
.nav__list {
  display: flex;
  flex-direction: column;
}
.nav__item{
  margin-bottom: var(--mb-4);
}
.nav__link{
  color: var(--third-color);
}
.nav__link:hover{
  position: relative;
}
.nav__link:hover::after{
  position: absolute;
  content: "";
  width: 100%;
  height: 0.2rem;
  left: 0;
  top: 2rem;
  background-color: var(--third-color);
}
.nav__logo a{
  color: var(--second-color);
}
.active::after{
  position: absolute;
  content: "";
  width: 100%;
  height: 0.18rem;
  left: 0;
  top: 2rem;
  background-color:transparent;
}
.show{
  right: var(--mb-2);
}
/* ==================== BUTTONS ==================== */
.home__button{
  display: flex; 
  position: relative;
  align-items: center; 
  gap: var(--px-3);
}
.button{
  display: inline-block;
  background-color: var(--first-color);
  color: var(--third-color);;
  padding: 0.75rem 2.5rem;
  font-weight: var(--font-semi);
  border-radius: 0.5rem;
  height: auto;
}
.button:hover{
  box-shadow: 0px 0px 20px rgba(0,0,0,0.25)
}
/* ==================== ABOUT ==================== */
.about__container{
  row-gap: 2rem;
  text-align: center;
  padding: 1rem;
  border: 2px solid var(--first-color);
  border-radius: var(--px-3);  
  background-color: var(--third-color); 
}
.about__subtitle{
  margin-bottom: var(--mb-2);
}
.about__img{
  justify-self: center;
  width: 200px; 
  height: 200px;
}
.about__img img{
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}
.about__text-color{
  color: var(--first-color);
}
/* ==================== SKILLS ==================== */
.skills__container{
  row-gap: 2rem;
  text-align: center;
  position: relative;
  z-index: var(--z-normal);

  padding: 1rem;
  border: 2px solid var(--first-color);
  border-radius: var(--px-3); 
}
.skills__data, 
.skills__data__2{
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  font-weight: var(--font-semi);
  padding: 0.5rem 1rem;
  margin-bottom: var(--mb-4);
  border-radius: 0.5rem;
  box-shadow: 0 4px 25px rgba(14,36,49,.15);
  background-color: rgba(255, 255, 255, 0.80);
}
.skills__icon{
  font-size: 2rem;
  margin-right: var(--mb-2);
  color: var(--first-color);
}
.skills__names{
  display: flex;
  align-items: center;
}
.skills__bar{
  position: absolute;
  left: 0;
  bottom: 0;
  background-color: var(--first-color);
  height: 0.25rem;
  border-radius: 0.5rem;
  z-index: var(--z-tooltip);
}
.skills__html { width: 100%; }
.skills__css  { width: 100%; }
.skills__js   { width: 90%;  }
.skills__php  { width: 90%;  }
.skills__nodejs  { width: 75%; }
.skills__abap    { width: 75%; }
.skills__angular { width: 75%; }
.skills__vue     { width: 75%; }
.skills__react   { width: 75%; }
.skills__laravel { width: 75%; }
.skills__ionic   { width: 60%; }
.skills__flutter { width: 60%; }
/* ==================== WORK ==================== */
.work__container{
  row-gap: 2rem;
  padding: 1rem;;
  border: 2px solid var(--first-color);
  border-radius: var(--px-3); 
  background-color: var(--third-color); 
}
.work__img{
  box-shadow: 0 4px 25px rgba(14,36,49,.15);
  border-radius: 0.5rem;
  overflow: hidden;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}
.work__img:hover{
  box-shadow: 0px 0px 20px rgba(0,0,0,0.75)
}
.work__img img{
  transition: 1s;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
@supports(object-fit: cover){
  .work__img img{
    object-fit: cover;
    object-position: center;
  }
}
.work__img img:hover{
  transform: scale(1.2); 
}
/* ==================== CONTACT FORM ==================== */
.contact__container{
  justify-items: center;
}
.contact__form {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  
  padding: 1rem;
  border: 2px solid var(--first-color);
  border-radius: var(--px-3);   
  background-color: var(--third-color); 
}
.contact__input{
  width: 100%;
  font-size: var(--normal-font-size);
  font-weight: var(--font-semi);
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1.5px solid var(--second-color);
  outline: none;
  margin-bottom: 0.25rem;
  margin-left: auto;
  margin-right: auto;
  display: block;
}
.contact__textarea {
  height: 100px;
  resize: vertical;
  min-height: 100px;
  max-height: 200px;
}
.contact__input:hover,
.contact__input:focus {
  border: 1.5px solid var(--first-color);
}
.cf-turnstile-container {
  margin: 0.25rem 0;
  display: flex;
  justify-content: center;
}
.contact__button{
  display: block;
  border: none;
  outline: none;
  font-size: var(--normal-font-size);
  cursor: pointer;
  margin-left: auto;
  margin-right: auto;
  margin-top: var(--mb-2);
}
/* ==================== FOOTER ==================== */
.footer{
  margin: 2rem var(--mb-2);
  padding: 2rem;
  background-color: var(--second-color);
  color: var(--third-color);
  text-align: center;
  font-weight: var(--font-semi); 
  border-radius: var(--px-3);
}
.footer__title{
  font-size: 2rem;
  color: var(--third-color);
  margin-bottom: var(--mb-4);
}
.footer__title:hover{
  color: var(--first-color)
}
.footer__social{
  margin-bottom: var(--mb-4);
}
.footer__icon{
  font-size: 1.5rem;
  color: var(--third-color);
  margin: 0 var(--mb-2)
}
.footer__icon:hover{
  color: var(--first-color)
}
.footer__copyright{
  font-size: 1rem;
  color: var(--third-color);
}
.footer__copyright:hover{
  color: var(--first-color)
}
/* --- ESTILOS PARA ESCRITORIO (TABLET Y MÁS GRANDES) --- */
@media screen and (min-width: 768px){
   body{
    margin: 0;
  }
  .l-main{
    padding: 6rem 0 2rem 0;
  } 
  .section-title::after{
    width: 80px;
    top: 3rem;
  }
  .nav{
    height: calc(var(--header-height) + 1rem);
  }
  .nav__menu {
    all: unset;
  }
  .nav__list {
    flex-direction: row;
    align-items: center;
  }
  .nav__item {
    margin-bottom: 0;
    margin-left: var(--mb-6);
  }
  .nav__link{
    color: var(--second-color);
  }
  .nav__link:hover::after{
    background-color: var(--first-color);
  }
   .nav__toggle{
    display: none;
  }
  .about__container, .skills__container{
    grid-template-columns: repeat(2,1fr);
    align-items: center;
    text-align: initial;
  }
  .about__img img{
    width: 300px;
  }
  .work__container{
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2,1fr);
    column-gap: 2rem;
  } 
  .contact__form {
    max-width: 400px; 
    gap: 0.5rem;     
  }    
  .contact__textarea {
    height: 100px; 
    min-height: 100px;
    max-height: 200px;
  } 

}
