/* ============================================================
   skills.css
   Changes:
   - Added .no-float modifier class: JS adds this on mobile/reduced-motion
     to disable all 20+ concurrent CSS animations (major paint saving)
   - animation-fill-mode: both added to prevent flash-of-default-position
   - overflow:hidden scoped to section (not #about) to avoid clipping issues
   ============================================================ */

.skills-wrapper-unique {
    background-color: var(--bg-color);
    position: relative;
    padding: 100px 0;
    font-family: var(--font-family);
    box-sizing: border-box;
    overflow: hidden; /* moved from #about to here — more precise scope */
}

/* Magic glow backgrounds */
.skills-wrapper-unique::before,
.skills-wrapper-unique::after {
    content: '';
    position: absolute;
    width: 350px; height: 350px;
    background: var(--magic-glow);
    filter: blur(120px);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}
.skills-wrapper-unique::before { top: -100px; left: -100px; }
.skills-wrapper-unique::after  { bottom: -100px; right: -100px; }

/* Section header — unified with portfolio/resume */
.skills-wrapper-unique .section-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    margin-bottom: 50px;
    margin-left: 8%;
}

.skills-wrapper-unique .section-header__tag {
    color: var(--primary-blue);
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 400;
    font-family: 'Fira Code', 'Courier New', monospace;
    opacity: 0.8;
}

.skills-wrapper-unique .section-header__title {
    color: var(--text-white);
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 700;
    text-transform: lowercase;
    margin: 0;
    letter-spacing: -0.5px;
    font-family: var(--font-family);
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.skills-inner-container {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

/* Skills grid */
.skills-flex-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    list-style: none;
    padding: 0;
    margin-bottom: 60px;
}

.skill-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: var(--secondary-navy);
    border: 1px solid rgba(0, 212, 255, 0.1);
    border-radius: 50px;
    color: var(--text-white);
    font-size: 16px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
    /* FIX: animation-fill-mode:both prevents pills from snapping to
       default position before animation starts */
    animation: floating-random var(--duration, 6s) ease-in-out infinite both;
    animation-delay: var(--delay, 0s);
}

@keyframes floating-random {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25%  { transform: translate(var(--x-move, 5px), var(--y-move, -10px)) rotate(1deg); }
    50%  { transform: translate(calc(var(--x-move, 5px) * -1), var(--y-move, -15px)) rotate(-1deg); }
    75%  { transform: translate(var(--x-move, 5px), var(--y-move, -5px)) rotate(0.5deg); }
}

.skill-pill:hover {
    border-color: var(--primary-blue);
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 30px var(--magic-glow);
    transform: scale(1.15) !important;
    animation-play-state: paused;
    z-index: 100;
}

.skill-pill img {
    width: 22px; height: 22px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px var(--magic-glow));
}

/* ── .no-float: JS adds this class on mobile & reduced-motion ── */
/* Kills all 20+ concurrent floating animations — single biggest mobile win */
.skills-wrapper-unique.no-float .skill-pill {
    animation: none;
    transform: none !important;
}

/* CTA area */
.skills-cta-area p {
    color: var(--text-gray);
    font-size: 20px;
}

.skills-cta-area a {
    color: var(--primary-blue);
    font-weight: 600;
    position: relative;
    padding: 0 5px;
    text-decoration: none;
}

.skills-cta-area a::after {
    content: '';
    position: absolute;
    width: 0; height: 2px;
    bottom: -2px; left: 0;
    background: var(--primary-blue);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--primary-blue);
}

.skills-cta-area a:hover::after { width: 100%; }

/* Mobile overrides */
@media (max-width: 768px) {
    .skills-wrapper-unique .section-header {
        margin-left: 20px;
        gap: 8px;
    }
    .skills-wrapper-unique .section-header__title {
        font-size: 1.3rem;
    }
    /* Belt-and-suspenders: also disable via media query in case JS is slow */
    .skill-pill {
        animation: none;
        transform: none !important;
    }
}
