/* ==============================================================
   ORTHO BARUC · SPLASH PREMIUM Y TRANSICIÓN DE PÁGINAS
   Todas las clases se limitan al componente ob-splash/ob-route.
   Los @media se migrarán a _responsive.scss en la fase SCSS.
================================================================ */

/* Bloqueo de pantalla blanca desde el primer pintado de index.html,
   mientras se carga components/splash.html. */
body.ob-intro-boot #splash-container {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #fff;
}

/* Permite ver el contenido durante el desvanecimiento de salida. */
body.ob-intro-reveal #splash-container {
  background: transparent;
}

/* El Inicio aparece progresivamente debajo del isotipo. */
body.ob-intro-boot>main,
body.ob-intro-boot>#navbar-container,
body.ob-intro-boot>#footer-container {
  opacity: 0;
  transform: translate3d(0, 15px, 0);
  transition:
    opacity 1.05s cubic-bezier(.25, .8, .25, 1),
    transform 1.25s cubic-bezier(.2, .75, .25, 1);
}

body.ob-intro-boot.ob-intro-reveal>main,
body.ob-intro-boot.ob-intro-reveal>#navbar-container,
body.ob-intro-boot.ob-intro-reveal>#footer-container {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

body.ob-splash-active {
  overflow: hidden !important;
}

.ob-splash {
  --ob-intro-navy: #17233d;
  --ob-intro-blue: #087fc4;
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 43%, #fff 34%, #f8fafc 100%);
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  will-change: opacity, transform;
}

/* Disolver y elevar apenas, en lugar de retirar toda la pantalla bruscamente. */
.ob-splash.is-exiting {
  opacity: 0;
  transform: translate3d(0, -14px, 0) scale(1.012);
  transition:
    opacity 1.35s cubic-bezier(.2, .65, .2, 1),
    transform 1.45s cubic-bezier(.2, .65, .2, 1);
  pointer-events: none;
}

/* Geometría que retoma el estilo actual, pero con menos ruido visual. */
.ob-splash__geometry {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ob-splash__shape {
  position: absolute;
  display: block;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s ease, transform 1.25s cubic-bezier(.22, 1, .36, 1);
}

.ob-splash__shape--left {
  left: -18%;
  top: -17%;
  width: 57%;
  height: 63%;
  background: #f0f3f6;
  clip-path: polygon(0 0, 100% 0, 66% 100%, 0 77%);
}

.ob-splash__shape--right {
  top: -12%;
  right: -20%;
  width: 57%;
  height: 61%;
  background: #e9edf2;
  clip-path: polygon(27% 0, 100% 0, 100% 100%, 0 58%);
}

.ob-splash__shape--bottom {
  bottom: -30%;
  left: -16%;
  width: 49%;
  height: 56%;
  background: #f2f4f7;
  clip-path: polygon(0 22%, 100% 0, 63% 100%, 0 100%);
}

.ob-splash__line {
  position: absolute;
  display: block;
  width: 114px;
  height: 5px;
  background: var(--ob-intro-blue);
  opacity: 0;
  transform: rotate(-45deg) scaleX(.3);
  transition: opacity .7s ease, transform 1.1s cubic-bezier(.22, 1, .36, 1);
}

.ob-splash__line--one {
  top: 17%;
  left: -17px;
}

.ob-splash__line--two {
  top: 11%;
  right: 5%;
  width: 160px;
  background: #818a97;
}

.ob-splash__line--three {
  right: 5%;
  bottom: 20%;
  width: 140px;
  background: var(--ob-intro-navy);
}

.ob-splash__line--four {
  left: 9%;
  bottom: 18%;
  width: 98px;
  background: #87909a;
}

.ob-splash.is-playing .ob-splash__shape {
  opacity: 1;
  transform: translateY(0);
}

.ob-splash.is-playing .ob-splash__line {
  opacity: 1;
  transform: rotate(-45deg) scaleX(1);
}

/* Centro. Isotipo vectorial extraído directamente de LOB1.svg original. */
.ob-splash__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(88vw, 720px);
  padding: 18px;
  text-align: center;
}

