/* ==========================================================================
   AZYION — ENHANCEMENT LAYER (professional)
   Subtle, single-colour motion on top of styles.css. No content changes.
   Remove the enhance.css / enhance.js lines in index.html to switch off.
   ========================================================================== */

:root {
    --fx-blue: #2563EB;
    --fx-blue-soft: rgba(37, 99, 235, 0.10);
    --fx-cyan: #06B6D4;
    --fx-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   Cards: a soft blue light follows the cursor on hover
   -------------------------------------------------------------------------- */
.fx-glow {
    position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
    opacity: 0; transition: opacity .35s ease;
    background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), var(--fx-tint, rgba(37, 99, 235, .07)), transparent 70%);
}
.fx-card:hover .fx-glow { opacity: 1; }

/* --------------------------------------------------------------------------
   Section headings: a short blue rule draws in once when seen
   -------------------------------------------------------------------------- */
.fx-line {
    display: block; height: 3px; width: 0; margin: -.35rem auto 1.4rem; border-radius: 3px;
    background: linear-gradient(90deg, var(--fx-blue), var(--fx-cyan));
    transition: width .9s var(--fx-ease);
}
.fx-line.fx-in { width: 56px; }

/* --------------------------------------------------------------------------
   Process: steps highlight one after another, once
   -------------------------------------------------------------------------- */
.flow-step-card { transition: transform .35s var(--fx-ease), box-shadow .45s ease, border-color .45s ease; }
.flow-step-card.fx-lit { border-color: rgba(37, 99, 235, .45); box-shadow: 0 12px 28px -12px rgba(37, 99, 235, .25); }

/* --------------------------------------------------------------------------
   Buttons: a light sweep on hover only
   -------------------------------------------------------------------------- */
.fx-shine {
    position: absolute; top: 0; bottom: 0; left: 0; width: 35%; pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: translateX(-140%) skewX(-20deg);
}
.btn:hover .fx-shine { transform: translateX(340%) skewX(-20deg); transition: transform .8s ease; }

/* ==========================================================================
   TOP NAV BAR — dark navy dock
   ========================================================================== */
html .site-header .header-inner,
html .site-header.scrolled .header-inner {
    background: rgba(11, 16, 32, 0.90);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 36px -14px rgba(5, 8, 17, 0.55);
}
html .site-header .header-inner::after { opacity: .6; }

/* Hide while scrolling down, return when scrolling up */
html .site-header.nx-hidden .header-inner { transform: translateY(-150%); }

/* Scroll progress along the bottom edge of the bar */
.nx-progress {
    position: absolute; left: 22px; right: 22px; bottom: -1px; height: 2px; border-radius: 2px;
    pointer-events: none; z-index: 2;
    background: linear-gradient(90deg, var(--fx-blue), var(--fx-cyan));
    transform-origin: 0 50%; transform: scaleX(var(--p, 0));
}

