/* ================================================================
   SKILLS SECTION — Premium Bento Grid v3
   Top 0.1% UI: Asymmetrical grid, rich backgrounds, glassmorphism,
   and dynamic hover micro-interactions.
   ================================================================ */

.skills {
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

/* ── Bento Grid Layout ── */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 1.25rem;
    position: relative;
    z-index: 2;
    padding-top: 2rem;
}

/* Desktop spans */
.bento-ml    { grid-column: span 2; grid-row: span 2; min-height: 400px; }
.bento-data  { grid-column: span 1; grid-row: span 2; }
.bento-prog  { grid-column: span 1; grid-row: span 1; }
.bento-tools { grid-column: span 1; grid-row: span 1; }
.bento-libs  { grid-column: span 4; grid-row: span 1; min-height: 120px; }

/* ── Bento Card Base ── */
.bento-card {
    position: relative;
    background: rgba(18, 20, 38, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.4s ease, box-shadow 0.4s ease;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.bento-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 
                inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 10;
}

/* Spotlit border effect on hover */
.bento-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(circle 400px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 5;
}
.bento-card:hover::after { opacity: 1; }

.bento-content {
    position: relative;
    z-index: 2;
    padding: 1.75rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ── Headers ── */
.bento-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.bento-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.05);
}

.bento-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    letter-spacing: -0.01em;
}

/* ── 1. AI & ML Hero Card ── */
.bento-bg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.6;
    mix-blend-mode: screen;
}

.bento-ml .bento-body {
    margin-top: auto;
}

.bento-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.bento-list li {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.bento-list span {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.b-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.b-fill {
    height: 100%;
    background: linear-gradient(90deg, #818cf8, #c084fc);
    border-radius: 4px;
    position: relative;
}

.b-fill::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite linear;
}

/* ── 2. Data Engineering (Vertical Tech Stack) ── */
.bento-data {
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.08) 0%, rgba(18, 20, 38, 0.4) 100%);
}

.tech-stack-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
    justify-content: space-evenly;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.25s ease;
}

.tech-item i {
    color: #38bdf8;
    width: 20px;
    text-align: center;
}

.bento-data:hover .tech-item:nth-child(even) { transform: translateX(4px); background: rgba(56, 189, 248, 0.08); border-color: rgba(56, 189, 248, 0.15); }
.bento-data:hover .tech-item:nth-child(odd)  { transform: translateX(-4px); background: rgba(56, 189, 248, 0.08); border-color: rgba(56, 189, 248, 0.15); }

/* ── 3. Programming (Tags) ── */
.bento-prog .bento-body {
    display: flex;
    align-items: center;
    height: 100%;
}

.lang-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.l-tag {
    padding: 0.35rem 0.85rem;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: 50px;
    font-size: 0.75rem;
    color: #fbbf24;
    font-family: 'Inter', monospace;
    transition: all 0.25s ease;
}

.bento-prog:hover .l-tag {
    background: rgba(251, 191, 36, 0.15);
    transform: scale(1.05);
}

/* ── 4. Tools (Grid) ── */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    height: 100%;
    align-content: center;
}

.t-icon {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    font-size: 1.3rem;
    color: rgba(255,255,255,0.6);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-tools:hover .t-icon {
    color: rgba(255,255,255,0.9);
}
.t-icon:hover {
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.3);
    color: #f43f5e;
    transform: translateY(-3px) scale(1.1);
}

/* ── 5. Libraries (Marquee) ── */
.bento-content.horizontal {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1.75rem;
}

.bento-header.shrink {
    margin: 0;
    flex-shrink: 0;
}

.marquee-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.marquee-track {
    display: flex;
    gap: 2rem;
    width: max-content;
    animation: scroll-left 30s linear infinite;
}

.m-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    transition: color 0.3s, border-color 0.3s;
}

.m-item i { color: #34d399; }
.m-item:hover {
    color: #fff;
    border-color: rgba(52, 211, 153, 0.4);
    background: rgba(52, 211, 153, 0.1);
}

@keyframes scroll-left {
    from { transform: translateX(0); }
    to   { transform: translateX(calc(-50% - 1rem)); } /* -50% because sequence is duplicated, plus half gap */
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ── Responsive Refinements ── */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bento-ml    { grid-column: span 2; grid-row: span 1; }
    .bento-data  { grid-column: span 1; grid-row: span 1; }
    .bento-prog  { grid-column: span 1; grid-row: span 1; }
    .bento-tools { grid-column: span 2; grid-row: span 1; }
    .bento-libs  { grid-column: span 2; }
    .desktop-only { display: none; }
    .bento-content.horizontal { flex-direction: column; align-items: flex-start; gap: 1rem; padding: 1.5rem; }
    .marquee-container { width: 100%; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 1rem;}
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-ml, .bento-data, .bento-prog, .bento-tools, .bento-libs {
        grid-column: span 1;
        grid-row: span 1;
    }
    .bento-ml { min-height: unset; }
    .bento-content { padding: 1.25rem; }
}
