/* ============================================
   HERO.CSS — CodigoBell v5 — DEFINITIVO
   Arquitectura z-index:
   z-1  hero-bg-mountains
   z-2  snow-particles, mist-layer
   z-3  hero-inner (texto parallax: badge + line-1 + sub + cta)
   z-4  line-1
   z-5  hero-man-foreground  ← el hombre
   z-6  foreground-mist
   z-8  #line2  ← FUERA de cualquier transform → siempre encima
   z-9  hero-glass-card
   z-10 lens-flare
   ============================================ */

/* --- HERO BASE --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #080c18;
  perspective: 1200px;
}

/* Capa 1: Fondo montañas */
.hero-bg-mountains {
  position: absolute;
  inset: 0;
  background-image: url('../assets/images/fondo-patagonia.jpg');
  background-size: cover;
  background-position: center bottom;
  z-index: 1;
  filter: brightness(0.7);
}

/* Capa 2: Aura mouse */
#hero-aura {
  position: absolute;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(255, 157, 0, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  transform: translate(-50%, -50%);
  transition: opacity 0.5s;
}

/* Capa 3: Contenedor texto — recibe el parallax del JS */
.hero-inner {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 0 5%;
}

/* hero-content = parallax container: badge + line-1 + sub + cta
   NO tiene will-change ni transform propio (el JS lo aplica en runtime
   pero no hay stacking context PRE-existente que rompa z-index) */
.hero-content {
  max-width: 1350px;
}

/* Desktop title visible, mobile title hidden by default */
.main-impact-mobile { display: none; }
.main-impact-desktop { display: flex; }
.main-impact {
  display: flex;
  flex-direction: column;
  font-family: 'League Spartan', sans-serif;
  font-size: clamp(2.8rem, 5.5vw, 7rem);
  font-weight: 900;
  line-height: 0.88;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  /* SIN will-change: el JS aplica transform directamente.
     will-change crearía stacking context previo → line-2 quedaría atrapada */
}

/* Renglón 1: blanco, z-index 4 — DEBAJO del hombre */
.line-1 {
  position: relative;
  z-index: 4;
  display: block;
  padding: 0.05em 0;
  white-space: nowrap;
  background: linear-gradient(180deg, #ffffff 20%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Ghost invisible: misma tipografía que #line2, reserva la altura
   en el flujo para que sub y cta queden en la posición correcta.
   También sirve de referencia para el JS que posiciona #line2. */
.line-1-ghost {
  display: block;
  margin-top: -0.05em;
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
  font-family: 'League Spartan', sans-serif;
  font-size: inherit;
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.04em;
}

/* ── RENGLÓN 2: DEFINITIVO ─────────────────────────
   Vive directamente en .hero, NO dentro de ningún
   elemento que reciba transform → z-index:8 funciona
   siempre, sin importar el parallax del mousemove.
   El JS lo posiciona con getBoundingClientRect del ghost.  */
#line2 {
  position: absolute;
  z-index: 8;
  pointer-events: none;
  font-family: 'League Spartan', sans-serif;
  font-size: clamp(2.8rem, 5.5vw, 7rem);
  font-weight: 900;
  line-height: 0.88;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  white-space: nowrap;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.88);
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 255, 255, 0.22))
          drop-shadow(0 4px 32px rgba(255, 255, 255, 0.10));
}
.hero-sub {
  margin-bottom: 0.5%;
  font-size: 1.2rem;
}

/* Capa 5: El Sujeto — en el medio del sándwich */
.hero-man-foreground {
  position: absolute;
  bottom: -12%;
  right: -2%;
  height: 90vh;
  z-index: 5;
  pointer-events: none;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(-20px 0 50px rgba(0,0,0,0.8));
  will-change: transform;
}

