@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;400&display=swap');

* {
  box-sizing: border-box;
}

:root {
  --primary: #264653;
  --primary-light: #3c6677;
  --secondary: #20796e;
  --text: #222;
  --text-light: #555;
  --text-muted: #666;
  --text-soft: #888;
  --bg: #f4f4f4;
  --bg-header: #d6d6d6;
  --gray: #e2e2e2;
  --border: #eaeaea;
  --radius: 22px;
}

body.dark-mode {
  --primary: #2a9d8f;
  --primary-light: #3c6677;
  --secondary: #264653;
  --text: #f4f4f4;
  --text-light: #ccc;
  --text-muted: #aaa;
  --text-soft: #888;
  --bg: #121212;
  --bg-header: #1e1e1e;
  --gray: #202020;
  --border: #333;
}

body {
  font-family: 'Montserrat', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4vh 12vw;
  background: var(--bg-header);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  font-weight: bold;
  letter-spacing: 3px;
  font-size: 1.1rem;
}
.header-controls {
  display: flex;
  gap: 1rem; 
  align-items: center;
}
.menu-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
}
nav {
  display: flex;
  gap: 2.5rem;
}
nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.2s;
  position: relative;
}
nav a.activo, nav a:hover {
  color: var(--primary);
}
nav a.activo::after, nav a:hover::after {
  content: '';
  display: block;
  width: 100%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  margin-top: 2px;
}

.btn-mode {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text);
    transition: color 0.2s;
}
.btn-mode:hover {
    color: var(--primary);
}

/* Secciones */
section {
  margin: 6vh 12vw;
  scroll-margin-top: 90px; 
}
.seccion-titulo {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
  position: relative;
}
.seccion-titulo::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  margin-top: 8px;
}

/* Perfil */
.perfil {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6rem;
}
.perfil-img {
  width: 400px;
  height: 400px;
  border-radius: 50%;
  border: 6px solid var(--primary);
  object-fit: cover;
}
.perfil-info {
  max-width: 640px;
}
.perfil-info h1 {
  font-size: 2.8rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  line-height: 1.1;
}
.perfil-info p .highlight {
  color: var(--primary);
  font-weight: bold;
}
.perfil-info p {
  margin: 0 0 1.5rem 0;
  color: var(--text-light);
  font-size: 1.08rem;
}
.btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.7rem 1.7rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 1rem;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(38, 70, 83, 0.15);
  transition: background 0.2s, box-shadow 0.2s;
}
.btn:hover {
  background: var(--secondary);
  box-shadow: 0 2px 16px rgba(42, 157, 143, 0.18);
}

/* Proyectos */
.proyectos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
}

.proyecto-card {
  background: var(--gray);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(38, 70, 83, 0.1);
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 2px solid var(--primary-light);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.proyecto-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(38, 70, 83, 0.2);
  border-color: var(--primary);
}

.proyecto-card::before {
  content: '';
  position: absolute;
  top: -30px; left: -30px;
  width: 120px; height: 40px;
  background: var(--primary);
  opacity: 0.15;
  border-radius: 40px;
  transform: rotate(-15deg);
}

.proyecto-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(38, 70, 83, 0.1);
}

.proyecto-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.proyecto-card p {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 1rem;
}

.proyecto-card p a{
  color: var(--text-muted);
  padding-left: 1rem;
}

