
@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.border-control {
    display: flex;
    flex-direction: column;
    align-content: center;
    align-items: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
    /* width: 50%; */
}

/* .border-enforce {
    /* width: 50%; 
} */

.rotating-border {
    box-shadow: 0 0.5rem 0.75rem #0003;
    --border-radius: 1rem;
    --border-size: 0.5rem;
    --border-bg: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
    --padding: 1px;
    position: relative;
    overflow: hidden;
    padding: calc(var(--padding) + var(--border-size));
    border-radius: var(--border-radius);

    &::before {
        content: "";
        display: block;
        background: var(--border-bg);
        width: calc(100% * 1.41421356237);
        padding-bottom: calc(100% * 1.41421356237);
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        border-radius: 100%;
        z-index: 0;
        animation: spin 5s linear infinite;
    }
    &--reverse::before {
        animation-direction: reverse;
    }
    &::after {
        content: "";
        position: absolute;
        inset: var(--border-size);
        background: white;
        z-index: -1;
        border-radius: calc(var(--border-radius) - var(--border-size));
    }
}

.rotating-border--builders {
    --border-radius: 1.5rem;
    --border-size: 0.3rem;
    --border-bg: conic-gradient(#c3edef, #20d5a0, #a4f0f3, #2ef1f9);
}

html.js .rotating-border[data-reveal-after] {
    box-shadow: none;
}

html.js .rotating-border[data-reveal-after]::before {
    opacity: 0;
    animation-play-state: paused;
    transition: opacity 450ms ease;
}

html.js .rotating-border[data-reveal-after].border-visible {
    box-shadow: 0 0.5rem 0.75rem #0003;
}

html.js .rotating-border[data-reveal-after].border-visible::before {
    opacity: 1;
    animation-play-state: running;
}
