/* Variabel Warna */
:root {
    /* 1. Base: Biru-abu sangat muda (dingin, seperti baja) */
    --bg-white: #f8fafc; 
    
    /* 2. Card: Sedikit lebih gelap (memberi kesan panel solid) */
    --card-bg: #e2e8f0; 
    
    /* 3. Text: Navy-Teal sangat gelap (tegas & tajam) */
    --text-main: #181818; 
    --text-muted: #475569; 
    
    /* 4. Border: Steel-Teal (netral) */
    --border-color: #cbd5e1; 
    
    /* 5. Accent: Petrol Green (Biru-Ijo yang sangat maskulin & teknis) */
    --accent-color: #0f766e; 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Space Grotesk', sans-serif;
}

body {
    background-color: var(--bg-white);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navbar */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 10%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(241, 245, 249, 0.85); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -1px;
    color: var(--text-main);
    text-decoration: none;
}

/* Gaya khusus untuk simbol R lingkaran (Registered) */
.logo .registered-mark {
    font-size: 1em; 
    font-weight: 650;
    margin-left: -1px; 
    color: var(--tech-accent); 
    position: relative;
    top: -0.1em; 
    vertical-align: baseline;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 30px;
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Gaya menu navigasi yang sedang aktif */
.nav-links a.active-link {
    color: var(--accent-color);
    font-weight: 700;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 2px;
}

/* Global Section Padding */
.section-padding {
    padding: 120px 10%;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-main);
}

.section-title span {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 15px 40px;
    
    /* ANIMASI SWEEP KIRI KE KANAN */
    background: linear-gradient(to right, transparent 50%, var(--accent-color) 50%);
    background-size: 200% 100%;
    background-position: 100% 0; /* Tombol dimulai dari bagian hitam (Kanan) */
    
    color: #ffffff;
    border: 2px solid var(--accent-color);
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.5s ease-out; /* Durasi animasi diatur ke 0.5 detik agar geserannya terlihat mulus */
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
}

.btn:hover {
    background-position: 0 0; /* Saat di-hover, warna digeser ke bagian transparan/putih (Kiri) */
    color: var(--accent-color); /* Warna teks berubah menjadi accent saat di-hover */
}

.btn-outline {
    background: var(--bg-white); 
    background-image: none;
    border-color: var(--border-color);
    color: var(--text-main);
    margin-left: 15px;
}

.btn-outline:hover {
    background: var(--bg-white); /* Pastikan tetap putih saat di-hover */
    background-image: none; 
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* Efek Background Skematik/PCB di sebelah kanan */
.hero::after {
    content: "";
    position: absolute;
    right: 0;
    width: 60%; 
    height: 100%;

    background-image: url('../img/bg arduino.png'); 
    background-size: 500px;
    
    background-position: right 30% center;
    background-repeat: no-repeat;
    
    opacity: 0.5;
    z-index: -1; 
    
    /* Efek fade-out (memudar) ke arah kiri */
    mask-image: linear-gradient(to right, transparent 0%, black 70%);
}

.hero h1 {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 20px;
}

.hero h1 span {
    color: var(--text-muted);
}

.hero-subtitle {
    font-size: 3.5rem;
    font-weight: 600;
    letter-spacing: -1px;
    color: var(--accent-color);
    margin-top: -25px;
    margin-bottom: 0px;
}

.hero-buttons {
    display: flex;
    align-items: center;
}

/* Warna abu-abu untuk baris kedua nama */
.text-grey {
    color: var(--text-muted);
}

/* Penyesuaian jarak deskripsi */
.hero-desc {
    font-size: 1.2rem;
    max-width: 600px;
    color: var(--text-muted);
    margin-bottom: 25px; 
}

/* Social Media Global (Digabung untuk Hero & Contact) */
.hero-socials {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.contact-socials {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.hero-socials a,
.contact-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: var(--bg-white); 
    color: var(--text-muted); 
    border: 1px solid var(--border-color);
    border-radius: 50%;
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.hero-socials a:hover,
.contact-socials a:hover {
    background-color: var(--accent-color); 
    color: #ffffff; 
    border-color: var(--accent-color);
    transform: translateY(-3px); 
}

/* Cards & Elements */
.card, .stat-box, .contact-box, .timeline-content {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.card:hover, .stat-box:hover, .timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.04); 
}

.card h3, .stat-box h3, .contact-box h2, .timeline-content h3 {
    color: var(--text-main);
    margin-bottom: 2px;
}

.timeline-content h3 {
    margin-top: 8px;
    margin-bottom: 2px;
}

.card p, .stat-box p, .contact-box p, .timeline-content p {
    color: var(--text-muted);
}

.card-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}
/* About Section */
.about-content {
    display: flex;
    gap: 50px;
    align-items: center;
}

.about-image {
    flex-shrink: 0;
    width: 300px; /* Ukuran disesuaikan sedikit agar pas bulatnya */
    height: 300px;
    border-radius: 50%; /* KUNCI 1: Membuat jadi bulat sempurna */
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1); /* Bayangan sedikit lebih tegas */
    transition: border-color 0.3s ease; /* Transisi warna bingkai saat hover */
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* transition: transform 0.8s ease-in-out; */ /* Ganti transisi sebelumnya dengan ini agar putarannya lebih 'smooth' */
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); /* Efek membal sedikit di akhir putaran */
}

