/*
 * SMT connected Tree visual
 * Loaded on the home page after main.css so it safely replaces only the Tree artwork.
 */

.tree-network {
    position: relative;
    width: min(100%, 38rem);
    min-height: 39rem;
    margin-inline: auto;
    isolation: isolate;
}

.tree-network__connections {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.tree-network__connections path {
    fill: none;
    stroke: var(--orange);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 .3rem .45rem rgba(255, 90, 0, .17));
}

.tree-network__connections .tree-network__trunk {
    stroke: var(--black);
    stroke-width: 20;
}

.tree-network__connections circle {
    fill: var(--black);
    stroke: var(--orange);
    stroke-width: 7;
}

.tree-network__mark {
    position: absolute;
    top: 5.8rem;
    left: 50%;
    z-index: 3;
    display: grid;
    width: 11.6rem;
    height: 11.6rem;
    padding: .55rem;
    place-items: center;
    background: var(--white);
    border-radius: 2rem;
    filter: drop-shadow(0 1rem 1.4rem rgba(255, 90, 0, .18));
    transform: translateX(-50%);
}

.tree-network__mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tree-module {
    position: absolute;
    z-index: 4;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .75rem;
    width: 11.5rem;
    min-height: 5.4rem;
    padding: .9rem;
    align-items: center;
    color: var(--white);
    background: var(--black);
    border: 1px solid #292929;
    border-top: .28rem solid var(--orange);
    border-radius: .9rem;
    box-shadow: 0 .9rem 2rem rgba(16, 16, 16, .16);
}

.tree-module__code {
    display: grid;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    color: var(--black);
    background: var(--orange);
    border-radius: .6rem;
    font-size: .7rem;
    font-weight: 950;
    letter-spacing: .04em;
}

.tree-module small,
.tree-module strong {
    display: block;
}

.tree-module small {
    margin-bottom: .18rem;
    color: #bdbdbd;
    font-size: .56rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tree-module strong {
    font-size: .9rem;
    line-height: 1.15;
}

.tree-module--invoice { top: 5.2rem; left: 0; }
.tree-module--quote { top: 5.2rem; right: 0; }
.tree-module--portal { top: 17.4rem; left: 0; }
.tree-module--team { top: 17.4rem; right: 0; }

.tree-network__foundation {
    position: absolute;
    right: 50%;
    bottom: 1.1rem;
    z-index: 4;
    display: grid;
    width: 15rem;
    min-height: 7rem;
    padding: 1rem 1.25rem;
    place-content: center;
    color: var(--white);
    background: var(--black);
    border: .32rem solid var(--orange);
    border-radius: 1rem;
    box-shadow: 0 1rem 2.1rem rgba(16, 16, 16, .16);
    text-align: center;
    transform: translateX(50%);
}

.tree-network__foundation::before {
    position: absolute;
    top: -.7rem;
    left: 50%;
    width: 1rem;
    height: 1rem;
    background: var(--orange);
    border: .26rem solid var(--black);
    border-radius: 50%;
    content: '';
    transform: translateX(-50%);
}

.tree-network__foundation span {
    color: var(--orange);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .18em;
}

.tree-network__foundation strong {
    font-size: 2rem;
    line-height: 1;
}

.tree-network__foundation small {
    margin-top: .45rem;
    color: #bdbdbd;
    font-size: .62rem;
}

@media (max-width: 41.99rem) {
    .tree-network {
        display: grid;
        width: min(100%, 24rem);
        min-height: 0;
        gap: 1.5rem;
        padding-block: .5rem;
        justify-items: center;
    }

    .tree-network::before {
        position: absolute;
        top: 6rem;
        bottom: 5rem;
        left: 50%;
        z-index: -1;
        width: .65rem;
        background: var(--orange);
        border: .18rem solid var(--black);
        border-block: 0;
        content: '';
        transform: translateX(-50%);
    }

    .tree-network__connections { display: none; }

    .tree-network__mark,
    .tree-module,
    .tree-network__foundation {
        position: relative;
        inset: auto;
        transform: none;
    }

    .tree-network__mark {
        z-index: 3;
        width: 9.5rem;
        height: 9.5rem;
        order: 1;
    }

    .tree-module {
        isolation: isolate;
        width: min(100%, 19rem);
    }

    .tree-module > * {
        position: relative;
        z-index: 1;
    }

    .tree-module > div {
        padding: .18rem .28rem;
        background: var(--black);
        border-radius: .25rem;
    }

    .tree-module::before {
        position: absolute;
        top: 50%;
        left: 50%;
        z-index: 0;
        width: calc(100% + 1.5rem);
        height: .3rem;
        background: var(--orange);
        border-radius: 99rem;
        content: '';
        transform: translate(-50%, -50%);
    }

    .tree-module--invoice { order: 2; }
    .tree-module--quote { order: 3; }
    .tree-module--portal { order: 4; }
    .tree-module--team { order: 5; }

    .tree-network__foundation {
        width: min(100%, 19rem);
        min-height: 7rem;
        order: 6;
    }
}

@media (min-width: 42rem) and (max-width: 63rem) {
    .tree-network { transform: scale(.92); transform-origin: center; }
}

@media (prefers-reduced-motion: no-preference) {
    .tree-network__connections path,
    .tree-network__connections circle {
        animation: tree-connect-in .7s ease-out both;
    }

    .tree-network__connections path:nth-child(2),
    .tree-network__connections path:nth-child(3) { animation-delay: .08s; }

    .tree-network__connections path:nth-child(4),
    .tree-network__connections path:nth-child(5) { animation-delay: .16s; }
}

@keyframes tree-connect-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
