html {
  font-size: 62.5%;
  box-sizing: border-box;
  height: 100vh;
}

:root {
  --body-color: #020202;
  --primary-color: #212529;

  --secundary-color: #1b263b;
  --third-color: #415a77;
  --cuarto-color: #778da9;
  --quinto-color: #e0e1dd;
}

/* Nota: Sintaxis media queries
@media (600px <= width <= 1200px) {
      body {background-color: blue;
    }
  }
*/

body {
  background-color: var(--body-color);
  margin-bottom: 4rem;
  color: #eee;
  font-size: 15px;
  background-image: repeating-linear-gradient(
      to right,
      transparent 0 33px,
      #eee1 33px 35px
    ),
    repeating-linear-gradient(to bottom, transparent 0 33px, #eee1 33px 35px);
}

/* 
    NOTA:
    rem: relativo al tamaño de fuente raiz (html)
    em: relativo al tamaño de fuente del elemento padre
    porcentajes(%): calcula el tamaño basado en el emento contenedor
*/

/* General */
ul {
  list-style-type: none;
}

h1 {
  font-size: 3.5rem;
}

a {
  text-decoration: none;
}

.color_b {
  background-color: rgba(128, 128, 128, 0.178
  ); /* Fondo blanco con transparencia */
  backdrop-filter: blur(1px); /* Mayor desenfoque */
  border: 2px solid rgba(6, 67, 148, 0.534);
  box-shadow: 5px -5px 10px rgba(255, 255, 255, 0.226); /* Sombra para dar profundidad */
  border-radius: 8px; /* Bordes redondeados */
}

/* Global -> Designe Buttons */
.global-button {
  background: #374a61ef;
  font-family: inherit;
  color: #b6b6b6;
  padding: 0.3rem 0.8em;
  font-weight: 900;
  font-size: 18px;
  border: 2px solid rgba(66, 169, 187, 0.671);
  border-radius: 0.4em;
  box-shadow: 0.2em -0.2em;
  cursor: pointer;
  margin: 0 0.7rem 0 0.7rem;
}

.global-button:hover {
  transform: translate(0.05em, -0.05em);
  background-color: #1f4f6bc9;
  color: #fff;
  box-shadow: 0.15em -0.15em;
}

/* Header - Nav*/
.header {
  display: flex;
  justify-content: space-between;
  padding: 0 2rem 0 2rem;
  align-items: center;
  width: 100%;
  backdrop-filter: blur(10px);
  box-shadow: 0px 1px 15px rgba(255, 255, 255, 1);
  z-index: 100;
  height: 5.5rem;
  background: rgba(49, 87, 131, 0.349);
}

/* Layout content */
.layout-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 2rem;
  margin-bottom: 1rem;
}

/* Description about */
#description {
  width: 100%;
  height: 100%;
  position: relative;
  max-height: 10em;
  grid-column: 1/3;
  grid-row: 1/2;

  .welcome_text {
    margin: -1rem 0 0.5rem 0;
    text-align: justify;
  }

  .welcome_p {
    width: 100%;
  }

  #button_cv {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 5rem;
    position: absolute;
    font-size: 1.5rem;
    height: 1.7em;
    right: 1%;
    top: 75%;
  }

  .bg-decoration {
    position: absolute;
    background-color: rgba(40, 82, 146, 0.185);
    z-index: -1;
    top: 0;
    left: 0;
    width: 100%;
    height: 30%;
  }
}

/* Profile */
#photo {
  width: 100%;
  /* height: 20em; */
  height: 100%;
  grid-column: 3/4;
  grid-row: 1/3;
}

.photo_container {
  position: absolute;
  right: 12%;
  bottom: 0;
  max-height: 26rem;
  overflow: hidden;
  width: 27rem;
  border: solid 4px rgba(27, 37, 85, 0.877);
  height: 100%;
  border-radius: 80% 60% 45% 40%;

  img {
    position: absolute;
    width: 100%;
    height: 100%;
    filter: brightness(0.9);
    filter: contrast(1.2);
    position: relative;
    object-fit: cover;
    object-position: 0 20%;
  }
}

.text_typing {
  background: linear-gradient(to top, hsla(0, 0%, 0%, 0.856), hsl(0, 0%, 0%));
  font-size: 2rem;
  margin: 0.5rem 0 0 4rem;
  color: var(--title-color);
  background-clip: text;
  white-space: nowrap;
  width: 27ch;
  border-right: solid 4px;

  animation: typing 4s steps(26), blink 0.5s infinite step-end alternate;
  overflow: hidden;
}
@keyframes typing {
  from {
    width: 0;
  }
}
@keyframes blink {
  50% {
    border-right: transparent;
  }
}