.about-image img:hover {
    /* KUNCI 2: Gabungkan sedikit zoom dan putaran (e.g., 3 derajat) */
    transform: scale(1.1) rotate(3deg); 
}

.about-text p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* SKILLS SECTION STYLES */
.skills-wrapper {
    margin-top: 30px;
}

.subsection-title {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text-main);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.skill-card h4 {
    font-size: 1.25rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-tag {
    background-color: var(--bg-white);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: default;
}

.skill-tag:hover {
    background-color: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.tech-icon {
    color: var(--text-main);
    font-size: 1.4rem;
}

/* Experience Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 30px;
    border-left: 2px dashed var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-dot {
    position: absolute;
    left: -37px;
    top: 20px;
    width: 14px;
    height: 14px;
    background-color: var(--accent-color);
    border-radius: 50%;
    border: 3px solid var(--bg-white);
}

.timeline-content {
    padding: 20px;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: -5px;
    flex-wrap: wrap;
    gap: 10px;
}

.exp-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    padding: 5px 15px;
    border-radius: 20px;
    background: var(--bg-white);
}

.company {
    color: var(--text-main) !important;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 5px !important;
    font-size: 1.1rem;
}

/* Projects */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card-tag {
    font-size: 0.8rem;
    color: var(--text-main);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: inline-block;
    font-weight: 600;
}

/* ========================================= */
/* DESAIN FORMULIR KONTAK (TEMA TERANG)      */
/* ========================================= */
.contact-container {
    width: 100%;
    max-width: 500px; /* Menjaga form agar tetap padat dan rapi di tengah */
    margin: 0 auto; /* Memaksa kotak berada di tengah */
    text-align: center;
}

.contact-container h2 {
    font-size: 2rem; /* Diperkecil dari 2.5rem agar setara dengan judul section lain */
    margin-bottom: 0px;
    color: var(--text-color, #1e293b); 
}

.contact-desc {
    font-size: 1rem; 
    color: #64748b; 
    margin-top: 0 !important; /* KUNCI UTAMA: Hapus jarak bawaan dari atas paragraf */
    margin-bottom: 10px;
    line-height: 1.5;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px; 
}

/* Kolom Input & Pesan */
.contact-form input,
.contact-form textarea {
    width: 100%;
    background-color: #ffffff; 
    border: 1px solid #cbd5e1; 
    border-radius: 12px;
    padding: 16px 20px;
    color: #1e293b; 
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    resize: none;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #94a3b8; 
}

/* Efek menyala saat diketik */
.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent-color, #157362); 
    box-shadow: 0 0 0 3px rgba(21, 115, 98, 0.15); 
}

/* Desain Tombol Kirim */
.contact-form button {
    width: 100%;
    background-color: var(--accent-color, #157362); 
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.contact-form button:hover {
    filter: brightness(0.9); /* Tombol sedikit lebih gelap saat disentuh */
    transform: translateY(-3px);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* SINGLE PAGE APPLICATION (SPA) STYLES */
main {
    min-height: 100vh;
}

.page-section {
    display: none;
    animation: fadeInPage 0.4s ease-out forwards;
}

.page-section.active {
    display: block;
}

@keyframes fadeInPage {
    0% { 
        opacity: 0; 
        transform: translateY(15px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* ========================================================
   RESPONSIVE DESIGN (MEDIA QUERIES) - FIXED & OPTIMIZED
   ======================================================== */
/* Gaya Dasar Hamburger (Sembunyi di Desktop) */
.hamburger {
    display: none; 
    cursor: pointer;
    z-index: 1001;
}

/* Bentuk 3 Garis Hamburger */
.hamburger .bar {
    display: block;
    width: 26px;
    height: 2px; /* <--- Diubah ke angka genap agar ketebalannya konsisten */
    margin: 6px auto;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: all 0.4s ease-in-out;
}

/* Animasi saat diklik menyilang jadi X */
.hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg); /* <--- Disesuaikan menjadi 8px */
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0; /* Garis tengah hilang */
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg); /* <--- Disesuaikan menjadi -8px */
}

/* 1. Layar Tablet & Laptop Kecil (Maksimal Lebar: 1024px) */
@media (max-width: 1024px) {
    .section-padding { 
        padding: 100px 6%; /* Sedikit merapatkan sisi kanan-kiri */
    }
    .hero h1 { 
        font-size: 4rem; 
    }
    .hero-subtitle { 
        font-size: 2.8rem; 
    }
    .section-title {
        font-size: 2.6rem;
    }
}

/* 2. Layar HP Besar & Tablet Portrait (Maksimal Lebar: 768px) */
@media (max-width: 768px) {
    nav { 
        padding: 20px 10%;
        left: 5%;
    }
    
    .hamburger {
        display: block; /* Munculkan hamburger di HP */
        position: absolute;
        right: 15%;
    }
    
    /* Perbaikan Menu Mobile: Menggunakan fixed agar tidak merusak scroll halaman */
    .nav-links { 
        position: fixed;
        top: 0; 
        right: -100%; 
        width: 80%; /* Menu tidak memenuhi 100% layar agar tetap elegan */
        height: 100vh;
        background-color: var(--bg-white);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center; /* Menu rata tengah secara vertikal */
        gap: 10px;
        transition: right 0.4s ease-in-out;
        box-shadow: -10px 0 25px rgba(0, 0, 0, 0.08);
        z-index: 1000;
    }

    .nav-links.active {
        right: 0; /* Geser masuk */
    }

    .nav-links a {
        margin: 15px 0;
        font-size: 1.25rem;
        width: 100%;
        text-align: center;
    }
    
    .nav-links a.active-link {
        border-bottom: none; /* Hilangkan garis bawah di HP karena terlihat aneh */
        color: var(--accent-color);
    }

    /* Padding Section untuk HP */
    .section-padding { 
        padding: 80px 10%; 
    }

    .hero::after {
        display: none;
    }

    .hero h1 { 
        font-size: 2rem; 
        line-height: 1.1;
        margin-bottom: 10px;
    }
    .hero-subtitle { 
        font-size: 1.3rem; 
        margin-top: -10px; 
        margin-bottom: 10px;
    }
    .hero-desc { 
        font-size: 1.05rem;
        margin-top: -10px; 
        margin-bottom: 15px
    }
    
    .section-title { 
        font-size: 1.6rem; 
        margin-bottom: 5px;
    }
    .subsection-title {
        font-size: 1.4rem;
        margin-bottom: 5px;
    }
    
    /* Layout About Me dari menyamping jadi vertikal */
    .about-content { 
        flex-direction: column; 
        gap: 25px;
    }
    .about-image {
        width: 260px; /* Ukuran diperkecil untuk layar HP */
        height: 260px;
        margin: 0 auto; /* Memaksa kotak foto berada tepat di tengah layar */
    }
    .about-text p {
        font-size: 1.05rem;
        text-align: center; /* (Opsional) Mengubah teks jadi rata tengah di HP agar lebih serasi dengan fotonya */
    }
    .about-text p {
        font-size: 1.05rem;
    }

    /* Elemen Grid (Skills & Portfolio) otomatis 1 kolom di HP sempit */
    .skills-grid, .grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* --- TOTAL CONTROL: URUTAN KARTU EXPERIENCE DI HP --- */
    
    .timeline-content.card {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Bongkar bungkus header */
    .exp-header {
        display: contents !important; 
    }

    /* [Order 1] Label (Freelance / Organization) */
    .card-tag {
        order: 1 !important;
        align-self: flex-start;
        margin-bottom: 10px !important;
    }

    /* [Order 2] Judul Posisi (h3) */
    .timeline-content h3 {
        order: 2 !important;
        margin-top: 0 !important;
        margin-bottom: 0px !important;
    }

    /* [Order 3] Nama Perusahaan (p class="company") */
    .timeline-content .company {
        order: 3 !important;
        margin-top: 0 !important;
        margin-bottom: 0px !important; /* Jarak ke tanggal */
    }

    /* [Order 4] Tanggal */
    .exp-date {
        order: 4 !important;
        align-self: flex-start;
        margin-bottom: 0px !important; 
        
        /* HILANGKAN GAYA KAPSUL DI HP AGAR ELEGAN */
        background: transparent !important; /* Hilangkan background putih */
        border: none !important;            /* Hilangkan garis pinggir */
        padding: 0 !important;              /* Hilangkan jarak dalam */
        color: #64748b !important;          /* Ubah jadi warna abu-abu elegan */
        font-size: 0.95rem !important;      /* Ukuran sedikit lebih kecil */
        font-weight: 500 !important;
    }

    /* [Order 5] Teks Deskripsi (Hanya tag p yang BUKAN .company) */
    .timeline-content p:not(.company) {
        order: 5 !important;
        margin-top: 0 !important;
    }

    /* --- UKURAN JUDUL KARTU (PROYEK & PRESTASI) --- */
    /* --- JARAK LABEL PORTFOLIO KE JUDUL --- */
/* Sesuaikan nama class ini jika di HTML kamu berbeda (misal: .project-tag) */
    .portfolio .card-tag, 
    .portfolio-item .card-tag,
    .project-tag {
        display: inline-block; /* WAJIB ADA: agar margin-bottom bisa mendorong elemen di bawahnya */
        margin-bottom: 10px !important; /* Tambahkan atau kurangi angka ini sampai jaraknya pas */
    }
    .card h3, 
    .portfolio-item h3, 
    .project-title, 
    .achievement-title {
        font-size: 1.1rem; /* Ukuran yang pas untuk sub-judul di HP (sekitar 19px) */
        line-height: 1.3;
        margin-bottom: 3px; /* Merapikan jarak ke paragraf bawahnya */
    }

    /* Pastikan kode ini ada di dalam @media (max-width: 480px) */
    .contact-container h2 { 
        font-size: 1.5rem !important; /* Ukuran ideal judul section di layar HP */
    }
    .contact-desc { 
        font-size: 0.9rem !important; /* Setara dengan ukuran paragraf web kamu di HP */
        margin-bottom: 10px !important;
    }

/* 3. Layar HP Biasa / Kecil (Maksimal Lebar: 480px) */
@media (max-width: 480px) {
    nav { 
        padding: 15px 10%;
        width: 100%;
        left: 0;
    }
    .hamburger {
        display: block; /* Munculkan hamburger di HP */
        position: absolute;
        right: 10%;
    }
    .hero::after {
        display: none;
    }    
    .hero h1 { 
        font-size: 2.5rem; 
        line-height: 1.1;
        margin-bottom: 10px;
    }
    .hero-subtitle { 
        font-size: 1.5rem; 
        margin-top: -10px; 
        margin-bottom: 10px;
    }
    
    /* Memaksa tombol Hero menumpuk vertikal dengan rapi */
    .hero-buttons { 
        flex-direction: column; 
        width: 100%; 
        gap: 12px;
        align-items: stretch; /* Membuat tombol melebar sama rata */
    }
    .btn, .btn-outline { 
        width: 100%; 
        text-align: center; 
        margin-left: 0 !important; /* Buang margin-left 15px dari desktop */
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    /* Pastikan kode ini ada di dalam @media (max-width: 480px) */
    .contact-container h2 { 
        font-size: 1.5rem !important; /* Ukuran ideal judul section di layar HP */
    }
    .contact-desc { 
        font-size: 0.9rem !important; /* Setara dengan ukuran paragraf web kamu di HP */
        margin-bottom: 15px !important;
    }
    
    /* Merapatkan timeline agar garis tidak keluar layar */
    .timeline { 
        padding-left: 20px; 
    }
    .timeline-dot { 
        left: -27px; 
    }
}
