/* ==========================================================================
   Componente: Hero
   Responsabilidad: sección de apertura, timeline GSAP automático
   Depende de variables globales de paleta/tipografía definidas en app.css
   ========================================================================== */

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--ink, #0b0908);
}

/* ---------- Media (imagen + overlay) ---------- */

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* Estado inicial para el Ken Burns — GSAP toma el control desde acá */
  transform: scale(1);
  opacity: 0;
  filter: blur(18px);
  /* willChange ayuda al navegador a optimizar el filtro animado */
  will-change: filter, opacity, transform;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(11, 9, 8, 0.62) 0%,
    rgba(11, 9, 8, 0.46) 45%,
    rgba(11, 9, 8, 0.7) 80%,
    rgba(11, 9, 8, 0) 100%
  );
}

/* ---------- Contenido (kicker + título) ---------- */

.hero__content {
  position: absolute;
  left: 0;
  bottom: 7rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  max-width: 48rem;
  padding: 0 4.5rem;
}

.hero__kicker {
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--amber, #e2a24a);
  margin: 0 0 1.5rem;
  opacity: 0;
}

.hero__title {
  font-family: var(--font-display, 'Fraunces', serif);
  font-weight: 300;
  font-size: clamp(2.75rem, 5.2vw, 4.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--bone, #efe7db);
  margin: 0 0 1.75rem;
  opacity: 0;
}

.hero__title em {
  font-style: normal;
  color: var(--amber, #e2a24a);
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber, #e2a24a);
  background-color: transparent;
  border: 1px solid var(--amber, #e2a24a);
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  opacity: 0;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.hero__cta:hover,
.hero__cta:focus-visible {
  background-color: var(--amber, #e2a24a);
  color: var(--ink, #0b0908);
  transform: translateY(-1px);
}

/* ---------- Scroll CTA ---------- */

.hero__scroll-cta {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--bone, #efe7db);
  opacity: 0;
}

.hero__scroll-text {
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.75;
}

.hero__scroll-icon {
  display: flex;
  color: var(--bone, #efe7db);
  opacity: 0.85;
}

.hero__scroll-dot {
  transform-origin: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .hero__content {
    max-width: 100%;
    padding: 0 1.5rem;
    bottom: 7.95rem;
  }

  .hero__title {
    font-size: 1.85rem;
    line-height: 1.22;
  }

  .hero__scroll-cta {
    bottom: 1.75rem;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .hero__image,
  .hero__kicker,
  .hero__title,
  .hero__scroll-cta {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Splash de apertura — black frame + wordmark + trazo circular
   Corre una sola vez al cargar la Home, antes del Hero principal
   ========================================================================== */

.hero-splash {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--ink, #0b0908);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 1;
  visibility: visible;
}

.hero-splash.is-done {
  visibility: hidden;
  pointer-events: none;
}

.hero-splash__wordmark {
  position: relative;
  font-family: var(--font-display, 'Fraunces', serif);
  font-weight: 300;
  font-size: 7vw;
  line-height: 1;
  color: var(--amber, #e2a24a);
  opacity: 0;
  z-index: 2;
  white-space: nowrap;
}

.hero-splash__ring {
  position: absolute;
  width: min(32vw, 60vh);
  height: min(32vw, 60vh);
  color: var(--amber, #e2a24a);
  opacity: 0;
  z-index: 1;
}

.hero-splash__ring-circle {
  /* 2 * PI * r, con r=92 → ~578px de circunferencia en coordenadas del viewBox */
  stroke-dasharray: 578;
  stroke-dashoffset: 578;
  transform-origin: center;
  /* Rota el inicio del trazo de las 12 (default SVG) a las 6 — arranca abajo */
  transform: rotate(180deg);
}

@media (max-width: 640px) {
  .hero-splash__wordmark {
    font-size: 13vw;
  }

  .hero-splash__ring {
    width: min(58vw, 58vh);
    height: min(58vw, 58vh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-splash {
    display: none;
  }
}