main {
  flex: 1;
  padding: 1rem;
  margin-top: 1rem;
}

.intro {
  margin-bottom: 2rem;
  text-align: center;
}

.projects {
  margin-bottom: 2rem;
}

.projects h2 {
  text-align: center;
  margin-bottom: 1rem;
}

/* Botonera de filtros de proyectos */
.category-filters {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}
.category-filters button {
  background: var(--accent-color);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}
.category-filters button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.category-filters button:active {
  transform: scale(0.95);
}
.category-filters button.active-category {
  /*background: #4CAF50;*/
  /*background: #53a8b1;*/
  background: var(--active-text-color);
  /*text-shadow: 1px 1px 2px black;*/
  text-shadow: 1px 3px 1px black;
}

/* Grid de proyectos */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  justify-items: center;
  gap: 1rem;
}

.project-card {
  width: 250px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  
  padding: 0.5rem;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.project-card img {
  width: 100%;
  display: block;
  border-radius: 8px;
}
.project-card h3 {
  padding: 0.5rem 1rem;
}
.project-card p {
  padding: 0 1rem;
  font-size: 0.9rem;
}
.project-link {
  display: block;
  text-align: center;
  padding: 0.5rem;
  background: var(--accent-color);
  color: #fff;
  text-decoration: none;
  transition: background var(--transition-speed);
  border-radius: 8px;
}
.project-link:hover {
  background: #e0435f;
}

/* Sección extra */
.content-section {
  padding: 1rem;
  background: #eee;
  border-radius: 8px;
  /*margin-top: 0.5rem;*/
  margin-top: 0.5rem !important;
}


/* SECCION DE ESTUDIOS Y EXPERIENCIA TIMELINE*/
.experiencia {
  padding: 2rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.experiencia h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  border-left: 3px solid var(--accent-color);
}

.timeline-item {
  position: relative;
  margin: 2rem 0 2rem 2rem;
  opacity: 0; /* para animación fade-in */
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-icon {
  position: absolute;
  left: -36px;
  background: var(--accent-color);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.timeline-content {
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.timeline-content h3 {
  margin-bottom: 0.3rem;
  color: var(--primary-color);
}

.timeline-date {
  font-size: 0.9rem;
  color: #666;
  display: block;
  margin-bottom: 0.5rem;
}

/* SECCION DE METRICAS*/

.metricas {
  padding: 2rem 1rem;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.metricas h2 {
  margin-bottom: 2rem;
}

.metricas-grid {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.metrica {
  background: #fff;
  padding: 1rem 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  width: 200px;
  opacity: 0; /* para la animación fade-in */
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.metrica.visible {
  opacity: 1;
  transform: translateY(0);
}

.metrica .contador {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--accent-color);
  display: block;
  margin-bottom: 0.5rem;
}

/* SECCION DE SKILLS Y CV DESCARGABLE */

.habilidades {
  padding: 2rem 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.habilidades h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.habilidades-contenedor {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.habilidades-lista {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.habilidad {
  font-size: 2.5rem;
  color: var(--accent-color);
  opacity: 0; /* inicia invisible para animación */
  transform: translateY(30px);
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.habilidad.visible {
  opacity: 1;
  transform: translateY(0);
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.cv-button {
  background: linear-gradient(135deg, var(--accent-color), #ff758c);
  color: #fff;
  text-decoration: none;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  font-weight: bold;
  transition: background 0.3s ease, transform 0.3s ease;
}

.cv-button:hover {
  background: linear-gradient(135deg, #ff758c, var(--accent-color));
  transform: scale(1.05);
}

/* DEMO INTERACTIVA DE JUEGO EN UNITY */ 
.demo-interactiva {
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.demo-interactiva h2 {
  margin-bottom: 1.5rem;
}

.demo-wrapper {
  position: relative;
  /*width: 80%;*/
  width: 90%;
  margin: 0 auto;
  aspect-ratio: 4/3; /* relación aproximada de Unity WebGL */
  background: #000;
  border: 2px solid var(--accent-color);
  border-radius: 8px;
  overflow: hidden;
}

.demo-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.demo-buttons {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.demo-buttons button {
  background: var(--accent-color);
  color: #fff;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  transition: background 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

.demo-buttons button:hover {
  background: #e0435f;
  transform: scale(1.05);
}

.demo-loading {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  font-weight: bold;
  z-index: 10;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.demo-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.demo-message {
  margin-top: 1rem;
  font-size: 1rem;
  color: #f33;
  font-weight: bold;
}