/* ══════════════════════════════════════════════════════════════════════
   EXPERIENCIA DE ENTRADA — Black Embassy
   Archivo: ASSETS/css/experience.css
   ══════════════════════════════════════════════════════════════════════

   ¿QUÉ HAY EN ESTE ARCHIVO?
   -------------------------
   1. "El telar de la memoria": pantalla de carga con hilos dorados que
      se tejen. Aparece UNA vez por sesión y se puede saltar.
   2. Portada con Guille: retrato real dentro de un arco, tarjeta de
      presentación y botón para comenzar el recorrido guiado.
   3. Fondo de la portada con varias fotos que se funden lentamente
      (sin carrusel automático agresivo).
   4. Ajustes para móvil y para quien prefiere reducir movimiento.

   ¿CÓMO QUITO LA INTRO?
   ---------------------
   En experience.js, pon INTRO_ENABLED = false. El HTML de la intro se
   queda, pero se oculta solo al instante.

   ¿CÓMO CAMBIO LA DURACIÓN?
   -------------------------
   En experience.js, constante INTRO_MS (2000 ms por defecto).

   IMPORTANTE
   ----------
   La intro NUNCA atrapa al visitante: si el JavaScript falla, una
   animación CSS la retira a los pocos segundos. Además, todo el bloque
   queda por encima del sitio pero se elimina del DOM al terminar.
   ══════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════════
   1. INTRO — "EL TELAR DE LA MEMORIA"
   ══════════════════════════════════════════════════════════════════════ */

.be-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 38%, rgba(228, 184, 68, 0.12), transparent 58%),
    radial-gradient(ellipse at 50% 105%, rgba(43, 88, 118, 0.38), transparent 62%),
    linear-gradient(160deg, #07101d 0%, #0a1628 55%, #060d18 100%);
  overflow: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

/* Textura de tejido: dos tramas diagonales muy tenues. */
.be-loader::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(228, 184, 68, 0.05) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(-45deg, rgba(91, 180, 229, 0.04) 0 1px, transparent 1px 16px);
  opacity: 0.7;
  pointer-events: none;
}

/* Viñeta: oscurece los bordes y concentra la mirada en el telar. */
.be-loader::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, transparent 30%, rgba(3, 8, 14, 0.72) 100%);
  pointer-events: none;
}

/* Si el visitante ya vio la intro en esta sesión, no se muestra. */
.be-intro-done .be-loader {
  display: none !important;
}

/* Red de seguridad: si el JavaScript no corre, la intro se retira sola. */
.be-loader {
  animation: beLoaderFailsafe 0.6s ease 5s forwards;
}

@keyframes beLoaderFailsafe {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

.be-loader.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.be-loader.is-leaving .be-loader__inner {
  transform: translateY(-12px) scale(0.985);
}

.be-loader__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: min(420px, 100%);
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── El telar ─────────────────────────────────────────────────────── */

.be-loader__loom {
  position: relative;
  width: 238px;
  height: 238px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}

/* Halo dorado detrás del medallón. */
.be-loader__loom::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(228, 184, 68, 0.24), transparent 68%);
  filter: blur(6px);
  animation: beLoaderGlow 2.6s ease-in-out infinite alternate;
}

/* Anillo fino que gira muy despacio. */
.be-loader__loom::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px dashed rgba(228, 184, 68, 0.22);
  animation: beLoaderRing 26s linear infinite;
}

@keyframes beLoaderGlow {
  from { opacity: 0.55; transform: scale(0.94); }
  to   { opacity: 1;    transform: scale(1.06); }
}

@keyframes beLoaderRing {
  to { transform: rotate(360deg); }
}

.be-loader__loom svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Hilos verticales (urdimbre). */
.be-loader__warp line {
  transform-box: fill-box;
  transform-origin: top center;
  animation: beLoaderWarp 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

@keyframes beLoaderWarp {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 0.55; }
}

/* Hilos horizontales (trama). */
.be-loader__weft line {
  transform-box: fill-box;
  transform-origin: left center;
  animation: beLoaderWeft 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(420ms + var(--i, 0) * 55ms);
}

@keyframes beLoaderWeft {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 0.34; }
}

/* Medallón central con el logo. */
.be-loader__mark {
  position: relative;
  z-index: 1;
  display: block;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(228, 184, 68, 0.42),
    0 0 0 9px rgba(228, 184, 68, 0.05),
    0 18px 46px rgba(0, 0, 0, 0.55);
  animation: beLoaderMarkIn 1.1s cubic-bezier(0.16, 1, 0.3, 1) both 0.3s;
}

