/* ═══════════════════════════════════════════════════════════════════
   ARRECIFE SISAL v2.0 — Componente 1: HERO + NAVEGACIÓN
   Requiere: arrecife-v2.css (Design System base)
   ═══════════════════════════════════════════════════════════════════ */


/* ───────────────────────────────────────────────────────────────────
   HERO — Sección principal fullscreen con video cinemático
   ─────────────────────────────────────────────────────────────────── */
#hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background-color: var(--navy-ink);
  /* Sin padding-top — el nav flota sobre el hero */
}

/* ── Video background ── */
.hero__video-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  /* Sin clips, sin cortes — video en un solo formato horizontal */
}

/* Poster (imagen estática mientras carga el video) */
.hero__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  /* Se oculta via JS cuando el video está listo */
}
/* object-fit aplica al <img>, no al <picture> contenedor.
   Sin esto el poster no cubre el hero correctamente (se ve desproporcionado). */
.hero__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
}
.hero__poster.hidden {
  opacity: 0;
  transition: opacity .8s var(--ease);
  pointer-events: none;
}

/* ── Overlays graduales (dan profundidad sin ocultar el video) ── */
.hero__overlays {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* Gradiente principal — oscurece desde abajo donde va el texto */
.hero__overlay-bottom {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(13, 27, 42, .95) 0%,
    rgba(13, 27, 42, .55) 25%,
    rgba(13, 27, 42, .15)  55%,
    transparent          80%
  );
}

/* Gradiente lateral — da espacio visual al texto */
.hero__overlay-side {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(22, 61, 92, .55) 0%,
    rgba(22, 61, 92, .15) 40%,
    transparent          65%
  );
}

/* Overlay superior sutil (para que el logo del nav sea legible) */
.hero__overlay-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 220px;
  background: linear-gradient(
    to bottom,
    rgba(13, 27, 42, .6) 0%,
    transparent         100%
  );
}

/* ── Contenido principal ── */
.hero__content {
  position: relative;
  z-index: 3;
  width: 100%;
  padding-bottom: clamp(4.5rem, 8vw, 7rem);
  padding-top: 0;
}

/* Eyebrow */
.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  opacity: 0;
  animation: fade-up var(--t-slow) var(--ease-out) .3s forwards;
}
.hero__eyebrow::before {
  content: '';
  display: block;
  width: 36px;
  height: 1px;
  background: var(--gold);
  flex-shrink: 0;
}
.hero__eyebrow-text {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--w-semi);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--gold);
}

/* Título principal — gran serif */
.hero__title {
  font-family: var(--font-serif);
  font-size: var(--text-5xl);
  font-weight: var(--w-bold);
  color: var(--off-white);
  line-height: 1.05;
  letter-spacing: -0.035em;
  max-width: 14ch;
  margin-bottom: var(--sp-6);
  opacity: 0;
  animation: fade-up var(--t-slow) var(--ease-out) .5s forwards;
}

/* Línea en cursiva — firma tipográfica de marca:
   script en Atardecer + Athelas navy. Ver Manual de Identidad 2026. */
.hero__title em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--w-normal);
  color: var(--atardecer);
  letter-spacing: 0;
  font-size: 1.08em;
}

/* Subtítulo */
.hero__subtitle {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  color: rgba(232, 220, 200, .7);
  max-width: 44ch;
  line-height: var(--leading-loose);
  margin-bottom: var(--sp-8);
  opacity: 0;
  animation: fade-up var(--t-slow) var(--ease-out) .7s forwards;
}

/* CTAs */
.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  opacity: 0;
  animation: fade-up var(--t-slow) var(--ease-out) .9s forwards;
}

/* Stats inline bajo los CTAs */
.hero__stats {
  display: flex;
  gap: var(--sp-8);
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid rgba(255,255,255,.1);
  opacity: 0;
  animation: fade-up var(--t-slow) var(--ease-out) 1.1s forwards;
}

.hero__stat-value {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--w-bold);
  color: var(--off-white);
  line-height: 1;
  margin-bottom: var(--sp-1);
}
.hero__stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

/* ── Controles del video (esquina inferior derecha) ── */
.hero__controls {
  position: absolute;
  bottom: clamp(2rem, 4vw, 3.5rem);
  right: var(--sp-8);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  opacity: 0;
  animation: fade-in 1s var(--ease-out) 1.4s forwards;
}

/* Botón de sonido */
.hero__sound-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast), color var(--t-fast);
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.hero__sound-btn:hover {
  background: rgba(216,185,147,.15);
  color: var(--gold);
  border-color: var(--gold-border);
}
.hero__sound-btn svg { width: 16px; height: 16px; }

