/* Skills: single row, centered, animated & touch-friendly */
.skills-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;                 /* keep items on one straight line */
    gap: 1.5rem;
    justify-content: center;           /* center the whole row */
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    overflow-x: auto;                  /* allow horizontal scroll on very small screens */
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;     /* optional: snap per card */
    scrollbar-width: none;             /* hide Firefox scrollbar */
}
.skills-grid::-webkit-scrollbar { display: none; } /* hide WebKit scrollbar */

.skill-card {
    flex: 0 0 160px;                   /* fixed card width so they line up */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    animation: skillEnter 600ms cubic-bezier(.19,1,.22,1) forwards;
    scroll-snap-align: center;
}

/* staggered entrance */
.skills-grid .skill-card:nth-child(1) { animation-delay: 0ms; }
.skills-grid .skill-card:nth-child(2) { animation-delay: 120ms; }
.skills-grid .skill-card:nth-child(3) { animation-delay: 240ms; }
.skills-grid .skill-card:nth-child(4) { animation-delay: 360ms; }
.skills-grid .skill-card:nth-child(5) { animation-delay: 480ms; }

@keyframes skillEnter {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.skill-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 18px 40px rgba(0,0,0,0.6);
}

/* icon sizing */
.skill-logo {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
}
.skill-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
}

/* responsive tweaks */
@media (max-width: 700px) {
    .skill-card { flex: 0 0 140px; padding: 0.9rem; }
    .skill-logo { width: 56px; height: 56px; }
    .skill-icon { width: 48px; height: 48px; }
}

/* very small screens: slightly smaller cards */
@media (max-width: 420px) {
    .skill-card { flex: 0 0 120px; }
    .skill-logo { width: 48px; height: 48px; }
    .skill-icon { width: 40px; height: 40px; }
}

/* work card media */
.work-media {
    width: 100%;
    height: 12rem; /* adjust if you want taller thumbnails */
    overflow: hidden;
    flex: 0 0 auto;
    display: block;
    background: transparent;
}

.work-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    vertical-align: middle;
}

/* card body (text) sits above the image and never overlaps it */
.work-card .p-6,
.work-card .card-body,
.work-card .work-content {
    position: relative;
    z-index: 1;
    margin-top: 0;
    padding: 1rem;
    background: transparent; /* change if you want a panel behind text */
}

/* If you used an absolute-positioned overlay on the image, lower its z-index */
.work-media::after,
.work-media .overlay {
    z-index: 0;
}

/* optional: ensure consistent box-sizing */
.work-card * { box-sizing: border-box; }

/* responsive height sanity */
@media (max-width: 640px) {
    .work-media { height: 10rem; }
}
@media (min-width: 1024px) {
    .work-media { height: 14rem; }
}