/**
 * Hero Section Styles - iAudita Landing
 * Incluye: hero con orbes, grid, badge, carrusel 3D, responsive
 */

/* ===== HERO SECTION ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 40px 60px;
  position: relative;
  overflow: hidden;
  background: var(--color-bg-deep);
}

/* Hero compacto para páginas legales/internas */
.hero--small {
  min-height: auto;
  padding: 6rem 40px 3rem;
}
.hero--small .hero__content { max-width: 800px; }
.hero--small .hero__title {
  font-size: 2.5rem;
  color: var(--color-text-white);
  margin-bottom: 0.75rem;
}
.hero--small .hero__subtitle {
  color: var(--color-text-dim);
  font-size: 1.1rem;
}

/* Fondo con gradientes */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 25% 0%, rgba(108, 58, 237, 0.35), transparent 70%),
    radial-gradient(ellipse 60% 45% at 75% 15%, rgba(59, 130, 246, 0.2), transparent 70%),
    radial-gradient(ellipse 50% 50% at 50% 90%, rgba(108, 58, 237, 0.15), transparent 60%),
    radial-gradient(ellipse 30% 30% at 85% 80%, rgba(6, 214, 160, 0.08), transparent);
}

/* Fade inferior del hero para empatar con la siguiente sección */
.hero-bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: linear-gradient(to bottom, transparent, #0e0a24);
  pointer-events: none;
}

/* Grid sutil de fondo */
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 70%);
}

/* Orbes animados */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  will-change: transform;
}
.orb-1 {
  width: 500px; height: 500px;
  background: rgba(108, 58, 237, 0.2);
  top: -15%; left: -8%;
  animation: drift 12s ease-in-out infinite;
}
.orb-2 {
  width: 350px; height: 350px;
  background: rgba(59, 130, 246, 0.15);
  top: 20%; right: -5%;
  animation: drift 10s ease-in-out infinite reverse;
}
.orb-3 {
  width: 300px; height: 300px;
  background: rgba(6, 214, 160, 0.08);
  bottom: 5%; left: 25%;
  animation: drift 14s ease-in-out infinite 2s;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(25px, -15px); }
  50% { transform: translate(-10px, 20px); }
  75% { transform: translate(15px, 10px); }
}

/* Contenido hero */
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 760px;
  margin-bottom: 56px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: 100px;
  padding: 7px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
  animation: heroFadeIn 0.7s ease-out;
}
.hero-badge-pulse {
  width: 7px; height: 7px;
  background: var(--color-accent);
  border-radius: 50%;
  animation: heroPulse 2.5s infinite;
}
@keyframes heroPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(6,214,160,0.3); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(6,214,160,0); }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 18px;
  color: var(--color-text-white);
  animation: heroFadeUp 0.7s ease-out 0.1s both;
}
.hero-title .accent {
  background: linear-gradient(135deg, var(--color-accent), #34D399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.08rem;
  color: var(--color-text-dim);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto 32px;
  animation: heroFadeUp 0.7s ease-out 0.2s both;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  animation: heroFadeUp 0.7s ease-out 0.3s both;
}
.cta-main {
  background: linear-gradient(135deg, var(--color-accent), #34D399);
  color: var(--color-bg-deep);
  padding: 14px 30px;
  border-radius: 11px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(6,214,160,0.2);
}
.cta-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(6,214,160,0.35);
  color: var(--color-bg-deep);
  text-decoration: none;
}
.cta-secondary {
  background: var(--color-bg-card);
  color: var(--color-text-white);
  padding: 14px 30px;
  border-radius: 11px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--color-border-subtle);
  backdrop-filter: blur(8px);
  transition: all 0.3s;
}
.cta-secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  color: var(--color-text-white);
  text-decoration: none;
}

/* Stats */
.hero-stats {
  display: flex;
  gap: 40px;
  justify-content: center;
  margin-top: 36px;
  animation: heroFadeUp 0.7s ease-out 0.4s both;
}
.stat-item { text-align: center; }
.stat-val {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--color-text-white);
}
.stat-lbl {
  font-size: 0.78rem;
  color: var(--color-text-dim);
  margin-top: 2px;
}

@keyframes heroFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ===== CARRUSEL 3D ===== */
.carousel-3d {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  animation: heroFadeUp 0.8s ease-out 0.55s both;
}

