@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wdth,wght@75..100,400..700&family=Newsreader:ital,opsz,wght@1,6..72,400&display=swap');

/* ==========================================================================
   SIGNAL — Audiovisual Hero Section
   Diseño de vanguardia editorial & kinetic textile
   ========================================================================== */

:root {
  --font-sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;
  
  --color-green-base: #255424;
  --color-green-dark: #173716;
  --color-green-light: #346c33;
  --color-accent: #f4ff3f;
  --color-white: #ffffff;
  --color-text-body: rgba(255, 255, 255, 0.94);
  --color-text-dim: rgba(255, 255, 255, 0.72);
  --color-border: rgba(255, 255, 255, 0.2);
  --color-border-hover: rgba(244, 255, 63, 0.6);
  
  --radius-max: 6px;
  --fluid-gutter: clamp(22px, 6vw, 96px);
  --ease-editorial: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset base y prevención estricta de scroll horizontal */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: clip;
  background-color: var(--color-green-base);
  color: var(--color-white);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Accesibilidad: Foco de teclado */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ==========================================================================
   Contenedor Hero
   min-height: 100svh, composición full-bleed con video y gradiente localizado
   ========================================================================== */
.hero {
  position: relative;
  width: 100%;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 0 var(--fluid-gutter);
}

/* Medio de fondo full-bleed — imagen del gorila mirando hacia la izquierda */
.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  z-index: 0;
  pointer-events: none;
}

/* Fade localizado detrás del texto armonizado con la fotografía verde */
.hero .edge {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(14, 34, 18, 0.90) 0%, rgba(14, 34, 18, 0.42) 46%, transparent 68%);
}

/* Overlay de fusión inferior entre el Hero y la sección intermedia */
.hero-blend-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(31, 69, 29, 0.6) 60%, #1f451d 100%);
}

/* ==========================================================================
   Barra Superior / Header
   ========================================================================== */
.hero-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(24px, 4vw, 44px) var(--fluid-gutter);
}

.brand {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-white);
  text-decoration: none;
  border-radius: var(--radius-max);
  transition: color 0.25s ease;
}

.brand:hover {
  color: var(--color-accent);
}

.hero-nav {
  display: block;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-link {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-white);
  text-decoration: none;
  opacity: 0.9;
  position: relative;
  padding: 4px 0;
  border-radius: var(--radius-max);
  transition: opacity 0.2s ease, color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-accent);
  transition: width 0.25s var(--ease-editorial);
}

.nav-link:hover {
  opacity: 1;
  color: var(--color-accent);
}

.nav-link:hover::after {
  width: 100%;
}

/* ==========================================================================
   Bloque Editorial: Contenido en el tercio izquierdo
   max-width: 600px, centrado verticalmente
   ========================================================================== */
.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 620px;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 80px 0;
}

/* H1: clamp(52px, 6.4vw, 104px), peso 540, line-height .90 — despejado para no tapar al gorila */
.hero-title {
  display: flex;
  flex-direction: column;
  font-size: clamp(52px, 6.4vw, 104px);
  font-weight: 540;
  line-height: 0.90;
  letter-spacing: -0.015em;
  font-variation-settings: 'wdth' 100;
  color: var(--color-white);
  margin-bottom: 26px;
}

.title-line-1 {
  display: block;
  font-family: var(--font-sans);
  font-weight: 540;
  white-space: nowrap;
}

/* Newsreader 400 itálica solo en la segunda línea */
.title-line-2 {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* Cuerpo de texto: máximo 480 px */
.hero-description {
  max-width: 480px;
  font-family: var(--font-sans);
  font-size: clamp(16px, 1.25vw, 19px);
  font-weight: 400;
  line-height: 1.48;
  color: var(--color-text-body);
  margin-bottom: 36px;
  text-wrap: pretty;
}

/* Acciones / CTA editorial */
.hero-actions {
  display: flex;
  align-items: center;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-white);
  text-decoration: none;
  background-color: transparent;
  padding: 13px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-max);
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.hero-cta:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background-color: rgba(244, 255, 63, 0.06);
  transform: translateX(4px);
}

.cta-arrow {
  display: inline-block;
  transition: transform 0.25s var(--ease-editorial);
}

.hero-cta:hover .cta-arrow {
  transform: translateX(3px);
}

.hero-actions {
  animation: heroReveal 0.75s var(--ease-editorial) 0.38s both;
}

.hero-header {
  animation: heroReveal 0.75s var(--ease-editorial) 0.02s both;
}

