/* ============================================
   MOREL CONSTRUCCIONES — Hero
   ============================================ */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-top: var(--nav-height);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 60% 40%, rgba(196,160,80,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 80% at 90% 80%, rgba(196,160,80,0.04) 0%, transparent 50%),
    linear-gradient(160deg, var(--color-hero-grad-start) 0%, var(--color-hero-grad-mid) 50%, var(--color-hero-grad-end) 100%);
  z-index: 0;
}

/* Grain texture */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: var(--container-max);
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--space-6);
  padding-block: var(--space-16);
}

.hero-eyebrow {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.hero-eyebrow::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--color-gold);
}

.hero-title {
  font-size: clamp(var(--text-5xl), 8vw, var(--text-6xl));
  font-weight: 700;
  line-height: 1.0;
  color: var(--color-text);
  margin-bottom: var(--space-6);
  max-width: 12ch;
}

.hero-desc {
  font-size: clamp(var(--text-base), 2vw, var(--text-lg));
  color: var(--color-text);
  max-width: 48ch;
  line-height: 1.75;
  margin-bottom: var(--space-10);
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Stats bar */
.hero-stats {
  position: relative;
  z-index: 10; /* Increased to be above overlay (5) and animation (1) */
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
  padding-bottom: var(--space-12);
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.stat { text-align: center; }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-gold);
  line-height: 1;
}
.stat-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: var(--space-1);
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--color-border);
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: var(--space-8);
  right: var(--space-8);
  z-index: 1;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  transition: all var(--duration-base) var(--ease-out);
  animation: heroScrollBounce 2s ease-in-out infinite;
}
.hero-scroll svg { width: 18px; height: 18px; }
.hero-scroll:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

@keyframes heroScrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@media (max-width: 600px) {
  .hero-stats { flex-wrap: wrap; gap: var(--space-6); }
  .stat-divider { display: none; }
  .hero-scroll { right: var(--space-4); bottom: var(--space-4); }
}

/* Animation Container from user */
.hero-animation-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

@media (min-width: 1024px) {
    .hero-animation-container {
        width: 100%;
    }
    /* Usa un degradado en la imagen como máscara para que se mezcle con el fondo a la izquierda */
    .animation-stage {
        mask-image: linear-gradient(to right, transparent 20%, black 50%);
        -webkit-mask-image: linear-gradient(to right, transparent 20%, black 50%);
    }
}

.animation-stage {
    position: relative;
    width: 100%;
    height: 100%;
}

.stage-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.stage-img.active {
    opacity: 1;
}

.progress-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background-color: rgba(255,255,255,0.2);
    z-index: 10;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--color-gold);
    transition: width 0.1s linear;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        /* Top dark gradient to ensure nav visibility */
        linear-gradient(180deg, var(--color-overlay-dark) 0%, var(--color-overlay-dark) 12%, transparent 25%),
        /* Left dark gradient shifted left so images are more visible */
        linear-gradient(90deg, var(--color-hero-grad-start) 0%, var(--color-overlay-dark) 25%, var(--color-overlay-light) 50%, transparent 100%);
    z-index: 5;
    pointer-events: none;
}

@media (max-width: 768px) {
    .hero-overlay {
        background: 
            /* Top dark gradient for nav */
            linear-gradient(180deg, var(--color-overlay-dark) 0%, var(--color-overlay-dark) 12%, transparent 25%),
            /* Bottom dark gradient for content, lighter at top */
            linear-gradient(0deg, var(--color-hero-grad-start) 0%, var(--color-overlay-dark) 35%, var(--color-overlay-light) 80%, transparent 100%);
    }
}
