/* ==========================================================================
   CSS VARIABLES (Theming System)
   ========================================================================== */
:root {
    /* LIGHT THEME (Minimal / High Contrast) */
    --bg-main: #ffffff;
    --bg-alt: #f8f9fa;
    --surface: #ffffff;
    --border: #e4e4e7;
    --text-main: #111111;
    --text-muted: #666666;
    --accent: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.05);
    --modal-overlay: rgba(17, 17, 17, 0.6);
    
    --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --transition: all 0.2s ease;
    --radius-sm: 4px;
    --radius-md: 8px;
}

[data-theme="dark"] {
    --bg-main: #0a0a0a;
    --bg-alt: #121212;
    --surface: #171717;
    --border: #262626;
    --text-main: #ededed;
    --text-muted: #888888;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.1);
    --modal-overlay: rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   LANGUAGE TOGGLE SYSTEM
   ========================================================================== */
html[lang="en"] .id-only { display: none !important; }
html[lang="id"] .en-only { display: none !important; }

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-ui);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s, color 0.3s;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.font-mono { font-family: var(--font-mono); font-size: 0.85em; letter-spacing: -0.02em; }
.container { max-width: 1024px; margin: 0 auto; padding: 0 2rem; }
.section { padding: 6rem 0; }
.alt-bg { background-color: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.text-center { text-align: center; }

/* Typography */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 600; color: var(--text-main); letter-spacing: -0.02em; }

/* ==========================================================================
   COMPONENTS
   ========================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.75rem 1.5rem; font-weight: 500; font-size: 0.95rem;
    border-radius: var(--radius-sm); transition: var(--transition);
}
.btn-primary { background-color: var(--text-main); color: var(--bg-main); }
.btn-primary:hover { opacity: 0.85; }
.icon-btn { color: var(--text-muted); padding: 0.5rem; border-radius: var(--radius-sm); transition: var(--transition); }
.icon-btn:hover { color: var(--text-main); background-color: var(--surface); }

[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }

/* ==========================================================================
   LAYOUT: NAVBAR
   ========================================================================== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    height: 70px; background-color: rgba(var(--bg-main), 0.8);
    backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
    z-index: 1000;
}
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.brand { display: flex; align-items: center; }
.brand-logo { height: 24px; width: auto; transition: filter 0.3s ease; }
[data-theme="dark"] .brand-logo { filter: invert(1) brightness(2); }
.nav-links { display: flex; gap: 2rem; }
.nav-links a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; transition: var(--transition); }
.nav-links a:hover, .nav-links a.active { color: var(--text-main); }
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.mobile-only { display: none; }

/* ==========================================================================
   LAYOUT: HERO
   ========================================================================== */
.hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 85vh;
    padding-top: 150px;
}

.hero-content {
    max-width: 800px;
}

.hero-name {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.03em;
}