.ob-splash__eyebrow {
  color: #8191a4;
  font-family: var(--font-heading, "Poppins", sans-serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3em;
  opacity: 0;
  transform: translateY(9px);
  transition: opacity .6s ease .10s, transform .7s ease .10s;
}

.ob-splash__symbol {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(144px, 19vw, 238px);
  margin-top: 30px;
}

.ob-splash__symbol-halo {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(8, 127, 196, .08), rgba(8, 127, 196, 0) 68%);
  opacity: 0;
  transform: scale(.8);
  transition: opacity 1s ease 1.55s, transform 1.2s ease 1.55s;
}

.ob-splash__symbol-drawing {
  position: relative;
  z-index: 1;
  width: 100%;
  opacity: 1;
}

/* Rutas SVG ORIGINALES: nitidez independiente de zoom / resolución. */
.ob-splash__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  shape-rendering: auto;
}

/* Paso 1 · SVG original: cada segmento se dibuja a su propio ritmo según su longitud.
   Evita el salto visual producido por seis subtrazos en un solo pathLength. */
/* Línea de construcción suave; nunca sustituye ni pixeliza el original. */
.ob-splash__trace {
  color: #7194b5;
  stroke-width: 1.7px;
}

.ob-splash__trace-path {
  opacity: 0;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition:
    stroke-dashoffset var(--ob-draw-time, 1.4s) linear var(--ob-draw-delay, .3s),
    opacity .18s ease var(--ob-draw-delay, .3s);
}

.ob-splash.is-playing .ob-splash__trace-path {
  opacity: 1;
  stroke-dashoffset: 0;
}

/* Paso 2 · Tras terminar los trazos, aparece el azul Ortho Baruc. */
.ob-splash__fill-shape {
  fill: #233561;
  opacity: 0;
  transition: opacity .72s ease 3.30s;
}

.ob-splash.is-playing .ob-splash__fill-shape {
  opacity: 1;
}

.ob-splash.is-playing .ob-splash__trace {
  opacity: 0;
  transition: opacity .48s ease 3.66s;
}

/* Paso 3 · Se descubre la marca y su eslogan. */
.ob-splash__wordmark-reveal {
  overflow: hidden;
  width: min(100%, 390px);
  margin-top: 14px;
  opacity: 0;
  transform: translateY(9px);
  clip-path: inset(0 100% 0 0);
  transition:
    clip-path .85s cubic-bezier(.22, 1, .36, 1) 4.12s,
    opacity .25s ease 4.12s,
    transform .95s cubic-bezier(.22, 1, .36, 1) 4.12s;
}

.ob-splash__wordmark {
  display: block;
  width: 100%;
  height: auto;
}

.ob-splash.is-playing .ob-splash__wordmark-reveal {
  opacity: 1;
  transform: translateY(0);
  clip-path: inset(0 0 0 0);
}

.ob-splash__loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-top: 36px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .5s ease 4.65s, transform .65s ease 4.65s;
}

.ob-splash__loader-label {
  color: #7c8a9b;
  font-family: var(--font-heading, "Poppins", sans-serif);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .22em;
}

.ob-splash__track {
  position: relative;
  display: block;
  width: 156px;
  height: 2px;
  overflow: hidden;
  background: #dfe7ef;
  border-radius: 10px;
}

.ob-splash__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ob-intro-navy), var(--ob-intro-blue));
  transition: width .82s cubic-bezier(.22, 1, .36, 1) 4.78s;
}

.ob-splash.is-playing .ob-splash__eyebrow,
.ob-splash.is-playing .ob-splash__loader {
  opacity: 1;
  transform: none;
}

.ob-splash.is-playing .ob-splash__symbol-halo {
  opacity: 1;
  transform: scale(1);
}

.ob-splash.is-playing .ob-splash__fill {
  width: 100%;
}

.ob-splash__bottom {
  position: absolute;
  z-index: 2;
  right: clamp(22px, 5vw, 85px);
  bottom: clamp(19px, 4vh, 40px);
  left: clamp(22px, 5vw, 85px);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #91a1b1;
  font-family: var(--font-heading, "Poppins", sans-serif);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .15em;
  opacity: 0;
  transition: opacity .5s ease 4.85s;
}

