/* ════════════════════════════════════════════════════════════
   SMED Redes — Hero 3D.
   Misma familia visual que el hero de /desarrollo (noche azul,
   velo, rejilla técnica estática, titular con volumen), pero con
   su propia escena: la red de una empresa en capas, en 3D
   (redesHero3D.js). Todo va con prefijo rx- para convivir con
   ServiceLanding.css mientras el resto de la página se rehace.
   ════════════════════════════════════════════════════════════ */

.rx-hero {
  --rx-text: #f5f7fa;
  --rx-muted: rgba(245, 247, 250, 0.74);
  --rx-line: rgba(245, 247, 250, 0.16);
  --rx-accent: #7fb2ff;
  --rx-cyan: #5fd8ff;
  --rx-accent-soft: rgba(127, 178, 255, 0.16);
  --rx-ease: cubic-bezier(0.22, 1.15, 0.36, 1);
  position: relative;
  overflow: hidden;
  color: var(--rx-text);
  font-family: 'Inter', sans-serif;
  background: #050e22;
}

.rx-hero :is(h1, p) { margin: 0; }

/* ── Fondo: velo azul + rejilla estática ── */
.rx-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.rx-hero-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 70% at 72% 46%, rgba(24, 78, 180, 0.55), transparent 70%),
    radial-gradient(40% 40% at 12% 90%, rgba(13, 120, 200, 0.18), transparent 70%),
    linear-gradient(180deg, #040b1c 0%, #061433 60%, #050e22 100%);
}

.rx-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(127, 178, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 178, 255, 0.12) 1px, transparent 1px);
  background-size: 76px 76px;
  -webkit-mask-image: radial-gradient(70% 64% at 60% 46%, #000 10%, transparent 76%);
  mask-image: radial-gradient(70% 64% at 60% 46%, #000 10%, transparent 76%);
}

/* ── Escena WebGL (mitad derecha) ── */
.rx-scene {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 38%;
  right: -6%;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.6s ease;
  -webkit-mask-image: radial-gradient(60% 62% at 52% 50%, #000 40%, transparent 82%);
  mask-image: radial-gradient(60% 62% at 52% 50%, #000 40%, transparent 82%);
}

.has-rx-3d .rx-scene { opacity: 1; }

.rx-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Etiquetas de cada capa: HTML proyectado desde el 3D */
.rx-tags {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease 1.2s;
}

.has-rx-3d .rx-tags { opacity: calc(1 - var(--rx-out, 0) * 1.6); }

.rx-tag {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.38rem 0.75rem 0.38rem 0.5rem;
  border: 1px solid rgba(127, 178, 255, 0.28);
  border-radius: 999px;
  background: rgba(6, 18, 46, 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--rx-muted);
  white-space: nowrap;
  translate: 0 -50%;
  will-change: transform;
}

.rx-tag b {
  color: var(--rx-text);
  font-weight: 600;
}

.rx-tag i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--rx-accent-soft);
  color: var(--rx-cyan);
  font-size: 0.85rem;
}

/* ── Contenido ── */
.rx-hero-inner {
  position: relative;
  z-index: 2;
  width: min(1200px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: calc(80px + clamp(1.5rem, 4vw, 3rem)) 2rem clamp(1.2rem, 3vw, 2.2rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1rem, 2vw, 1.6rem);
  opacity: calc(1 - var(--rx-out, 0));
  translate: 0 calc(var(--rx-out, 0) * -40px);
  pointer-events: none;
}

.rx-hero-inner a { pointer-events: auto; }

.rx-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rx-accent);
  opacity: 0;
  translate: 0 14px;
  transition: opacity 0.7s ease, translate 0.7s var(--rx-ease);
}

.rx-kicker::before {
  content: "";
  width: 26px;
  height: 2px;
  background: currentColor;
}

.rx-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.6rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #6ee7a0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}

.rx-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(110, 231, 160, 0.6);
  animation: rx-live 1.8s ease-out infinite;
}

