/* === 1. TEMA & RESET === */
:root {
    --bg: #ffffff; --box-bg: #ffffff; 
    --text: #000000; --border: #000000; --shadow: #000000;
    --brown: #8B4513; --red: #C62828;  
}
body[data-theme="dark"] {
    --bg: #121212; --box-bg: #1e1e1e; 
    --text: #FFFFF0; --border: #FFFFF0; --shadow: #FFFFF0;
}
* { 
    margin: 0; padding: 0; box-sizing: border-box; 
    font-family: 'Space Grotesk', sans-serif; 
}
h1, h2, h3, .logo-box, .section-title-box, .footer-credit { 
    font-family: 'Zilla Slab', serif; font-weight: 700; 
}
a { text-decoration: none !important; } /* Membunuh garis bawah bawaan browser di seluruh link */

/* === 2. BODY & KUNCI SINGLE SCREEN (TANPA SCROLL) === */
body {
    background-color: var(--bg); color: var(--text);
    transition: background-color 0.3s, color 0.3s;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><path d='M10,4 A6,6 0 1,1 4,10 A6,6 0 1,1 10,4 M10,11 L22,23' stroke='%23C62828' stroke-width='3' fill='none'/><circle cx='22' cy='23' r='3' fill='%23C62828'/></svg>") 0 0, auto;
    
    height: 100dvh; max-height: 100dvh; overflow: hidden; 
    display: flex; flex-direction: column; justify-content: space-between;
}

body::before, body::after {
    content: ''; position: fixed; inset: 0;
    background-size: cover; background-position: center; background-repeat: no-repeat;
    pointer-events: none; transition: opacity 0.5s ease-in-out;
}
body::before { background-image: url('bgl.svg'); z-index: -2; opacity: 0.4; } 
body::after { background-image: url('bgn.svg'); z-index: -1; opacity: 0; }
body[data-theme="dark"]::before { opacity: 0; }
body[data-theme="dark"]::after { opacity: 0.2; } 

/* === 3. GAYA UI NEOBRUTALISM === */
.neo-box { border: 3px solid var(--border); box-shadow: 5px 5px 0px var(--shadow); background: var(--box-bg); padding: 1.5vh 2vw; }
.neo-btn {
    border: 3px solid var(--border); box-shadow: 3px 3px 0px var(--shadow);
    background: var(--box-bg); color: var(--text); font-weight: 700;
    cursor: pointer; transition: all 0.15s ease;
}
.neo-btn:active { box-shadow: 0 0 0 transparent; transform: translate(3px, 3px); }

/* === 4. NAVBAR (DESKTOP) === */
.navbar-section { 
    flex: 0 0 auto; 
    width: calc(100% - 4vw); max-width: 1200px; margin: 2vh auto 0; z-index: 100; padding: 1vh 2vw; 
}
.navbar { display: flex; justify-content: space-between; align-items: center; }

.navbar-logo { 
    height: 140px; 
    width: auto; display: block;
    filter: drop-shadow(0px 10px 15px rgba(0,0,0,0.15)); 
    transition: transform 0.4s; 
}
.navbar-logo:hover { transform: scale(1.05); }

.nav-right-container { display: flex; align-items: center; gap: 2vw; }
.nav-actions { display: flex; align-items: center; gap: 1vw; }

.theme-toggle-navbar { background: transparent; border: none; font-size: clamp(1.2rem, 3vh, 1.8rem); cursor: pointer; transition: transform 0.2s; }
.theme-toggle-navbar:hover { transform: scale(1.15) rotate(15deg); }

