/* =========================================================
   e origen · INTRO B
   01 «Trazo que se dibuja» + 06 «El símbolo viaja al
   encabezado». Símbolo reconstruido a partir del vector
   oficial (Logo-vectores-Model.svg).
   Se carga después de styles.css e interacciones-b.css.
========================================================= */

/* el contenedor original pasa a ser solo un marco; el telón
   de travertino es un elemento propio para poder levantarlo
   sin recortar el símbolo que viaja */
.intro-screen.eo-b {
  z-index: 2147483000 !important;
  background: transparent !important;
  display: block !important;
  overflow: visible !important;
  cursor: default;
}

.intro-screen.eo-b::before,
.intro-screen.eo-b::after {
  display: none !important;
}

.intro-screen.eo-b .intro-logo {
  display: none !important;
}

.eo-curtain {
  position: absolute;
  inset: 0;
  background-color: rgb(251, 248, 240);
  background-image: radial-gradient(120% 90% at 50% 45%, #fffdf8 0%, rgba(255, 253, 248, 0) 65%);
}

.eo-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(18px, 2.6vw, 30px);
  padding: 0 16px;
  pointer-events: none;
}

.eo-draw {
  display: block;
  width: clamp(170px, 21vw, 300px);
  height: auto;
  overflow: visible;
  transform-origin: 0 0;
  will-change: transform;
}

.eo-draw path {
  fill: none;
  stroke-width: 43.5;
  stroke-linecap: round;
}

.eo-wm {
  margin: 0;
  font-family: "IBM Plex Sans", Arial, Helvetica, sans-serif;
  font-weight: 300;
  font-size: clamp(1.05rem, 1.7vw, 1.5rem);
  line-height: 1;
  letter-spacing: 0.52em;
  margin-right: -0.52em;
  color: rgb(11, 66, 53);
  white-space: nowrap;
}

.eo-wm span {
  display: inline-block;
}

.eo-sub {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 12px;
  font-family: "IBM Plex Sans", Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-size: clamp(0.66rem, 0.9vw, 0.8rem);
  line-height: 1;
  letter-spacing: 0.3em;
  margin-right: -0.3em;
  color: rgb(111, 91, 63);
  white-space: nowrap;
}

.eo-rule {
  display: block;
  width: 64px;
  height: 1px;
  background: #b08d57;
}

.eo-skip {
  position: absolute;
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(11, 66, 53, 0.06);
  color: rgb(11, 66, 53);
  font: 500 0.72rem/1 "IBM Plex Sans", Arial, sans-serif;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  cursor: pointer;
  opacity: 0;
  animation: eoFade 0.4s ease 0.9s forwards;
}

.eo-skip:hover {
  background: rgba(11, 66, 53, 0.12);
}

/* el símbolo y «e origen» siempre en una línea (a 1024 px el
   encabezado partía la palabra) */
.site-header .wordmark {
  white-space: nowrap;
}

/* tablet horizontal (769–1100 px): el menú original no cabía en
   el encabezado. Se compacta el menú y, por debajo de 900 px,
   el encabezado muestra solo el símbolo (el nombre se sigue
   leyendo para lectores de pantalla y en el enlace) */
@media (min-width: 769px) and (max-width: 1100px) {
  html body .site-header .wordmark {
    margin-right: 16px !important;
  }
  html body .site-header .wordmark .eo-mark {
    margin-right: 0.42em;
  }
  html body .site-header .main-nav {
    gap: 16px !important;
    column-gap: 16px !important;
  }
  html body .site-header .main-nav a {
    font-size: 10.4px !important;
    letter-spacing: 0.1em !important;
  }
}

@media (min-width: 769px) and (max-width: 900px) {
  html body .site-header .wordmark {
    max-width: 2.45em;
    overflow: hidden;
  }
}

/* símbolo del encabezado (lo inserta intro-b.js) */
.eo-mark {
  display: inline-block;
  height: 1.2em;
  width: auto;
  margin-right: 0.62em;
  vertical-align: -0.2em;
  overflow: visible;
  flex: none;
}

