/* Portada SECORP: logotipo animado con scroll (sustituye la portada original #story / #hero).
   Archivo propio, fuera del bundle compilado de React. */

/* 1. Ocultar portada original y sus frases */
#story,
#hero { display: none !important; }

/* 2. Orden de las secciones: portada → empresa → servicios → barra de clientes → resto */
.ui-layer { display: flex; flex-direction: column; }
.ui-layer > * { order: 50; }
.ui-layer > #inicio { order: 1; }
.ui-layer > #manifesto { order: 2; }
.ui-layer > #services { order: 3; }
.ui-layer > .clients-marquee { order: 4; }
.ui-layer > #video-scroll { order: 5; }
.ui-layer > .statement { order: 6; }
.ui-layer > #clients { order: 7; }
.ui-layer > #certificaciones { order: 8; }
.ui-layer > #contact { order: 9; }
.ui-layer > .footer { order: 10; }

/* 3. Portada nueva */
.sx-hero {
  --sx-blue: #0a2f73;
  --H: min(25vw, 38vh);              /* alto del isotipo en su tamaño final */
  position: relative;
  height: 320vh;
  height: 320svh;
  background: #fff;
}
.sx-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.sx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.sx-logo {
  display: flex;
  align-items: stretch;
  height: var(--H);
  will-change: transform;
}
.sx-iso {
  position: relative;
  z-index: 2;
  flex: none;
  width: calc(var(--H) * 1.0447);   /* proporción 304 × 291 */
  height: var(--H);
  transform-origin: 50% 50%;
  opacity: 0;
  will-change: transform;
}
.sx-iso svg { display: block; width: 100%; height: 100%; }
.sx-hero.is-in .sx-iso { animation: sx-iso-in 1s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes sx-iso-in {
  from { opacity: 0; filter: blur(8px); }
  to   { opacity: 1; filter: blur(0); }
}

/* Párpado: tapa el ojo (recortado a la forma del ojo) */
.sx-lid { transform: translateY(140px); }
.sx-hero.is-in .sx-lid { animation: sx-wake 1.4s .5s cubic-bezier(.6, 0, .3, 1) forwards; }
.sx-hero.is-awake .sx-lid { transform: translateY(0); animation: none; }
.sx-hero.is-awake.is-blink .sx-lid { animation: sx-blink .5s ease-in-out; }
@keyframes sx-wake {
  0%   { transform: translateY(140px); }
  35%  { transform: translateY(70px); }
  50%  { transform: translateY(95px); }
  100% { transform: translateY(0); }
}
@keyframes sx-blink {
  0%, 100% { transform: translateY(0); }
  45%, 55% { transform: translateY(140px); }
}

/* Texto: «Secorp.» sale de atrás del isotipo hacia la derecha; «Seguridad Corporativa» sale hacia abajo */
.sx-text {
  position: relative;
  flex: none;
  width: calc(var(--H) * 2.155);
  margin-left: calc(var(--H) * .107);
}
.sx-wordclip {
  position: absolute;
  top: calc(var(--H) * .368);
  left: calc(var(--H) * -.2);       /* el recorte empieza detrás del isotipo */
  right: 0;
  height: calc(var(--H) * .42);
  padding-left: calc(var(--H) * .2);
  overflow: hidden;
}
.sx-word {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
  transform: translateX(-110%);
  will-change: transform;
}
.sx-tagclip {
  position: absolute;
  top: calc(var(--H) * .79);
  left: calc(var(--H) * .017);
  height: calc(var(--H) * .23);
  width: calc(var(--H) * 2.2);
  overflow: hidden;
}
.sx-tag {
  display: inline-block;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-weight: 700;
  font-size: calc(var(--H) * .158);
  line-height: 1;
  letter-spacing: .13em;
  white-space: nowrap;
  color: #000;
  padding-top: calc(var(--H) * .06);
  transform: translateY(-110%);
  opacity: 0;
  will-change: transform, opacity;
}

/* Indicador de scroll (sin texto) */
.sx-cue {
  position: absolute;
  left: 50%;
  bottom: max(2rem, env(safe-area-inset-bottom));
  translate: -50% 0;
  color: var(--sx-blue);
  font-size: 1.25rem;
  opacity: 0;
  transition: opacity .4s;
  animation: sx-cue 1.8s ease-in-out infinite;
}
.sx-hero.is-awake .sx-cue { opacity: .7; }
.sx-hero.is-scrolled .sx-cue { opacity: 0; }
@keyframes sx-cue { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

@media (max-width: 760px) {
  .sx-hero { --H: min(26.5vw, 34vh); height: 280vh; height: 280svh; }
}

/* Movimiento reducido: logo completo, sin scroll largo */
@media (prefers-reduced-motion: reduce) {
  .sx-hero { height: 100vh; height: 100svh; }
  .sx-iso, .sx-word, .sx-tag { opacity: 1 !important; transform: none !important; animation: none !important; filter: none !important; }
  .sx-logo { transform: none !important; }
  .sx-lid { transform: translateY(0) !important; animation: none !important; }
  .sx-cue { display: none; }
}

/* Fuerza el tamaño del logotipo frente a la regla global del sitio para img (max-width:100%; height:auto) */
.sx-word { height: 100% !important; width: auto !important; max-width: none !important; }