@keyframes rx-live {
  to { box-shadow: 0 0 0 8px rgba(110, 231, 160, 0); }
}

.rx-h1 {
  max-width: 13ch;
  font-size: clamp(2.2rem, 5.6vw, 5rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.rx-line {
  display: block;
  padding-bottom: 0.06em;
  perspective: 620px;
  perspective-origin: 20% 50%;
}

.rx-word {
  display: inline-block;
  white-space: nowrap;
  transform-style: preserve-3d;
}

.rx-char {
  display: inline-block;
  transform-origin: 50% 100%;
  transform: rotateX(-92deg) translateZ(-0.42em);
  opacity: 0;
  text-shadow:
    0.018em 0.018em 0 #1d4078,
    0.036em 0.036em 0 #18376c,
    0.054em 0.054em 0 #142f5c,
    0.072em 0.072em 0 #10264b,
    0.095em 0.095em 0.16em rgba(3, 10, 26, 0.5);
  transition:
    transform 0.95s cubic-bezier(0.17, 0.84, 0.28, 1) var(--rx-delay, 0ms),
    opacity 0.5s ease var(--rx-delay, 0ms);
}

.rx-accent .rx-char,
.rx-h1:not([data-rx-split-ready]) .rx-accent {
  color: transparent;
  background: linear-gradient(100deg, #7fb2ff 0%, #5fd8ff 60%, #b9e8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0.05em 0.06em 0 #10264b);
}

.is-rx-in .rx-kicker,
.is-rx-in .rx-char {
  opacity: 1;
  translate: 0 0;
  transform: none;
}

.rx-h1:not([data-rx-split-ready]) .rx-line { perspective: none; }

.rx-foot {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  max-width: 34rem;
  opacity: 0;
  translate: 0 22px;
  transition: opacity 0.9s ease 0.5s, translate 0.9s var(--rx-ease) 0.5s;
}

.is-rx-in .rx-foot { opacity: 1; translate: 0 0; }

.rx-note {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.65;
  color: var(--rx-muted);
}

.rx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.rx-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.95rem 1.7rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease, filter 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.rx-btn:hover { transform: translateY(-2px); }

.rx-btn i { font-size: 1.2rem; }

.rx-btn--primary,
.rx-btn--primary:hover {
  background: var(--rx-accent);
  color: #06122b;
}

.rx-btn--primary:hover { filter: brightness(1.08); }

.rx-btn--ghost {
  border-color: rgba(245, 247, 250, 0.35);
  color: var(--rx-text);
}

.rx-btn--ghost:hover {
  border-color: var(--rx-accent);
  color: var(--rx-accent);
}

/* ── Pie: cifras en vivo ── */
.rx-metrics {
  margin-top: auto;
  padding-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rx-line);
  opacity: 0;
  translate: 0 18px;
  transition: opacity 0.9s ease 0.8s, translate 0.9s var(--rx-ease) 0.8s;
}

.is-rx-in .rx-metrics { opacity: 1; translate: 0 0; }

.rx-metric {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.6rem 1.3rem;
}

.rx-metric + .rx-metric { border-left: 1px solid var(--rx-line); }

.rx-metric strong {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.rx-metric span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rx-muted);
}

/* ── Móvil: la red pasa detrás del texto ── */
@media (max-width: 900px) {
  .rx-scene {
    left: -20%;
    right: -20%;
    top: 10%;
    opacity: 0;
  }
  .has-rx-3d .rx-scene { opacity: 0.45; }
  .rx-tags { display: none; }
  .rx-hero-inner { padding-left: 16px; padding-right: 16px; }
  .rx-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rx-metric:nth-child(3) { border-left: 0; }
  .rx-metric:nth-child(n + 3) { border-top: 1px solid var(--rx-line); }
}

@media (prefers-reduced-motion: reduce) {
  .rx-kicker, .rx-char, .rx-foot, .rx-metrics {
    transition: none;
  }
  .rx-live::before { animation: none; }
}
