/* Variables globales */
:root {
  --poppins: 'Poppins', sans-serif;
  --first-color: #66c2ff;
  --toggle-color: #0d2330;
  --second-color: #0d2330;
}

/* Configuración general y reset de estilos */
*,
::before,
::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 3rem 0 0 0;
  font-family: var(--poppins);
  font-size: 0.938rem;
  color: var(--second-color);
}

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;
}

/* Títulos de secciones */
.section-title {
  position: relative;
  font-size: 1.25rem;
  color: var(--first-color);
  margin-top: 1rem;
  margin-bottom: 2rem;
  text-align: center;
}

.section-title::after {
  position: absolute;
  content: '';
  width: 64px;
  height: 0.18rem;
  left: 0;
  right: 0;
  margin: auto;
  top: 2rem;
  background-color: var(--first-color);
}

.section {
  padding-top: 3rem;
  padding-bottom: 2rem;
}

/* Header - Cabecera */
.h-grid {
  max-width: 120rem;
  width: 90%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 100%;
  grid-column-gap: 2rem;
  justify-content: center;
}

.header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  background-color: #fff;
  box-shadow: 0 1px 4px rgba(146, 161, 176, 0.15);
}

/* Navigation - Barra de navegación */
.nav {
  height: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

@media screen and (max-width: 768px) {
  .nav__menu {
    position: fixed;
    top: 3rem;
    right: -100%;
    width: 100%;
    height: 100%;
    padding: 2rem;
    background-color: var(--second-color);
    transition: 0.5s;
  }
}

.nav__item {
  margin-bottom: 2rem;
}

.nav__link {
  position: relative;
  color: #fff;
}

.nav__link:hover::after {
  position: absolute;
  content: '';
  width: 100%;
  height: 0.18rem;
  left: 0;
  top: 2rem;
  background-color: var(--first-color);
}

.nav__logo {
  color: var(--second-color);
}

.nav__toggle {
  color: var(--second-color);
  font-size: 1.5rem;
  cursor: pointer;
}

.active::after {
  position: absolute;
  content: '';
  width: 100%;
  height: 0.18rem;
  left: 0;
  top: 2rem;
  background-color: var(--first-color);
}

.show {
  right: 0;
}

/* Home - Página principal */
.home {
  position: relative;
  row-gap: 3rem;
  padding: 2rem 0 3rem;
}

.home__data {
  align-self: center;
}

.home__title {
  font-size: 2rem;
  margin-bottom: 2.5rem;
}

.home__title-color {
  color: var(--first-color);
}

.home__social {
  display: flex;
  flex-direction: column;
}

.home__social-icon {
  width: max-content;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--second-color);
}

.home__social-icon:hover {
  color: var(--first-color);
}

.home__img {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 260px;
}

.home__img-perfil {
  width: 360px;
}

.button {
  display: inline-block;
  background-color: var(--first-color);
  color: #fff;
  padding: 0.75rem 2.5rem;
  font-weight: 600;
  border-radius: 0.5rem;
}

.button:hover {
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.15);
}

/* About - Sección sobre mí */
.about__container {
  row-gap: 2rem;
  display: flex;
  text-align: center;
}

.about__content {
  box-shadow: 0 4px 25px rgba(14, 36, 49, 0.15);
  padding: 1.1rem 0;
  border-radius: 0.5rem;
}

.about__subtitle {
  margin-bottom: 1rem;
}

.about__container .about__text {
  text-align: justify;
  margin: 20px;
}

.about__img {
  display: flex;
  justify-content: center;
}

.about__img img {
  width: 200px;
  height: 200px;
  box-shadow: 0 4px 25px rgba(14, 36, 49, 0.15);
  border-radius: 50%;
  object-fit: cover;
}

/* Projects - Sección de proyectos */
.projects {
  text-align: center;
}

.projects__container {
  row-gap: 2rem;
}

.projects__links {
  box-shadow: 0 4px 25px rgba(14, 36, 49, 0.15);
  border-radius: 0.55rem;
  overflow: hidden;
  width: 350px;
  height: 350px;
  margin: 0 auto;
}

.projects__links img {
  transition: 1s;
  cursor: pointer;
  width: 350px;
  height: 230px;
  object-fit: contain;
}

.projects__links img:hover {
  transform: scale(1.05);
}

.project__link-item {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.53rem;
}

.project__item {
  padding: 0 1rem;
  color: var(--second-color);
}

.project__item:hover {
  color: var(--first-color);
}

/* Modal styles */
.modal {
  display: none; /* Oculto por defecto */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4); /* Fondo oscuro semi-transparente */
}

.modal__content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
  text-align: center;
  border-radius: 5px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

.modal__close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.modal__close:hover,
.modal__close:focus {
  color: #000;
  text-decoration: none;
}

/* Qualifications - Sección de cualificaciones */
.qualification {
  text-align: center;
}
.qualification__container {
  display: flex;
  justify-content: space-around;
  gap: 2rem;
}
.qualification__links {
  flex: 1 0 30%; 
  max-width: 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  margin: 0 auto;
  text-align: center;
}
.qualification__title {
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  color: var(--first-color);
  margin-bottom: 1rem;
}
.qualification__icon {
  width: 24px;
  height: 24px;
  margin-right: 0.5rem;
}
.qualification__icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.work__container {
  flex: 1 0 45%; /* Cada contenedor ocupa hasta el 45% del ancho del contenedor padre */
  max-width: 45%; /* Limita el ancho máximo */
  display: flex;
  justify-content: center;
  align-items: center;
  height: 70px; /* Ajusta esta altura según sea necesario */
}
.work__icon {
  max-width: 80%; /* Limita el ancho máximo a 100% del contenedor */
  height: auto; /* Mantiene la proporción de la imagen */
  object-fit: contain; /* Asegura que la imagen se ajuste sin distorsión */
}
.qualification__list {
  list-style: none;
  padding: 0;
  text-align: center;
}
.qualification__list li {
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
  color: var(--second-color);
  text-align: center;
}
.small-text {
  font-size: 0.8rem !important;
  color: var(--second-color);
  text-align: center;
}

