/* --- CSS VARIABLES & BASE SETUP --- */
:root {
    --bg-main: #0d0d0d;
    --bg-secondary: #141414;
    --text-primary: #f8f8f8;
    --text-secondary: #a1a1aa;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(20, 20, 20, 0.7);
    --hover-bg: rgba(255, 255, 255, 0.05);
    --accent: #ffffff;
}

body.light-mode {
    --bg-main: #f9fafb;
    --bg-secondary: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --hover-bg: rgba(0, 0, 0, 0.03);
    --accent: #000000;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-main); color: var(--text-primary);
    font-family: 'Inter', sans-serif; line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

/* --- TYPOGRAPHY --- */
.serif-italic { font-family: 'Playfair Display', serif; font-style: italic; font-weight: 400; }
.section-label {
    display: block; font-size: 0.75rem; letter-spacing: 0.15em;
    color: var(--text-secondary); text-transform: uppercase; margin-bottom: 1rem;
}

/* --- NAVBAR --- */
nav { position: fixed; top: 0; width: 100%; z-index: 100; transition: background 0.3s, backdrop-filter 0.3s; }
nav.scrolled { background: var(--glass-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-color); }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 2rem; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; color: var(--text-primary); text-decoration: none; }
.nav-links { list-style: none; display: flex; gap: 2rem; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.75rem; letter-spacing: 0.1em; transition: color 0.3s; }
.nav-links a:hover { color: var(--text-primary); }

/* --- GLOBAL SECTION --- */
.section { max-width: 1200px; margin: 0 auto; padding: 6rem 2rem; }
.center-header { text-align: center; margin-bottom: 4rem; }
.section-title { font-size: 2.5rem; line-height: 1.2; }

/* --- HERO SECTION --- */
.hero-section { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding-top: 8rem; }
.badge { border: 1px solid var(--border-color); padding: 0.4rem 1rem; border-radius: 4px; font-size: 0.7rem; letter-spacing: 0.1em; margin-bottom: 2rem; color: var(--text-secondary); }
.hero-title { font-size: 4.5rem; margin-bottom: 1.5rem; line-height: 1.1; }
.hero-subtitle { max-width: 600px; color: var(--text-secondary); margin-bottom: 3rem; }
.hero-subtitle strong { color: var(--text-primary); font-weight: 500; }
.cta-link { font-size: 0.8rem; letter-spacing: 0.1em; color: var(--text-primary); text-decoration: none; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; transition: 0.3s; }
.cta-link:hover { border-color: var(--text-primary); gap: 10px; }

/* --- SPLIT LAYOUT --- */
.split-layout { display: flex; gap: 4rem; }
.split-left { flex: 1; }
.split-right { flex: 1.5; }
.right-align { text-align: right; }
.timeline-item { margin-bottom: 3rem; border-top: 1px solid var(--border-color); padding-top: 2rem; }
.timeline-label { display: block; font-size: 0.7rem; letter-spacing: 0.1em; color: var(--text-secondary); margin-bottom: 1rem; }
.timeline-item h3 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.timeline-item .role { font-size: 0.8rem; letter-spacing: 0.05em; color: var(--text-secondary); }
.timeline-item .sub-role { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 1rem; }
.timeline-item .desc { color: var(--text-secondary); font-size: 0.95rem; }

/* --- BENTO GRID (Projects) --- */
.bento-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.project-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 4px; padding: 1.5rem; cursor: pointer; transition: transform 0.3s ease, border-color 0.3s; }
.project-card:hover { transform: translateY(-5px); border-color: var(--text-primary); }

/* Jika jumlah Proyek adalah 5 (ganjil), proyek terakhir akan membentang otomatis sepanjang 2 grid */
.project-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.img-wrapper { width: 100%; height: 300px; border-radius: 4px; overflow: hidden; margin-bottom: 1.5rem; background: var(--bg-main); }
.img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.project-card:hover .img-wrapper img { transform: scale(1.05); }
.glass-placeholder { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--bg-main), var(--bg-secondary)); }
.project-card h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.project-card p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1.5rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags span, .skill-tags span { border: 1px solid var(--border-color); padding: 0.3rem 0.8rem; font-size: 0.65rem; letter-spacing: 0.05em; border-radius: 2px; color: var(--text-secondary); }