.be-loader__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes beLoaderMarkIn {
  from { opacity: 0; transform: scale(0.72) rotate(-6deg); }
  to   { opacity: 1; transform: none; }
}

/* ── Textos ───────────────────────────────────────────────────────── */

.be-loader__brand {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--white);
  padding-left: 0.4em;
  line-height: 1.2;
}

.be-loader__brand span {
  display: block;
  margin-top: 7px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--gold-light);
  text-transform: uppercase;
}

.be-loader__words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}

.be-loader__words span {
  opacity: 0;
  animation: beLoaderWordIn 0.7s ease forwards;
  animation-delay: calc(0.7s + var(--i, 0) * 0.19s);
}

.be-loader__words i {
  font-style: normal;
  color: rgba(228, 184, 68, 0.55);
  opacity: 0;
  animation: beLoaderWordIn 0.7s ease forwards;
  animation-delay: calc(0.7s + var(--i, 0) * 0.19s);
}

@keyframes beLoaderWordIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

/* Barra de avance fina. */
.be-loader__bar {
  position: relative;
  width: min(220px, 62vw);
  height: 1px;
  margin-top: 8px;
  background: rgba(228, 184, 68, 0.16);
  overflow: hidden;
}

.be-loader__bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  animation: beLoaderBar 2s cubic-bezier(0.3, 0.8, 0.3, 1) forwards 0.35s;
}

@keyframes beLoaderBar {
  to { width: 100%; }
}

/* Botón para saltar la intro. */
.be-loader__skip {
  position: absolute;
  right: 22px;
  bottom: 20px;
  z-index: 2;
  padding: 10px 14px;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: "DM Sans", sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.be-loader__skip:hover,
.be-loader__skip:focus-visible {
  color: var(--gold-light);
}

.be-loader__skip:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}


/* ══════════════════════════════════════════════════════════════════════
   2. PORTADA — GUILLE, LA ANFITRIONA
   ══════════════════════════════════════════════════════════════════════ */

/* ── Fondo: fotos que se funden con calma ─────────────────────────── */

/* El cambio entre fotos se hace solo con opacidad: la imagen no se
   amplía ni se mueve, por eso el fondo nunca se ve borroso. */
.hero-photo-bg img {
  opacity: 0;
  transition: opacity 1.8s ease;
}

.hero-photo-bg img.is-active {
  opacity: 1;
}

/* ── Columna derecha: retrato + tarjeta de presentación ───────────── */

.hero-host {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 430px;
  margin-inline: auto;
}

.hero-host__stage {
  position: relative;
  width: 100%;
  height: clamp(360px, 48vh, 500px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  isolation: isolate;
}

/* Arco-portal detrás de Guille. */
.hero-host__arch {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(340px, 84%);
  height: 84%;
  border-radius: 190px 190px 26px 26px;
  border: 1px solid rgba(228, 184, 68, 0.3);
  background:
    radial-gradient(120% 80% at 50% 4%, rgba(228, 184, 68, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(20, 43, 68, 0.72), rgba(8, 19, 33, 0.22));
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.38),
    0 30px 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

/* Marca de agua del logo dentro del arco. */
.hero-host__arch::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4%;
  width: 66%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  background: url("../img/logo-mark.webp") center / contain no-repeat;
  opacity: 0.07;
}

/* Trama de tejido muy sutil. */
.hero-host__arch::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(228, 184, 68, 0.06) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(-45deg, rgba(91, 180, 229, 0.05) 0 1px, transparent 1px 18px);
  opacity: 0.5;
}

.hero-host__picture {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
}

.hero-host__picture picture {
  display: block;
  height: 100%;
}

.hero-host__photo {
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 26px 30px rgba(0, 0, 0, 0.48));
  animation: hostBreathe 7s ease-in-out infinite;
}

/* Respiración muy leve: da vida sin distraer. */
@keyframes hostBreathe {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* Tarjeta de presentación. */
.hero-host__card {
  position: relative;
  z-index: 2;
  width: calc(100% + 8px);
  margin-top: -22px;
  padding: 18px 20px 20px;
  border: 1px solid rgba(228, 184, 68, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(15, 31, 56, 0.95), rgba(7, 16, 29, 0.97));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.hero-host__identity {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.hero-host__name {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--white);
  line-height: 1;
}

.hero-host__role {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.hero-host__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38d39f;
  box-shadow: 0 0 0 3px rgba(56, 211, 159, 0.14), 0 0 10px rgba(56, 211, 159, 0.7);
  animation: hostOnline 2.6s ease-in-out infinite;
}

@keyframes hostOnline {
  0%, 100% { box-shadow: 0 0 0 3px rgba(56, 211, 159, 0.14), 0 0 10px rgba(56, 211, 159, 0.7); }
  50%      { box-shadow: 0 0 0 5px rgba(56, 211, 159, 0.07), 0 0 16px rgba(56, 211, 159, 0.9); }
}

.hero-host__say {
  margin: 9px 0 15px;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--muted);
}

.hero-host__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.btn-host {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border: 0;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #14223a;
  font-family: "DM Sans", sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(228, 184, 68, 0.28);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}

.btn-host:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(228, 184, 68, 0.4);
}

