/* --- Diagrams --- */
.diagram-visual {
    height: 150px;
    margin-bottom: 20px;
    position: relative;
    border: 1px dashed #333;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Neural Net */
.neural-net .node {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    position: absolute;
    z-index: 2;
    box-shadow: 0 0 10px white;
}

.n1 {
    top: 30%;
    left: 30%;
}

.n2 {
    top: 70%;
    left: 30%;
}

.n3 {
    top: 50%;
    right: 30%;
}

.n4 {
    bottom: 20%;
    right: 40%;
    transform: scale(0.5);
    opacity: 0.5;
}

.neural-net .line {
    position: absolute;
    background: #333;
    height: 1px;
    transform-origin: 0 0;
    z-index: 1;
}

.l1 {
    top: 35%;
    left: 32%;
    width: 50px;
    transform: rotate(25deg);
}

.l2 {
    top: 72%;
    left: 32%;
    width: 50px;
    transform: rotate(-25deg);
}

.l3 {
    top: 52%;
    left: 68%;
    width: 30px;
    transform: rotate(120deg);
}

/* Animation for Neural Net */
.neural-net .node {
    animation: pulseNode 2s infinite;
}

@keyframes pulseNode {
    0% {
        background: #fff;
        box-shadow: 0 0 5px #fff;
    }

    50% {
        background: var(--accent-color);
        box-shadow: 0 0 15px var(--accent-color);
    }

    100% {
        background: #fff;
        box-shadow: 0 0 5px #fff;
    }
}

/* Agent Loop */
.loop-circle {
    position: relative;
    width: 120px;
    height: 120px;
    border: 2px solid #222;
    border-radius: 50%;
    animation: rotate 10s linear infinite;
}

.loop-item {
    position: absolute;
    font-size: 0.6rem;
    font-weight: 800;
    background: #000;
    padding: 2px 5px;
    color: var(--accent-color);
}

.loop-item.top {
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.loop-item.bottom {
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.loop-item.left {
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
}

.loop-item.right {
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
}

.loop-arrow {
    position: absolute;
    color: #444;
    font-size: 0.8rem;
}

.loop-arrow.right {
    top: 10px;
    right: 20px;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.loop-circle>* {
    animation: counter-rotate 10s linear infinite;
}

@keyframes counter-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(-360deg);
    }

    /* Keep letters upright */
}

/* Tech Stack */
.stack-layer {
    width: 80%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #333;
    text-align: center;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    background: #050505;
    transition: all 0.3s;
}

.l-top:hover {
    background: var(--accent-color);
    color: black;
    transform: scale(1.05);
}

.l-mid:hover {
    background: white;
    color: black;
    transform: scale(1.05);
}

.l-bot:hover {
    border-color: white;
    transform: scale(1.05);
}