/* --- SKILLS --- */
.skills-container { display: flex; gap: 4rem; border-top: 1px solid var(--border-color); padding-top: 4rem; }
.skills-col { flex: 1; }
.skills-col h4 { font-size: 0.75rem; letter-spacing: 0.1em; margin-bottom: 1.5rem; color: var(--text-secondary); }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* --- CONTACT --- */
.border-top { border-top: 1px solid var(--border-color); padding-top: 4rem; }
.contact-info { list-style: none; margin: 2rem 0; }
.contact-info li { display: flex; justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; }
.contact-info .lbl { color: var(--text-secondary); font-size: 0.75rem; letter-spacing: 0.1em; }
.contact-info a { color: var(--text-primary); text-decoration: none; }
.btn-primary { display: inline-block; background: var(--text-primary); color: var(--bg-main); padding: 0.8rem 1.5rem; text-decoration: none; font-size: 0.8rem; border-radius: 4px; font-weight: 500; transition: opacity 0.3s; }
.btn-primary:hover { opacity: 0.8; }
.social-links { list-style: none; font-size: 1.5rem; }
.social-links li { margin-bottom: 1rem; }
.social-links a { color: var(--text-primary); text-decoration: none; transition: opacity 0.3s;}
.social-links a:hover { opacity: 0.5; }
footer { text-align: center; margin-top: 6rem; font-size: 0.7rem; color: var(--text-secondary); letter-spacing: 0.1em; }

/* --- FLOATING THEME TOGGLE --- */
.floating-btn { position: fixed; bottom: 2rem; right: 2rem; width: 50px; height: 50px; border-radius: 50%; background: var(--text-primary); color: var(--bg-main); border: none; cursor: pointer; z-index: 90; font-size: 1.2rem; display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 15px rgba(0,0,0,0.3); transition: transform 0.3s; }
.floating-btn:hover { transform: scale(1.1); }

/* --- MODAL DETAIL PROJECT --- */
.modal { position: fixed; inset: 0; z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; display: flex; justify-content: center; align-items: center; }
.modal.active { opacity: 1; pointer-events: auto; }
.modal-overlay { position: absolute; inset: 0; background: var(--glass-bg); backdrop-filter: blur(15px); }
.modal-content { position: relative; width: 90%; max-width: 1200px; height: 90vh; background: var(--bg-main); border: 1px solid var(--border-color); border-radius: 8px; overflow-y: auto; padding: 3rem; z-index: 201; box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
.close-modal { position: absolute; top: 1.5rem; right: 1.5rem; background: transparent; border: none; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; transition: opacity 0.3s; }
.close-modal:hover { opacity: 0.5; }
.modal-body { display: flex; gap: 4rem; }
.modal-left { flex: 1; position: sticky; top: 0; }
.modal-right { flex: 1.5; }
#modal-title { font-size: 2.5rem; margin-bottom: 2rem; line-height: 1.1; }
.modal-meta { border-top: 1px solid var(--border-color); padding-top: 2rem; margin-bottom: 2rem; }
.meta-item { margin-bottom: 1.5rem; }
.meta-label { display: block; font-size: 0.65rem; color: var(--text-secondary); letter-spacing: 0.1em; margin-bottom: 0.5rem; }
.meta-item p { font-size: 0.9rem; }
.deliverables-list { list-style: none; font-size: 0.9rem; color: var(--text-secondary); }
.deliverables-list li::before { content: "- "; }
.modal-main-visual img { width: 100%; border-radius: 4px; border: 1px solid var(--border-color); margin-bottom: 2rem; }
.modal-links-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.modal-link-btn { border: 1px solid var(--border-color); padding: 0.8rem; text-align: center; text-decoration: none; color: var(--text-secondary); font-size: 0.75rem; border-radius: 4px; transition: 0.3s; }
.modal-link-btn:hover { border-color: var(--text-primary); color: var(--text-primary); }
.modal-description { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 3rem; }

/* --- GAYA UNTUK GALERI MODAL & THUMBNAIL --- */
.video-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }

.video-box {
    position: relative;
    background: var(--bg-secondary);
    height: 150px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.video-box:hover { border-color: var(--text-primary); transform: translateY(-3px); }

.video-box video, .video-box img {
    width: 100%; height: 100%; object-fit: cover;
    position: absolute; top: 0; left: 0; z-index: 1;
    transition: transform 0.5s ease;
}
.video-box:hover video, .video-box:hover img { transform: scale(1.05); }

.play-overlay {
    position: absolute; inset: 0; z-index: 2;
    display: flex; justify-content: center; align-items: center;
    background: rgba(0, 0, 0, 0.4); color: rgba(255, 255, 255, 0.8);
    font-size: 2.5rem; transition: all 0.3s;
}
.video-box:hover .play-overlay { background: rgba(0, 0, 0, 0.1); color: #ffffff; }

.gallery-img-box { position: relative; height: 150px; border-radius: 4px; overflow: hidden; border: 1px solid var(--border-color); cursor: pointer; }
.gallery-img-box img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-img-box:hover img { transform: scale(1.05); }

/* --- SCROLL FADE ANIMATION --- */
.fade-scroll { opacity: 0; transform: translateY(40px) scale(0.98); transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); will-change: opacity, transform; }
.fade-scroll.visible { opacity: 1; transform: translateY(0) scale(1); }

/* --- RESPONSIVE DESIGN & MOBILE FIXES --- */
@media (max-width: 1024px) {
    .split-layout, .modal-body { flex-direction: column; gap: 2rem; }
    .split-right.right-align { text-align: left; }
    .hero-title { font-size: 3.5rem; }
    .modal-left { position: relative; top: auto; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero-title { font-size: 2.5rem; }
    .section { padding: 4rem 1.5rem; }
    .bento-grid, .skills-container { grid-template-columns: 1fr; }
    
    /* Membatalkan lebar 2 column saat versi HP */
    .project-card:last-child:nth-child(odd) { grid-column: 1; }
    
    .modal-content { padding: 4rem 1.5rem 1.5rem; width: 95%; height: 95vh; }
    #modal-title { font-size: 1.8rem; margin-bottom: 1.5rem; }
    
    .close-modal {
        top: 0.8rem; right: 0.8rem; padding: 0.5rem 0.8rem;
        z-index: 9999; background: var(--bg-main);
        border: 1px solid var(--border-color); border-radius: 50%;
        box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    }

    .modal-meta { padding-top: 1.5rem; margin-bottom: 1.5rem; }
    .meta-item { margin-bottom: 1rem; }
    .modal-links-grid { grid-template-columns: 1fr; gap: 0.8rem; }
    .video-grid { grid-template-columns: 1fr; }
}

/* --- MEDIA LIGHTBOX (FULLSCREEN PREVIEW) --- */
.lightbox {
    position: fixed; inset: 0;
    z-index: 9999; 
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.lightbox.active {
    opacity: 1; pointer-events: auto;
}
.lightbox-content {
    position: relative;
    width: 90%; max-width: 1100px;
    max-height: 90vh;
    display: flex; justify-content: center; align-items: center;
}
.lightbox-content img,
.lightbox-content video,
.lightbox-content iframe {
    max-width: 100%; max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.1);
}
.lightbox-content iframe {
    width: 100%; aspect-ratio: 16/9; 
}
.close-lightbox {
    position: absolute; top: 1.5rem; right: 1.5rem;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    color: #fff; font-size: 1.5rem; width: 45px; height: 45px;
    border-radius: 50%; cursor: pointer; transition: 0.3s;
    z-index: 10000;
    display: flex; justify-content: center; align-items: center;
}
.close-lightbox:hover { background: rgba(255,255,255,0.3); transform: scale(1.1); }