.text_developer {
  font-size: 1.7rem;
  text-align: center;
}

/* Habilities - Skills*/
#habilities {
  width: 100%;
  height: 100%;
  max-height: 27em;
  grid-column: 1/2;
  grid-row: 2/4;
}

/*  Barra de habilidades */
.skill-bars {
  padding: 25px 30px;
  width: 300px;
  height: 85%;
  color: #fff;
  background-color: rgba(25, 65, 126, 0.445);
  box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  margin: 0 auto;
  overflow-y: scroll;
  scrollbar-width: thin;
  scrollbar-color: #324163 #000000c0;
}
.skill-bars .bar {
  margin: 20px 0;
}
.skill-bars .bar:first-child {
  margin-top: 0px;
}
.skill-bars .bar .info {
  margin-bottom: 5px;
}
.skill-bars .bar .info span {
  font-size: 17px;
  opacity: 0;
  animation: showText 0.5s 1s linear forwards;
}
@keyframes showText {
  100% {
    opacity: 1;
  }
}
.info span {
  display: inline-block;
  transform: skew(-15deg);
}
.skill-bars .bar .progress-line {
  height: 10px;
  width: 100%;
  background: rgba(65, 67, 95, 0.548);
  position: relative;
  transform: scaleX(0);
  transform-origin: left;
  border-radius: 10px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05),
    0 1px rgba(156, 156, 156, 0.8);
  animation: animate 1s cubic-bezier(1, 0, 0.5, 1) forwards;
}
@keyframes animate {
  100% {
    transform: scaleX(1);
  }
}
.bar .progress-line span {
  height: 100%;
  position: absolute;
  border-radius: 10px;
  transform: scaleX(0);
  transform-origin: left;
  background: rgba(186, 192, 197, 0.712);
  animation: animate 1s 1s cubic-bezier(1, 0, 0.5, 1) forwards;
}
.bar .progress-line.html span {
  width: 90%;
}
.bar .progress-line.css span {
  width: 80%;
}
.bar .progress-line.javascript span {
  width: 50%;
}
.bar .progress-line.react span {
  width: 60%;
}
.bar .progress-line.nextjs span {
  width: 55%;
}
.bar .progress-line.postgress span {
  width: 40%;
}
.bar .progress-line.mongodb span {
  width: 60%;
}
.bar .progress-line.nodejs span {
  width: 70%;
}
.bar .progress-line.tailwindcss span {
  width: 60%;
}
.bar .progress-line.bootstrap span {
  width: 40%;
}
.progress-line span::before {
  position: absolute;
  content: "";
  top: -10px;
  left: calc(0% + 21rem);
  right: 0;
  border: 7px solid transparent;
  border-bottom-width: 0px;
  border-right-width: 0px;
  border-top-color: #000;
  opacity: 0;
  animation: showText2 0.5s 1.5s linear forwards;
}
.progress-line span::after {
  position: absolute;
  top: -28px;
  left: calc(0% + 18rem);
  font-weight: 500;
  background: #000;
  color: #fff;
  padding: 1px 8px;
  font-size: 12px;
  border-radius: 3px;
  opacity: 0;
  animation: showText2 0.5s 1.5s linear forwards;
}
@keyframes showText2 {
  100% {
    opacity: 1;
  }
}
.progress-line.html span::after {
  content: "90%";
}
.progress-line.css span::after {
  content: "80%";
}
.progress-line.javascript span::after {
  content: "50%";
}
.progress-line.react span::after {
  content: "60%";
}
.progress-line.nextjs span::after {
  content: "55%";
}
.progress-line.postgress span::after {
  content: "40%";
}
.progress-line.mongodb span::after {
  content: "60%";
}
.progress-line.nodejs span::after {
  content: "70%";
}
.progress-line.tailwindcss span::after {
  content: "60%";
}
.progress-line.bootstrap span::after {
  content: "40%";
}

/* Image decoration */
#image {
  width: 100%;
  height: 100%;
  max-height: 12em;
  grid-column: 2/3;

  img {
    width: 100%;
    height: 100%;
    overflow: hidden;
    object-fit: cover;
    /* Posicionamiento más preciso */
    object-position: 0 80%; /* X% horizontal, Y% vertical */
  }
}