.carousel-viewport {
  perspective: 1200px;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.c-card {
  position: absolute;
  width: 620px;
  height: 380px;
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.65s cubic-bezier(0.4, 0, 0.15, 1);
  cursor: pointer;
  background: #0d0820;
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.c-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  display: block;
}

/* Overlay gradient */
.c-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(8,5,21,0.85) 95%);
  pointer-events: none;
  z-index: 1;
}

.c-card-info {
  position: absolute;
  bottom: 18px; left: 22px;
  z-index: 2;
}
.c-card-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--color-accent);
  margin-bottom: 4px;
}
.c-card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text-white);
}

/* Posiciones del carrusel */
.c-card[data-pos="center"] {
  z-index: 5;
  transform: translateX(0) scale(1) rotateY(0);
  opacity: 1;
}
.c-card[data-pos="left"] {
  z-index: 3;
  transform: translateX(-400px) scale(0.78) rotateY(10deg);
  opacity: 0.55;
  filter: brightness(0.55) saturate(0.7);
}
.c-card[data-pos="right"] {
  z-index: 3;
  transform: translateX(400px) scale(0.78) rotateY(-10deg);
  opacity: 0.55;
  filter: brightness(0.55) saturate(0.7);
}
.c-card[data-pos="far-left"] {
  z-index: 1;
  transform: translateX(-660px) scale(0.58) rotateY(18deg);
  opacity: 0;
  pointer-events: none;
}
.c-card[data-pos="far-right"] {
  z-index: 1;
  transform: translateX(660px) scale(0.58) rotateY(-18deg);
  opacity: 0;
  pointer-events: none;
}

/* Glow en card central */
.c-card[data-pos="center"]::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(108,58,237,0.3), rgba(6,214,160,0.2));
  z-index: -1;
  opacity: 0.6;
  filter: blur(1px);
}

/* Controles del carrusel */
.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 28px;
}

.c-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-card);
  color: var(--color-text-white);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.25s;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
}
.c-btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.08);
}

.c-dots { display: flex; gap: 6px; }
.c-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  transition: all 0.35s;
  cursor: pointer;
}
.c-dot.on {
  background: var(--color-accent);
  width: 22px;
  border-radius: 4px;
}

.c-counter {
  font-size: 0.85rem;
  color: var(--color-text-dim);
  font-weight: 500;
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}


/* ===== TRANSICIÓN DARK → LIGHT ===== */
.section--dark-to-light {
  background: linear-gradient(180deg,
    #0e0a24 0%,       /* Empata con el ::after del hero-bg */
    #0e0a24 5%,       /* Mantiene el color sólido un tramo para cubrir el seam */
    #150e30 15%,
    #1a1238 28%,
    #2a2050 40%,
    #f8f9fa 75%
  );
  padding-top: 6rem;
  margin-top: -2px;   /* Elimina cualquier gap de subpixel entre secciones */
}
.section--dark-to-light .section-title {
  color: var(--color-text-white);
}
.section--dark-to-light .section-subtitle {
  color: var(--color-text-dim);
}

/* CTA final oscuro */
#cta-final.section--dark {
  background: var(--color-bg-deep);
}
#cta-final.section--dark h2,
#cta-final.section--dark .h1 {
  color: var(--color-text-white);
}
#cta-final.section--dark .lead,
#cta-final.section--dark .text-gray {
  color: var(--color-text-dim) !important;
}
#cta-final.section--dark .small.text-muted {
  color: var(--color-text-dim) !important;
}


/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero { padding: 90px 20px 40px; }
  .c-card { width: 360px; height: 240px; }
  .c-card[data-pos="left"] { transform: translateX(-240px) scale(0.75) rotateY(10deg); }
  .c-card[data-pos="right"] { transform: translateX(240px) scale(0.75) rotateY(-10deg); }
  .carousel-viewport { height: 280px; }
  .hero-stats { gap: 24px; }
  .stat-val { font-size: 1.3rem; }
}

@media (max-width: 500px) {
  .hero { padding: 80px 16px 32px; }
  .c-card { width: 280px; height: 190px; }
  .c-card[data-pos="left"] { transform: translateX(-180px) scale(0.7) rotateY(10deg); }
  .c-card[data-pos="right"] { transform: translateX(180px) scale(0.7) rotateY(-10deg); }
  .carousel-viewport { height: 230px; }
  .hero-stats { gap: 16px; flex-wrap: wrap; }
  .hero-ctas { flex-direction: column; align-items: center; }
}
