/* ============================================================
   TXLOC — Premium Ambient Motion System
   Layered on top of txloc.css. Subtle, GPU-accelerated, 60fps.
   Enhances only the visual experience — no layout changes.
   ============================================================ */

/* ---------- Master switch: honor reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .tx-liquid::before,
  .tx-hero-dark::before,
  .tx-page-hero::before,
  .bg-navy::before,
  .tx-hero-dark .tx-card,
  .btn-tx-accent { animation: none !important; }
  #tx-cursor-glow, #tx-particles { display: none !important; }
}

/* ---------- Overlays (cursor glow + particles) ---------- */
#tx-cursor-glow {
  position: fixed; top: 0; left: 0;
  width: 440px; height: 440px; margin: -220px 0 0 -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,115,245,.06) 0%, transparent 66%);
  pointer-events: none; z-index: 1;
  /* no screen blend -> removes the white halo on light sections */
  opacity: 0; transition: opacity .5s ease;
  will-change: transform;
}
#tx-cursor-glow.on { opacity: .8; }

#tx-particles {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}

/* ---------- Liquid / aurora backgrounds for blue sections ---------- */
.tx-hero-dark, .tx-page-hero, .bg-navy { position: relative; overflow: hidden; isolation: isolate; }

.tx-hero-dark::before,
.tx-page-hero::before,
.bg-navy::before {
  content: ""; position: absolute; inset: -25%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 38% at 22% 28%, rgba(59,115,245,.45), transparent 62%),
    radial-gradient(34% 34% at 80% 22%, rgba(6,182,212,.38), transparent 60%),
    radial-gradient(44% 44% at 62% 82%, rgba(29,85,153,.42), transparent 64%),
    radial-gradient(30% 30% at 12% 78%, rgba(34,211,238,.28), transparent 60%);
  filter: blur(48px) saturate(120%);
  animation: tx-aurora 34s ease-in-out infinite alternate;
  will-change: transform;
}
.bg-navy::before { opacity: .8; }

/* keep section content above the aurora layer */
.tx-hero-dark > .container,
.tx-page-hero > .container,
.bg-navy > .container { position: relative; z-index: 1; }

@keyframes tx-aurora {
  0%   { transform: translate3d(-3%, -2%, 0) rotate(0deg)  scale(1.06); }
  50%  { transform: translate3d(3%,  2%, 0) rotate(7deg)  scale(1.16); }
  100% { transform: translate3d(-2%, 3%, 0) rotate(-5deg) scale(1.10); }
}

/* Second layer: flowing "liquid water" light streaks (injected by JS) */
.tx-liquid-layer {
  position: absolute; inset: -30%; z-index: -1; pointer-events: none;
  background:
    linear-gradient(115deg, transparent 20%, rgba(99,150,255,.22) 40%, rgba(34,211,238,.18) 49%, transparent 63%),
    linear-gradient(58deg,  transparent 32%, rgba(59,115,245,.16) 50%, transparent 70%);
  background-size: 240% 240%, 210% 210%;
  filter: blur(26px);
  mix-blend-mode: screen;
  animation: tx-liquid 30s ease-in-out infinite alternate;
  will-change: background-position, transform;
}
@keyframes tx-liquid {
  0%   { background-position: 0% 0%,   100% 100%; transform: translate3d(0,0,0)   rotate(0deg); }
  100% { background-position: 100% 55%, 0% 45%;   transform: translate3d(0,-3%,0) rotate(3deg); }
}
@media (prefers-reduced-motion: reduce) { .tx-liquid-layer { display: none; } }

/* ---------- Hero: floating snapshot card + text reveal ---------- */
.tx-hero-dark .tx-card {
  animation: tx-float 7s ease-in-out infinite;
  will-change: transform;
}
@keyframes tx-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -10px, 0); }
}

