/* ====================================
   CARDS 3D HOLOGRÁFICAS - PROYECTOS
   ==================================== */

:root {
  --pointer-x: 50%;
  --pointer-y: 50%;
  --pointer-from-center: 0;
  --pointer-from-top: 0.5;
  --pointer-from-left: 0.5;
  --card-opacity: 0;
  --rotate-x: 0deg;
  --rotate-y: 0deg;
  --background-x: 50%;
  --background-y: 50%;
  --card-radius: 20px;
  --sunpillar-1: hsl(2, 100%, 73%);
  --sunpillar-2: hsl(53, 100%, 69%);
  --sunpillar-3: hsl(93, 100%, 69%);
  --sunpillar-4: hsl(176, 100%, 76%);
  --sunpillar-5: hsl(228, 100%, 74%);
  --sunpillar-6: hsl(283, 100%, 73%);
}

.projects-section {
  width: 100%;
  padding: 80px 0;
  background: transparent;
}

.projects-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.projects-header {
  text-align: center;
  margin-bottom: 60px;
}

.projects-header h2 {
  font-size: 3rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.projects-header p {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.7);
}

/* ====================================
   GRID DE PROYECTOS
   ==================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

/* ====================================
   CARD WRAPPER CON PERSPECTIVA
   ==================================== */

.project-card-wrapper {
  perspective: 1000px;
  transform: translate3d(0, 0, 0.1px);
  position: relative;
  touch-action: none;
  height: 600px;
}

