/* layout of the two cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  align-items: start;
  gap: 2rem;
  margin: 0;
  width: 100%;
}


.card {
  background: var(--bg-card);
  transform-origin: center center;
  position: relative;
  border: 1px solid var(--glass-2);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 8px 30px rgba(2, 6, 12, .6);
  backdrop-filter: blur(6px);
  cursor: pointer;
  overflow: visible;
  /* 👈 importante para permitir que el contenido salga hacia arriba */
  transition: transform .28s cubic-bezier(.2, .9, .2, 1), box-shadow .28s;

}

.card:hover {
  box-shadow: 0 18px 45px rgba(2, 6, 12, .8)
}

/* === 🔽 BOTÓN DE DESPLIEGUE (CHEVRON) === */
.toggle-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease, opacity 0.3s ease;
  width: 36px;
  height: 36px;
  border-radius: 16px;
  opacity: 0.8;
}

.toggle-btn img {
  width: 30px;
  height: 30px;
  filter: brightness(0.9) saturate(1.2);
  transition: transform 0.4s ease;
}

/* Hover efecto */
.toggle-btn:hover {
  opacity: 1;
  /* transform: scale(1.1); */
}

/* Rotación del ícono cuando el card se expande */
.card.expanded .toggle-btn img {
  transform: rotate(180deg);
}



.card .title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
}

.card .title h3 {
  margin: 0
}

.card .meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px
}

/* scale/expand animation */
.card .content {
  position: absolute;
  bottom: 100%;
  /* 👈 se abre hacia arriba */
  padding-top: 0;
  left: 0;
  width: 100%;
  background: var(--card, #0f1720);
  border-radius: var(--radius);
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition:
    max-height 0.6s ease,
    opacity 0.4s ease,
    transform 0.4s ease;
  z-index: 5;
  padding: 0 24px;
}

.card.expanded .content {
  padding-top: 16px 40px;
  max-height: 1200px;
  margin: 1rem auto;
  opacity: 1;
  transform: translateY(0) scale(1);
  padding: 24px 28px 28px;

}

.skills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px
}

.skill {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--bg-card);
  font-size: 13px;
  color: var(--muted)
}

.projects {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px
}

.project {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  border: 1px solid rgba(255, 255, 255, 0.02)
}

.project:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.1));
}

.project .thumb {
  width: 72px;
  height: 56px;
  border-radius: 8px;
  background: var(--bg-intro);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700
}

.project .info h4 {
  margin: 0 0 6px 0;
  font-size: 15px
}

.project .info p {
  margin: 0;
  color: var(--muted);
  font-size: 13px
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px
}

.btn {
  padding: 10px 12px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
  cursor: pointer
}

.btn.ghost {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.02);

}

/* subtle scale-in animation for cards inner parts */
.card .title,
.card .meta,
.card .skills,
.projects .project {
  transform-origin: center left;
  transition: transform .36s cubic-bezier(.2, .9, .2, 1) .03s, opacity .28s
}

.card .reveal {
  transform: translateY(8px) scale(.98);
  opacity: 0
}

.card.expanded .reveal {
  transform: none;
  opacity: 1
}

.project-card {
  position: relative;
  width: 76.5%;
  height: 140%;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: all 0.4s ease;
  background: var(--bg-card);
  border: var(--border-soft);
  color: var(--text-color);
  font-family: var(--font-main);
}

/* Hover con desplazamiento y brillo */
.project-card:hover {
  box-shadow: var(--shadow-card-hover);
}

/* Imagen */
.project-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
  transition: transform 0.6s ease, filter 0.5s ease;
}

.project-card:hover .project-card-img {
  filter: brightness(0.5);
}

/* Overlay */
.project-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 55%;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.9) 90%);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.4s ease;
  transform: translateY(20px);
  pointer-events: none;
}

.project-card:hover .project-card-overlay {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Estados activos */
.project-card.active,
.project-card.activo {
  width: 100%;
  height: auto;
  transition: all 0.5s ease;
}

.project-card.active .project-card-overlay,
.project-card.activo .project-card-overlay {
  opacity: 1;
  transform: translateY(0);
  height: auto;
  background: var(--bg-card);
}

/* Título */
.project-card-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: capitalize;
  letter-spacing: 0.5px;
  color: var(--accent);
}

/* Descripción */
.project-card-desc {
  font-size: 0.95rem;
  color: white;
  line-height: 1.4;
  margin-bottom: 0.8rem;
}

/* Tags */
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}



.skill:hover {
  background: var(--btn-ghost-bg-hover);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 15px var(--accent-glow);
}

/* Botón */
.project-card-btn {
  align-self: flex-start;
  text-decoration: none;
  color: var(--btn-color);
  background: var(--btn-bg);
  padding: 10px 22px;
  border-radius: 16px;
  font-weight: 600;
  letter-spacing: 0.4px;
  transition: all 0.3s ease;
  margin-top: 1rem;
  display: inline-block;
  box-shadow: var(--btn-shadow);
}

/* .project-card-btn:hover {
  transform: scale(1.05);
  background: var(--btn-hover-bg);
  box-shadow: var(--glow-accent);
} */

/* Fade-in animation */
.project-card-fade {
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInCard 0.9s ease forwards;
}

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

/* =============================== */
/* 📱 MEDIA QUERY: MODO MÓVIL     */
/* =============================== */
@media (max-width: 1024px) {

  /* 🔽 Cambia la forma en que se abren las cards */
  .card .content {
    position: relative;
    bottom: auto;
    top: 100%;
    /* Se abre hacia abajo */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transform: translateY(-10px) scale(0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 var(--radius) var(--radius);
  }

  .card.expanded .content {
    max-height: 1000px;
    opacity: 1;
    transform: translateY(0) scale(1);
    padding: 20px;
    margin-top: 10px;
    overflow: auto;
    border-radius: var(--radius);
  }

  /* 🔧 Ajusta el grid para que las cards ocupen todo el ancho */
  .cards {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  /* 📏 Ajustes visuales para las cards */
  .card {
    right: 43px;
    width: 130%;
    padding: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  }

  /* ✨ El botón de desplegar un poco más grande y visible */
  .toggle-btn {
    width: 42px;
    height: 42px;
  }

  .toggle-btn img {
    border-radius: 16px;
    width: 32px;
    height: 32px;
  }

  /* 🧩 Acomoda los proyectos dentro de cada card */
  .projects {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .project {
    flex-direction: column;
    align-items: flex-start;
  }

  .project .thumb {
    width: 100%;
    height: 160px;
  }

  .project .info h4 {
    font-size: 1rem;
  }

  .project .info p {
    font-size: 0.9rem;
  }

  /* 🔹 Ajuste general para las tarjetas de proyecto */
  .project-card {
    width: 100%;
    height: auto;
  }

  .project-card-img {
    height: 220px;
  }

  .project-card-overlay {
    height: auto;
    position: relative;
    /* background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 10%, rgba(0, 0, 0, 0.9) 90%); */
    padding: 1.2rem;
  }

  .project-card-title {
    font-size: 1.3rem;
  }

  .project-card-desc {
    font-size: 0.9rem;
  }

  .project-card-btn {
    width: 100%;
    text-align: center;
  }
}