/* --- CSS Variables & Global Styles --- */
:root {
    --bg-color: #0D1117;
    --primary-color: #161B22;
    --border-color: #30363D;
    --text-primary: #E6EDF3;
    --text-secondary: #8B949E;
    --accent-color: #22D3EE;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }

a {
    text-decoration: none;
    color: var(--accent-color);
    transition: color 0.3s ease;
}
a:hover {
    color: var(--text-primary);
}

img {
    max-width: 100%;
    display: block;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--primary-color); }
::-webkit-scrollbar-thumb { background: var(--accent-color); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #1cbac9; }


/* --- Header Section --- */
.header {
    text-align: center;
    margin-bottom: 40px;
}
.header h1 {
    margin-bottom: 4px;
}
.header .subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
}
.profile-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    outline: 3px solid var(--accent-color);
    object-fit: cover;
    margin: 0 auto 20px;
}
.profile-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}
.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--primary-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.action-btn:hover {
    background-color: #2a3038;
}
.action-btn i {
    font-size: 1.2rem;
}
.about-me {
    background-color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 10px;
    text-align: left;
}
.about-me h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: var(--accent-color);
}
.about-me p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* --- Stats & Info Section --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}
.stat-card {
    background-color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 10px;
}
.stat-card .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}
.stat-card .value {
    font-size: 1.1rem;
    font-weight: 600;
}
.dev-info {
    display: flex;
    justify-content: space-around;
    background-color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 50px;
}
.info-item {
    text-align: center;
    flex: 1;
}
.info-item .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.info-item .value {
    font-size: 1.1rem;
    font-weight: 500;
}

/* --- Common Section Styles --- */
section {
    margin-bottom: 50px;
}
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.section-title i {
    color: var(--accent-color);
}
.section-title--centered {
    justify-content: center;
}
.section-description {
    color: var(--text-secondary);
    margin-bottom: 25px;
    max-width: 600px;
}
#istri .section-description { /* Center description for this section */
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}


/* --- Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}
.skill-card {
    background-color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.skill-card i {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}
.skill-card h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}
.skill-level {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.skill-card .skill-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    object-fit: contain;
    /* This filter cleverly converts any icon color to the accent color */
    filter: invert(64%) sepia(57%) saturate(7490%) hue-rotate(156deg) brightness(97%) contrast(94%);
}

/* --- Projects Section --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.project-card {
    background-color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    display: flex;
    flex-direction: column;
}
.project-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 20px;
}
.project-tech {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tech-tag {
    background-color: rgba(34, 211, 238, 0.1);
    color: var(--accent-color);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}
.project-links {
    display: flex;
    gap: 15px;
    align-items: center;
}
.project-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.project-links a i {
    font-size: 1.2rem;
}

/* --- "My Istri" Section --- */
.istri-grid {
    display: grid;
    /* Default untuk HP: 1 kolom agar lebih besar */
    grid-template-columns: 2fr;
    gap: 20px;
}
.istri-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    /* Hapus baris ini */
    /* height: 350px; */ 
    
    /* Tambahkan baris ini */
    aspect-ratio: 1 / 1; /* Membuat rasio lebar:tinggi menjadi 1:1 */

    cursor: pointer;
}

.istri-card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ini akan memastikan gambar mengisi kotak tanpa distorsi */
    transition: transform 0.4s ease, filter 0.4s ease;
}
.istri-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 10%, transparent 80%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    opacity: 0; 
    transition: opacity 0.4s ease;
}
.istri-content {
    transform: translateY(20px);
    transition: transform 0.4s ease;
}
.istri-content h4 {
    font-size: 1.5rem;
}
.istri-content .subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 10px;
}
.istri-content p {
    font-size: 0.9rem;
    color: var(--text-primary);
}
.istri-card:hover img {
    filter: blur(4px) brightness(0.6);
    transform: scale(1.05);
}
.istri-card:hover .istri-overlay {
    opacity: 1;
}
.istri-card:hover .istri-content {
    transform: translateY(0);
}


/* --- Music & Anime Sections --- */
.spotify-player {
    background-color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
}
.anime-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.anime-card {
    background-color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.anime-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
.anime-card img {
    width: 100%;
    aspect-ratio: 16 / 10; 
    object-fit: cover;
}
.anime-details {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.anime-details h4 {
    flex-grow: 1;
}
.anime-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}
.anime-links a {
    font-weight: 500;
}
.anime-links .external-link i {
    font-size: 1.4rem;
}


/* --- Footer --- */
.main-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    text-align: center;
}
.footer-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-section {
    text-align: center;
}
.footer-section h4 {
    margin-bottom: 15px;
}
.quick-links {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.quick-links a {
    color: var(--text-secondary);
}
.quick-links a:hover {
    color: var(--accent-color);
}
.contact-email {
    display: block;
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-style: normal;
}
.contact-btn {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--bg-color);
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 600;
    transition: opacity 0.3s ease;
}
.contact-btn:hover {
    opacity: 0.9;
    color: var(--bg-color);
}
.copyright {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}


/* --- Responsive Design --- */
@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        gap: 20px;
    }

    .istri-grid {
        /* Ubah menjadi 2 kolom untuk tablet/layar yang lebih lebar */
        grid-template-columns: repeat(2, 2fr);
    }

    .footer-section {
        text-align: left;
        flex: 1;
    }
}