/* ============================================
   Fundación Vegeta — Hero con isla 3D
   Se carga después de style.css y mobile.css.
   ============================================ */

.hero {
  display: block;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0;
  text-align: left;
  color: #fff;
  isolation: isolate;
  background: radial-gradient(120% 90% at 74% 42%, #133522 0%, #0b1b12 46%, #070d0a 100%);
}

.hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }

.hero-aurora {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(38% 34% at 70% 46%, rgba(34, 165, 76, 0.3), transparent 70%),
    radial-gradient(26% 26% at 18% 82%, rgba(252, 211, 77, 0.07), transparent 70%),
    radial-gradient(30% 30% at 92% 10%, rgba(126, 226, 160, 0.08), transparent 70%);
  animation: heroAurora 18s ease-in-out infinite alternate;
}
@keyframes heroAurora { to { transform: translate3d(-3%, 2%, 0) scale(1.06); } }

.hero-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.hero-3d.is-ready { opacity: 1; }
.hero-3d.is-ready.is-dim { opacity: 0.45; }

/* Velo que asegura la lectura del texto sobre la escena */
.hero-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 13, 10, 0.88) 0%, rgba(7, 13, 10, 0.55) 34%, rgba(7, 13, 10, 0) 58%),
    linear-gradient(0deg, rgba(7, 13, 10, 0.9) 0%, rgba(7, 13, 10, 0) 26%);
}
/* Grano fino: da textura de pieza diseñada y evita el banding de los degradados */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.07;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 116px 40px 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
}
.hero-content {
  max-width: 600px;
  text-align: left;
  pointer-events: auto;
}

.hero-title {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(48px, 6.4vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: #f4f7f2;
  margin-bottom: 26px;
}
.hero-title-accent {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: #7ee2a0;
  font-style: italic;
  font-weight: 500;
}

.hero-sub {
  color: rgba(236, 243, 238, 0.76);
  margin: 0 0 36px;
  max-width: 520px;
}

.hero-actions { justify-content: flex-start; }
/* Primario sobre fondo oscuro: verde de marca con texto oscuro (contraste ~7:1) */
.hero .btn-primary {
  background: var(--cta-dark-bg, #22a54c);
  color: var(--cta-dark-fg, #07140c);
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(34, 165, 76, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.hero .btn-primary:hover { background: #2bbf5a; box-shadow: 0 14px 40px rgba(34, 165, 76, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.hero .btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.hero .btn-ghost:hover { border-color: #7ee2a0; color: #7ee2a0; background: rgba(255, 255, 255, 0.1); }
.hero .btn-ghost:hover .btn-icon-circle { background: #7ee2a0; border-color: #7ee2a0; color: #0b1b12; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 0 44px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  max-width: 540px;
}
.hero-stat { text-align: left; }
.hero-stat-divider { display: none; }
.hero-stat-num {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: #fff;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 40px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.hero-stat-label { color: rgba(236, 243, 238, 0.62); font-size: 13px; }

/* Leyenda de la escena */
.hero-legend {
  position: absolute;
  right: 120px;
  bottom: 44px;
  display: flex;
  gap: 22px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: rgba(236, 243, 238, 0.6);
}
.hero-legend i { display: inline-block; vertical-align: middle; margin-right: 8px; }
.hl-beam { width: 2px; height: 14px; background: linear-gradient(#ffe7a3, rgba(255, 231, 163, 0)); box-shadow: 0 0 8px #ffd27a; }
.hl-relief { width: 14px; height: 10px; border-radius: 2px; background: linear-gradient(#2ab95c, #0e3a22); transform: skewX(-14deg); }
.hero:not(.has-3d) .hero-legend { display: none; }

/* === Navegación sobre el hero oscuro === */
.nav-logo-img--light { display: none; }
.has-dark-hero .nav:not(.scrolled) .nav-logo-img--dark { display: none; }
.has-dark-hero .nav:not(.scrolled) .nav-logo-img--light { display: block; }
.has-dark-hero .nav:not(.scrolled) .nav-logo-text { color: #fff; }
.has-dark-hero .nav:not(.scrolled) .nav-link { color: rgba(255, 255, 255, 0.78); }
.has-dark-hero .nav:not(.scrolled) .nav-link:hover,
.has-dark-hero .nav:not(.scrolled) .nav-link.active { color: #7ee2a0; }
.has-dark-hero .nav:not(.scrolled) .nav-link::after { background: #7ee2a0; }
.has-dark-hero .nav:not(.scrolled) .nav-cta { background: #22a54c; color: #07140c; }
.has-dark-hero .nav:not(.scrolled) .nav-hamburger span { background: #fff; }
/* Con el menú móvil abierto (fondo claro) la barra vuelve a sus colores normales */
.has-dark-hero.menu-open .nav:not(.scrolled) .nav-logo-img--dark { display: block; }
.has-dark-hero.menu-open .nav:not(.scrolled) .nav-logo-img--light { display: none; }
.has-dark-hero.menu-open .nav:not(.scrolled) .nav-logo-text { color: var(--text-primary); }
.has-dark-hero.menu-open .nav:not(.scrolled) .nav-hamburger span { background: var(--text-primary); }

/* === Tablet === */
@media (max-width: 1023px) {
  .hero-shade {
    background:
      linear-gradient(0deg, rgba(7, 13, 10, 0.96) 0%, rgba(7, 13, 10, 0.86) 46%, rgba(7, 13, 10, 0) 72%);
  }
  .hero.has-3d .hero-inner { justify-content: flex-end; }
  .hero-inner { padding: 120px 32px 64px; }
  .hero-legend { display: none; }
}

/* === Móvil === */
@media (max-width: 768px) {
  .hero-inner { padding: 96px 20px 44px; }
  .hero-content { max-width: 100%; }
  .hero-title { font-size: clamp(40px, 11.5vw, 56px); margin-bottom: 18px; }
  .hero-sub { font-size: 15px; line-height: 1.65; margin-bottom: 26px; }
  /* Franja propia para la isla: el texto empieza debajo de ella */
  .hero.has-3d .hero-inner { justify-content: flex-start; padding-top: calc(64px + 36svh); }
  .hero-shade {
    background: linear-gradient(0deg, rgba(7, 13, 10, 0.95) 0%, rgba(7, 13, 10, 0.82) 50%, rgba(7, 13, 10, 0) 66%);
  }
  .hero-actions { flex-direction: row; align-items: center; gap: 20px; width: 100%; }
  .hero-actions .btn { justify-content: center; padding: 14px 24px; font-size: 15px; }
  .hero-actions .btn-primary { width: auto; flex: 1 1 auto; }
  /* «Ver impacto» pasa a enlace de texto con su círculo de flecha */
  .hero .btn-ghost {
    width: auto;
    flex: 0 0 auto;
    background: none;
    border: 0;
    padding: 12px 0 !important;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .hero .btn-ghost:hover { background: none; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 0 12px; margin-top: 30px; padding-top: 20px; max-width: none; }
  .hero-stat-num { font-size: 28px; }
  .hero-stat-label { font-size: 12px; line-height: 1.3; display: block; }
}

@media (max-width: 400px) {
  .hero-title { font-size: 36px; }
  .hero-sub { font-size: 14px; }
}

@media (max-width: 360px) {
  .hero-actions { gap: 14px; flex-wrap: nowrap; }
  .hero-actions .btn-primary { padding: 14px 18px !important; }
  .hero .btn-ghost .btn-icon-circle { display: none; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .hero-inner { padding: 80px 24px 32px; min-height: auto; }
  .hero-title { font-size: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-aurora { animation: none; }
  .hero-3d { transition: none; }
}