/* Efecto de brillo detrás de la card */
.project-card-wrapper::before {
  content: '';
  position: absolute;
  inset: -10px;
  background: inherit;
  background-position: inherit;
  border-radius: inherit;
  transition: all 0.5s ease;
  filter: contrast(2) saturate(2) blur(36px);
  transform: scale(0.8) translate3d(0, 0, 0.1px);
  background-size: 100% 100%;
  background-image: radial-gradient(
    farthest-side circle at var(--pointer-x) var(--pointer-y),
    hsla(266, 100%, 90%, var(--card-opacity)) 4%,
    hsla(266, 50%, 80%, calc(var(--card-opacity) * 0.75)) 10%,
    hsla(266, 25%, 70%, calc(var(--card-opacity) * 0.5)) 50%,
    hsla(266, 0%, 60%, 0) 100%
  ),
  radial-gradient(35% 52% at 55% 20%, #00ffaac4 0%, #073aff00 100%),
  radial-gradient(100% 100% at 50% 50%, #00c1ffff 1%, #073aff00 76%),
  conic-gradient(from 124deg at 50% 50%, #c137ffff 0%, #07c6ffff 40%, #07c6ffff 60%, #c137ffff 100%);
}

.project-card-wrapper:hover::before,
.project-card-wrapper.active::before {
  --card-opacity: 1;
  filter: contrast(1) saturate(2) blur(40px) opacity(1);
  transform: scale(0.9) translate3d(0, 0, 0.1px);
}

/* ====================================
   CARD PRINCIPAL
   ==================================== */

.project-card-3d {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: var(--card-radius);
  position: relative;
  background-blend-mode: color-dodge, normal, normal, normal;
  animation: glow-bg 12s linear infinite;
  box-shadow: 
    rgba(0, 0, 0, 0.8) calc((var(--pointer-from-left) * 10px) - 3px)
    calc((var(--pointer-from-top) * 20px) - 6px) 20px -5px;
  transition: transform 1s ease;
  transform: translate3d(0, 0, 0.1px) rotateX(0deg) rotateY(0deg);
  background-size: 100% 100%;
  background-position: 0 0, 0 0, 50% 50%, 0 0;
  background-image:
    radial-gradient(
      farthest-side circle at var(--pointer-x) var(--pointer-y),
      hsla(266, 100%, 90%, var(--card-opacity)) 4%,
      hsla(266, 50%, 80%, calc(var(--card-opacity) * 0.75)) 10%,
      hsla(266, 25%, 70%, calc(var(--card-opacity) * 0.5)) 50%,
      hsla(266, 0%, 60%, 0) 100%
    ),
    radial-gradient(35% 52% at 55% 20%, #00ffaac4 0%, #073aff00 100%),
    radial-gradient(100% 100% at 50% 50%, #00c1ffff 1%, #073aff00 76%),
    conic-gradient(from 124deg at 50% 50%, #c137ffff 0%, #07c6ffff 40%, #07c6ffff 60%, #c137ffff 100%);
  overflow: hidden;
  cursor: pointer;
}

.project-card-wrapper:hover .project-card-3d,
.project-card-wrapper.active .project-card-3d {
  transition: none;
  transform: translate3d(0, 0, 0.1px) rotateX(var(--rotate-y)) rotateY(var(--rotate-x));
}

/* ====================================
   INTERIOR DE LA CARD
   ==================================== */

.project-card-inside {
  position: absolute;
  inset: 1px;
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
  border-radius: var(--card-radius);
  transform: translate3d(0, 0, 0.01px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ====================================
   EFECTOS HOLOGRÁFICOS
   ==================================== */

.project-card-shine {
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  transform: translate3d(0, 0, 1px);
  overflow: hidden;
  z-index: 3;
  background: transparent;
  background-size: cover;
  background-position: center;
  --space: 5%;
  --angle: -45deg;
  background-image:
    repeating-linear-gradient(
      0deg,
      var(--sunpillar-1) calc(var(--space) * 1),
      var(--sunpillar-2) calc(var(--space) * 2),
      var(--sunpillar-3) calc(var(--space) * 3),
      var(--sunpillar-4) calc(var(--space) * 4),
      var(--sunpillar-5) calc(var(--space) * 5),
      var(--sunpillar-6) calc(var(--space) * 6),
      var(--sunpillar-1) calc(var(--space) * 7)
    ),
    repeating-linear-gradient(
      var(--angle),
      #0e152e 0%,
      hsl(180, 10%, 60%) 3.8%,
      hsl(180, 29%, 66%) 4.5%,
      hsl(180, 10%, 60%) 5.2%,
      #0e152e 10%,
      #0e152e 12%
    ),
    radial-gradient(
      farthest-corner circle at var(--pointer-x) var(--pointer-y),
      hsla(0, 0%, 0%, 0.1) 12%,
      hsla(0, 0%, 0%, 0.15) 20%,
      hsla(0, 0%, 0%, 0.25) 120%
    );
  background-position:
    0 var(--background-y),
    var(--background-x) var(--background-y),
    center;
  background-blend-mode: color, hard-light;
  background-size:
    500% 500%,
    300% 300%,
    200% 200%;
  transition: filter 0.6s ease;
  filter: brightness(0.66) contrast(1.33) saturate(0.33) opacity(0.5);
  animation: holo-bg 18s linear infinite;
  mix-blend-mode: color-dodge;
  pointer-events: none;
}

.project-card-wrapper:hover .project-card-shine,
.project-card-wrapper.active .project-card-shine {
  filter: brightness(0.85) contrast(1.5) saturate(0.5);
  animation: none;
}

.project-card-glare {
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  transform: translate3d(0, 0, 1.1px);
  overflow: hidden;
  background-image: radial-gradient(
    farthest-corner circle at var(--pointer-x) var(--pointer-y),
    hsl(248, 25%, 80%) 12%,
    hsla(207, 40%, 30%, 0.8) 90%
  );
  mix-blend-mode: overlay;
  filter: brightness(0.8) contrast(1.2);
  z-index: 4;
  pointer-events: none;
}

/* ====================================
   CONTENIDO DE LA CARD
   ==================================== */

.project-card-content {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  height: 100%;
  pointer-events: none;
}

/* Imagen del proyecto */
.project-image-3d {
  width: 100%;
  height: 280px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  flex-shrink: 0;
  pointer-events: none;
}

.project-image-3d img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
  opacity: 0.9;
}

.project-card-wrapper:hover .project-image-3d img,
.project-card-wrapper.active .project-image-3d img {
  transform: scale(1.05);
  opacity: 1;
}

/* Placeholder */
.project-image-placeholder-3d {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.placeholder-icon-3d {
  font-size: 4rem;
  color: white;
  margin-bottom: 10px;
  opacity: 0.9;
}

.placeholder-text-3d {
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  text-align: center;
  padding: 0 20px;
  opacity: 0.9;
}

/* Badge destacado */
.project-badge-3d {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 215, 0, 0.15);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffd700;
  z-index: 10;
  border: 1px solid rgba(255, 215, 0, 0.3);
  pointer-events: none;
}

/* Contenido de texto */
/* Contenido de texto */
.project-content-3d {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transform: translate3d(
    calc(var(--pointer-from-left) * -6px + 3px),
    calc(var(--pointer-from-top) * -6px + 3px),
    0.1px
  );
  min-height: 0; /* Importante para flex */
}

.project-title-3d {
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
  margin: 0;
  line-height: 1.3;
  background-image: linear-gradient(to bottom, #fff, #6f6fbe);
  -webkit-text-fill-color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  flex-shrink: 0;
}

.project-description-3d {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  flex: 0 1 auto;
  max-height: 50px;
}

/* Tech Stack */
.project-tech-3d {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  flex-shrink: 0;
}

.tech-tag-3d {
  padding: 5px 10px;
  background: rgba(102, 126, 234, 0.15);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 6px;
  font-size: 0.75rem;
  color: #a5b4fc;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.project-card-wrapper:hover .tech-tag-3d,
.project-card-wrapper.active .tech-tag-3d {
  background: rgba(102, 126, 234, 0.25);
  border-color: rgba(102, 126, 234, 0.5);
  transform: translateY(-2px);
}

.tech-tag-3d.more {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
}

/* ====================================
   BOTONES MEJORADOS - 3 OPCIONES
   ==================================== */

/* Contenedor del botón */
.project-actions-3d {
  margin-top: 12px;
  pointer-events: auto;
  flex-shrink: 0;
}

/* OPCIÓN 1: Botón con gradiente neón */
.project-btn-3d {
  width: 100%;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow: hidden;
  
  /* Gradiente neón */
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: rgb(255, 255, 255);
  box-shadow: 
    0 4px 15px rgba(102, 126, 234, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.project-btn-3d::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-btn-3d:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 8px 25px rgba(102, 126, 234, 0.6),
    0 0 30px rgba(102, 126, 234, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.project-btn-3d:hover::before {
  opacity: 1;
}

.project-btn-3d:active {
  transform: translateY(-1px);
}

.project-btn-3d i {
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.project-btn-3d:hover i {
  transform: translateX(4px);
}

.project-btn-3d span {
  position: relative;
  z-index: 1;
}

/* ====================================
   OPCIÓN 2: Botón glassmorphism (descomenta para usar)
   ==================================== */

/*
.project-btn-3d {
  width: 100%;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  position: relative;
  
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.project-btn-3d::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 2px;
  background: linear-gradient(135deg, #667eea, #764ba2, #667eea);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-btn-3d:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-3px);
  box-shadow: 
    0 12px 40px rgba(102, 126, 234, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.project-btn-3d:hover::after {
  opacity: 1;
}

.project-btn-3d i {
  transition: transform 0.3s ease;
}

.project-btn-3d:hover i {
  transform: translateX(4px);
}
*/

/* ====================================
   OPCIÓN 3: Botón con borde animado (descomenta para usar)
   ==================================== */

/*
.project-btn-3d {
  width: 100%;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  position: relative;
  
  background: transparent;
  border: 2px solid rgba(102, 126, 234, 0.5);
  color: white;
  overflow: hidden;
}

.project-btn-3d::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.project-btn-3d:hover::before {
  transform: translateY(0);
}

.project-btn-3d:hover {
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 
    0 8px 25px rgba(102, 126, 234, 0.5),
    0 0 40px rgba(102, 126, 234, 0.3);
}

.project-btn-3d i,
.project-btn-3d span {
  position: relative;
  z-index: 1;
}

.project-btn-3d i {
  transition: transform 0.3s ease;
}

.project-btn-3d:hover i {
  transform: translateX(4px);
}
*/

/* ====================================
   ANIMACIONES
   ==================================== */

@keyframes glow-bg {
  0% { --bgrotate: 0deg; }
  100% { --bgrotate: 360deg; }
}

@keyframes holo-bg {
  0% {
    background-position: 0 var(--background-y), 0 0, center;
  }
  100% {
    background-position: 0 var(--background-y), 90% 90%, center;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-card-wrapper {
  animation: fadeInUp 0.6s ease-out backwards;
}

.project-card-wrapper:nth-child(1) { animation-delay: 0.1s; }
.project-card-wrapper:nth-child(2) { animation-delay: 0.2s; }
.project-card-wrapper:nth-child(3) { animation-delay: 0.3s; }
.project-card-wrapper:nth-child(4) { animation-delay: 0.4s; }
.project-card-wrapper:nth-child(5) { animation-delay: 0.5s; }
.project-card-wrapper:nth-child(6) { animation-delay: 0.6s; }

/* ====================================
   RESPONSIVE
   ==================================== */

@media (max-width: 1200px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 35px;
  }
  
  .project-card-wrapper {
    height: 560px;
  }
  
  .project-image-3d {
    height: 240px;
  }
  
  .projects-header h2 {
    font-size: 2.5rem;
  }
  
  .project-content-3d {
    padding: 18px;
  }
}

@media (max-width: 768px) {
  .projects-section {
    padding: 60px 0;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .project-card-wrapper {
    height: 520px;
  }
  
  .project-image-3d {
    height: 220px;
  }
  
  .projects-header h2 {
    font-size: 2rem;
  }
  
  .projects-header p {
    font-size: 1rem;
  }
  
  .project-title-3d {
    font-size: 1.3rem;
  }
  
  .project-description-3d {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
    max-height: 45px;
  }
  
  .tech-tag-3d {
    font-size: 0.7rem;
    padding: 4px 8px;
  }
  
  .project-btn-3d {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .projects-section {
    padding: 40px 0;
  }
  
  .project-card-wrapper {
    height: 500px;
  }
  
  .project-image-3d {
    height: 200px;
  }
  
  .project-content-3d {
    padding: 16px;
    gap: 10px;
  }
  
  .project-title-3d {
    font-size: 1.2rem;
  }
  
  .project-description-3d {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
    max-height: 42px;
  }
  
  .project-btn-3d {
    padding: 11px 18px;
    font-size: 0.85rem;
  }
}
/* ====================================
   GRID DE PROYECTOS
   ==================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

/* ====================================
   CARD WRAPPER CON PERSPECTIVA
   ==================================== */

.project-card-wrapper {
  perspective: 1000px;
  transform: translate3d(0, 0, 0.1px);
  position: relative;
  touch-action: none;
  height: 520px;
}/* Imagen del proyecto */
.project-image-3d {
  width: 100%;
  height: 240px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  flex-shrink: 0;
  pointer-events: none;
}
/* Contenido de texto */
.project-content-3d {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transform: translate3d(
    calc(var(--pointer-from-left) * -6px + 3px),
    calc(var(--pointer-from-top) * -6px + 3px),
    0.1px
  );
  min-height: 0;
}

.project-title-3d {
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
  margin: 0;
  line-height: 1.3;
  background-image: linear-gradient(to bottom, #fff, #6f6fbe);
  -webkit-text-fill-color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  flex-shrink: 0;
}

.project-description-3d {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  flex: 0 1 auto;
  max-height: 45px;
}
/* Tech Stack */
.project-tech-3d {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  flex-shrink: 0;
}

.tech-tag-3d {
  padding: 4px 10px;
  background: rgba(102, 126, 234, 0.15);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 6px;
  font-size: 0.72rem;
  color: #a5b4fc;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.3s ease;
}/* Contenedor del botón */
.project-actions-3d {
  margin-top: 10px;
  pointer-events: auto;
  flex-shrink: 0;
}

/* OPCIÓN 1: Botón con gradiente neón */
.project-btn-3d {
  width: 100%;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow: hidden;
  
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  box-shadow: 
    0 4px 15px rgba(102, 126, 234, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.projects-header {
  text-align: center;
  margin-bottom: 60px;
}

.projects-header h2 {
  font-size: 3.0rem;
  font-weight: 300;
  color: #0a0a0a;
  margin-bottom: 1rem;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.02em;
  position: relative;
  padding-bottom: 1.5rem;
}

.projects-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #0a0a0a, transparent);
}

.projects-header p {
  font-size: 1.2rem;
  font-weight: 400;
  color: #2a2a2a;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.01em;
  opacity: 0.8;
}