.tx-hero-dark .tx-eyebrow,
.tx-hero-dark h1,
.tx-hero-dark > .container .tx-subtitle,
.tx-hero-dark .d-flex.flex-wrap.gap-3,
.tx-hero-dark .row.g-4 {
  animation: tx-rise .9s cubic-bezier(.22,.61,.36,1) both;
}
.tx-hero-dark h1 { animation-delay: .08s; }
.tx-hero-dark > .container .tx-subtitle { animation-delay: .16s; }
.tx-hero-dark .d-flex.flex-wrap.gap-3 { animation-delay: .24s; }
.tx-hero-dark .row.g-4 { animation-delay: .32s; }
@keyframes tx-rise {
  from { opacity: 0; transform: translate3d(0, 22px, 0); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Section reveal (enhances existing .reveal) ---------- */
.reveal { opacity: 0; transform: translateY(28px) scale(.985); transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1); will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Cards: smoother lift + glow + border + icon ---------- */
.tx-card {
  transition: transform .38s cubic-bezier(.22,.61,.36,1),
              box-shadow .38s ease,
              border-color .38s ease;
}
.tx-card:hover {
  box-shadow: 0 22px 48px rgba(10,37,64,.16), 0 0 0 1px rgba(37,99,235,.10), 0 8px 30px rgba(37,99,235,.14);
}
.tx-card:hover .tx-icon {
  transform: rotate(-4deg) scale(1.06);
  box-shadow: 0 12px 26px rgba(10,37,64,.30);
}
.tx-card:hover .tx-icon-soft {
  transform: rotate(-4deg) scale(1.06);
  background: rgba(37,99,235,.14);
}
.tx-icon { transition: transform .4s cubic-bezier(.22,.61,.36,1), box-shadow .4s ease, background .4s ease; }

/* ---------- Buttons: animated gradient, glow, arrow, ripple ---------- */
.btn-tx-accent {
  background: linear-gradient(120deg, var(--tx-blue-600), var(--tx-blue-500) 35%, var(--tx-cyan-500) 55%, var(--tx-blue-600));
  background-size: 220% 220%;
  animation: tx-btn-grad 9s ease infinite;
  position: relative; overflow: hidden;
}
@keyframes tx-btn-grad {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.btn-tx-accent:hover { box-shadow: 0 14px 30px rgba(37,99,235,.38), 0 0 0 1px rgba(255,255,255,.06) inset; }
.btn i.bi-arrow-right { transition: transform .28s cubic-bezier(.22,.61,.36,1); }
.btn:hover i.bi-arrow-right { transform: translateX(4px); }

/* click ripple */
.tx-ripple {
  position: absolute; border-radius: 50%; transform: scale(0);
  background: rgba(255,255,255,.4); pointer-events: none;
  animation: tx-ripple .6s ease-out forwards;
}
@keyframes tx-ripple { to { transform: scale(2.6); opacity: 0; } }

/* magnetic buttons use inline transform from JS; add smoothing */
.tx-magnetic { transition: transform .25s cubic-bezier(.22,.61,.36,1); will-change: transform; }

/* ---------- Navbar: glassmorphism + slight shrink on scroll ---------- */
.tx-navbar { transition: box-shadow .3s ease, background .3s ease, backdrop-filter .3s ease, padding .3s ease; }
.tx-navbar.scrolled {
  background: rgba(255,255,255,.72) !important;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  box-shadow: 0 6px 24px rgba(10,37,64,.08);
  padding-top: .25rem !important; padding-bottom: .25rem !important;
}
.tx-navbar.scrolled .navbar-brand { font-size: 1.3rem; transition: font-size .3s ease; }

/* ---------- Pills / arrow links micro-motion ---------- */
.tx-pill { transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease; }
a.tx-pill:hover { transform: translateY(-2px); }

/* ---------- Animated wave divider (opt-in) ---------- */
.tx-wave-divider { line-height: 0; overflow: hidden; }
.tx-wave-divider svg { width: 100%; height: 60px; display: block; }
.tx-wave-divider .tx-wave-path { animation: tx-wave 18s linear infinite; }
@keyframes tx-wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Clients strip (Trusted by) — auto-marquee on overflow ---------- */
.tx-clients {
  position: relative; overflow: hidden; width: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.tx-clients-track {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: clamp(2rem, 5vw, 4.5rem); width: 100%;
}
/* Marquee mode toggled by JS only when logos overflow the viewport */
.tx-clients.is-marquee .tx-clients-track {
  flex-wrap: nowrap; justify-content: flex-start; width: max-content;
  animation: tx-marquee var(--marquee-dur, 40s) linear infinite;
  will-change: transform;
}
.tx-clients.is-marquee:hover .tx-clients-track { animation-play-state: paused; }
@keyframes tx-marquee { from { transform: translate3d(0,0,0); } to { transform: translate3d(-50%,0,0); } }

.tx-client {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  height: var(--client-logo-h, 44px); text-decoration: none;
  filter: grayscale(1); opacity: .55;
  transition: filter .35s ease, opacity .35s ease, transform .35s ease;
}
.tx-client:hover { filter: grayscale(0); opacity: 1; transform: translateY(-3px); }
.tx-client img { max-height: var(--client-logo-h, 44px); max-width: 200px; width: auto; object-fit: contain; display: block; }
.tx-client .tx-client-name {
  font-family: var(--tx-font-head); font-weight: 700; font-size: 1.15rem;
  color: var(--tx-gray-500); white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .tx-clients.is-marquee .tx-clients-track { animation: none; flex-wrap: wrap; justify-content: center; width: 100%; }
}

/* ---------- Section background blocks (builder-managed) ---------- */
.tx-block { position: relative; }
.tx-custombg { background-size: cover; background-position: center; }
.tx-custombg > section,
.tx-custombg > section.bg-navy,
.tx-custombg > section.bg-alt,
.tx-custombg > section.tx-hero-dark { background: transparent !important; }
.tx-custombg > section::before { display: none !important; } /* hide aurora over a custom bg */
.tx-block-overlay { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.tx-block-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; pointer-events: none; }
.tx-custombg > section { position: relative; z-index: 1; }
.tx-text-light :is(h1,h2,h3,h4,h5,.tx-title,.tx-title-lg,.tx-stat-num) { color: #fff !important; }
.tx-text-light :is(p,.tx-subtitle,.tx-stat-label,.tx-check-list li) { color: rgba(255,255,255,.86) !important; }

/* ---------- Flexible navbar (uses screen width, adapts to any logo) ---------- */
.btn { white-space: nowrap; }                    /* buttons never wrap to 2 lines */
/* wider than the content container so items have room on large screens */
.tx-nav-container { width: 100%; max-width: 1560px; margin-inline: auto; padding-inline: clamp(1rem, 3vw, 2.5rem); }
.tx-navbar .navbar-brand { flex-shrink: 0; margin-right: 1rem; }
.tx-navbar .navbar-brand img { max-height: 100%; width: auto; }
.tx-navbar .navbar-collapse { min-width: 0; }
.tx-navbar .navbar-nav { flex-shrink: 1; min-width: 0; }
.tx-navbar .btn-tx-accent { flex-shrink: 0; margin-left: .75rem; }
/* progressively tighten link spacing on smaller desktops so nothing collides */
@media (min-width: 992px) and (max-width: 1400px) {
  .tx-navbar .navbar-nav.gap-lg-1 { gap: 0 !important; }
  .tx-navbar .nav-link { padding: .5rem .55rem !important; }
}
@media (min-width: 992px) and (max-width: 1150px) {
  .tx-navbar .nav-link { padding: .5rem .4rem !important; font-size: .93rem; }
}

/* Smooth-scroll target offset for in-page anchors under the sticky navbar */
#services, [id][data-scroll-target] { scroll-margin-top: 92px; }

/* ---------- Dark-section text uses the admin-controlled dark-text color ---------- */
.tx-hero-dark .tx-subtitle,
.tx-page-hero .tx-subtitle,
.bg-navy .tx-subtitle { color: var(--tx-dark-text); }

/* ---------- Content image fit (admin-controlled) ---------- */
.tx-media-img { object-fit: cover; }
.img-fit-contain .tx-media-img { object-fit: contain; background: var(--tx-gray-100); }

/* ---------- Rich-text (Quill) output normalization ---------- */
.tx-rich > p { margin: 0; }
.tx-rich > p + p { margin-top: .55rem; }
.tx-rich ul, .tx-rich ol { margin: .4rem 0; padding-left: 1.2rem; text-align: left; }
.tx-rich a { color: var(--tx-accent); text-decoration: underline; }
.tx-rich .ql-align-center { text-align: center; }
.tx-rich .ql-align-right { text-align: right; }

/* ---------- Global animation toggles (admin-managed) ---------- */
.no-anim-wave .tx-liquid-layer { display: none; }
.no-anim-wave .tx-hero-dark::before,
.no-anim-wave .tx-page-hero::before,
.no-anim-wave .bg-navy::before { animation: none; }
.no-anim-card-lift .tx-card:hover { transform: none; }
.no-anim-gradient .btn-tx-accent { animation: none; background: var(--tx-accent); }
.no-anim-hero .tx-hero-dark .tx-eyebrow,
.no-anim-hero .tx-hero-dark h1,
.no-anim-hero .tx-hero-dark > .container .tx-subtitle,
.no-anim-hero .tx-hero-dark .d-flex.flex-wrap.gap-3,
.no-anim-hero .tx-hero-dark .row.g-4 { animation: none; }
.no-anim-floating .tx-hero-dark .tx-card { animation: none; }
.no-anim-reveal .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }

/* ---------- WhatsApp float subtle pulse ---------- */
.tx-whatsapp { animation: tx-pulse 3.2s ease-in-out infinite; }
@keyframes tx-pulse {
  0%, 100% { box-shadow: 0 10px 28px rgba(37,211,102,.45); }
  50%      { box-shadow: 0 10px 28px rgba(37,211,102,.45), 0 0 0 12px rgba(37,211,102,.06); }
}
@media (prefers-reduced-motion: reduce) { .tx-whatsapp { animation: none; } }
