/* ============================================================
   Órbita Studio — hero.css
   Sección 1 — Hero (layout en grid).
   ============================================================ */

.hero {
  position: relative;
  min-height: calc(100svh - var(--nav-height));
  display: flex;
  align-items: center;
  padding: 4rem 1.5rem;
  overflow: hidden;
}

/* ---------- Fondo: globo animado (Vanta GLOBE) ---------- */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* Color de fondo del globo Vanta — sirve de fallback antes de que cargue */
  background: var(--color-bg);
}

/* Vanta inyecta un <canvas> dentro de #hero__bg */
.hero__bg canvas {
  display: block;
}

/* Overlay para asegurar el contraste del texto sobre el fondo animado */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    100deg,
    rgba(10, 15, 30, 0.88) 0%,
    rgba(10, 15, 30, 0.55) 45%,
    rgba(10, 15, 30, 0.15) 100%
  );
  pointer-events: none;
}

/* ---------- Grid de contenido ---------- */
.hero__grid {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 3.5rem;
  align-items: center;
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  text-align: left;
}

/* ---------- Título ---------- */
.hero__title {
  position: relative;
  font-family: var(--font-hero);
  font-size: clamp(2.1rem, 4.2vw, 2.7rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* Brillo de fondo difuso detrás del titular */
.hero__title::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -8%;
  top: -25%;
  width: 75%;
  height: 150%;
  background: radial-gradient(ellipse at center, rgba(79, 142, 247, 0.28), transparent 70%);
  filter: blur(45px);
  pointer-events: none;
}

/* El acento va en su propia línea, debajo del titular */
.hero__title-accent {
  display: block;
  color: var(--color-accent);
  margin-top: 0.18em;
}

@media (min-width: 769px) {
  .hero__title-accent {
    white-space: nowrap;   /* una sola línea en escritorio */
  }
}

.hero__subtitle {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--color-muted);
  max-width: 50ch;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* ---------- Métricas (columna derecha) ---------- */
.hero__metrics {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.metric {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.15rem 1.3rem;
  background: rgba(10, 15, 30, 0.4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.metric:hover {
  border-color: rgba(79, 142, 247, 0.35);
  transform: translateX(2px);
}

.metric__value {
  flex-shrink: 0;
  min-width: 3.5rem;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.metric__label {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.4;
}

/* ---------- Indicador "en producción" (live) ---------- */
.metric__live {
  position: relative;
  flex-shrink: 0;
  width: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric__live-dot {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-live);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.7);
}

/* Anillo que late (ping) simulando un sistema vivo en producción */
.metric__live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--color-live);
  animation: livePing 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes livePing {
  0%   { transform: scale(1);   opacity: 0.6; }
  80%, 100% { transform: scale(3); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .metric__live-dot::after { animation: none; }
}

/* ============================================================
   Responsive — Hero (< 768px)
   ============================================================ */
@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding: 3.5rem 1.5rem;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero__title-accent {
    white-space: normal;
  }

  .hero__cta {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 340px;
  }
}

/* ============================================================
   Animación de entrada (aparición escalonada)
   ============================================================ */
@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero__content > *,
.hero__metrics .metric {
  animation: heroFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Escalonado del contenido */
.hero__content > .pill        { animation-delay: 0.05s; }
.hero__content > .hero__title { animation-delay: 0.15s; }
.hero__content > .hero__subtitle { animation-delay: 0.28s; }
.hero__content > .hero__cta   { animation-delay: 0.40s; }

/* Escalonado de las métricas (entran después del contenido) */
.hero__metrics .metric:nth-child(1) { animation-delay: 0.50s; }
.hero__metrics .metric:nth-child(2) { animation-delay: 0.60s; }
.hero__metrics .metric:nth-child(3) { animation-delay: 0.70s; }

@media (prefers-reduced-motion: reduce) {
  .hero__content > *,
  .hero__metrics .metric {
    animation: none;
  }
}
