/* ============================================================
   CONSTRUFACH — HERO SECTION
   ============================================================ */

/* ── Sección principal ─────────────────────────────────────── */
.hero-bg {
  min-height: 100vh;
  background-color: var(--navy);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* Textura diagonal sutil sobre el fondo */
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      -55deg,
      transparent,
      transparent 40px,
      rgba(255,255,255,0.018) 40px,
      rgba(255,255,255,0.018) 41px
    );
  pointer-events: none;
}

/* Acento rojo: barra vertical izquierda */
.hero-bg::after {
  content: '';
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 4px;
  background: var(--red);
  border-radius: 0 2px 2px 0;
}

/* ── Contenedor ────────────────────────────────────────────── */
.hero-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 6rem 3rem 4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
  /* Permite que .hero-img se estire a la altura del grid row */
  align-items: stretch;
}

/* La columna de texto se centra verticalmente dentro del row */
.hero-text {
  align-self: center;
}

/* ── Columna texto ─────────────────────────────────────────── */
.hero-text {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.hero-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  font-weight: 700;
  line-height: 1.08;
  color: var(--white);
  letter-spacing: -0.01em;
  text-transform: uppercase;

  /* Línea roja decorativa antes del título */
  padding-left: 1.25rem;
  border-left: 4px solid var(--red);
}

.hero-info {
  font-family: 'Barlow', sans-serif;
  font-size: 1.05rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  padding-left: 1.25rem;
}

/* ── Lista de servicios ────────────────────────────────────── */
.hero-services {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-left: 1.25rem;
}

.hero-services li {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--white);
  padding: 0.3rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.15);
  position: relative;
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
  transition: background 0.25s ease, color 0.25s ease;
}

.hero-services li:hover {
  background: var(--red);
  color: var(--white);
}

/* ── Botones de acción ─────────────────────────────────────── */
.hero-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-left: 1.25rem;
  flex-wrap: wrap;
}

.hero-link {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: color 0.3s ease;
}

/* Primer link — relleno rojo */
.hero-link:first-child {
  background: var(--red);
  color: var(--white);
  border: 2px solid var(--red);
}

.hero-link:first-child::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--white);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out-expo);
}

.hero-link:first-child:hover {
  color: var(--red);
}

.hero-link:first-child:hover::before {
  transform: scaleX(1);
}

.hero-link:first-child .material-symbols-outlined,
.hero-link:first-child span {
  position: relative;
}

/* Segundo link — contorno blanco */
.hero-link:last-child {
  color: rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
}

.hero-link:last-child::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.08);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out-expo);
}

.hero-link:last-child:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.6);
}

.hero-link:last-child:hover::before {
  transform: scaleX(1);
}

.hero-link .material-symbols-outlined {
  font-size: 1rem;
  transition: transform 0.25s ease;
}

.hero-link:hover .material-symbols-outlined {
  transform: translate(3px, -3px);
}

/* ── Video fondo (solo mobile) ─────────────────────────────── */
.hero-video-bg {
  display: none;
}
.hero-video-overlay {
  display: none;
}

/* ── Columna derecha: panel de video ───────────────────────── */
.hero-img {
  position: relative;
  align-self: stretch;
  min-height: 480px;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}

/* Gradiente sobre el video para que los números sean legibles */
.hero-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(7, 31, 52, 0.88) 0%,
    rgba(7, 31, 52, 0.15) 55%,
    transparent 100%
  );
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
}

/* Video llena todo el panel */
.hero-video-el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 0;
}

.hero-img-fallback {
  display: none;
}

/* ── Números / stats: superpuestos al pie del video ─────────── */
.hero-numbers {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 0;
  z-index: 2;
  border-top: 1px solid rgba(255,255,255,0.12);
  background: rgba(7, 31, 52, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hero-number {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem 0.75rem;
  position: relative;
  transition: background 0.3s ease;
}

.hero-number:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: rgba(255,255,255,0.12);
}

.hero-number:hover {
  background: rgba(218, 33, 65, 0.08);
}

.hero-number h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1;
  letter-spacing: -0.02em;
}

.hero-number span {
  font-family: 'Barlow', sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  margin-top: 0.35rem;
  line-height: 1.4;
}

/* ── Accesibilidad ─────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   ANIMACIONES ON SCROLL
   ============================================================ */

/* Estado inicial — invisible */
.animate-on-scroll {
  opacity: 0;
  will-change: transform, opacity;
}

.animate-on-scroll.zoom-in {
  transform: translateY(24px) scale(0.97);
  transition:
    opacity 0.65s var(--ease-out-expo),
    transform 0.65s var(--ease-out-expo);
}

.animate-on-scroll.fade-right {
  transform: translateX(40px);
  transition:
    opacity 0.7s var(--ease-out-expo),
    transform 0.7s var(--ease-out-expo);
}

/* Estado visible — activado por JS */
.animate-on-scroll.visible {
  opacity: 1;
  transform: none;
}

/* ── Stagger para hijos directos de .hero-text ─────────────── */
.hero-text .animate-on-scroll:nth-child(1) { transition-delay: 0.05s; }
.hero-text .animate-on-scroll:nth-child(2) { transition-delay: 0.15s; }
.hero-text .animate-on-scroll:nth-child(3) { transition-delay: 0.25s; }
.hero-text .animate-on-scroll:nth-child(4) { transition-delay: 0.35s; }

.hero-numbers .animate-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.hero-numbers .animate-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.hero-numbers .animate-on-scroll:nth-child(3) { transition-delay: 0.3s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  /* Quitar foto de fondo — el video la reemplaza */
  .hero-bg {
    background-image: none !important;
  }

  /* Video fondo: cubre toda la sección */
  .hero-video-bg {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
  }

  /* Overlay oscuro para legibilidad del texto */
  .hero-video-overlay {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(7, 31, 52, 0.78);
    z-index: 1;
  }

  /* Todo el contenido encima del overlay */
  .hero-container {
    grid-template-columns: 1fr;
    padding: 5rem 1.5rem 3rem;
    gap: 3rem;
    position: relative;
    z-index: 2;
  }

  /* Ocultar video elemento en mobile */
  .hero-video-el {
    display: none;
  }

  /* Resetear panel de video para mobile */
  .hero-img {
    align-self: auto;
    min-height: unset;
    overflow: visible;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-img::after {
    display: none;
  }

  /* Números vuelven a flujo normal */
  .hero-numbers {
    position: static;
    max-width: 100%;
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-top: none;
    border: 1px solid rgba(255,255,255,0.1);
  }

  .hero-img img {
    max-width: 340px;
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero-bg::after {
    display: none;
  }

  /* Ocultar también ::before (textura) — el video ya da suficiente profundidad */
  .hero-bg::before {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero-links {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-link {
    width: 100%;
    justify-content: center;
  }
}