.tools-section {
    position: relative;
    min-height: clamp(780px, 66.8vw, 820px);
    overflow: hidden;
    isolation: isolate;
    padding: clamp(64px, 5.8vw, 78px) 24px clamp(78px, 7vw, 98px);
    background:
        linear-gradient(135deg, #100639 0%, #5025ac 55%, #5025ac 100%);
    color: #ffffff;
    font-family: "Poppins", sans-serif;
}

.tools-section img {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    user-select: none;
}

.tools-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        repeating-linear-gradient(to right,
            rgba(255, 255, 255, 0.18) 0,
            rgba(255, 255, 255, 0.18) 1px,
            transparent 1px,
            transparent 40px),
        repeating-linear-gradient(to bottom,
            rgba(255, 255, 255, 0.18) 0,
            rgba(255, 255, 255, 0.18) 1px,
            transparent 1px,
            transparent 40px);
    background-size: 40px 40px;
    background-position: 0 0;
    opacity: 1;
    mix-blend-mode: normal;
    animation: gridDrift 28s ease-in-out infinite alternate;
}

.tools-lines {
    position: absolute;
    z-index: 1;
    left: 0;
    right: 0;
    bottom: -56px;
    width: 100%;
    max-width: none;
    opacity: 0.56;
    object-fit: cover;
    animation: linesMove 8s ease-in-out infinite alternate;
    pointer-events: none;
}

.tools-container {
    position: relative;
    z-index: 2;
    width: min(100%, 1258px);
    margin: 0 auto;
}

.tools-container h2 {
    color: #ffffff;
    font-size: clamp(2.5rem, 3.55vw, 3rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    margin-left: clamp(-114px, -12.5vw, -158px);
}

.tools-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: clamp(174px, 14.8vw, 202px);
    display: flex;
    align-items: center;
    padding: clamp(22px, 2.2vw, 30px) 0;
    border-radius: 24px;
    border: 1px solid rgba(236, 238, 255, 0.24);
    background:
        radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.13), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(63, 91, 211, 0.13) 36%, rgba(19, 31, 155, 0.28) 100%),
        rgba(33, 12, 96, 0.38);
    backdrop-filter: blur(14px) saturate(145%);
    -webkit-backdrop-filter: blur(14px) saturate(145%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.13),
        inset 0 22px 34px rgba(255, 255, 255, 0.08),
        inset 0 -26px 46px rgba(40, 4, 75, 0.24),
        0 0 5px rgba(255, 255, 255, 0.28),
        0 0 20px rgba(75, 15, 159, 0.34),
        0 18px 30px rgba(0, 0, 0, 0.22);
}

.tools-card:hover .tools-track {
    animation-play-state: paused;
}

.tools-card::before {
    mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}

.tools-card::before,
.tools-card::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.tools-card::before {
    inset: 1px;
    z-index: 1;
    border-radius: 23px;
    background:
        radial-gradient(circle at 10% 12%, rgba(255, 255, 255, 0.22), transparent 26%),
        radial-gradient(circle at 92% 14%, rgba(11, 1, 33, 0.34), transparent 28%);
    opacity: 0.78;
}

.tools-card::after {
    top: 0;
    left: 4%;
    right: 4%;
    z-index: 3;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    opacity: 0.72;
}

.tools-card+.tools-card {
    margin-top: clamp(58px, 5.5vw, 76px);
}

.tools-card-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: fill;
    opacity: 0;
    pointer-events: none;
}

.tools-track {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    width: max-content;
    min-width: max-content;
    --tools-marquee-distance: 0px;
    animation: toolsMarqueeLeft 28s linear infinite;
    will-change: transform;
}

.tools-card-bottom .tools-track {
    animation-name: toolsMarqueeRight;
}

.tools-track__group {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: center;
    flex: 0 0 var(--tools-group-width, 100%);
    width: var(--tools-group-width, 100%);
    min-width: var(--tools-group-width, 100%);
    box-sizing: border-box;
}

.tool-item {
    position: relative;
    z-index: 2;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: clamp(17px, 1.7vw, 23px);
    flex: 0 0 clamp(116px, 10vw, 148px);
    min-width: 0;
    color: rgba(235, 239, 255, 0.62);
    text-align: center;
    font-size: clamp(1.02rem, 1.38vw, 1.22rem);
    font-weight: 500;
    line-height: 1;
    transition: color 220ms ease, transform 220ms ease, text-shadow 220ms ease;
}

.tool-item img {
    width: var(--tool-icon-size, clamp(64px, 6vw, 82px));
    aspect-ratio: 1;
    object-fit: contain;
    filter: grayscale(1) saturate(0) brightness(.72) contrast(.92) opacity(.56) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.14));
    transition: filter 220ms ease, transform 220ms ease;
}

.tool-item:hover {
    color: #ffffff;
    transform: translateY(-5px);
    text-shadow: 0 0 16px rgba(140, 230, 255, 0.28);
}

.tool-item:hover img {
    filter: grayscale(0) saturate(1) brightness(1) opacity(1) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.20)) drop-shadow(0 0 14px rgba(108, 224, 255, 0.22));
    transform: scale(1.08);
}

.tools-card-top .tool-item:nth-child(4) img {
    width: clamp(86px, 7.4vw, 118px);
    aspect-ratio: auto;
}

.tools-card-bottom .tool-item:nth-child(6) img {
    width: clamp(76px, 6.8vw, 96px);
    aspect-ratio: auto;
}

.stats-row {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: clamp(42px, 6vw, 86px);
    margin-top: clamp(42px, 4.4vw, 56px);
    padding-inline: clamp(10px, 3.3vw, 44px);
}