.hero-role {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.role-text {
    display: inline-block;
}
.cursor {
    font-weight: 300;
    color: var(--accent);
    animation: blink 1s step-end infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-bio {
    color: var(--text-main);
    font-size: 1.1rem;
    max-width: 720px;
    margin-bottom: 2.5rem;
    line-height: 1.7;
    opacity: 0.9;
}

.hero-skills-group { margin-bottom: 3rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.skill-tag {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.hero-footer-actions { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.hero-socials { display: flex; gap: 1.25rem; }
.social-icon-link { color: var(--text-muted); transition: var(--transition); }
.social-icon-link:hover { color: var(--text-main); }
.hero-btns { display: flex; gap: 1rem; }
.btn-ref {
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}
.btn-filled { background-color: var(--text-main); color: var(--bg-main); }
.btn-filled:hover { opacity: 0.85; }
.btn-outline { border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { background-color: var(--surface); }

@media (max-width: 900px) {
    .hero { text-align: left; padding-top: 100px; justify-content: flex-start; }
}

.hero-status-group {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.availability-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background-color: var(--accent-glow);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--accent);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981; /* Warna hijau emerald */
    border-radius: 50%;
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background-color: #10b981;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { transform: scale(1); opacity: 0.8; }
    70% { transform: scale(2.5); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

.location-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section-header { margin-bottom: 3rem; max-width: 640px; }
.section-title { font-size: 1.8rem; margin-bottom: 0.5rem; }
.section-subtitle { color: var(--text-muted); font-size: 0.95rem; }

/* Expertise Grid */
.expertise-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.expertise-card { padding: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius-md); background-color: var(--surface); }
.expertise-card h3 { font-size: 1.05rem; margin-bottom: 0.5rem; color: var(--text-main); }
.expertise-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; line-height: 1.5; }
.tech-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tech-tags span { background-color: var(--bg-alt); padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; color: var(--text-muted); border: 1px solid var(--border); }

/* Timeline */
.timeline { position: relative; padding-left: 2rem; border-left: 1px solid var(--border); max-width: 768px; margin: 0 auto; }
.timeline-item { position: relative; margin-bottom: 3rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot { position: absolute; left: -2.35rem; top: 0.35rem; width: 10px; height: 10px; border-radius: 50%; background-color: var(--border); border: 2px solid var(--bg-main); }
.timeline-date { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 0.5rem; }
.timeline-content .role { font-size: 1.15rem; margin-bottom: 0.2rem; }
.timeline-content .company { color: var(--text-muted); font-weight: 500; font-size: 0.9rem; margin-bottom: 1rem; }
.contributions li { position: relative; padding-left: 1rem; margin-bottom: 0.6rem; color: var(--text-main); font-size: 0.95rem; opacity: 0.9; }
.contributions li::before { content: "—"; position: absolute; left: 0; color: var(--text-muted); }

.hidden-exp-wrapper {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.hidden-exp-wrapper.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Approach List */
.about-layout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.about-main-text .hero-desc { margin-bottom: 1.5rem; font-size: 1rem; color: var(--text-main); opacity: 0.9; }
.approach-list { display: flex; flex-direction: column; gap: 2rem; }
.approach-item { display: flex; gap: 1rem; }
.approach-number { color: var(--text-muted); font-size: 1rem; font-weight: 500; padding-top: 0.1rem; }
.approach-text h3 { margin-bottom: 0.5rem; font-size: 1rem; }
.approach-text p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }

@media (max-width: 768px) {
    .about-layout-grid { grid-template-columns: 1fr; gap: 3rem; }
}

/* ==========================================================================
   PROJECTS
   ========================================================================== */
.header-with-filter { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 2.5rem; }
.project-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-btn { padding: 0.3rem 0.8rem; border: 1px solid transparent; border-radius: 20px; color: var(--text-muted); background: transparent; transition: var(--transition); font-size: 0.8rem; }
.filter-btn:hover, .filter-btn.active { color: var(--text-main); border-color: var(--border); background-color: var(--surface); }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; transition: opacity 0.2s ease; }
.project-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-md); background-color: var(--surface); overflow: hidden; animation: fadeInCard 0.4s ease forwards; opacity: 0; transform: translateY(10px); }

@keyframes fadeInCard {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.project-card-content { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }

.project-preview { width: 100%; height: 160px; background-color: var(--bg-alt); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.confidential-preview { flex-direction: column; gap: 0.5rem; color: var(--text-muted); opacity: 0.6; }
.confidential-preview span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; }
.image-fallback { width: 100%; height: 100%; background-image: radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0); background-size: 16px 16px; opacity: 0.5; }

.project-top-row { margin-bottom: 0.75rem; }
.project-category { color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; }
.project-title { font-size: 1.1rem; margin-bottom: 0.5rem; }
.project-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; flex-grow: 1; line-height: 1.5; }
.project-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; border-top: 1px solid var(--border); padding-top: 1rem; }
.project-tech { display: flex; gap: 0.5rem; flex-wrap: wrap;}
.project-tech span { font-size: 0.75rem; color: var(--text-muted); background: var(--bg-alt); padding: 0.2rem 0.4rem; border-radius: 4px; border: 1px solid var(--border); white-space: nowrap; }
.view-btn { font-size: 0.75rem; color: var(--text-main); font-weight: 500; transition: opacity 0.2s; }
.view-btn:hover { opacity: 0.7; }

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 2000; display: flex; align-items: center; justify-content: center; visibility: hidden; opacity: 0; transition: var(--transition); }
.modal[aria-hidden="false"] { visibility: visible; opacity: 1; }
.modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--modal-overlay); backdrop-filter: blur(4px); }
.modal-content { position: relative; background-color: var(--bg-main); width: 90%; max-width: 640px; max-height: 85vh; overflow-y: auto; border-radius: var(--radius-md); border: 1px solid var(--border); transform: translateY(10px); transition: transform 0.3s ease; }
.modal[aria-hidden="false"] .modal-content { transform: translateY(0); }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: var(--surface); border: 1px solid var(--border); z-index: 10; border-radius: var(--radius-sm); }
.modal-body { padding: 2.5rem 2rem; }

