/* ================================================================
   EPICORE PREMIUM TEXT EFFECTS R4
   - illuminated text rails
   - oversized drifting background words
   Additive only; current HQ theme + Connected Business stay intact.
   ================================================================ */

:root{
  --eptx-cyan:#19b6e7;
  --eptx-cyan-hi:#b8f3ff;
  --eptx-muted:#8fb8cf;
}

/* ---------------------------------------------------------------
   1. THIN ILLUMINATED LINE BESIDE SELECTED TEXT BLOCKS
   --------------------------------------------------------------- */

.epicore-text-rail-r4{
  position:relative !important;
  padding-left:24px !important;
  isolation:isolate;
}

.epicore-text-rail-r4::before{
  content:"";
  position:absolute;
  left:0;
  top:.12em;
  bottom:.10em;
  width:1px;
  background:
    linear-gradient(
      180deg,
      rgba(25,182,231,.08) 0%,
      rgba(25,182,231,.55) 25%,
      rgba(25,182,231,.32) 74%,
      rgba(25,182,231,.06) 100%
    );
  box-shadow:0 0 8px rgba(25,182,231,.10);
  pointer-events:none;
}

.epicore-text-rail-r4::after{
  content:"";
  position:absolute;
  left:-1.5px;
  top:.12em;
  width:4px;
  height:24px;
  border-radius:999px;
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0),
      rgba(184,243,255,.96) 48%,
      rgba(25,182,231,.80) 72%,
      rgba(25,182,231,0)
    );
  filter:blur(.15px);
  box-shadow:
    0 0 4px rgba(255,255,255,.55),
    0 0 10px rgba(25,182,231,.58),
    0 0 18px rgba(25,182,231,.22);
  opacity:0;
  pointer-events:none;
  animation:epicoreRailTravelR4 7.8s cubic-bezier(.42,.05,.55,.95) infinite;
  animation-delay:var(--epicore-rail-delay-r4, 0s);
}

@keyframes epicoreRailTravelR4{
  0%{
    top:.12em;
    opacity:0;
    transform:scaleY(.65);
  }
  8%{opacity:.85}
  42%{opacity:.72}
  74%{opacity:.82}
  91%{opacity:0}
  100%{
    top:calc(100% - 24px);
    opacity:0;
    transform:scaleY(.85);
  }
}

/* Hero supporting paragraph rail is slightly stronger. */
.epicore-text-rail-r4.epicore-text-rail-hero-r4::before{
  background:
    linear-gradient(
      180deg,
      rgba(25,182,231,.10),
      rgba(25,182,231,.70) 30%,
      rgba(25,182,231,.40) 75%,
      rgba(25,182,231,.07)
    );
}

/* ---------------------------------------------------------------
   2. OVERSIZED FAINT BACKGROUND WORDS
   --------------------------------------------------------------- */

.epicore-ghost-section-r4{
  position:relative !important;
  isolation:isolate !important;
  overflow:hidden !important;
}

.epicore-ghost-section-r4 > *:not(.epicore-ghost-word-r4){
  position:relative;
  z-index:1;
}

.epicore-ghost-word-r4{
  position:absolute;
  z-index:0;
  pointer-events:none;
  user-select:none;
  white-space:nowrap;

  color:#68d7f6;
  font-family:"Segoe UI",Arial,sans-serif;
  font-size:clamp(78px,11vw,190px);
  line-height:.85;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;

  opacity:.018;
  filter:blur(.15px);
  will-change:transform,opacity;

  animation:
    epicoreGhostFloatR4 var(--ghost-float-duration-r4,18s) ease-in-out infinite alternate,
    epicoreGhostFadeR4 var(--ghost-fade-duration-r4,15s) ease-in-out infinite;

  animation-delay:
    var(--ghost-delay-r4,0s),
    var(--ghost-delay-r4,0s);
}

.epicore-ghost-word-r4.epicore-ghost-left-r4{
  left:-3%;
  top:12%;
}

.epicore-ghost-word-r4.epicore-ghost-right-r4{
  right:-4%;
  bottom:8%;
}

.epicore-ghost-word-r4.epicore-ghost-centre-r4{
  left:50%;
  top:52%;
  transform:translate(-50%,-50%);
}

/* Large words drift only a very small distance. */
@keyframes epicoreGhostFloatR4{
  0%{
    transform:translate3d(-8px,8px,0) scale(.985);
  }
  48%{
    transform:translate3d(5px,-7px,0) scale(1.005);
  }
  100%{
    transform:translate3d(13px,5px,0) scale(.992);
  }
}

.epicore-ghost-centre-r4{
  animation-name:epicoreGhostFloatCentreR4,epicoreGhostFadeR4;
}

@keyframes epicoreGhostFloatCentreR4{
  0%{
    transform:translate(-50%,-50%) translate3d(-10px,7px,0) scale(.985);
  }
  50%{
    transform:translate(-50%,-50%) translate3d(6px,-8px,0) scale(1.008);
  }
  100%{
    transform:translate(-50%,-50%) translate3d(12px,5px,0) scale(.992);
  }
}

@keyframes epicoreGhostFadeR4{
  0%,100%{opacity:.010}
  18%{opacity:.026}
  48%{opacity:.045}
  72%{opacity:.022}
}

/* Every second ghost is even more subdued. */
.epicore-ghost-soft-r4{
  color:#239aca;
  animation-duration:
    calc(var(--ghost-float-duration-r4,18s) + 4s),
    calc(var(--ghost-fade-duration-r4,15s) + 5s);
}

@media(max-width:900px){
  .epicore-ghost-word-r4{
    font-size:clamp(62px,14vw,116px);
    opacity:.014;
  }

  .epicore-text-rail-r4{
    padding-left:18px !important;
  }
}

@media(max-width:600px){
  .epicore-ghost-word-r4{
    opacity:.010;
    font-size:72px;
  }

  .epicore-text-rail-r4{
    padding-left:15px !important;
  }
}

/* ---------------------------------------------------------------
   FALLBACK / ACCESSIBILITY
   --------------------------------------------------------------- */

html.epicore-text-motion-off-r4 .epicore-text-rail-r4::after{
  display:none !important;
}

html.epicore-text-motion-off-r4 .epicore-ghost-word-r4{
  animation:none !important;
  opacity:.025 !important;
  transform:none !important;
}

html.epicore-text-motion-off-r4 .epicore-ghost-centre-r4{
  transform:translate(-50%,-50%) !important;
}

@media(prefers-reduced-motion:reduce){
  .epicore-text-rail-r4::after{
    display:none !important;
  }

  .epicore-ghost-word-r4{
    animation:none !important;
    opacity:.022 !important;
  }

  .epicore-ghost-centre-r4{
    transform:translate(-50%,-50%) !important;
  }
}