@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&family=Playfair+Display:wght@700&display=swap');

/* Reset & base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  background: #0a192f;
  font-family: 'Poppins', sans-serif;
  color: #e6f1ff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 16px;
}

main {
  max-width: 1200px;
  width: 100%;
}

h1 {
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 3.2rem;
  margin-bottom: 48px;
  color: #64ffda;
  text-shadow: 0 4px 8px rgba(0,0,0,0.3);
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

h1::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #64ffda, transparent);
}

.tarjetas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.tarjeta-container {
  perspective: 1000px;
}

.tarjeta-checkbox {
  display: none;
}

.tarjeta {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  cursor: pointer;
}

.tarjeta-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.3);
  transition: transform 0.6s cubic-bezier(0.4,0,0.2,1);
  transform-style: preserve-3d;
  background: linear-gradient(145deg, #112240, #0a192f);
  border: 1px solid rgba(100, 255, 218, 0.1);
}

.tarjeta-checkbox:checked + .tarjeta .tarjeta-inner {
  transform: rotateY(180deg);
}

.tarjeta-front, .tarjeta-back {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  backface-visibility: hidden;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.tarjeta-front {
  background: linear-gradient(135deg, #112240, #0a192f);
  color: #e6f1ff;
  text-align: center;
  border: 1px solid rgba(100, 255, 218, 0.2);
}

.tarjeta-front img {
  width: 100%;
  height: 70%;
  border-radius: 12px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
  margin-bottom: 16px;
  object-fit: cover;
  border: 1px solid rgba(100, 255, 218, 0.1);
  transition: transform 0.3s ease;
}

.tarjeta:hover .tarjeta-front img {
  transform: scale(1.03);
}

.tarjeta-front .titulo {
  font-weight: 700;
  font-size: 1.5rem;
  color: #64ffda;
  margin-top: 10px;
}

.tarjeta-back {
  background: linear-gradient(135deg, #112240, #0a192f);
  color: #ccd6f6;
  transform: rotateY(180deg);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  padding: 32px 24px;
  user-select: none;
  border: 1px solid rgba(100, 255, 218, 0.2);
}

/* Efectos hover */
.tarjeta:hover .tarjeta-inner {
  box-shadow: 0 16px 32px rgba(0,0,0,0.4);
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 2.4rem;
    margin-bottom: 32px;
  }
  
  .tarjetas-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
    margin-bottom: 24px;
  }
  
  .tarjeta {
    aspect-ratio: 5 / 4;
  }
  
  .tarjeta-front img {
    height: 60%;
  }
  
  .tarjeta-back {
    font-size: 1rem;
    padding: 24px 16px;
  }
}