/* Reset básico */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Share Tech Mono', monospace;
  background-color: #0d0d0d;
  color: #e0e0e0;
  line-height: 1.6;
  padding: 20px;

  max-width: 960px;
  margin: 0 auto;
}

/* Header y navegación */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 50px;
}

.logo {
  font-size: 1.8rem;
  letter-spacing: 2px;
  cursor: pointer;
  transition: color 0.3s ease;
}

nav a {
  color: #ccc;
  margin-left: 20px;
  text-decoration: none;
  transition: color 0.3s;
}

nav a:hover,
.logo:hover {
  color: #00ffc3;
}

/* Sección principal */
.hero {
  text-align: center;
  padding: 80px 20px;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: #00ffc3;
  transition: all 0.3s ease;
  cursor: pointer;
}

/* Secciones generales */
#about,
#projects,
#contact {
  margin: 60px 0;
}

/* Proyectos */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.project-card {
  border: 1px solid #333;
  padding: 20px;
  border-radius: 10px;
  background-color: #161616;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 255, 195, 0.1);
}

.project-card h3 {
  margin-bottom: 10px;
  color: #00ffc3;
}

.project-card a {
  color: #00ffc3;
  text-decoration: none;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 60px;
  padding: 20px 0;
  font-size: 0.9rem;
  color: #888;
}

/* Responsividad */
@media (min-width: 768px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero h1 {
    font-size: 3rem;
  }
}

/* Contact form */
#contact {
  margin: 60px 0;
  padding: 4rem 2rem;
  background-color: #111;
  border-radius: 10px;
}

#contact h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #00ffc3;
}

#contact form {
  max-width: 500px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#contact label {
  font-weight: bold;
  margin-bottom: 0.3rem;
  color: #e0e0e0;
}

#contact input,
#contact select,
#contact textarea {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #444;
  background-color: #1a1a1a;
  color: #f0f0f0;
  font-family: inherit;
}

#contact textarea {
  height: 100px;
  resize: vertical;
}

#contact button {
  background: #2563eb;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease, transform 0.2s ease;
}

#contact button:hover {
  background-color: #1e4fcc;
  transform: scale(1.03);
}

#contact .alt-contact {
  text-align: center;
  margin-top: 2rem;
  color: #ccc;
}

#contact .alt-contact a {
  color: #00ffc3;
  text-decoration: none;
}

/* === Project Demo Pages === */
.project-page {
  font-family: 'Share Tech Mono', monospace;
  background: #0a0a0a;
  color: #f4f4f4;
  line-height: 1.6;
  padding: 2rem;
  margin-left: auto;
  margin-right: auto;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
}

.project-page > * {
  max-width: 1000px;
  width: 90%;
  margin: 0 auto;
  text-align: center;
}

/* === Header === */
.demo-header {
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.demo-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.demo-header p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 400px;
}

.back-btn {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.5rem 1rem;
  background: #111;
  color: #00ffcc;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: #00ffcc;
  color: #111;
}

/* Fix responsive header en móviles */
@media (max-width: 768px) {
  .demo-header {
    flex-direction: column;
    text-align: center;
  }

  .demo-header h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }

  .demo-header p {
    font-size: 1rem;
    max-width: 90%;
    margin: 0 auto 1rem;
    word-wrap: break-word;
  }

  .back-btn {
    margin-top: 1rem;
  }
}

/* Showcase */
.demo-showcase {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 2rem;
  padding: 3rem 2rem;
}

.demo-image,
.demo-description {
  flex: 1 1 400px;
  max-width: 500px;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 255, 204, 0.3);
  transition: transform 0.3s ease;
}

.demo-image:hover {
  transform: scale(1.03);
}

.demo-description h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

/* Features Section */
.demo-features {
  background: #111;
  padding: 4rem 2rem;
}

.demo-features h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  justify-items: center;
}

.feature {
  background: #1a1a1a;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.feature h3 {
  margin-bottom: 0.5rem;
  color: #00ffcc;
}

/* Call to Action */
.demo-cta {
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #2c5364, #203a43, #0f2027);
}

/* Animaciones suaves */
.demo-showcase,
.demo-features,
.demo-cta {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s forwards;
}

.demo-showcase { animation-delay: 0.2s; }
.demo-features { animation-delay: 0.4s; }
.demo-cta { animation-delay: 0.6s; }

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

/* Fix específico para móviles en vertical (pantallas pequeñas) */
@media (max-width: 480px) {
  .demo-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1rem;  /* menos padding */
  }

  .demo-header h1 {
    font-size: 1.6rem;   /* más pequeño en vertical */
    margin-bottom: 1rem;
  }

  .demo-header p {
    font-size: 0.95rem;
    max-width: 90%;      /* que no se extienda demasiado */
    line-height: 1.4;
    margin-bottom: 1rem;
    word-break: break-word; /* corta si una palabra es larga */
  }

  .back-btn {
    width: 100%;          /* ocupa todo el ancho en vertical */
    max-width: 220px;     /* pero con límite */
    text-align: center;
    margin-top: 1rem;
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
  }
}