.ob-splash.is-playing .ob-splash__bottom {
  opacity: 1;
}

/* ================================================================
   NAVEGACIÓN: UNA SOLA TRANSICIÓN (sin segundo spinner)
   El mismo par de pseudoelementos es visible al salir y al llegar.
   NOTA: splash-boot.js DEBE estar en el <head> de todas las vistas.
================================================================ */
html.ob-route-leaving::before,
html.ob-route-arriving::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: #fff;
  pointer-events: auto;
}

html.ob-route-leaving::after,
html.ob-route-arriving::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2147483001;
  width: 88px;
  height: 38px;
  margin: -19px 0 0 -44px;
  background-image:
    radial-gradient(circle, #bad9fa 0 8px, transparent 8.5px),
    radial-gradient(circle, #087fc4 0 8px, transparent 8.5px),
    radial-gradient(circle, #bad9fa 0 8px, transparent 8.5px);
  background-repeat: no-repeat;
  background-size: 20px 20px, 20px 20px, 20px 20px;
  animation: ob-three-dots 1.35s ease-in-out infinite;
  pointer-events: none;
}

/* SALIDA: fundido de una sola capa sobre la página anterior. */
html.ob-route-leaving::before,
html.ob-route-leaving::after {
  opacity: 0;
  transition: opacity .44s cubic-bezier(.22, 1, .36, 1);
}

html.ob-route-leaving.ob-route-covering::before,
html.ob-route-leaving.ob-route-covering::after {
  opacity: 1;
}

/* LLEGADA: está presente ANTES del primer pintado de la nueva página,
   sin fade-in, sin insertar otro nodo ni cambiar un loader por otro. */
html.ob-route-arriving::before,
html.ob-route-arriving::after {
  opacity: 1;
}

html.ob-route-arriving.ob-route-finishing::before,
html.ob-route-arriving.ob-route-finishing::after {
  opacity: 0;
  pointer-events: none;
  transition: opacity .7s cubic-bezier(.22, 1, .36, 1);
}

/* Tres puntos que ondulan suavemente sin cambiar el diseño solicitado. */
@keyframes ob-three-dots {

  0%,
  100% {
    background-position: 1px 10px, 34px 10px, 67px 10px;
  }

  14% {
    background-position: 1px 3px, 34px 10px, 67px 10px;
  }

  29% {
    background-position: 1px 10px, 34px 10px, 67px 10px;
  }

  43% {
    background-position: 1px 10px, 34px 3px, 67px 10px;
  }

  58% {
    background-position: 1px 10px, 34px 10px, 67px 10px;
  }

  72% {
    background-position: 1px 10px, 34px 10px, 67px 3px;
  }

  86% {
    background-position: 1px 10px, 34px 10px, 67px 10px;
  }
}

@media (max-width: 767px) {
  .ob-splash__shape--left {
    width: 105%;
    left: -50%;
  }

  .ob-splash__shape--right {
    width: 104%;
    right: -52%;
  }

  .ob-splash__shape--bottom {
    width: 86%;
    left: -45%;
  }

  .ob-splash__line {
    height: 4px;
    width: 80px;
  }

  .ob-splash__line--two {
    width: 95px;
  }

  .ob-splash__line--three {
    width: 92px;
  }

  .ob-splash__symbol {
    width: clamp(145px, 41vw, 204px);
    margin-top: 25px;
  }

  .ob-splash__wordmark-reveal {
    width: min(87vw, 335px);
  }

  .ob-splash__bottom {
    justify-content: center;
    font-size: 8px;
  }

  .ob-splash__bottom span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .ob-splash,
  .ob-splash *,
  body.ob-intro-boot>main,
  body.ob-intro-boot>#navbar-container,
  body.ob-intro-boot>#footer-container {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }

  .ob-splash__trace {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  html.ob-route-leaving::after,
  html.ob-route-arriving::after {
    animation: none !important;
  }
}