/* Tech Orbit Animation */
.tech-orbit {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 280px;
    /* Match profile-image height */
    /* Matches wrapper height? Wrapper has no height if image is floated or static. */
    /* Wrapper contains profile-image (280px tall). */
    /* We need to center this orbit on the profile image. profile-image has margin-top -100px. */
    pointer-events: none;
    z-index: 10;
    /* Behind image if needed, or in front? "round about" usually means surrounding.
                 If I want behind, z-index -1. But profile-image is z-index auto.
                 Let's keep it 1, ensuring it doesn't block clicks (pointer-events none). */
    /* Center placement relative to profile-image-wrapper */
    display: flex;
    justify-content: center;
    align-items: center;
    /* Match profile-image offset */
}

.tech-orbit .orbit-item {
    position: absolute;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--surface-color);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(4px);
    pointer-events: auto;
    /* Allow hover */
    /* Initial placement in center, animation moves it out */
    opacity: 0;
    /* Fade in */
    animation: orbit-fade-in 1s ease-out forwards, orbit-spin 20s linear infinite;
}

.tech-orbit .orbit-item i {
    /* Counter rotate to keep upright */
    animation: orbit-counter-spin 20s linear infinite;
}

/* Calculate delays for 8 items */
.tech-orbit .orbit-item:nth-child(1) {
    animation-delay: 0s;
}

.tech-orbit .orbit-item:nth-child(2) {
    animation-delay: -2.5s;
}

.tech-orbit .orbit-item:nth-child(3) {
    animation-delay: -5s;
}

.tech-orbit .orbit-item:nth-child(4) {
    animation-delay: -7.5s;
}

.tech-orbit .orbit-item:nth-child(5) {
    animation-delay: -10s;
}

.tech-orbit .orbit-item:nth-child(6) {
    animation-delay: -12.5s;
}

.tech-orbit .orbit-item:nth-child(7) {
    animation-delay: -15s;
}

.tech-orbit .orbit-item:nth-child(8) {
    animation-delay: -17.5s;
}

/* Apply delays to inner icons too so they sync */
.tech-orbit .orbit-item:nth-child(1) i {
    animation-delay: 0s;
}

.tech-orbit .orbit-item:nth-child(2) i {
    animation-delay: -2.5s;
}

.tech-orbit .orbit-item:nth-child(3) i {
    animation-delay: -5s;
}

.tech-orbit .orbit-item:nth-child(4) i {
    animation-delay: -7.5s;
}

.tech-orbit .orbit-item:nth-child(5) i {
    animation-delay: -10s;
}

.tech-orbit .orbit-item:nth-child(6) i {
    animation-delay: -12.5s;
}

.tech-orbit .orbit-item:nth-child(7) i {
    animation-delay: -15s;
}

.tech-orbit .orbit-item:nth-child(8) i {
    animation-delay: -17.5s;
}


@keyframes orbit-spin {
    0% {
        transform: rotate(0deg) translateX(190px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: rotate(360deg) translateX(190px) rotate(-360deg);
        opacity: 1;
    }
}

/* Wait, my keyframe logic for upright items:
   transform: rotate(A) translate(R) rotate(-A) 
   keeps the item upright relative to the screen IF the container is static.
   Here the container matches the wrapper. The ITEMS move.
   So yes, this keyframe works!
   Wait, if I use `rotate(-360deg)` at the end, the item rotates around its center to counteract the orbit.
   BUT, `translateX` happens before the second rotate? NO.
   Order: rotate(A) -> moves axes. Translate(R) -> moves along new X. Rotate(-A) -> rotates local axes back.
   So visual result: Positioned at circle, unrotated orientation.
   CORRECT.
   
   However, I also have `i { animation: orbit-counter-spin ... }`.
   If the item is ALREADY unrotated by the keyframe `rotate(-360deg)`, then `i` doesn't need to rotate?
   Let's trace:
   0%: rotate(0) trans(190) rotate(0). Item is upright at 3 o'clock.
   90%: rotate(90) trans(190) rotate(-90). Item is at 6 o'clock. 
        Local axes: X points Down? No.
        Rotate(90) -> X points down. Trans(190) -> moves down.
        Rotate(-90) -> X points Right again.
        So Item is Upright.
   So I DO NOT NEED to animate `i`. The keyframe on `.orbit-item` handles it.
*/

/* Correction: remove inner animation on i */
.tech-orbit .orbit-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Missing Keyframe */
@keyframes orbit-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .tech-orbit {
        height: 200px;
    }

    @keyframes orbit-spin {
        0% {
            transform: rotate(0deg) translateX(130px) rotate(0deg);
            opacity: 1;
        }

        100% {
            transform: rotate(360deg) translateX(130px) rotate(-360deg);
            opacity: 1;
        }
    }
}