/* ================================ESTILOS GENERALES================================ */
body {
  margin: 0;
  padding: 0;
  background-color: #e1e1e1;
  font-family: 'Open Sans', sans-serif;
  cursor: none; /* ocultamos el cursor nativo */
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s;
}

a:hover {
  color: #2fff28;
}

/* ================================hERO SECTION (Portada)================================ */
.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

#p5-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0; /* canvas al fondo */
  background: #000;
}

.hero-text {
  position: relative;
  z-index: 1; /* texto encima del canvas */
  color: #fff;
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: 3rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: fadeDown 1.5s ease forwards; /* animación al cargar */
}

/* Animación para el texto del hero */
@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* ================================AVBAR=============================== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.95);
  padding: 1rem 2rem;
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar .logo {
  font-size: 1.4rem;
  font-weight: bold;
  font-family: 'Space Mono', monospace;
}

.navbar .nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.navbar .nav-links a {
  color: white;
}

.navbar .nav-links a:hover {
  color: #2fff28;
}

/* ================================ CURSOR PERSONALIZADO=============================== */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 25px;
  height: 25px;
  background-color: rgba(47, 255, 40, 0.8);
  border-radius: 50%;
  pointer-events: none; /* no bloquea clicks */
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  z-index: 10000;
  transition: transform 0.1s ease;
}

/* ================================cONTENEDOR PRINCIPAL=============================== */
#container {
  max-width: 1200px;
  margin: 2em auto;
  padding: 1em;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2em;
  align-items: start;
}

/* ================================ÍTULOS=============================== */
h2 {
  text-align: left;
  font-family: 'Space Mono', monospace;
  font-weight: bold;
  font-size: 2.5rem;
}

/* ================================INTRODUCCIÓN================================ */
.intro {
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 2rem;
  align-items: start;
}

.intro-left h2 {
  margin: 0;
}

.intro-right {
  text-align: justify;
}

.intro-right p {
  margin: 0 0 1em;
  line-height: 1.6;
}

.intro-right a {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.intro-right button {
  font-family: 'Space Mono', monospace;
  padding: 15px 45px;
  border: none;
  background-color: #2fff28;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.intro-right button:hover {
  background: #000;
  color: #2fff28;
  transform: scale(1.05);
}

.intro-right button:focus {
  outline: 3px solid #2fff28;
  outline-offset: 3px;
}

/* ================================GALERÍA DE PROYECTOS================================ */
.proyectos {
  display: flex;
  flex-direction: column;
}

.galeria {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5em;
  justify-content: center;
}

.tarjeta {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tarjeta:hover {
  transform: scale(1.05);
  filter: contrast(110%);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.tarjeta img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.tarjeta h3 {
  font-family: 'Space Mono', monospace;
  font-size: 2rem;
  font-weight: bold;
  color: #333;
  text-align: center;
  margin: 0.8rem 0;
  transition: color 0.3s ease, transform 0.3s ease;
}

.tarjeta:hover h3 {
  color: #2fff28;
  transform: scale(1.05);
}

/* ================================MODAL============================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: #fff;
  padding: 2rem;
  border-radius: 12px;
  width: 80%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  text-align: justify;
  line-height: 1.6;
}

.modal-content img {
  max-width: 70%;
  border-radius: 8px;
  display: block;
  margin: 0 auto 1.5rem;
}

.modal-content p {
  margin-bottom: 1.5rem;
  font-family: 'Open Sans', sans-serif;
}

h4 {
  text-align: left;
  font-family: 'Space Mono', monospace;
  font-weight: bold;
  font-size: 2rem;
  color: #2fff28;
  margin-bottom: 1rem;
}

/* Botones dentro del modal */
.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.modal-btn {
  display: inline-block;
  padding: 12px 20px;
  font-family: 'Space Mono', monospace;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-green {
  background-color: #2fff28;
  color: #000;
}

.btn-green:hover {
  background-color: #000;
  color: #2fff28;
}

.btn-black {
  background-color: #000;
  color: #fff;
}

.btn-black:hover {
  background-color: #2fff28;
  color: #000;
}

/* Botón de cerrar modal */
.close {
  color: #aaa;
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: black;
}

/* ================================FOOTER================================ */
.footer {
  background-color: #111;
  color: #ccc;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
}

.footer a {
  color: #2fff28;
  margin: 0 0.5rem;
}

.footer a:hover {
  text-decoration: underline;
}

/* ================================BOTÓN FLOTANTE "Scroll to top"=============================== */
#scrollTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  background: #2fff28;
  color: #000;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  display: none;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#scrollTopBtn:hover {
  background: #000;
  color: #2fff28;
  transform: scale(1.1);
}

/* ================================EFECTOS DE SCROLL================================ */
.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================================ RESPONSIVE (Pantallas pequeñas)================================ */
@media (max-width: 768px) {
  .intro {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1rem;
  }

  .galeria {
    grid-template-columns: 1fr;
  }

  .hero-text {
    font-size: 2rem;
    padding: 0 1rem;
  }

  .navbar {
    flex-direction: column;
    gap: 0.8rem;
  }
}