/* ==========================================================================
   Responsive: Pantallas menores o iguales a 760 px
   - Oculta navegación
   - Texto a 22 px de los lados y 90 px del borde inferior
   - H1: clamp(46px, 14vw, 68px)
   - Fade vertical desde abajo
   ========================================================================== */
@media (max-width: 760px) {
  .hero {
    min-height: 100svh;
    padding: 0;
    justify-content: flex-end;
  }

  /* Ocultar navegación */
  .hero-nav {
    display: none;
  }

  /* Fade vertical desde abajo armonizado con el fondo verde */
  .hero .edge {
    background: linear-gradient(0deg, rgba(14, 34, 18, 0.96) 0%, rgba(14, 34, 18, 0.65) 45%, rgba(14, 34, 18, 0.25) 70%, transparent 88%);
  }

  .hero-media {
    object-position: 72% 20%;
  }

  .hero-header {
    padding: 24px 22px;
  }

  /* Coloca el texto a 22 px de los lados y 90 px del borde inferior */
  .hero-content {
    max-width: 100%;
    margin-top: auto;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    padding: 80px 22px 90px 22px;
  }

  /* H1 clamp(46px, 14vw, 68px) */
  .hero-title {
    font-size: clamp(46px, 14vw, 68px);
    line-height: 0.93;
    margin-bottom: 20px;
  }

  .title-line-1,
  .title-line-2 {
    white-space: normal;
  }

  .hero-description {
    font-size: 16px;
    line-height: 1.45;
    margin-bottom: 28px;
    max-width: 100%;
  }

  .hero-cta {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
  }
}

/* ==========================================================================
   Accesibilidad: prefers-reduced-motion
   - Muestra el poster
   - Deja todo visible de inmediato (sin retardos ni traslaciones)
   - Desactiva reproducción continua
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .title-line-1,
  .title-line-2,
  .hero-description,
  .hero-actions,
  .hero-header {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .hero-media {
    /* Muestra estáticamente el póster evitando animaciones */
    object-position: center;
  }
}

/* ==========================================================================
   SECCIÓN INTERMEDIA: Continuidad Tonal Verde con Degradé Hacia el Tono del Video
   Oscurece y aclara progresivamente para fusionar el Hero (#1f451d) con el Video (#356930)
   ========================================================================== */
.transition-section {
  position: relative;
  width: 100%;
  min-height: 85vh;
  /* Degradé vertical continuo: desde la base del Hero (#1f451d)
     hasta el verde de estudio exacto del video (#356930) */
  background: linear-gradient(180deg, #1f451d 0%, #255122 35%, #2d5e29 70%, #356930 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(90px, 12vh, 140px) var(--fluid-gutter) 160px;
  margin-bottom: -140px;
  z-index: 2;
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 140px), transparent 100%);
  mask-image: linear-gradient(to bottom, black calc(100% - 140px), transparent 100%);
  overflow: visible;
}

/* Overlay de fusión perimetral superior y atmósfera de estudio */
.transition-overlay-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, #1f451d 0%, rgba(31, 69, 29, 0.7) 45%, transparent 100%);
}

.transition-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 48%, rgba(56, 126, 52, 0.25) 0%, rgba(37, 84, 36, 0.05) 55%, transparent 80%);
}

.transition-container {
  position: relative;
  z-index: 2;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.transition-heading {
  display: flex;
  flex-direction: column;
  font-size: clamp(34px, 4.5vw, 60px);
  font-weight: 520;
  line-height: 1.08;
  color: var(--color-white);
  margin-bottom: 24px;
}

.heading-line-1 {
  font-family: var(--font-sans);
  font-weight: 520;
}

.heading-line-2 {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95);
}

.transition-lead {
  font-family: var(--font-sans);
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.55;
  color: var(--color-text-body);
  max-width: 620px;
  margin-bottom: 48px;
  text-wrap: pretty;
}

/* Selector Interactivo de Especificaciones */
.transition-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  width: 100%;
  max-width: 820px;
  gap: 16px;
  margin-bottom: 24px;
}

.spec-card {
  background: rgba(18, 42, 19, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-max);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  outline: none;
  transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.25s var(--ease-editorial), box-shadow 0.25s ease;
}

.spec-card:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(24, 56, 26, 0.7);
  transform: translateY(-3px);
}

.spec-card:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 3px;
}

