/* ========================================
   NEURAL SKILL SINGULARITY - ULTIMATE FIX
   ZERO-TOLERANCE MOBILE ALIGNMENT
   ======================================== */

.neural-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: #050508;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    padding: 2rem 0;
}

.neural-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* ========================================
   ORBITAL SYSTEM ROOT
   ======================================== */
.neural-system {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 800px;
    /* Ensure the system itself is centered */
    margin: 0 auto;
}

.neural-orbit-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 440px;
    border: 1px solid rgba(0, 212, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

/* ========================================
   NEURAL NODES
   ======================================== */
.neural-node {
    position: absolute;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.node-point {
    width: 16px;
    height: 16px;
    background: #0f172a;
    border: 2px solid var(--accent);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.node-label {
    position: absolute;
    bottom: -35px;
    font-size: 0.85rem;
    font-family: 'Space Grotesk', sans-serif;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
    text-transform: uppercase;
    font-weight: 600;
}

/* ========================================
   SKILL CARDS (ABSOLUTE CENTERING)
   ======================================== */
.node-skills {
    /* Critical: This container is moved by JS to the system center */
    position: absolute;
    pointer-events: none;
    z-index: 1000;
}

.skill-card {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%) scale(0);

    /* WIDTH DYNAMICS: GROW WITH TEXT BUT HAVE BOUNDS */
    width: fit-content;
    min-width: 320px;
    max-width: 85vw;
    height: 60px;

    background: #000000 !important;
    /* ABSOLUTE SOLID BLACK - NO TRANSPARENCY */
    border: 1px solid rgba(0, 212, 255, 0.5);
    border-left: 10px solid var(--accent);
    border-radius: 14px;
    z-index: calc(2000 + var(--k));
    /* Force to the very top */
    color: #fff;
    font-size: 1.1rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;

    /* CRITICAL PADDING: PREVENTS OVERLAP */
    padding: 0 100px 0 30px;

    display: flex;
    align-items: center;
    justify-content: flex-start;

    opacity: 0;
    visibility: hidden;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 1);
    backdrop-filter: none;
    pointer-events: auto;
    cursor: pointer;
    white-space: nowrap;
}

.skill-card.is-visible {
    opacity: 1;
    visibility: visible;
    /* Exact vertical stacking from the center */
    transform: translate(-50%, calc(-50% - 150px - (var(--k) * 70px))) scale(1);
}

.skill-card::after {
    content: '➔';
    position: absolute;
    right: 25px;
    font-size: 1.8rem;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent);
}

/* ========================================
   RESPONSIVE - NO MORE OVERFLOW
   ======================================== */
@media (max-width: 768px) {
    .neural-system {
        height: 1000px;
        overflow: hidden;
        /* Hard stop for any overflow */
    }

    .neural-orbit-ring {
        display: none;
    }

    .neural-node {
        z-index: 10;
        /* Base z-index */
    }

    .neural-node.active {
        z-index: 9999 !important;
        /* Force active node to the absolute top */
    }

    .neural-section.active .neural-node:not(.active) {
        z-index: 0 !important;
        /* Force all other circles to the absolute bottom */
        opacity: 0.03;
        /* Make them almost invisible to focus on cards */
    }

    .node-label {
        font-size: 0.75rem;
        /* Smaller labels for mobile */
        bottom: -30px;
        z-index: 1;
        /* Ensure label stays behind everything */
    }

    .skill-card {
        width: fit-content;
        min-width: 280px;
        max-width: 85vw;
        font-size: 1rem;
        padding-right: 95px;
        background: #000000 !important;
        /* SOLID BLACK */
        border: 1px solid rgba(0, 212, 255, 0.4);
        z-index: 10000;
        /* Cards stay above their parent node point */
    }

    .skill-card.is-visible {
        transform: translate(-50%, calc(-50% - 130px - (var(--k) * 65px))) scale(1);
    }
}

@media (max-width: 480px) {
    .skill-card {
        min-width: 260px;
        max-width: 90vw;
        /* Use more width to prevent wrapping/overlap */
        font-size: 0.9rem;
        padding-right: 85px;
        background: #000000 !important;
    }
}