.nav-links { display: flex; gap: 1vw; }
.nav-links a {
    color: var(--text); font-weight: 700; font-size: clamp(0.85rem, 2vh, 1.05rem);
    padding: 0.8vh 1.5vw; border: 3px solid var(--border); background: var(--box-bg);
    box-shadow: 3px 3px 0px var(--shadow); transition: 0.1s;
}
.nav-links a:hover { background: var(--brown); color: #fff; }
.cv-highlight { border-color: var(--red) !important; box-shadow: 3px 3px 0px var(--red) !important; }
.hamburger-btn { display: none; }

/* === 5. KONTEN TENGAH (DESKTOP) === */
.container {
    flex: 1; display: flex; flex-direction: column; gap: 2.5vh;
    padding: 2vh 4vw; max-width: 1200px; margin: 0 auto; width: 100%; justify-content: center;
    min-height: 0; 
}

.profile-intro-box { 
    display: flex; align-items: center; justify-content: flex-start;
    gap: 60px; padding: 35px 50px; 
    flex: 1 1 0; min-height: 0;
}
.profile-img-container { flex-shrink: 0; }
.profile-img { 
    height: 380px; max-height: 100%; width: auto; display: block; object-fit: contain;
    filter: drop-shadow(0px 15px 30px rgba(0,0,0,0.25)); transition: transform 0.5s; 
}
.profile-img:hover { transform: scale(1.03) translateY(-5px); }

.intro-text { flex: 1; text-align: left; max-width: 650px; overflow-y: auto; }
.intro-text h2 { margin-bottom: 1vh; font-size: clamp(1.4rem, 3vh, 1.8rem); }
.intro-text p { font-size: clamp(0.9rem, 2vh, 1.1rem); line-height: 1.5; margin-bottom: 2vh; }

.cv-profile-btn { display: inline-block; padding: 12px 24px; font-size: 1.05rem; border-color: var(--red); box-shadow: 4px 4px 0px var(--red); margin-top: 15px;}
.cv-profile-btn:hover { background: var(--red) !important; color: #fff; }

/* === 6. BOUNTY BOARD GRID (DESKTOP) === */
.links-section { flex: 0 0 auto; display: flex; flex-direction: column; gap: 1.5vh; }
.section-title-box { text-align: center; padding: 12px; font-size: 1.2rem; letter-spacing: 1px; margin: 0; }
.projects-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.project-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 25px 20px; text-align: center; gap: 10px;
}
.card-icon { font-size: 2.5rem; }
.project-card h3 { font-size: 1.15rem; color: var(--text); }

.cta-card { background-color: var(--text) !important; color: var(--box-bg) !important; }
.cta-card h3, .cta-card .card-icon { color: var(--box-bg) !important; }
.project-card:hover { background: var(--red) !important; transform: translateY(-3px); box-shadow: 5px 5px 0px var(--shadow); }
.project-card:hover h3, .project-card:hover .card-icon { color: #fff !important; }

/* === 7. FOOTER (DESKTOP) === */
.footer-section { 
    flex: 0 0 auto; 
    width: calc(100% - 4vw); max-width: 1200px; margin: 0 auto 20px; 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 15px 30px; 
}
.footer-credit { font-size: 1.05rem; }
.footer-socials { display: flex; gap: 12px; }
.footer-btn { padding: 10px 18px; font-size: 0.95rem; }
.footer-btn:hover { background: var(--red) !important; color: #fff; }

/* === 8. 📱 LAYOUT SMARTPHONE ADAPTIF (FINAL FIX) 📱 === */
@media screen and (max-width: 768px) {
    body { height: 100dvh; max-height: 100dvh; overflow: hidden !important; }

    /* 🚀 Navbar Dipindah Ke Atas Permanen */
    /* 🚀 Navbar Mobile Diperbaiki (Lebih Rapi & Proporsional) */
    .navbar-section { 
        position: fixed; top: 1.5vh; bottom: auto; left: 2vw; right: 2vw; 
        width: 96vw; margin: 0; 
        padding: 1.2vh 4vw !important; /* Ruang napas ekstra di kiri-kanan */
        z-index: 1000; 
        height: auto; /* Membiarkan tinggi menyesuaikan isi agar tidak gepeng */
        display: block; /* Mengembalikan kendali layout ke .navbar di dalamnya */
    }
    
    .navbar { 
        display: flex; justify-content: space-between; align-items: center; width: 100%; 
    }
    
    .navbar-logo { 
        height: 40px; /* Ukuran dikunci statis agar logo tetap tegak dan jelas */
        min-height: auto;
        filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.15));
    }
    
    /* Area Kanan (Mode & Menu) */
    .nav-actions { 
        display: flex; align-items: center; gap: 4vw; /* Jarak ideal dan seimbang */
    }
    
    .theme-toggle-navbar { 
        font-size: 1.5rem; /* Diperbesar sedikit agar mudah diklik */
        display: flex; align-items: center; justify-content: center;
    }
    
    /* Tombol Menu (Kotak Presisi Neobrutalism) */
    .hamburger-btn { 
        display: flex; flex-direction: column; justify-content: space-between; 
        width: 38px; height: 38px; /* Rasio kotak sempurna 1:1 */
        padding: 8px 6px; 
        background: var(--box-bg); border: 2px solid var(--border); 
        box-shadow: 2px 2px 0px var(--shadow); /* Tambahan shadow mikro agar tombol terasa timbul */
    }
    .hamburger-btn span { 
        width: 100%; height: 3px; background: var(--text); border-radius: 2px; 
    }
    
    /* Laci Menu turun dari atas */
    .nav-links {
        display: none !important; position: absolute; top: 7.5vh; bottom: auto; right: 0; width: 100%;
        flex-direction: column; background: var(--box-bg); border: 3px solid var(--border) !important;
        box-shadow: 4px 4px 0px var(--shadow) !important; padding: 8px; gap: 4px;
    }
    .nav-links.show { display: flex !important; }
    .nav-links a { 
        border: none; box-shadow: none; border-bottom: none !important; /* Hilangkan garis bawah pemisah */
        text-align: center; padding: 1vh 0; font-size: 0.9rem; 
    }
    
    /* 🚀 Container didorong ke bawah agar tidak tertutup Navbar Atas */
    .container { 
        padding: 1vh 4vw; gap: 1.5vh; margin-top: 9.5vh; margin-bottom: 0;
        justify-content: flex-start; min-height: 0;
    }
    
    /* Profil (Mobile: Vertikal, PP Atas - Teks Bawah) */
    .profile-intro-box { 
        flex: 1.2; flex-direction: column; padding: 2vh 4vw; gap: 1vh; 
        align-items: center; justify-content: center; text-align: center; min-height: 0;
    }
    .profile-img-container { flex: 0 0 auto; display: flex; justify-content: center; align-items: center; }
    .profile-img { 
        height: 14vh; width: auto; max-height: 110px; object-fit: contain; 
        filter: drop-shadow(0px 8px 16px rgba(0,0,0,0.15));
    }
    
    .intro-text { text-align: center; width: 100%; }
    .intro-text h2 { font-size: 1.25rem; margin-bottom: 0.4vh; }
    .intro-text p { 
        font-size: 0.82rem; margin-bottom: 1vh; line-height: 1.35; 
        display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; 
    }
    .cv-profile-btn { padding: 0.8vh 4vw; font-size: 0.8rem; margin-top: 0.5vh; }
    
    /* Grid 2x2 Folder Sempurna */
    .links-section { flex: 1; gap: 1vh; min-height: 0; }
    .section-title-box { padding: 0.6vh; font-size: 0.95rem; }
    .projects-grid { 
        flex: 1; display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); 
        gap: 1.2vh 3vw; min-height: 0;
    }
    .project-card { padding: 1vh; gap: 0.5vh; height: 100%; }
    .card-icon { font-size: 1.8rem; }
    .project-card h3 { font-size: 0.85rem; line-height: 1.2; }
    
    /* Footer Kembali Normal di Bawah */
    .footer-section { 
        flex: 0 0 auto; width: calc(100% - 6vw); flex-direction: column; 
        padding: 1vh; margin: 0 auto 1.5vh auto; gap: 0.8vh; text-align: center;
    }
    .footer-credit { display: none; } 
    .footer-socials { width: 100%; justify-content: space-between; gap: 2vw; }
    .footer-btn { padding: 0.8vh 0; font-size: 0.78rem; flex: 1; text-align: center; }
}