/* compensación óptica: a tamaño de encabezado el trazo
   necesita más cuerpo para leerse (≈1,6 px) */
.eo-mark path {
  fill: none;
  stroke-width: 92;
  stroke-linecap: round;
}

.eo-mark.is-waiting {
  visibility: hidden;
}

/* ---------------------------------------------------------
   VERSIÓN COMPLETA (primera visita)
--------------------------------------------------------- */

.eo-full .eo-draw .eo-p {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}

.eo-full .eo-draw .eo-e {
  animation: eoDash 0.78s cubic-bezier(0.65, 0, 0.35, 1) 0.12s forwards;
}

.eo-full .eo-draw .eo-s {
  animation: eoDash 0.95s cubic-bezier(0.55, 0, 0.3, 1) 0.6s forwards;
}

.eo-full .eo-wm {
  animation: eoTrack 1.1s cubic-bezier(0.16, 1, 0.3, 1) 1.2s both;
}

.eo-full .eo-wm span {
  opacity: 0;
  animation: eoLetter 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(1.2s + var(--i) * 50ms);
}

.eo-full .eo-rule {
  scale: 0 1;
  animation: eoRule 0.7s cubic-bezier(0.65, 0, 0.35, 1) 1.45s forwards;
}

.eo-full .eo-sub .eo-t {
  opacity: 0;
  animation: eoFadeUp 0.7s ease 1.65s forwards;
}

@keyframes eoDash {
  to { stroke-dashoffset: 0; }
}

@keyframes eoTrack {
  from { letter-spacing: 0.95em; margin-right: -0.95em; }
}

@keyframes eoLetter {
  from { opacity: 0; translate: 0 0.35em; filter: blur(4px); }
  to { opacity: 1; translate: 0 0; filter: blur(0); }
}

@keyframes eoRule {
  to { scale: 1 1; }
}

@keyframes eoFadeUp {
  from { opacity: 0; translate: 0 0.4em; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes eoFade {
  to { opacity: 1; }
}

/* ---------------------------------------------------------
   VERSIÓN CORTA (siguientes páginas de la visita): el símbolo
   se vuelve a dibujar, más rápido, mientras el hilo de latón y
   «arquitectura & ingeniería» aparecen debajo (≈ 1,4 s).
   MOVIMIENTO REDUCIDO: el símbolo ya está dibujado.
--------------------------------------------------------- */

.eo-short .eo-wm,
.eo-short .eo-skip {
  display: none;
}

.eo-short .eo-draw .eo-p {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}

.eo-short .eo-draw .eo-e {
  animation: eoDash 0.55s cubic-bezier(0.65, 0, 0.35, 1) 0.05s forwards;
}

.eo-short .eo-draw .eo-s {
  animation: eoDash 0.7s cubic-bezier(0.55, 0, 0.3, 1) 0.38s forwards;
}

.eo-short .eo-rule {
  scale: 0 1;
  animation: eoRule 0.6s cubic-bezier(0.65, 0, 0.35, 1) 0.3s forwards;
}

.eo-short .eo-sub .eo-t {
  opacity: 0;
  animation: eoFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

.eo-reduced .eo-skip {
  display: none;
}

/* salida de textos antes del viaje */
.eo-b.is-leaving .eo-wm,
.eo-b.is-leaving .eo-sub,
.eo-b.is-leaving .eo-skip {
  transition: opacity 0.25s ease;
  opacity: 0 !important;
}

.eo-b.is-leaving .eo-wm span,
.eo-b.is-leaving .eo-sub .eo-t {
  animation-play-state: paused;
}

/* al saltar, el trazo se completa al instante */
.eo-b.is-drawn .eo-p {
  animation: none !important;
  stroke-dashoffset: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  .eo-skip { animation: none; opacity: 1; }
}

/* páginas siguientes de la visita: sin intro */
.intro-screen.eo-nointro { display: none !important; }