.btn-host:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
}

.hero-host__skip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.hero-host__skip:hover {
  color: var(--gold-light);
  border-color: rgba(228, 184, 68, 0.5);
}

.hero-host__skip i {
  font-size: 0.66rem;
  transition: transform 0.25s ease;
}

.hero-host__skip:hover i {
  transform: translateY(2px);
}

/* ── Cifras dentro de la columna de texto ─────────────────────────── */

.hero-stats--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 18px 30px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(228, 184, 68, 0.16);
}

.hero-stats--inline .hero-stat {
  flex: 0 1 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  text-align: left;
}

.hero-stats--inline .hero-stat strong {
  font-size: 1.75rem;
  margin-bottom: 2px;
}


/* ── Ajuste de altura en escritorio ──────────────────────────────────
   Con el retrato de Guille, el hero no necesita tanto aire vertical.
   Así la portada cabe casi entera en la primera pantalla y el titular
   no se parte en cuatro líneas. */
@media (min-width: 1025px) {
  .hero-inner {
    padding-top: 96px;
    padding-bottom: 104px;
  }

  .hero-title {
    font-size: clamp(3rem, 5vw, 4.8rem);
    line-height: 1.04;
  }

  .hero-desc {
    margin-bottom: 30px;
  }
}


/* ══════════════════════════════════════════════════════════════════════
   3. RESPONSIVE
   ══════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .hero-host {
    max-width: 440px;
    margin-top: 6px;
  }

  .hero-host__stage {
    height: 420px;
  }

  .hero-stats--inline {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .be-loader__loom {
    width: 196px;
    height: 196px;
  }

  .be-loader__mark {
    width: 96px;
    height: 96px;
  }

  .be-loader__brand {
    font-size: 1.15rem;
    letter-spacing: 0.3em;
    padding-left: 0.3em;
  }

  .be-loader__brand span {
    font-size: 0.5rem;
    letter-spacing: 0.24em;
  }

  .be-loader__words {
    font-size: 0.58rem;
    letter-spacing: 0.18em;
    gap: 6px;
  }

  .be-loader__skip {
    right: 12px;
    bottom: 12px;
  }

  .hero-host {
    max-width: 360px;
  }

  .hero-host__stage {
    height: 300px;
  }

  .hero-host__arch {
    width: 232px;
    border-radius: 130px 130px 20px 20px;
  }

  .hero-host__card {
    width: 100%;
    margin-top: -12px;
    padding: 15px 16px 17px;
  }

  .hero-host__name {
    font-size: 1.25rem;
  }

  .hero-host__say {
    font-size: 0.78rem;
    margin-bottom: 13px;
  }

  .btn-host {
    padding: 11px 16px;
    font-size: 0.76rem;
  }

  .hero-stats--inline {
    gap: 14px 22px;
    margin-top: 30px;
    padding-top: 22px;
  }

  .hero-stats--inline .hero-stat strong {
    font-size: 1.45rem;
  }
}

@media (max-width: 400px) {
  .hero-host__stage {
    height: 258px;
  }

  .hero-host__arch {
    width: 206px;
  }

  .hero-host__say {
    font-size: 0.74rem;
  }

  .hero-host__actions {
    gap: 8px 12px;
  }
}


/* ══════════════════════════════════════════════════════════════════════
   4. ACCESIBILIDAD: REDUCIR MOVIMIENTO
   ══════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  /* La intro se queda quieta y se retira rápido desde experience.js. */
  .be-loader__warp line,
  .be-loader__weft line {
    animation: none !important;
    opacity: 0.4;
  }

  .be-loader__mark,
  .be-loader__words span,
  .be-loader__words i,
  .be-loader__bar span,
  .be-loader__loom::before,
  .be-loader__loom::after {
    animation: none !important;
  }

  .be-loader__words span,
  .be-loader__words i {
    opacity: 1;
  }

  .be-loader__bar span {
    width: 100%;
  }

  .be-loader,
  .be-loader__inner {
    transition: none;
  }

  .hero-photo-bg img {
    transition: none;
  }

  .hero-photo-bg img,
  .hero-host__photo,
  .hero-host__dot {
    animation: none !important;
  }
}