.stat-item {
    display: grid;
    justify-items: center;
    gap: 8px;
    color: #ffffff;
    text-align: center;
}

.stat-item strong {
    display: block;
    font-size: clamp(4rem, 6.1vw, 5.4rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: 0;
}

.stat-item span {
    display: block;
    font-size: clamp(1rem, 1.55vw, 1.25rem);
    font-weight: 700;
    line-height: 1.2;
}

.stat-separator {
    width: 3px;
    height: clamp(112px, 10.5vw, 130px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 999px;
}

@keyframes linesMove {
    0% {
        transform: translateY(0);
        opacity: 0.45;
    }

    100% {
        transform: translateY(-8px);
        opacity: 0.75;
    }
}

@keyframes gridDrift {
    0% {
        background-position: 0 0;
        opacity: 0.72;
    }

    100% {
        background-position: 40px 40px;
        opacity: 0.9;
    }
}

@keyframes toolsMarqueeLeft {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(calc(var(--tools-marquee-distance) * -1));
    }
}

@keyframes toolsMarqueeRight {
    from {
        transform: translateX(calc(var(--tools-marquee-distance) * -1));
    }

    to {
        transform: translateX(0);
    }
}

@media (max-width: 1180px) {
    .tools-section {
        min-height: auto;
    }

    .tools-container {
        width: min(100%, 1040px);
    }

    .tools-card {
        min-height: 168px;
        padding-block: 28px;
    }

    .tools-track {
        animation-duration: 26s;
    }

    .tools-track__group {
        width: var(--tools-group-width, 100%);
    }

    .tool-item {
        flex-basis: 112px;
        font-size: clamp(1rem, 1.7vw, 1.25rem);
    }

    .tool-item img {
        width: clamp(54px, 5.8vw, 70px);
    }
}

@media (max-width: 900px) {
    .tools-section {
        padding: 64px 22px 76px;
    }

    .tools-container {
        width: min(100%, 720px);
    }

    .tools-container h2 {
        margin-left: 0;
        text-align: center;
    }

    .tools-card {
        min-height: 154px;
        padding: 30px 0;
        border-radius: 20px;
    }

    .tools-card-bg {
        object-fit: cover;
    }

    .tools-card+.tools-card {
        margin-top: 34px;
    }

    .tools-track {
        animation-duration: 24s;
    }

    .tools-track__group {
        width: var(--tools-group-width, 100%);
    }

    .tool-item {
        flex-basis: 102px;
    }

    .stats-row {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-top: 44px;
    }

    .stat-separator {
        width: min(260px, 72vw);
        height: 2px;
    }

    .stat-item strong {
        font-size: clamp(3.2rem, 13vw, 4.4rem);
    }
}

@media (max-width: 760px) {
    .tools-section {
        padding: 56px 12px 66px;
    }

    .tools-grid {
        background-size: auto 58%;
    }

    .tools-container {
        width: min(100%, 500px);
    }

    .tools-container h2 {
        margin-bottom: 28px;
        font-size: clamp(2.05rem, 9vw, 2.55rem);
    }

    .tools-card {
        min-height: auto;
        align-items: stretch;
        padding: 22px 16px 20px;
        border-radius: 18px;
    }

    .tools-card+.tools-card {
        margin-top: 28px;
    }

    .tools-card:hover .tools-track {
        animation-play-state: running;
    }

    .tools-track,
    .tools-card-bottom .tools-track {
        display: block;
        width: 100%;
        min-width: 0;
        animation: none;
        transform: none;
    }

    .tools-track__group {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: 12px;
        row-gap: 18px;
        flex: none;
        width: 100%;
        min-width: 0;
    }

    .tools-track__group[aria-hidden="true"] {
        display: none;
    }

    .tool-item {
        min-width: 0;
        gap: 9px;
        padding-inline: 2px;
        font-size: 0.8rem;
        line-height: 1.12;
    }

    .tool-item span {
        display: block;
        width: 100%;
        min-height: 2.24em;
        white-space: normal;
        overflow-wrap: break-word;
    }

    .tool-item img {
        width: 46px;
    }

    .tools-card-top .tool-item:nth-child(4) img {
        width: 62px;
    }

    .tools-card-bottom .tool-item:nth-child(6) img {
        width: 58px;
    }

    .stats-row {
        gap: 22px;
        padding-inline: 0;
    }

    .stat-item span {
        font-size: 0.95rem;
    }
}

@media (max-width: 380px) {
    .tools-section {
        padding-inline: 8px;
    }

    .tools-container h2 {
        font-size: clamp(1.95rem, 8.6vw, 2.18rem);
    }

    .tools-card {
        padding-inline: 14px;
    }

    .tools-track__group {
        column-gap: 8px;
        row-gap: 16px;
    }

    .tool-item {
        padding-inline: 0;
        font-size: 0.76rem;
    }

    .tool-item img {
        width: 42px;
    }

    .tools-card-top .tool-item:nth-child(4) img {
        width: 56px;
    }

    .tools-card-bottom .tool-item:nth-child(6) img {
        width: 54px;
    }
}

/* mobile stats separator alignment */
@media (max-width: 900px) {
    .stats-row {
        justify-items: center !important;
    }

    .stat-separator {
        justify-self: center !important;
        margin-inline: auto !important;
        width: min(340px, 82vw) !important;
        max-width: 100% !important;
    }
}

@media (max-width: 540px) {
    .stat-separator {
        width: min(342px, 82vw) !important;
    }
}
