/* VARIABLES DE COLOR */
:root {
  --azul-marino: #1A2A47;
  --azul-medio: #2C3E70;
  --azul-claro: #4A6FA5;
  --blanco: #FFFFFF;
  --gris-claro: #E5E9F0;
  --gris-oscuro: #3B3B3B;
  --sombra: rgba(0, 0, 0, 0.1);
}

/* RESET BÁSICO */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--blanco);
  color: var(--azul-marino);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ENLACES */
a {
  color: var(--azul-claro);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover,
a:focus {
  color: var(--azul-medio);
  outline: none;
}

/* NAVBAR */
nav {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  background-color: var(--azul-marino);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  z-index: 10000;
  box-shadow: 0 2px 8px var(--sombra);
  transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

nav.scrolled {
  background-color: var(--azul-medio);
  padding: 0.6rem 2rem;
  box-shadow: 0 5px 15px var(--sombra);
}

nav .logo {
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--blanco);
  letter-spacing: 3px;
  user-select: none;
  cursor: default;
  text-transform: uppercase;
}

nav ul {
  display: flex;
  gap: 2.2rem;
  list-style: none;
}

nav ul li a {
  text-decoration: none; /* Elimina cualquier subrayado por defecto */
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--blanco);
  padding: 6px 0;
  position: relative;
  transition: color 0.3s ease;
}

nav ul li a::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 3px;
  background-color: var(--azul-claro);
  left: 0;
  bottom: -4px;
  border-radius: 2px;
  transition: width 0.3s ease;
}

nav ul li a:hover::after,
nav ul li a.active::after {
  width: 100%;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--azul-claro);
}

/* BURGER MENU */
.burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  z-index: 10001;
}

.burger div {
  width: 28px;
  height: 3px;
  background-color: var(--blanco);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.burger.active div:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.burger.active div:nth-child(2) {
  opacity: 0;
}

.burger.active div:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

@media (max-width: 768px) {
  nav ul {
    position: fixed;
    top: 65px;
    right: -110%;
    flex-direction: column;
    background-color: var(--azul-marino);
    width: 220px;
    padding: 2.5rem 1.5rem;
    gap: 2rem;
    height: calc(100vh - 65px);
    transition: right 0.35s ease;
    box-shadow: -5px 0 15px var(--sombra);
  }

  nav ul.show {
    right: 0;
  }

  .burger {
    display: flex;
  }
}

/* SECCIONES GENERALES */
section {
  padding: 110px 20px 70px;
  max-width: 900px;
  margin: auto;
}

section h2 {
  color: var(--azul-marino);
  font-size: 2.3rem;
  margin-bottom: 1.6rem;
  border-bottom: 3px solid var(--azul-claro);
  padding-bottom: 0.3rem;
  width: fit-content;
  font-weight: 700;
  user-select: none;
}

/* BOTONES */
.btn {
  background-color: var(--azul-medio);
  color: var(--blanco);
  padding: 0.85rem 2rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 5px 15px rgba(44, 62, 112, 0.3);
}

.btn:hover,
.btn:focus {
  background-color: var(--azul-claro);
  transform: scale(1.05);
  outline: none;
}

/* INICIO / HERO */
#inicio {
  text-align: center;
  padding-top: 140px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

#inicio img {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 5px solid var(--azul-medio);
  object-fit: cover;
  margin-bottom: 1.2rem;
  transition: transform 0.4s ease;
  box-shadow: 0 8px 15px rgba(26, 42, 71, 0.4);
}

#inicio img:hover {
  transform: scale(1.1) rotate(3deg);
  box-shadow: 0 14px 25px rgba(26, 42, 71, 0.7);
}

#inicio h1 {
  font-size: 3rem;
  color: var(--azul-marino);
  margin-bottom: 0.5rem;
  letter-spacing: 3px;
}

#inicio p {
  font-size: 1.3rem;
  color: var(--azul-medio);
  margin-bottom: 2rem;
  font-weight: 500;
}

/* SERVICIOS */
#servicios {
  max-width: 1140px;
  margin: 0 auto 60px;
}

