/* -------- RESET Y VARIABLES -------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-color: #f8f9fc;
  --text-color: #2c2c2c;
  --primary: #007bff;
  --primary-dark: #0056b3;
  --accent: #00c6ff;
  --header-bg: #111;
  --card-bg: #fff;
  --radius: 14px;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  --max-width: 1300px;
  --font-title: "Poppins", sans-serif;
  --font-body: "Inter", sans-serif;
}

/* -------- BODY -------- */
body {
  font-family: var(--font-body);
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.7;
  scroll-behavior: smooth;
}

/* -------- HEADER -------- */
header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  text-align: center;
  padding: 5rem 2rem 4rem;
  border-bottom: 4px solid var(--accent);
}

header h1 {
  font-family: var(--font-title);
  font-size: 2.6rem;
  margin-bottom: 1rem;
}

header p {
  font-size: 1.1rem;
  opacity: 0.95;
  max-width: 900px;
  margin: 0 auto 2.5rem;
}

header section {
  background: rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  border-radius: var(--radius);
  max-width: 900px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.8;
}

/* -------- TITULOS -------- */
h2 {
  text-align: center;
  font-family: var(--font-title);
  text-transform: uppercase;
  font-size: 1.8rem;
  margin: 4rem 0 2rem;
  color: #111;
  position: relative;
}

h2::after {
  content: "";
  width: 60px;
  height: 4px;
  background: var(--primary);
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 4px;
}

/* -------- CONTENEDORES -------- */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem 3rem;
}

/* -------- TARJETAS DE PROYECTO -------- */
.project-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.project-card h3 {
  font-family: var(--font-title);
  text-transform: uppercase;
  font-size: 1.2rem;
  color: var(--primary-dark);
}

.project-card h4 {
  text-transform: uppercase;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1rem;
}

.project-card p {
  text-align: justify;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* --- Alinear los botones al fondo de cada tarjeta --- */
.project-card {
  display: flex;
  flex-direction: column;
}

.project-card p {
  flex-grow: 1; /* Hace que el texto ocupe el espacio libre y empuje los enlaces hacia abajo */
}

.project-card a {
  display: inline-block;
  align-self: flex-start; /* Mantiene el tamaño natural de cada botón */
  margin-right: 0.5rem;
}

.project-card a:last-of-type {
  margin-bottom: 0; /* Elimina espacio extra si lo hubiera */
}

/* -------- BOTONES -------- */
.project-card a {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  margin: 0.2rem;
  text-decoration: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 500;
  transition: var(--transition);
}

.project-card a:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

/* -------- FOOTER -------- */
footer {
  background: var(--header-bg);
  color: #fff;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.9rem;
  border-top: 3px solid var(--accent);
}

/* -------- ANIMACIÓN SUAVE AL CARGAR -------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-card {
  animation: fadeInUp 0.6s ease forwards;
}

/* -------- RESPONSIVE -------- */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

  header section {
    width: 95%;
  }

  h2 {
    font-size: 1.5rem;
  }

  .project-card {
    padding: 1.5rem;
  }
}
