/* ============================================================
   PORTAFOLIO — usa las variables de base.css
   ============================================================ */

/* ---------- Cabecera ---------- */

.cabecera-portafolio {
  padding: 72px 0 40px;
  border-bottom: 1px solid var(--line);
}

.cabecera-portafolio h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  margin: 14px 0 22px;
}

.cabecera-parrafo {
  max-width: 79ch;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--tms);
}

/* Título de la sección de proyectos.
   OJO: no se llama .titulo-seccion porque esa clase la usa el footer (base.css). */
.titulo-proyectos {
  font-size: 2rem;
  margin-bottom: 28px;
  color: var(--tp);
}

/* ---------- Lista ---------- */

.lista-proyectos {
  padding-top: 56px;
}

.pila-proyectos {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ---------- Animación de entrada ---------- */

@keyframes entradaElegante {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Tarjeta de proyecto ---------- */

.proyecto {
  display: flex;
  flex-direction: column;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 6px 6px 0 var(--brass);
  overflow: hidden;
  animation: entradaElegante 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

/* Efecto cascada */
.proyecto:nth-child(1) { animation-delay: 0.1s; }
.proyecto:nth-child(2) { animation-delay: 0.25s; }
.proyecto:nth-child(3) { animation-delay: 0.4s; }
.proyecto:nth-child(4) { animation-delay: 0.55s; }
.proyecto:nth-child(5) { animation-delay: 0.7s; }
.proyecto:nth-child(6) { animation-delay: 0.85s; }
.proyecto:nth-child(7) { animation-delay: 1s; }

.proyecto:hover,
.proyecto:focus-within {
  transform: translate(-4px, -6px);
  box-shadow: 12px 12px 0 var(--brass);
}

/* El botón reacciona cuando el cursor toca cualquier parte de la tarjeta */
.proyecto:hover .proyecto-enlace {
  background: var(--tp);
  border-color: var(--tp);
  color: var(--paper);
}

/* ---------- Vista previa (iframe) ---------- */

.proyecto-imagen {
  width: 100%;
  height: 320px;
  border-bottom: 1px solid var(--line);
  background-color: var(--paper);
  overflow: hidden;
  position: relative;
}

.proyecto-imagen img,
.proyecto-imagen iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  object-fit: cover;
}

.proyecto-imagen iframe {
  filter: grayscale(15%) opacity(0.9);
  transition: filter 0.4s ease;
}

.proyecto:hover .proyecto-imagen iframe {
  filter: grayscale(0%) opacity(1);
}

/* ---------- Información del proyecto ---------- */

.proyecto-info {
  padding: 32px 36px;
}

.proyecto-tipo {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--brass);
  border: 1px solid var(--brass);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 14px;
}

.proyecto h3 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin-bottom: 14px;
}

.proyecto-descripcion {
  max-width: 100%;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--tms);
  margin-bottom: 22px;
}

/* ---------- Lenguajes ---------- */

.etiquetas-lenguaje {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.etiquetas-lenguaje li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--tp);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 11px;
}

/* ---------- Ficha inferior ---------- */

.proyecto-ficha {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  padding: 24px 36px;
  background: var(--paper);
  border-top: 1px dashed var(--line);
}

.ficha-dato {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.1;
}

.ficha-dato span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

/* ---------- Botón de enlace ---------- */

.proyecto-enlace {
  margin-left: auto;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  padding: 12px 18px;
  border-radius: 6px;
  border: 1px solid var(--brass);
  background: var(--brass);
  color: var(--paper-warm);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease,
              transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.proyecto-enlace:hover {
  background: var(--tp);
  border-color: var(--tp);
  color: var(--paper);
  transform: scale(1.05);
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .proyecto-imagen {
    height: 250px;
  }
}

@media (max-width: 768px) {
  .proyecto-info {
    padding: 26px 22px;
  }

  .proyecto-ficha {
    flex-wrap: wrap;
    gap: 14px 28px;
    padding: 20px 22px;
  }
}

@media (max-width: 500px) {
  .proyecto-enlace {
    width: 100%;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .proyecto,
  .proyecto-enlace,
  .proyecto-imagen iframe {
    animation: none;
    transition: none;
  }
}