.servicio {
  background-color: var(--gris-claro);
  padding: 2.2rem 1.8rem;
  border-radius: 12px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.35s ease, transform 0.35s ease;
  cursor: default;
  color: var(--azul-marino);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex: 1 1 100%;
  min-height: 280px;
}

.servicio:hover,
.servicio:focus-within {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14);
  transform: translateY(-6px);
}

.servicio h3 {
  margin-top: 1rem;
  margin-bottom: 0.9rem;
  font-weight: 700;
  color: var(--azul-marino);
}

.servicio p {
  font-size: 1.05rem;
  color: var(--gris-oscuro);
}

.servicio i {
  color: var(--azul-medio);
  margin-bottom: 0.8rem;
  transition: color 0.3s ease;
}

.servicio:hover i {
  color: var(--azul-claro);
  transform: scale(1.1);
  transition: transform 0.3s ease, color 0.3s ease;
}

/* PROYECTOS */
#proyectos {
  max-width: 900px;
  margin: 0 auto 80px;
}

#proyectos h2 {
  text-align: center;
}

.proyecto {
  background-color: var(--gris-claro);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  cursor: pointer;
}

.proyecto:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.18);
}

.proyecto img {
  width: 100%;
  max-width: 400px;
  object-fit: cover;
  flex-shrink: 0;
}

.proyecto .info {
  padding: 1.5rem 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.proyecto .info h4 {
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--azul-medio);
  user-select: none;
}

.proyecto .info p {
  font-size: 1rem;
  color: var(--gris-oscuro);
  flex-grow: 1;
  margin-bottom: 1.2rem;
}

.proyecto .info a {
  font-weight: 600;
  color: var(--azul-claro);
  align-self: flex-start;
  transition: color 0.3s ease;
}

.proyecto .info a:hover,
.proyecto .info a:focus {
  color: var(--azul-medio);
  outline: none;
}

/* SOBRE MÍ */
#sobre-mi {
  max-width: 700px;
  margin: 0 auto 80px;
}

#sobre-mi p {
  font-size: 1.18rem;
  color: var(--gris-oscuro);
  line-height: 1.8;
  font-weight: 500;
  user-select: text;
  text-align: center;
}

/* CONTACTO */
#contacto {
  max-width: 500px;
  margin: 0 auto 100px;
}

#contacto h2 {
  text-align: center;
}

#contacto form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 0 15px;
}

#contacto input,
#contacto textarea {
  padding: 1rem;
  font-size: 1.05rem;
  border: 1.8px solid var(--gris-claro);
  border-radius: 8px;
  transition: border-color 0.3s ease;
  resize: vertical;
}

#contacto input:focus,
#contacto textarea:focus {
  border-color: var(--azul-medio);
  outline: none;
  box-shadow: 0 0 8px var(--azul-claro);
}

#contacto button {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background-color: var(--azul-medio);
  color: var(--blanco);
  box-shadow: 0 6px 15px rgba(44, 62, 112, 0.3);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#contacto button:hover,
#contacto button:focus {
  background-color: var(--azul-claro);
  transform: scale(1.03);
  outline: none;
}

/* INFO DE CONTACTO ABAJO */
#contacto p {
  text-align: center;
  margin-top: 1.4rem;
  font-size: 1rem;
  color: var(--azul-medio);
  font-weight: 600;
  user-select: text;
}

#contacto p a {
  color: var(--azul-claro);
  transition: color 0.3s ease;
}

#contacto p a:hover,
#contacto p a:focus {
  color: var(--azul-medio);
  outline: none;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 1.4rem 1rem;
  background-color: var(--azul-marino);
  color: var(--blanco);
  font-size: 0.95rem;
  user-select: none;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* MEDIA QUERIES ADICIONALES PARA MEJORAR RESPONSIVE */
@media (max-width: 992px) {
  #inicio h1 {
    font-size: 2.6rem;
  }
  #inicio p {
    font-size: 1.15rem;
  }
}

@media (max-width: 576px) {
  #inicio h1 {
    font-size: 2.2rem;
  }
  #inicio p {
    font-size: 1.05rem;
  }
}
