/* =========================================================
   Homepage — Integrations (hub-and-spoke)
   ========================================================= */

.nx-int {
    position: relative;
    background: var(--nx-bg);
    color: var(--nx-text);
    padding: clamp(5rem, 12vh, 9rem) 0 clamp(4.5rem, 10vh, 7.5rem);
    overflow-x: clip;
    border-top: 1px solid var(--nx-border);
}

.nx-int__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: radial-gradient(ellipse 70% 65% at 50% 58%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 58%, #000 20%, transparent 75%);
}

.nx-int__glow {
    position: absolute;
    width: min(560px, 70vw);
    height: min(360px, 46vh);
    left: 50%;
    top: 62%;
    transform: translate(-50%, -50%);
    background: radial-gradient(
        ellipse at center,
        rgba(79, 124, 255, 0.16) 0%,
        rgba(79, 124, 255, 0.04) 42%,
        transparent 70%
    );
    filter: blur(28px);
}

.nx-int__inner {
    position: relative;
    z-index: 1;
    max-width: var(--nx-content);
    margin: 0 auto;
    padding: 0 var(--nx-pad);
}

.nx-int__header {
    text-align: center;
    max-width: 40rem;
    margin: 0 auto clamp(2.5rem, 6vw, 3.75rem);
}

.nx-int__badge {
    margin: 0 0 1.15rem;
}

body.nx-home .nx-int h2 {
    margin: 0 0 0.9rem;
    font-family: var(--font-display, 'Syne', sans-serif);
    font-size: clamp(2.1rem, 4.4vw, 3.5rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.nx-int__header p:last-child {
    margin: 0 auto;
    max-width: 36rem;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: clamp(1rem, 1.2vw, 1.1rem);
    line-height: 1.65;
    color: var(--nx-text-muted);
}

.nx-int__stage {
    position: relative;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    aspect-ratio: 1000 / 440;
}

.nx-int__lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.nx-int__line {
    fill: none;
    stroke: rgba(255, 255, 255, 0.16);
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}

.nx-int.is-on .nx-int__line {
    animation: nxIntDraw 1.45s ease forwards;
}

.nx-int.is-on .nx-int__line:nth-of-type(2) { animation-delay: 0.06s; }
.nx-int.is-on .nx-int__line:nth-of-type(3) { animation-delay: 0.12s; }
.nx-int.is-on .nx-int__line:nth-of-type(4) { animation-delay: 0.18s; }
.nx-int.is-on .nx-int__line:nth-of-type(5) { animation-delay: 0.24s; }
.nx-int.is-on .nx-int__line:nth-of-type(6) { animation-delay: 0.3s; }
.nx-int.is-on .nx-int__line:nth-of-type(7) { animation-delay: 0.08s; }
.nx-int.is-on .nx-int__line:nth-of-type(8) { animation-delay: 0.14s; }
.nx-int.is-on .nx-int__line:nth-of-type(9) { animation-delay: 0.2s; }
.nx-int.is-on .nx-int__line:nth-of-type(10) { animation-delay: 0.26s; }
.nx-int.is-on .nx-int__line:nth-of-type(11) { animation-delay: 0.32s; }
.nx-int.is-on .nx-int__line:nth-of-type(12) { animation-delay: 0.36s; }

.nx-int__flow {
    fill: var(--nx-accent);
    opacity: 0;
}

.nx-int.is-on .nx-int__flow {
    opacity: 1;
}

.nx-int__hub {
    position: absolute;
    left: 50%;
    top: 50%;
    width: clamp(4.6rem, 9vw, 5.75rem);
    height: clamp(4.6rem, 9vw, 5.75rem);
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    background: rgba(13, 15, 18, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 1rem;
    z-index: 2;
}

.nx-int__hub::before {
    content: "";
    position: absolute;
    inset: -7px;
    pointer-events: none;
    background:
        linear-gradient(#E8ECF2, #E8ECF2) top left / 9px 1px no-repeat,
        linear-gradient(#E8ECF2, #E8ECF2) top left / 1px 9px no-repeat,
        linear-gradient(#E8ECF2, #E8ECF2) top right / 9px 1px no-repeat,
        linear-gradient(#E8ECF2, #E8ECF2) top right / 1px 9px no-repeat,
        linear-gradient(#E8ECF2, #E8ECF2) bottom left / 9px 1px no-repeat,
        linear-gradient(#E8ECF2, #E8ECF2) bottom left / 1px 9px no-repeat,
        linear-gradient(#E8ECF2, #E8ECF2) bottom right / 9px 1px no-repeat,
        linear-gradient(#E8ECF2, #E8ECF2) bottom right / 1px 9px no-repeat;
}

.nx-int__hub img {
    width: 46%;
    height: 46%;
    object-fit: contain;
}

.nx-int__nodes {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nx-int__node {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: clamp(2.5rem, 4.4vw, 3.15rem);
    height: clamp(2.5rem, 4.4vw, 3.15rem);
    transform: translate(-50%, -50%) scale(0.82);
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #12151A;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    opacity: 0;
    z-index: 2;
}

.nx-int.is-on .nx-int__node {
    animation: nxIntPop 0.5s ease forwards;
}

.nx-int.is-on .nx-int__node:nth-child(1) { animation-delay: 0.55s; }
.nx-int.is-on .nx-int__node:nth-child(2) { animation-delay: 0.62s; }
.nx-int.is-on .nx-int__node:nth-child(3) { animation-delay: 0.69s; }
.nx-int.is-on .nx-int__node:nth-child(4) { animation-delay: 0.76s; }
.nx-int.is-on .nx-int__node:nth-child(5) { animation-delay: 0.6s; }
.nx-int.is-on .nx-int__node:nth-child(6) { animation-delay: 0.72s; }
.nx-int.is-on .nx-int__node:nth-child(7) { animation-delay: 0.55s; }
.nx-int.is-on .nx-int__node:nth-child(8) { animation-delay: 0.62s; }
.nx-int.is-on .nx-int__node:nth-child(9) { animation-delay: 0.69s; }
.nx-int.is-on .nx-int__node:nth-child(10) { animation-delay: 0.76s; }
.nx-int.is-on .nx-int__node:nth-child(11) { animation-delay: 0.6s; }
.nx-int.is-on .nx-int__node:nth-child(12) { animation-delay: 0.72s; }

.nx-int__node svg,
.nx-int__node img {
    width: 52%;
    height: 52%;
    display: block;
    object-fit: contain;
}

.nx-int .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.nx-int .reveal.is-visible {
    opacity: 1;
    transform: none;
}

@keyframes nxIntDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes nxIntPop {
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@media (max-width: 820px) {
    .nx-int__stage {
        aspect-ratio: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.75rem;
    }

    .nx-int__lines {
        display: none;
    }

    .nx-int__hub {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: 4.5rem;
        height: 4.5rem;
    }

    .nx-int__nodes {
        position: static;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.85rem 0.7rem;
        width: 100%;
        max-width: 22rem;
        justify-items: center;
    }

    .nx-int__node,
    .nx-int.is-on .nx-int__node {
        position: static;
        transform: none;
        opacity: 1;
        animation: none;
        width: 2.85rem;
        height: 2.85rem;
    }
}

@media (max-width: 480px) {
    .nx-int__nodes {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .nx-int .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .nx-int__line,
    .nx-int.is-on .nx-int__line,
    .nx-int.is-on .nx-int__node {
        animation: none;
    }

    .nx-int__line {
        stroke-dasharray: none;
        stroke-dashoffset: 0;
    }

    .nx-int__flow {
        display: none;
    }

    .nx-int__node {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}