/* Indicador de scroll */
.hero__scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}
.hero__scroll-text {
  font-size: 0.6rem;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.hero__scroll-line {
  width: 1px;
  height: 52px;
  background: linear-gradient(to bottom, rgba(196,169,109,.5), transparent);
  animation: scroll-line 2.2s ease-in-out infinite;
}

/* ── Indicador de calidad de imagen (esquina inf. izquierda) ── */
.hero__badge {
  position: absolute;
  bottom: clamp(2rem, 4vw, 3.5rem);
  left: var(--sp-8);
  z-index: 4;
  opacity: 0;
  animation: fade-in 1s var(--ease-out) 1.6s forwards;
}


/* ───────────────────────────────────────────────────────────────────
   RESPONSIVE HERO
   ─────────────────────────────────────────────────────────────────── */

/* Tablet — stacking de CTAs cuando el viewport no da para una fila */
@media (max-width: 900px) {
  .hero__subtitle { max-width: 100%; }
  .hero__stats { gap: var(--sp-6); }
  .hero__controls { right: var(--sp-6); }
  .hero__badge  { display: none; }
  /* Botones apilados verticalmente en tablet */
  .hero__ctas {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-3);
  }
  .hero__ctas .btn {
    min-width: 260px;
  }
}

/* Mobile grande */
@media (max-width: 768px) {
  /* En mobile el video TAMBIÉN se reproduce; el JS decide según la conexión
     (lo desactiva y deja el poster solo si la red es muy lenta / Save-Data). */

  .hero__overlay-side {
    background: linear-gradient(
      to right,
      rgba(13,27,42,.7) 0%,
      rgba(13,27,42,.3) 100%
    );
  }

  .hero__title {
    font-size: var(--text-4xl);
    max-width: 100%;
    letter-spacing: -0.025em;
  }

  .hero__stats { display: none; } /* Aparecerán en la sección stats debajo */
  .hero__controls { display: none; }
  .hero__badge   { display: none; }
}

/* Mobile — botones a ancho completo + margen derecho para WA flotante */
@media (max-width: 660px) {
  .hero__ctas .btn {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    text-align: center;
  }
  /* Margen derecho para que el botón WA flotante no tape el texto */
  .hero__ctas { padding-right: 68px; }
  /* Espacio inferior para que el WA flotante no cubra los botones */
  .hero__content { padding-bottom: 7rem; }
}

/* Mobile pequeño */
@media (max-width: 480px) {
  #hero { height: 100dvh; min-height: 580px; }

  .hero__content { padding-bottom: 6rem; }

  .hero__title { font-size: clamp(2.2rem, 9.5vw, 3rem); }
  .hero__subtitle { font-size: var(--text-base); }
}

/* ── Viewport de altura reducida — laptop 768px, tablets en landscape ──
   Con overflow:hidden el top del hero__content se recorta cuando el contenido
   total supera el viewport. La solución: reducir padding + ocultar .hero__stats
   (que se repiten en el #stats strip inmediatamente debajo del hero).
   NEVER cambiar align-items:flex-end — el diseño bottom-anchored es intencional. */

@media (max-height: 820px) {
  .hero__stats  { display: none; }
  .hero__badge  { display: none; }
  .hero__content { padding-bottom: clamp(2rem, 4vw, 3.5rem); }
  .hero__subtitle { margin-bottom: var(--sp-6); }
}

@media (max-height: 680px) {
  .hero__subtitle { display: none; }
  .hero__eyebrow  { margin-bottom: var(--sp-4); }
  .hero__title {
    font-size: clamp(2.2rem, 5.5vw, 3.8rem);
    margin-bottom: var(--sp-4);
    line-height: 1.08;
  }
  .hero__content { padding-bottom: 2rem; }
}

/* Sin animaciones */
@media (prefers-reduced-motion: reduce) {
  .hero__video { display: none; }
  .hero__poster.hidden { opacity: 1; }
  .hero__eyebrow,
  .hero__title,
  .hero__subtitle,
  .hero__ctas,
  .hero__stats,
  .hero__controls,
  .hero__badge {
    opacity: 1;
    animation: none;
  }
  .hero__scroll-line { animation: none; }
}


/* ───────────────────────────────────────────────────────────────────
   STATS STRIP — Barra de métricas clave (después del hero)
   ─────────────────────────────────────────────────────────────────── */
#stats {
  background: var(--off-white);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-1);
}

.stats__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
  position: relative;
}

/* Separador vertical entre items */
.stats__item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: var(--border-light);
}

.stats__number {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  font-weight: var(--w-bold);
  color: var(--navy-ink);
  line-height: 1;
  margin-bottom: var(--sp-2);
  letter-spacing: -0.02em;
}

.stats__item--accent .stats__number { color: #a07b45; } /* bronce accesible — 3.7:1 sobre off-white (WCAG AA texto grande) */

.stats__suffix {
  font-family: var(--font-serif);
  font-size: .55em;
  font-weight: var(--w-normal);
  color: var(--arena-deep);
  vertical-align: super;
  line-height: 0;
}

.stats__label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--w-semi);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-gray);
  line-height: var(--leading-snug);
  max-width: 16ch;
}

/* Dots de disponibilidad vivos */
.stats__live {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}
.stats__live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--available);
  animation: pulse-dot 2.5s ease-in-out infinite;
  flex-shrink: 0;
}
.stats__live-text {
  font-size: 0.62rem;
  color: var(--navy);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  font-weight: var(--w-semi);
  opacity: 0.6;
}

@media (max-width: 900px) {
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .stats__item:nth-child(2)::after { display: none; }
}
@media (max-width: 480px) {
  .stats__grid { grid-template-columns: 1fr 1fr; gap: 0; }
  .stats__number { font-size: var(--text-3xl); }
  .stats__item { padding: var(--sp-5) var(--sp-3); }
}