.cs-confidential { display: inline-block; font-size: 0.7rem; color: var(--text-muted); border: 1px solid var(--border); padding: 0.2rem 0.5rem; border-radius: 4px; margin-bottom: 1.5rem; }
.cs-title { font-size: 1.5rem; margin-bottom: 2rem; }
.cs-section { margin-bottom: 1.5rem; }
.cs-section h4 { font-size: 0.85rem; font-family: var(--font-mono); color: var(--text-muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }
.cs-section p { color: var(--text-main); font-size: 0.95rem; line-height: 1.6; opacity: 0.9; }
.cs-list li { position: relative; padding-left: 1rem; margin-bottom: 0.5rem; color: var(--text-main); font-size: 0.95rem; opacity: 0.9; }
.cs-list li::before { content: "—"; position: absolute; left: 0; color: var(--text-muted); }
.cs-tech { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.cs-tech span { padding: 0.2rem 0.6rem; background-color: var(--bg-alt); border: 1px solid var(--border); border-radius: 4px; font-size: 0.8rem; color: var(--text-muted); }

/* ==========================================================================
   FOOTER & UTILS
   ========================================================================== */
footer { border-top: 1px solid var(--border); padding: 2rem 0; text-align: center; }
.footer-content { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.8rem; color: var(--text-muted); }
.contact-desc { max-width: 480px; margin: 0 auto 2rem auto; color: var(--text-muted); font-size: 0.95rem; }

.contact-email-wrapper { display: inline-flex; align-items: center; justify-content: space-between; background-color: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.5rem 0.5rem 0.5rem 1.5rem; gap: 2rem; max-width: 100%; flex-wrap: wrap; margin: 0 auto; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); }
.email-display { color: var(--text-main); font-size: 0.95rem; }
.contact-action-group { display: flex; gap: 0.5rem; }
.contact-action-group .btn { padding: 0.6rem 1rem; font-size: 0.85rem; gap: 0.4rem; }

.reveal { opacity: 0; transform: translateY(15px); transition: opacity 0.5s ease-out, transform 0.5s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    /* --- KODE BAWAAN ANDA (YANG SUDAH OKE) --- */
    .nav-links, .nav-cta { display: none; }
    .mobile-only { display: block; }
    .nav-links.nav-active {
        display: flex; flex-direction: column; position: absolute; top: 70px; left: 0; right: 0;
        background-color: var(--surface); padding: 1.5rem; border-bottom: 1px solid var(--border);
    }
    .section { padding: 1.5rem 0; }
    .modal-body { padding: 1.5rem; }
    .cs-title { font-size: 1.25rem; }
    
    .contact-email-wrapper { flex-direction: column; padding: 1rem; gap: 1rem; text-align: center; width: 100%; }
    .contact-action-group { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }


    /* --- TAMBAHAN PERBAIKAN TAMPILAN MOBILE --- */
    
    /* 1. Cegah layar bisa digeser ke kanan (overflow) & sesuaikan jarak margin layar */
    body { overflow-x: hidden; }
    .container { 
        padding-left: 1.5rem; 
        padding-right: 1.5rem; 
        width: 100%;
    }

    /* 2. Jarak aman Hero agar tidak terlalu nempel Navbar */
    .hero { 
        padding-top: 90px; 
    }

    /* 3. Merapikan tombol "Explore Projects" & "Download CV" agar memanjang rapi */
    .hero-footer-actions { 
        display: flex; flex-direction: column; align-items: flex-start; gap: 1.5rem; width: 100%; 
    }
    .hero-btns { 
        display: flex; flex-direction: column; width: 100%; gap: 0.8rem; 
    }
    .btn-ref { 
        width: 100%; justify-content: center; 
    }

    /* 4. Mengecilkan sedikit Skill Tags agar tidak makan tempat */
    .hero-skills-group { margin-bottom: 2rem; }
    .skill-tags { gap: 0.5rem; }
    .skill-tag { font-size: 0.75rem; padding: 0.4rem 0.8rem; }
    .hero-socials { display: flex; gap: 1.5rem; padding-top: 0.5rem; }

    /* 5. Memperbaiki titik Timeline Pengalaman agar pas di garis */
    .timeline { padding-left: 1.25rem; margin-left: 0.5rem; }
    .timeline-dot { left: calc(-1.25rem - 6.5px); }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1; transform: none; }
}