/* Skills - Sección de habilidades */
.skills__container {
  row-gap: 2rem;
  text-align: center;
}

.skills__subtitle {
  margin-bottom: 1rem;
}

.skills-title {
  color: #66c2ff;
  font-size: 1.2rem;
  margin-bottom: 3rem;
}

.skills__names {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}

.skills__name img {
  transition: 0.5s;
}

.skills__name img:hover {
  transform: scale(1.19);
}

.vite {
  width: 2.8rem;
}

.tools {
  width: 90%;
  display: grid;
  grid-template-columns: 33.3% 33.3% 33.3%;
  grid-template-rows: 4rem 4rem;
  justify-items: center;
  margin: 0 auto;
}

/* Contact - Sección de contacto */
.contact__title {
  margin-bottom: 1rem;
}

.contact__text {
  row-gap: 2rem;
  text-align: center;
  padding-bottom: 1rem;
}

.contact__social {
  padding: 2rem;
  padding-bottom: 0;
  margin-bottom: 2rem;
  justify-self: center;
  box-shadow: 0 4px 25px rgba(14, 36, 49, 0.15);
  border-radius: 0.5rem;
}

.contact__email,
.contact__phone,
.contact__map {
  display: flex;
  align-items: baseline;
  justify-content: center;
}

.contact__email-content,
.contact__phone-content,
.contact__map-content {
  font-size: 1.05rem;
}

.icon {
  font-size: 1.1rem;
  padding-right: 0.5rem;
}

.icon-social {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  padding-top: 1rem;
}

.icon-contact {
  font-size: 2rem;
  color: black;
}

.icon-contact:hover {
  color: var(--first-color);
}

/* Footer - Pie de página */
.footer {
  background-color: var(--second-color);
  color: #fff;
  text-align: center;
  font-weight: 400;
  padding: 1rem 0;
}

.footer .link-github {
  margin: 0 0.2rem;
  color: var(--first-color);
  text-decoration: none;
}

.footer__text p,
.footer__copyright p {
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer__copyright p {
  display: block;
}

/* Media Queries para responsive design */

@media screen and (min-width: 768px) {
  .h-grid {
    width: 80%;
  }
}

@media screen and (min-width: 768px) {
  body {
    margin: 0;
  }
  .section {
    padding-top: 4rem;
    padding-bottom: 3rem;
  }
  .section-title {
    margin-bottom: 3rem;
    font-size: 1.5rem;
  }
  .section-title::after {
    width: 80px;
    top: 3rem;
  }
}

@media screen and (min-width: 768px) {
  .nav {
    height: 4.5rem;
  }
  .nav__list {
    display: flex;
    padding-top: 0;
  }
  .nav__item {
    margin-left: 3rem;
    margin-bottom: 0;
  }
  .nav__toggle {
    display: none;
  }
  .nav__link {
    color: var(--second-color);
  }
  .nav__link-es,
  .nav__link-en {
    font-size: 0.8rem;
  }
  .nav__link-en {
    margin-left: -2rem;
  }
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
  .home__img {
    bottom: 10%;
  }
  .home__title {
    font-size: 2.5rem;
  }
}

@media screen and (min-width: 768px) {
  .home {
    padding: 8rem 0 0;
  }
  .home__title {
    font-size: 2rem;
  }
  .home__data {
    align-self: flex-end;
  }
  .home__social {
    padding-top: 0;
    flex-direction: row;
    align-self: flex-end;
  }
  .home__social-icon {
    font-size: 2.5rem;
    margin-bottom: 0;
    padding: 0 1rem;
  }
}

@media screen and (min-width: 1024px) {
  .home__img {
    width: 400px;
    bottom: -8%;
  }
}

@media screen and (min-width: 768px) {
  .about__container {
    padding-top: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .about__content {
    width: 50%;
    height: 30%;
  }
  .about__img img {
    width: 250px;
    height: 250px;
  }
}

@media screen and (min-width: 768px) {
  .projects__container {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 2rem;
    padding-top: 2rem;
  }
  .projects__links {
    width: 350px;
    height: 350px;
    margin-bottom: 2rem;
  }
  .projects__links img {
    width: 350px;
    height: 230px;
    object-fit: contain;
  }
}

@media screen and (max-width: 768px) {

  .qualification__container {
    display: grid;
    grid-template-columns: 1fr;
  }

  .qualification__icons {
    flex-direction: column;
    gap: 1rem;
  }

  .work__icon {
    height: 50px;
    width: auto;
  }

  .qualification__links {
    width: 100%;
    margin-bottom: 2rem;
  }
}

@media screen and (min-width: 768px) {
  .skills__name img {
    width: 5rem;
  }
  .vite {
    width: 4rem;
  }
  .tools {
    grid-template-columns: 15% 15% 15% 15%;
    grid-template-rows: 7rem;
    width: 80%;
  }
}

@media screen and (min-width: 768px) {
  .contact__social {
    width: 50%;
    max-width: 500px;
  }
  .contact__email,
  .contact__phone,
  .contact__map {
    justify-content: center;
    padding-bottom: 0.5rem;
  }
  .icon-social {
    padding-bottom: 1rem;
  }
}