/* Projects */
#projects {
  width: 100%;
  height: 100%;
  max-height: 20em;
  grid-column: 2/4;
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;

  .container_button_projects {
    text-align: center;
    display: flex;
    justify-content: space-between;
    width: 60%;
    margin-left: auto;

      button {
        margin: 1rem 5rem 0 0;
        width: 8em;
        height: 1.5em;
        font-size: 1.5rem;
      }
  }
}

.projects_container {
  display: flex;
  margin: 0 auto;
  width: 90%;
  height: 150px;
  gap: 1rem;

  .img_projects {
    width: 40%;
    height: 100%;
    overflow: hidden;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid rgba(36, 49, 124, 0.678);
    transition: all ease-in-out 0.5s;
  }
}
.projects_container img:hover {
  width: 70%;
}

.footer_container {
  margin-top: -1.5rem;
  font-size: 2rem;
}

/* Estilos del menú hamburguesa */
.mobile-menu-check {
  display: none;
}

.hamburger-menu {
  display: none;
  cursor: pointer;
  z-index: 1000;
  padding: 10px;
}

.hamburger-bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  background: #b6b6b6;
  transition: all 0.3s ease-in-out;
}

/* MEDIA QUERIES */
/* HEADER */ 
@media (max-width: 768px) {
  .header {
    position: relative;
    padding: 0 1rem;
  }
  
  .hamburger-menu {
    display: block;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
  }
  
  .nav-menu {
    position: fixed;
    top: 5.5rem;
    left: -100%;
    width: 100%;
    height: calc(100vh - -65em);
    background-color: rgba(87, 87, 87, 0.26);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease-in-out;
    z-index: 999;
  }
  
  .mobile-menu-check:checked ~ .nav-menu {
    left: 0;
  }
  
  .nav_menu {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background-color: rgba(27, 27, 27, 0.651);
    padding: 5rem 0;
    gap: 1rem;
  }
  
  .nav_btn {
    width: 15em;
    margin: 0.5rem auto;
    text-align: center;
  }
  
  /* Animación del botón hamburguesa */
  .mobile-menu-check:checked ~ .hamburger-menu .hamburger-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  
  .mobile-menu-check:checked ~ .hamburger-menu .hamburger-bar:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-check:checked ~ .hamburger-menu .hamburger-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

/* LAYOUT */
.layout-grid {
  grid-auto-rows: auto;
  grid-template-columns: 1fr;
}

#photo,
#description,
#habilities,
#image,
#projects {
  grid-column: 1;
}

#description {
  max-height: none;
  height: 16em;
  grid-row: 1;
  
  .welcome_text {
    font-size: 2rem;
    margin-bottom: 1rem;
  }

  .welcome_p {
    width: 95%;
    margin: 0 auto;
  }

  #button {
    position: relative;
    left: 8%;
    height: 3.5rem;
    font-size: 1.5rem;
    top: 10%;
    width: 80%;
    padding-bottom: 1rem;
  }

  .bg-decoration {
    height: 15%;
  }
}

#photo {
  grid-row: 2;
  height: 22em;
}

.photo_container {
  width: 24rem;
}

.text_typing {
  margin-left: 3rem;
  font-size: 1.6rem;
}

.text_developer {
  font-size: 1.5rem;
}

#habilities {
  grid-row: 3;
  height: 25em;
}

#images {
  /* display: block; */
  /* grid-column: 1/1; */
  grid-row: 5;
}

#projects {
  grid-row: 4;
  max-height: none;
  height: 22em;
  overflow: hidden;

  button {
    width: 100%;
  }
}

.projects_container {
  /* display: flex; */
  overflow-x: auto; /* Permite desplazamiento horizontal */
  scroll-snap-type: x mandatory; /* Efecto de carrusel */
  -webkit-overflow-scrolling: touch; /* Mejora el desplazamiento en iOS */
  width: 90%;
  height: auto;
  column-gap: 2rem;
  padding: 1rem;
}

.img_projects {
  flex: 0 0 100%; /* Cada imagen ocupa el 90% del ancho del viewport */
  height: auto;
  scroll-snap-align: center; /* Centra cada imagen en el carrusel */
  border-radius: 10px;
  border: 2px solid rgba(36, 49, 124, 0.678);
  transition: all ease-in-out 0.5s;
}

/* Ocultar scrollbar para un look más limpio */
.projects_container::-webkit-scrollbar {
  display: none;
}

.footer_container {
  font-size: 1.5rem;
  width: 55%;
  margin: 0 auto;
}
}