/* Sobre Mi */
.habilidades {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.habilidad-card h4 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}
.habilidad-items {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.imagen-container {
  flex: 1 1 calc(25% - 1rem); 
  max-width: calc(25% - 1rem);
  height: 45px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 12px rgba(38, 70, 83, 0.1);
  border: 2px solid var(--primary-light);
  background-color: var(--gray);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}
.imagen-container:hover {
  border: 2px solid var(--primary);
  box-shadow: 0 2px 8px rgba(38, 70, 83, 0.2);
  transform: translateY(-3px);
}
.imagen-container img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.imagen-container span {
  font-weight: bold;
}

.experiencia {
  margin-bottom: 3rem;
}
.experiencia-list {
  display: grid;
  grid-template-columns: 1fr 3fr;
}
.experiencia-list .compania {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}
.experiencia-list .rol {
  font-weight: 600;
  margin-bottom: 0.8rem;
  font-size: 1rem;
}
.experiencia-list ul {
  padding-left: 1.2rem;
  list-style: none;
}
.experiencia-list li {
  margin-bottom: 0.7rem;
  color: var(--text-light);
  font-size: 1rem;
  position: relative;
}
.experiencia-list li::before {
  content: '✔';
  position: relative;
  padding-right: 0.8rem;
  color: var(--primary);
  font-size: 1rem;
}

/* Contacto */
.contacto-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.contacto-info h3 {
  font-size: 1.6rem;
  margin-bottom: 0.8rem;
}

.contacto-info p {
  margin-bottom: 1.5rem;
  color: var(--text-light);
}

.contacto-datos {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contacto-datos div {
  border: 1px solid var(--border);
  background: var(--gray);
  padding: 1rem;
  text-align: center;
  border-radius: var(--radius);
  flex: 1;
}

.dato-num {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary);
  display: block;
}

.dato-texto {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.contacto-lista {
  border: 1px solid var(--border);
  background: var(--gray);
  padding: 1rem;
  border-radius: var(--radius);
  flex: 1;
}
.contacto-lista ul {
  padding: 0 20px;
}
.contacto-lista li {
  margin-bottom: 0.5rem;
  color: var(--text-light);
}
.contacto-redes {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.contacto-redes a {
  color: var(--text-muted);
  font-size: 1.8rem;
  transition: color 0.3s ease;
}

.contacto-redes a:hover {
  color: var(--primary); 
}

.contacto-form {
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--gray);
}
.contacto-form label {
  display: block;
  margin-bottom: 0.6rem;
  font-weight: bold;
  color: var(--text);
}
.contacto-form label span {
  color: #f52929;
}
.contacto-form input,
.contacto-form textarea {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  background: white;
  color: var(--text);
}
.contacto-form textarea {
  font-family: 'Montserrat', Arial, sans-serif;
  resize: vertical;
  min-height: 120px;
}
.contacto-form i {
  margin-right: 10px;
}

/* Footer */
footer {
  margin: 4rem 0 0 0;
  padding: 2rem 6vw;
  background: var(--gray);
  text-align: center;
  color: var(--text-soft);
  font-size: 0.98rem;
  border-top: 1px solid var(--border);
}
footer .footer-links {
  margin-bottom: 1rem;
}
footer a {
  color: var(--primary);
  margin: 0 0.5rem;
  text-decoration: none;
  font-weight: 500;
}
footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 1100px) {
  header {
    padding: 2rem 3vw;
  }
  section {
    margin: 3rem 3vw;
  }
  .perfil {
    flex-direction: column-reverse;
    align-items: center;
    gap: 1.5rem;
  }
  .perfil-img {
    width: 250px;
    height: 250px;
  }

  .imagen-container {
    flex: 1 1 calc(33.33% - 1rem);
    max-width: calc(33.33% - 1rem);
  }
  .experiencia-list {
    grid-template-columns: 1fr;
  }
  .contacto-container {
    grid-template-columns: 1fr;
  }
  footer {
    padding: 2rem 3vw;
  }
}

@media (max-width: 768px) {
  nav {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-header);
    flex-direction: column;
    align-items: flex-start;
    width: 200px;
    padding: 1rem;
    gap: 1rem;
    display: none;
  }
  nav.open {
    display: flex;
  }
  .menu-toggle {
    display: block;
  }
  .btn-mode {
    align-self: flex-end;
  }
  .perfil-img {
    width: 180px;
    height: 180px;
  }
  .perfil-info h1 {
    font-size: 2rem;
  }
  .seccion-titulo {
    font-size: 1.8rem;
  }
  .imagen-container {
    flex: 1 1 calc(50% - 1rem);
    max-width: calc(50% - 1rem);
  }
  .proyectos {
    grid-template-columns: 1fr;
  }
  .contacto-datos {
    flex-direction: column;
  }
  .contacto-datos div {
    width: 100%;
  }
}

@media (max-width: 480px) {
  header,
  section,
  footer {
    padding: 1rem 2vw;
    margin: 0;
  }
  .perfil-img {
    width: 120px;
    height: 120px;
    border-width: 4px;
  }
  .perfil-info h1 {
    font-size: 1.5rem;
  }
  .seccion-titulo {
    font-size: 1.4rem;
  }
  .proyecto-card h3 {
    font-size: 1.1rem;
  }
  .imagen-container {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .contacto-redes {
    flex-wrap: wrap;
    gap: 1.2rem;
  }
  .contacto-form {
    padding: 1rem;
  }
  .contacto-form input,
  .contacto-form textarea {
    font-size: 0.95rem;
  }
  .btn {
    width: 100%;
    padding: 0.6rem;
    font-size: 0.95rem;
    margin-bottom: 10px;
  }
  nav a {
    font-size: 0.95rem;
  }
  footer {
    font-size: 0.9rem;
  }
}
