/* ========================================= */
/* CSS KHUSUS UNTUK HALAMAN TALENT/STATS     */
/* ========================================= */

/* .section-title / .section-subtitle ada di base.css */

.talent-section {
    text-align: center;
    padding-top: var(--space-4);
}

/* --- Grid System untuk Widget --- */
.stats-grid {
    display: grid;
    /* min() mencegah track lebih lebar dari viewport 320px */
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: var(--space-6);
    align-items: center;
}

/* --- Container untuk masing-masing API --- */
.stat-card {
    padding: var(--space-6);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Menahan tinggi supaya permintaan pihak ketiga yang lambat
       tidak membuat grid melompat */
    min-height: 200px;
}

/* --- Styling Gambar API --- */
.stat-card a {
    display: block;
    width: 100%;
    transition: transform var(--dur-base) ease;
}

.stat-card img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

@media (hover: hover) and (pointer: fine) {
    .stat-card a:hover {
        transform: scale(1.03);
    }

    .project-card:hover .project-arrow {
        transform: translateX(4px);
    }
}

/* ========================================= */
/* FEATURED PROJECTS                         */
/* ========================================= */
.projects-section {
    text-align: center;
    margin-top: var(--space-12);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: var(--space-6);
    text-align: left;
}

.project-card {
    padding: var(--space-6);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    text-decoration: none;
    color: inherit;
}

.project-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
}

.project-name {
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--text-main);
}

.project-lang {
    font-size: 0.75rem;
    font-weight: 600;
    padding: var(--space-1) 0.7rem;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.lang-javascript {
    color: #8a6d00;
    background: rgb(240 219 79 / .25);
}

.lang-python {
    color: var(--primary-hover);
    background: var(--primary-a12);
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    flex-grow: 1;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-2);
    min-height: 1.5rem;
    /* baris selalu dipesan */
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.project-stars {
    color: var(--accent-energy);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Angka dari GitHub API: lebar dikunci agar 33 -> 1 tidak
   menggeser tata letak kartu */
.project-meta .num {
    display: inline-block;
    min-inline-size: 2ch;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* Selama data masih diambil, angka fallback diredupkan */
.project-card[aria-busy="true"] .project-stars {
    opacity: 0.55;
}

.project-arrow {
    color: var(--text-link);
    font-size: 1.2rem;
    transition: transform var(--dur-base) ease;
}

/* --- Responsive untuk Layar HP --- */
@media (max-width: 767px) {

    .stats-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: var(--space-4);
    }

    .projects-section {
        margin-top: var(--space-10);
    }
}