/* Tarjetas inclinadas controladas por tilted-card.js */
.tilted-card-grid {
  --tilted-card-min: 230px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--tilted-card-min), 1fr));
  gap: clamp(1.25rem, 2.5vw, 1.9rem);
  margin-top: clamp(1.5rem, 4vw, 2rem);
  justify-content: center;
  justify-items: center;
}

.tilted-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.tilted-card-figure {
  --tilt-card-height: 210px;
  --tilt-hover-scale: 1.02;
  position: relative;
  width: 100%;
  height: var(--tilt-card-height);
  margin: 0;
  perspective: 900px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.tilted-card-figure.no-tilt {
  perspective: none;
}

.tilted-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  transform-style: preserve-3d;
  background: radial-gradient(circle at 20% 20%, rgba(35, 87, 255, 0.14), transparent 65%),
    radial-gradient(circle at 80% 60%, rgba(121, 40, 202, 0.16), transparent 60%),
    linear-gradient(145deg, rgba(12, 18, 32, 0.92), rgba(20, 24, 46, 0.92));
  transition: transform 0.35s ease, box-shadow 0.35s ease, filter 0.35s ease;
  box-shadow: 0 18px 38px rgba(9, 12, 24, 0.25);
  transform: scale(1);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Halo que sigue al puntero para reforzar profundidad */
.tilted-card-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(94, 152, 255, 0.26), transparent 55%);
  opacity: var(--pointer-opacity, 0);
  transition: opacity 0.3s ease;
  mix-blend-mode: screen;
}

.tilted-card-img {
  max-width: 80%;
  max-height: 80%;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  display: block;
  border-radius: inherit;
  opacity: 0.9;
}

.tilted-card-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.85rem;
  background: linear-gradient(135deg, rgba(21, 32, 58, 0.62), rgba(48, 88, 168, 0.42));
  color: #f5f8ff;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: clamp(0.6rem, 1vw, 0.72rem);
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(7, 11, 25, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  min-width: min(75%, 180px);
  text-align: center;
}

.tilted-card-overlay span {
  display: block;
  width: 100%;
}

.tilted-card-caption {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -130%);
  background-color: rgba(255, 255, 255, 0.95);
  color: #0b0f1c;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  box-shadow: 0 8px 16px rgba(7, 11, 25, 0.25);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  transition: opacity 0.2s ease;
}

.tilted-card-figure.is-hovering .tilted-card-caption {
  opacity: 1;
}

@media (max-width: 960px) {
  .tilted-card-grid {
    --tilted-card-min: 140px;
    gap: clamp(0.75rem, 3vw, 1.25rem);
  }

  .tilted-card-figure {
    --tilt-card-height: 180px;
  }
}

@media (max-width: 600px) {
  .tilted-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tilted-card-overlay {
    min-width: 78%;
    padding: 0.25rem 0.7rem;
    font-size: 0.55rem;
  }

  .tilted-card-caption {
    display: none;
  }
}