/* --- GLASS CARD Core Web Vitals --- */
.hero-glass-card {
  position: absolute;
  bottom: 8%;
  right: 3%;
  z-index: 9;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  min-width: 190px;
  pointer-events: none;
}
.hero-glass-card .cwv-title {
  font-family: 'League Spartan', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero-glass-card .cwv-title::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
}
.hero-glass-card .cwv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.hero-glass-card .cwv-row:last-child { margin-bottom: 0; }
.hero-glass-card .cwv-label {
  font-family: 'League Spartan', sans-serif;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
}
.hero-glass-card .cwv-value {
  font-family: 'League Spartan', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: #4ade80;
}
.hero-glass-card .cwv-value.orange { color: #fb923c; }
.hero-glass-card .cwv-stars {
  font-size: 0.7rem;
  color: #facc15;
  letter-spacing: 1px;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hero-glass-card .cwv-stars span {
  font-family: 'League Spartan', sans-serif;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.4);
}

/* ============================================
   NAV
   ============================================ */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  height: 68px;
  z-index: 50;
  transition: box-shadow 0.3s;
}

.logo-svg {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.hamburger { display: none; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}

.nav-right .nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0; padding: 0;
  gap: 2.5rem;
}

.nav-right .nav-links li a {
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-right .nav-links li a:hover { color: #fff; }

.nav-cta {
  display: inline-flex !important;
  align-items: center;
  padding: 0.5rem 1.2rem !important;
  background: var(--blue-main, #2563eb) !important;
  border-radius: 6px !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  letter-spacing: 0.02em !important;
  transition: background 0.2s, transform 0.15s !important;
}
.nav-cta:hover {
  background: #1d4ed8 !important;
  transform: translateY(-1px);
}

.nav-login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.nav-login:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}
.nav-login svg { width: 18px; height: 18px; display: block; }

/* ============================================
   MOBILE MENU — panel lateral izquierdo
   ============================================ */
.mobile-menu {
  position: fixed;
  top: 0; left: 0;
  width: 75vw;
  max-width: 300px;
  height: 100vh;
  background: rgba(8, 12, 24, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 5rem 2rem 2rem;
  gap: 0.25rem;
  transform: translateX(-110%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid rgba(255,255,255,0.07);
}
.mobile-menu.open { transform: translateX(0); }

/* Botón cerrar dentro del menú mobile */
.mobile-menu-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.mobile-menu-close:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}
.mobile-menu-overlay.open { display: block; }

.mobile-menu a {
  font-family: 'League Spartan', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  letter-spacing: 0.04em;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: color 0.2s, padding-left 0.2s;
}
.hero-sub {
  margin-bottom: 0.5%;
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: #fff; padding-left: 0.5rem; }

/* ============================================
   NIEVE, NIEBLA, LENS FLARE
   ============================================ */
#snow-particles {
  position: absolute; inset: 0;
  z-index: 2; pointer-events: none;
}
.snow {
  position: absolute;
  background: white; border-radius: 50%;
  opacity: 0.5; filter: blur(1px);
  animation: wind-snow linear infinite;
}
@keyframes wind-snow {
  0%   { transform: translate(0,0);          opacity: 0; }
  10%  {                                      opacity: 0.8; }
  90%  {                                      opacity: 0.8; }
  100% { transform: translate(-500px,500px);  opacity: 0; }
}
.mist-layer, .foreground-mist {
  position: absolute; inset: 0;
  pointer-events: none;
  background-size: contain; opacity: 0.2;
}
.mist-layer { z-index: 2; animation: drift 60s linear infinite; }
.foreground-mist {
  z-index: 7; opacity: 0.15;
  animation: drift 40s linear infinite reverse;
  filter: blur(10px);
}
@keyframes drift {
  from { background-position: 0 0; }
  to   { background-position: 2000px 0; }
}
.lens-flare {
  position: absolute;
  top: 10%; left: 10%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(0,80,255,0.05) 40%, transparent 70%);
  z-index: 10; pointer-events: none;
  filter: blur(20px); mix-blend-mode: screen;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Monitor grande ≥ 1440px */
@media (min-width: 1440px) {
  .hero-inner { padding-left: 4%; }
  .main-impact { font-size: clamp(5rem, 7vw, 10rem); }
  #line2       { font-size: clamp(5rem, 7vw, 10rem); }
  .line-1-ghost { font-size: clamp(5rem, 7vw, 10rem); }
  .hero-man-foreground { height: 100vh; right: 0; }
  .main-impact-mobile {display: none;}
}

/* Notebook 1025–1439px: texto grande, bien repartido */
@media (max-width: 1439px) and (min-width: 1025px) {
  main-impact  { font-size: clamp(4.5rem, 6.5vw, 9rem); } /* <-- Aumentado aquí */
  #line2        { font-size: clamp(4.5rem, 6.5vw, 9rem); } /* <-- Aumentado aquí */
  .line-1-ghost { font-size: clamp(4.5rem, 6.5vw, 9rem); } /* <-- Aumentado aquí */
  .hero-inner   { padding: 0 4%; }
  .hero-man-foreground { height: 92vh; }
  .hero-glass-card { bottom: 6%; right: 2%; }
  .main-impact-mobile {display: none;}
}

/* Tablet 769–1024px */
@media (max-width: 1024px) and (min-width: 769px) {
  .main-impact  { font-size: clamp(3rem, 5vw, 5.5rem); }
  #line2        { font-size: clamp(3rem, 5vw, 5.5rem); }
  .line-1-ghost { font-size: clamp(3rem, 5vw, 5.5rem); }
  .hero-man-foreground { height: 70vh; opacity: 0.6; }
  .hero-glass-card { bottom: 5%; right: 2%; min-width: 170px; }
  .main-impact-desktop {display: none;}
}

/* ── MOBILE ≤ 768px ─────────────────────────── */
@media (max-width: 768px) {

  #nav { padding: 0 1.2rem; }

  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none; border: none;
    cursor: pointer; padding: 4px;
    width: 36px; height: 36px;
    order: -1;
  }
  .hamburger span {
    display: block;
    width: 24px; height: 2px;
    background: rgba(255,255,255,0.85);
    border-radius: 2px;
    transition: all 0.3s;
  }
  .nav-right { display: none; }
.hero-badge {
    margin-bottom: 0.5rem !important; /* Ajusta este valor (1.5rem, 2rem, etc.) para más espacio */
    display: inline-block; /* Asegura que el margen se aplique correctamente */
    line-height: 1.4;
    
  }
  /* Hero mobile */
  .hero { 
   display: flex !important;
    flex-direction: column !important;
    justify-content: center !important; /* Esto centra el bloque verticalmente */
    align-items: flex-start !important;
    min-height: 100vh !important;
    padding: 0 !important;
  }
  .hero-inner { 
    width: 100% !important;
    padding: 0 8% !important; /* Aumentamos a 8% para que respire mejor */
    flex: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem; /* Espacio entre elementos */
   }
  .hero-content {
    width: 100%;
    margin: 0;
  }
  /* Swap títulos: ocultar desktop, mostrar mobile */
  .main-impact-desktop { display: none !important; }
  .main-impact-mobile {
    display: flex !important;
    flex-direction: column;
    font-family: 'League Spartan', sans-serif;
    font-size: clamp(2.4rem, 10vw, 3.6rem) !important;
    font-weight: 900;
    line-height: 0.92;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    margin: 0 !important;
  }
  .line-1-mobile {
    display: block;
    background: linear-gradient(180deg, #ffffff 20%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: normal;
  }
  .line-2-mobile {
    display: block;
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.88);
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 18px rgba(255,255,255,0.2));
    white-space: normal;
  }

  /* Ocultar el #line2 del desktop en mobile */
  #line2 { display: none !important; }

  .hero-sub {
    margin-top: 0.1rem !important; /* Empuja tras el hueco de la Linea 2 */
    padding: 0 1% !important;
    max-width: 80% !important;

  }
  .hero-actions {
     margin-top: 1.2rem !important;
    
   }
  .hero-man-foreground, .hero-glass-card, .hero-badge {
    display: none !important;
  }
}

@media (max-width: 400px) {
  .main-impact { font-size: 2.1rem; }
  #line2        { font-size: 2.1rem; }
  .main-impact-desktop {display: none;}
}