:root {
  --color-bg: #000f35;
  --color-primary: #5ba8ff;
  --color-secondary: #00c8ff;
  --color-card-bg: #334155;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--color-bg);
  color: #F1F5F9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ---------- Encabezado centrado ---------- */
header {
  padding: 2rem 1rem 1rem;
  text-align: center;
  max-width: 800px;
}
header h1 {
  font-size: 2.1rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}
header p {
  line-height: 1.5;
}

/* ---------- Carrusel centrado ---------- */
.carousel {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 2rem; /* Más espacio entre tarjetas */
  padding: 2rem 1rem;
  justify-content: center;
  width: 100%;
}
.carousel::-webkit-scrollbar {
  height: 8px;
}
.carousel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* ---------- Tarjetas ---------- */
.card {
  flex: 0 0 260px;
  height: 320px;
  background: var(--color-card-bg);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}
.card:hover {
  transform: scale(1.2) translateY(-12px); /* Más grande y más separación */
  z-index: 10;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 0 10px rgba(255, 255, 255, 0.1),
    inset 0 0 5px rgba(255, 255, 255, 0.05); /* Relieve suave */
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s ease;
}

/* Capa negra semitransparente al hover */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}
.card:hover::before {
  opacity: 1;
}

/* Información */
.card .info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  z-index: 2;
  color: #fff;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.card:hover .info {
  transform: translateY(0);
}
.card .info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}
.card .info p {
  font-size: 0.85rem;
  color: #e2e8f0;
}

/* ---------- Visor ---------- */
.viewer {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  display: none;
  flex-direction: column;
  z-index: 100;
  padding: 1rem;
  overflow: hidden;
}
.viewer.active {
  display: flex;
}
.viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}
.viewer-header h2 {
  font-size: 1.3rem;
}
.viewer-header button {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.viewer-header button:hover {
  color: var(--color-secondary);
}
iframe {
  flex: 1;
  width: 100%;
  border: none;
  border-radius: 12px;
  background: #0f172a;
}

@media (max-width: 480px) {
  .card {
    height: 240px;
    flex: 0 0 180px;
  }
}