/* Brand */
html .site-header .brand-title,
html .site-header .brand-link:hover .brand-title { color: #FFFFFF; }
html .site-header .brand-tag { color: #7DD3FC; }

/* Links + gliding highlight */
@media (min-width: 769px) {
    .header-inner .nav-links { position: relative; }
    html .site-header .nav-item > a { color: #CBD5E1; background: transparent; box-shadow: none; transition: color .25s; }
    html .site-header .nav-item > a:hover,
    html .site-header .nav-item > a.active { color: #FFFFFF; background: transparent; box-shadow: none; }

    .header-inner .nav-links > .nav-item { position: relative; z-index: 1; }

    /* Dropdown: dark, items settle in quickly */
    html .site-header .dropdown-menu {
        background: rgba(11, 16, 32, 0.97);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 24px 54px -16px rgba(5, 8, 17, .6);
    }
}
@keyframes nxSettle { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

html .site-header .dropdown-item a { color: #E2E8F0; }
html .site-header .dropdown-item a:hover,
html .site-header .dropdown-item a.active { background: rgba(255, 255, 255, 0.06); color: #FFFFFF; }
html .site-header .dropdown-item .dropdown-icon { background: rgba(37, 99, 235, .14); border-color: rgba(37, 99, 235, .25); color: #93C5FD; }
html .site-header .dropdown-item a:hover .dropdown-icon { background: var(--fx-blue); color: #fff; box-shadow: none; }
html .site-header .dropdown-footer { border-top-color: rgba(255, 255, 255, .08); }
html .site-header .dropdown-all-link { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .1); color: #93C5FD; }
html .site-header .dropdown-all-link:hover { background: var(--fx-blue); color: #fff; }

/* Mobile */
html .site-header .mobile-menu-toggle { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); color: #FFFFFF; box-shadow: none; }
html .site-header .mobile-menu-toggle:hover,
html .site-header .mobile-menu-toggle.active { background: var(--fx-blue); border-color: transparent; color: #fff; box-shadow: none; }
@media (max-width: 768px) {
    .nx-progress { left: 14px; right: 14px; }
    .fx-ink.nx-ink { display: none; }
    html .site-header .nav-links {
        background: rgba(11, 16, 32, 0.97);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 24px 54px -12px rgba(5, 8, 17, .6);
    }
    html .site-header .nav-item a { color: #E2E8F0; }
    html .site-header .nav-item a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
    html .site-header .nav-item a.active { background: var(--fx-blue); color: #fff; box-shadow: none; }
    html .site-header .dropdown-menu { background: rgba(255, 255, 255, .03); border-color: rgba(255, 255, 255, .08); }
}

/* --------------------------------------------------------------------------
   Less motion for people who ask for it
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .fx-line, .flow-step-card, .fx-ink, .btn:hover .fx-shine { transition: none !important; }
    .nav-item-dropdown .dropdown-item { animation: none !important; }
    html .site-header.nx-hidden .header-inner { transform: none; }
}

/* ==========================================================================
   SIGNATURE MOTION — "ink" highlight, label roll, shutter reveal, hover motion
   ========================================================================== */

/* Ink highlight: front edge leads, back edge catches up (JS sets per-direction timing) */
.fx-ink {
    position: absolute; z-index: 0; border-radius: 999px; pointer-events: none;
    background: var(--fx-blue);
    opacity: 0; transition: opacity .25s;
}
.fx-ink.on { opacity: 1; }
.fx-ink-host > *:not(.fx-ink) { position: relative; z-index: 1; }

/* Services filter bar uses the same ink */
.services-filter-nav .filter-pill,
.services-filter-nav .filter-pill:hover,
.services-filter-nav .filter-pill.active { background: transparent; box-shadow: none; transform: none; border-color: transparent; }
.services-filter-nav .filter-pill.active { color: #FFFFFF; }
.services-filter-nav .filter-pill:not(.active):hover { color: var(--fx-blue); }
.services-filter-nav.fx-ink-host .filter-pill { transition: color .3s ease; }

/* Nav letter wave (hover devices only): letters roll up one after another */
.nx-roll { display: inline-block; overflow: hidden; vertical-align: top; height: 1.3em; line-height: 1.3em; white-space: nowrap; }
.nx-roll > span {
    display: inline-block; text-shadow: 0 1.3em 0 currentColor;
    transition: transform .5s cubic-bezier(.76, 0, .24, 1); transition-delay: calc(var(--i, 0) * 22ms);
}
@media (hover: hover) {
    .nav-item > a:hover .nx-roll > span,
    .nav-item > a:focus-visible .nx-roll > span,
    .header-action-wrap .btn:hover .nx-roll > span { transform: translateY(-1.3em); }
}

/* Dropdown items wipe in, one after another */
@media (min-width: 769px) {
    .nav-item-dropdown:hover .dropdown-item,
    .nav-item-dropdown:focus-within .dropdown-item,
    .nav-item-dropdown:hover .dropdown-footer,
    .nav-item-dropdown:focus-within .dropdown-footer { animation: nxWipe .45s var(--fx-ease) both; }
    .nav-item-dropdown:hover .dropdown-icon,
    .nav-item-dropdown:focus-within .dropdown-icon { animation: nxSlideIcon .5s var(--fx-ease) both; }
    .dropdown-item:nth-child(2), .dropdown-item:nth-child(2) .dropdown-icon { animation-delay: .03s !important; }
    .dropdown-item:nth-child(3), .dropdown-item:nth-child(3) .dropdown-icon { animation-delay: .06s !important; }
    .dropdown-item:nth-child(4), .dropdown-item:nth-child(4) .dropdown-icon { animation-delay: .09s !important; }
    .dropdown-item:nth-child(5), .dropdown-item:nth-child(5) .dropdown-icon { animation-delay: .12s !important; }
    .dropdown-item:nth-child(6), .dropdown-item:nth-child(6) .dropdown-icon { animation-delay: .15s !important; }
    .dropdown-item:nth-child(7), .dropdown-item:nth-child(7) .dropdown-icon { animation-delay: .18s !important; }
    .dropdown-item:nth-child(8), .dropdown-item:nth-child(8) .dropdown-icon { animation-delay: .21s !important; }
    .dropdown-item:nth-child(9), .dropdown-item:nth-child(9) .dropdown-icon { animation-delay: .24s !important; }
    .dropdown-footer { animation-delay: .27s !important; }
}
@keyframes nxWipe { from { clip-path: inset(0 100% 0 0); opacity: .4; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes nxSlideIcon { from { transform: translateX(-10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Service photos: styling governed smoothly by styles.css fade system */
.solution-card.fx-move p { transition: transform .5s var(--fx-ease) .05s; }
.solution-card.fx-move:hover p { transform: translateX(4px); }

.solution-card h3 {
    display: inline-block;
    background-image: linear-gradient(var(--fx-blue), var(--fx-blue));
    background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 2px;
    padding-bottom: 2px;
    transition: transform .3s ease, color .25s ease, background-size .5s var(--fx-ease);
}
.solution-card:hover h3 { background-size: 100% 2px; transform: translateX(4px); }

@media (prefers-reduced-motion: reduce) {
    .fx-shutter, .fx-shutter.fx-open { clip-path: none !important; }
    .fx-shutter .service-visual-img { transform: none !important; }
    .nav-item-dropdown .dropdown-item, .nav-item-dropdown .dropdown-icon, .dropdown-footer { animation: none !important; }
    .nx-roll > span { transition: none; }
    .nav-item > a:hover .nx-roll > span, .header-action-wrap .btn:hover .nx-roll > span { transform: none !important; }
    .solution-card.fx-move:hover .service-visual-img, .solution-card.fx-move:hover p { transform: none; }
}

/* --------------------------------------------------------------------------
   How It Works: card deal (driven by enhance.js)
   -------------------------------------------------------------------------- */
.flow-grid.fx-deal { position: relative; }
.flow-grid.fx-deal .flow-step-card {
    opacity: 1 !important;
    will-change: translate, rotate, scale;
    box-shadow: 0 18px 40px -18px rgba(11, 18, 32, .28), 0 2px 6px rgba(11, 18, 32, .05);
}
.flow-grid.fx-deal .flow-step-card.fx-dealt {
    box-shadow: 0 4px 16px rgba(11, 18, 32, .03);
    transition: transform .35s var(--fx-ease), box-shadow .6s ease, border-color .45s ease;
}

/* --------------------------------------------------------------------------
   Scroll-linked motion (driven by enhance.js)
   -------------------------------------------------------------------------- */
/* Service photos: slightly oversized so they can drift inside the frame.
   fx-anim-img: initial state before scroll reveal (fade + zoom into place). */
.service-visual-img.fx-par { scale: 1.16; will-change: translate; }

/* Scroll-reveal: images fade in as they enter the viewport.
   We avoid competing with fx-shutter's transform by only animating opacity here.
   The zoom-to-rest is added as a subtle scale on images NOT handled by fx-shutter. */
.service-visual-img.fx-img-hidden {
    opacity: 0;
    transition:
        opacity 0.9s ease 0.05s;
}
.service-visual-img.fx-img-visible {
    opacity: 1;
    transition:
        opacity 0.9s ease 0.05s;
}
/* After the shutter animation removes fx-shutter, the img settles to par scale */
.service-visual-img.fx-par.fx-img-visible {
    /* translate is set by JS, transform handles zoom */
    will-change: translate, opacity;
}

/* Section headings, stats and why-cards: JS sets translate; keep it smooth */
.section-head-center, .stats-section .stat-card, .why-us-grid .why-card { will-change: translate; }

/* Contact banner grows into place as it arrives */
.cta-banner.fx-grow { transform-origin: 50% 0; will-change: scale; }

@media (prefers-reduced-motion: reduce) {
    .service-visual-img.fx-par { scale: none; translate: none !important; }
    .service-visual-img.fx-img-hidden { opacity: 1 !important; transform: none !important; }
    .service-visual-img.fx-img-visible { opacity: 1 !important; transform: none !important; }
    .cta-banner.fx-grow { scale: none !important; }
}

/* ==========================================================================
   NAVBAR v2 — "orbit capsule"
   Unfurls from the centre on load, a light fills the border as the page
   scrolls, a spotlight follows the cursor, and the bar shrinks into a
   compact island once you scroll.
   ========================================================================== */
html .site-header.nx-v2 .header-inner {
    background:
        radial-gradient(120% 180% at 50% -60%, rgba(37, 99, 235, .22), transparent 60%),
        linear-gradient(180deg, rgba(15, 22, 42, .92), rgba(8, 12, 26, .94));
    border: 1px solid rgba(255, 255, 255, .06);
    box-shadow: 0 18px 40px -18px rgba(3, 7, 18, .7), inset 0 1px 0 rgba(255, 255, 255, .06);
    transition: max-width .7s cubic-bezier(.16, 1, .3, 1), padding .5s cubic-bezier(.16, 1, .3, 1),
                transform .45s cubic-bezier(.16, 1, .3, 1), box-shadow .5s ease;
    animation: nxUnfurl 1.1s cubic-bezier(.77, 0, .18, 1) .15s backwards;
}
html .site-header.nx-v2 .header-inner::after { display: none; }

@keyframes nxUnfurl {
    0%   { clip-path: inset(0 calc(50% - 26px) round 999px); opacity: 0; }
    25%  { clip-path: inset(0 calc(50% - 26px) round 999px); opacity: 1; }
    100% { clip-path: inset(0 0 round 999px); opacity: 1; }
}
.nx-v2 .brand-link { animation: nxFade .6s ease .8s backwards; }
.nx-v2 .nx-drop { animation: nxDrop .6s cubic-bezier(.16, 1, .3, 1) backwards; animation-delay: calc(.85s + var(--n, 0) * .08s); }
@keyframes nxFade { from { opacity: 0; } }
@keyframes nxDrop { from { opacity: 0; transform: translateY(-12px); filter: blur(4px); } }

/* Progress ring: the border fills clockwise from the top as you scroll */
.nx-v2 .nx-progress {
    left: -1px; right: -1px; top: -1px; bottom: -1px; height: auto; border-radius: 999px;
    transform: none; padding: 1.5px; z-index: 3;
    background: conic-gradient(from 0deg at 50% 50%,
        #22D3EE 0deg, #2563EB calc(var(--p, 0) * 360deg),
        rgba(255, 255, 255, .07) calc(var(--p, 0) * 360deg));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    filter: drop-shadow(0 0 4px rgba(34, 211, 238, .45));
}

/* Cursor spotlight */
.nx-spot {
    position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
    background: radial-gradient(220px 90px at var(--sx, 50%) var(--sy, 50%), rgba(96, 165, 250, .16), transparent 70%);
    opacity: 0; transition: opacity .4s ease;
}
.header-inner:hover > .nx-spot { opacity: 1; }
.nx-v2 .header-inner > *:not(.nx-spot):not(.nx-progress) { position: relative; z-index: 1; }

/* Highlight: glowing gradient pill with a dot beneath */
.nx-v2 .fx-ink.nx-ink {
    background: linear-gradient(135deg, #2563EB, #0891B2);
    box-shadow: 0 6px 18px -6px rgba(37, 99, 235, .75), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.nx-v2 .fx-ink.nx-ink::after {
    content: ''; position: absolute; left: 50%; bottom: -7px; width: 4px; height: 4px; margin-left: -2px;
    border-radius: 50%; background: #22D3EE; box-shadow: 0 0 8px #22D3EE;
}

/* Logo: a ring of light spins once on hover */
.nx-v2 .logo-badge { position: relative; }
.nx-v2 .logo-badge::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
    background: conic-gradient(from var(--nx-a, 0deg), transparent 0 70%, #22D3EE 85%, transparent);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: 0; transition: opacity .3s;
}
@property --nx-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.nx-v2 .brand-link:hover .logo-badge::before { opacity: 1; animation: nxSpin 1.1s cubic-bezier(.65, 0, .35, 1); }
@keyframes nxSpin { to { --nx-a: 360deg; } }

/* CTA: gradient capsule */
.nx-v2 .header-action-wrap .btn-primary {
    background: linear-gradient(135deg, #FFFFFF, #DBEAFE); color: #0B1020;
    box-shadow: 0 6px 18px -8px rgba(147, 197, 253, .8);
}
.nx-v2 .header-action-wrap .btn-primary i { transition: transform .4s cubic-bezier(.16, 1, .3, 1); }
.nx-v2 .header-action-wrap .btn-primary:hover i { transform: translateX(3px) rotate(-45deg); }

/* Compact island once scrolled (desktop) */
@media (min-width: 769px) {
    .nx-v2 .header-inner { max-width: min(1200px, calc(100% - 2.5rem)); }
    html .site-header.nx-v2.nx-compact .header-inner {
        max-width: min(900px, calc(100% - 2.5rem));
        padding-top: .3rem; padding-bottom: .3rem;
        box-shadow: 0 22px 46px -18px rgba(3, 7, 18, .85), inset 0 1px 0 rgba(255, 255, 255, .06);
    }
    .nx-v2 .brand-tag { max-height: 1.2em; overflow: hidden; transition: max-height .45s ease, opacity .3s ease, margin .45s ease; }
    .nx-v2.nx-compact .brand-tag { max-height: 0; opacity: 0; margin-top: 0; }
    .nx-v2 .logo-badge { transition: transform .45s cubic-bezier(.16, 1, .3, 1), box-shadow .3s; }
    .nx-v2.nx-compact .logo-badge { transform: scale(.86); }
}
@media (max-width: 768px) {
    .nx-v2 .nx-progress { left: -1px; right: -1px; }
}

@media (prefers-reduced-motion: reduce) {
    html .site-header.nx-v2 .header-inner, .nx-v2 .brand-link, .nx-v2 .nx-drop { animation: none !important; }
    .nx-v2 .brand-link:hover .logo-badge::before { animation: none; }
    html .site-header.nx-v2 .header-inner { transition: none; }
}