.spec-card.is-active {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(24, 56, 26, 0.88);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.spec-number {
  font-family: var(--font-sans);
  font-size: clamp(32px, 3.5vw, 44px);
  font-weight: 700;
  line-height: 1;
  color: var(--color-white);
}

.spec-unit {
  font-size: clamp(15px, 1.6vw, 19px);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  margin-left: 2px;
}

.spec-label {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-text-dim);
  margin-top: 8px;
}

/* Panel de Detalle Interactivo Limpio */
.spec-detail-panel {
  width: 100%;
  max-width: 820px;
  background: rgba(18, 42, 19, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-max);
  padding: 22px 28px;
  margin-bottom: 40px;
  text-align: left;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  transition: border-color 0.3s ease;
}

.detail-title {
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 600;
  color: var(--color-white);
  margin-bottom: 8px;
  transition: opacity 0.2s ease;
}

.detail-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text-body);
  margin-bottom: 0;
  transition: opacity 0.2s ease;
}

/* ==========================================================================
   SECCIÓN DE SECUENCIA POR SCROLL: Canvas Limpio (Sin viñetas que tapen al gorila)
   ========================================================================== */
.sequence-section {
  position: relative;
  width: 100%;
  background-color: #356930;
}

/* Fondo Adhesivo Fijo durante todo el scroll de la secuencia */
.sequence-sticky-bg {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.sequence-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Contenedor de los 3 Bloques Físicos en el Flujo de Scroll */
.sequence-steps {
  position: relative;
  z-index: 3;
  margin-top: -100vh;
  margin-top: -100svh;
}

.sequence-step {
  min-height: 120vh;
  display: flex;
  align-items: center;
  padding: 0 var(--fluid-gutter);
  box-sizing: border-box;
}

.sequence-step.step-1 {
  justify-content: flex-start;
}

.sequence-step.step-2 {
  justify-content: flex-end;
}

.sequence-step.step-3 {
  justify-content: flex-start;
  min-height: 135vh;
  padding-bottom: 35vh;
}

/* Bloques Editoriales sin cuadros de fondo: Texto puro flotante con sombra */
.sequence-block {
  position: relative;
  z-index: 4;
  width: min(480px, calc(46% - var(--fluid-gutter)));
  max-width: 480px;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  opacity: 1;
}


.block-title {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 520;
  line-height: 1.08;
  color: var(--color-white);
  margin-bottom: 14px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.9), 0 1px 4px rgba(0, 0, 0, 0.95);
}

.block-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.block-text {
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.94);
  margin-bottom: 0;
  text-wrap: pretty;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* ==========================================================================
   PIE DE PÁGINA: Minimalista, Tonalmente Continuo y Sin Amarillos
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: 4;
  /* Empate tonal con la base del video de la secuencia (#1f421d) */
  background: linear-gradient(180deg, #1f421d 0%, #173516 50%, #122811 100%);
  padding: clamp(90px, 12vh, 130px) var(--fluid-gutter) clamp(32px, 4vh, 44px);
  margin-top: -120px;
  /* Fusión gradual con mask-image: elimina por completo la línea física de corte */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.5) 50px, black 120px, black 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.5) 50px, black 120px, black 100%);
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4vh, 40px);
}

.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
  font-family: var(--font-sans);
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-white);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-brand:hover {
  opacity: 0.85;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-nav-link {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-nav-link:hover {
  color: var(--color-white);
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.back-to-top:hover {
  border-color: rgba(255, 255, 255, 0.6);
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.08);
}

.footer-bottom {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
}

.footer-copyright {
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Responsive: Mobile (<= 760px)
   ========================================================================== */
@media (max-width: 760px) {
  .transition-specs {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .spec-card {
    padding: 16px 20px;
    flex-direction: row;
    justify-content: space-between;
  }

  .spec-number {
    font-size: 28px;
  }

  .spec-label {
    margin-top: 0;
    font-size: 12px;
  }

  .spec-detail-panel {
    padding: 18px 20px;
  }

  .sequence-step {
    min-height: 105vh;
    justify-content: center !important;
    align-items: flex-end;
    padding: 0 20px 100px 20px;
  }

  .sequence-block {
    width: 100%;
    max-width: 100%;
  }

  .block-title {
    font-size: 24px;
    margin-bottom: 8px;
  }

  .block-text {
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 12px;
  }

  .site-footer {
    padding: 60px 20px 28px 20px;
    margin-top: -70px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.5) 25px, black 70px, black 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.5) 25px, black 70px, black 100%);
  }

  .footer-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .footer-nav {
    gap: 18px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
