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

:root {
  --color-fondo: #121212;
  --color-texto: #f5f5f5;
  --color-acento: #ff6f00;
  --color-card: #1e1e1e;
  --color-borde: #2c2c2c;
  --fuente-principal: 'Montserrat', sans-serif;
}

body {
  margin: 0;
  font-family: var(--fuente-principal);
  color: var(--color-texto);
  background-color: var(--color-fondo);
  line-height: 1.6;
}

header, nav, section, footer {
  max-width: 1200px;
  margin: auto;
  padding: 2rem;
}

/* Navegación */
nav {
  background-color: #000;
  color: var(--color-texto);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

nav a {
  color: var(--color-texto);
  margin: 0 1rem;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

nav a:hover {
  color: var(--color-acento);
}

/* Títulos */
h1, h2, h3, h4 {
  margin-top: 0;
  font-weight: 700;
}

h1 {
  font-size: 3rem;
  color: var(--color-acento);
}

/* Secciones */
section {
  border-bottom: 1px solid var(--color-borde);
  padding-top: 4rem;
  padding-bottom: 4rem;
}

/* Hero Visual */
header {
  text-align: center;
  background: linear-gradient(135deg, #1a1a1a, #000000);
  padding-top: 6rem;
  padding-bottom: 6rem;
  border-bottom: 1px solid var(--color-borde);
}

header p {
  font-size: 1.3rem;
  max-width: 700px;
  margin: 1rem auto;
  color: #ccc;
}

/* Grilla de portafolio */
.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  background-color: var(--color-card);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--color-borde);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }
.card:nth-child(5) { animation-delay: 0.4s; }
.card:nth-child(6) { animation-delay: 0.5s; }
.card:nth-child(7) { animation-delay: 0.6s; }
.card:nth-child(8) { animation-delay: 0.7s; }
.card:nth-child(9) { animation-delay: 0.8s; }
.card:nth-child(10) { animation-delay: 0.9s; }
.card:nth-child(11) { animation-delay: 1s; }
.card:nth-child(12) { animation-delay: 1.1s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card img, .card video {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.card h4 {
  color: var(--color-acento);
}

/* Formulario */
form input, form textarea, form button {
  display: block;
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--color-borde);
  border-radius: 8px;
  background-color: #181818;
  color: var(--color-texto);
}

form textarea {
  resize: vertical;
  min-height: 120px;
}

form button {
  background-color: var(--color-acento);
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

form button:hover {
  background-color: #e65c00;
}

/* Footer */
footer {
  background-color: #0f0f0f;
  text-align: center;
  font-size: 0.9rem;
  color: #888;
  padding: 2rem;
}

/* Servicios */
.grid-servicios {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  text-align: center;
}

.servicio {
  background-color: var(--color-card);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
}

.servicio i {
  font-size: 2rem;
  color: var(--color-acento);
  margin-bottom: 0.8rem;
}

.servicio p {
  margin: 0;
  font-weight: 500;
  color: var(--color-texto);
}

/* Software en CV con íconos */
.lista-software {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

.lista-software li {
  display: flex;
  align-items: center; /* Alineación vertical centrada */
  gap: 1rem;
  margin-bottom: 1.2rem;
  background-color: var(--color-card);
  padding: 1.2rem 1.5rem; /* Más equilibrado arriba y abajo */
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.lista-software i {
  font-size: 1.8rem;
  color: var(--color-acento);
}

/* Responsive ajustes */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
    align-items: flex-start;
  }
  nav div:last-child {
    display: flex;
    flex-wrap: wrap;
    margin-top: 1rem;
  }
  nav a {
    margin: 0.5rem 1rem 0.5rem 0;
  }

  h1 {
    font-size: 2.4rem;
  }
}
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: none;
  background-color: var(--color-acento);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: opacity 0.3s ease;
  z-index: 999;
}

#backToTop:hover {
  background-color: #e65c00;
}
.servicio:nth-child(n) {
  animation-delay: calc(0.1s * var(--i));
}