:root {
    --bg: #e8e4d9; /* Krem kertas tua */
    --dark: #121212;
    --accent: #d44d2e; /* Merah bata vintage */
    --border: #252525;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg);
    color: var(--dark);
    font-family: 'Space Grotesk', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

.grain {
    position: fixed; inset: 0;
    background: url('https://upload.wikimedia.org/wikipedia/commons/7/76/Noise_600x600.png');
    opacity: 0.05; pointer-events: none; z-index: 100;
}

/* Teks Berjalan di Background */
.bg-text-running {
    position: fixed; top: 10%; width: 100%;
    font-family: 'Syne'; font-size: 8vw; opacity: 0.03;
    white-space: nowrap; font-weight: 900; pointer-events: none;
}

.container {
    display: flex; flex-direction: column; align-items: center;
    padding: 40px 20px; min-height: 100vh; justify-content: space-between;
}

.main-header { text-align: center; z-index: 10; }

.main-header h1 {
    font-family: 'Syne'; font-size: clamp(2.5rem, 8vw, 6rem);
    letter-spacing: -2px; line-height: 0.9;
}

.sub-name {
    font-size: 1.5rem; letter-spacing: 10px; font-weight: 300;
    margin-top: 5px; border-top: 2px solid var(--dark); display: inline-block;
}

/* Preview Utama */
.hero-preview {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 40px 0; width: 100%;
}

.frame-container {
    position: relative; width: 85%; max-width: 500px;
    background: white; padding: 10px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
    transform: rotate(-1deg); transition: transform 0.3s ease;
}

.cv-card {
    position: relative; overflow: hidden; border: 1px solid #ddd;
    cursor: zoom-in;
}

.cv-card img { width: 100%; height: auto; display: block; filter: contrast(1.05) sepia(5%); }

/* Tape/Solasi Effect */
.tape {
    position: absolute; width: 100px; height: 35px;
    background: rgba(212, 190, 150, 0.4); backdrop-filter: blur(2px);
    z-index: 5;
}
.top-left { top: -15px; left: -30px; transform: rotate(-45deg); }
.bottom-right { bottom: -15px; right: -30px; transform: rotate(-45deg); }

/* Tombol Download */
.download-main {
    /* Warna & Font */
    background: #e0e0e0;
    color: var(--dark);
    border: 2px solid var(--dark);
    padding: clamp(12px, 4vw, 18px) clamp(24px, 6vw, 40px); /* Ukuran fleksibel HP/Desktop */
    font-family: 'Syne', sans-serif;
    font-size: clamp(1rem, 3vw, 1.2rem); /* Font mengecil di HP */
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    
    /* Layout */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    cursor: pointer;
    border-radius: 12px;
    position: relative;
    outline: none;
    overflow: hidden;

    /* Efek 3D & Kedalaman */
    box-shadow: 
        0px 6px 0px var(--dark), /* Bayangan bawah (tebal) */
        inset 2px 2px 0px rgba(255,255,255,0.8), /* Highight atas (kilauan material) */
        inset -2px -2px 0px rgba(0,0,0,0.05); /* Shadow dalam halus */
    
    /* Transisi Halus */
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none; /* Biar teks gak ter-highlight pas di-klik cepat */
    -webkit-tap-highlight-color: transparent; /* Hapus highlight biru di HP */
}

/* Hover (Hanya aktif di perangkat dengan Mouse) */
@media (hover: hover) {
    .download-main:hover {
        background: var(--bg); /* Berubah warna ke krem kertas tua */
        transform: translateY(2px); /* Turun sedikit */
        box-shadow: 
            0px 4px 0px var(--dark),
            inset 2px 2px 0px rgba(255,255,255,0.8);
    }
}

/* State Aktif (Pas diklik atau ditekan jari di HP) */
.download-main:active {
    transform: translateY(6px); /* Tertekan penuh ke bawah */
    box-shadow: 
        0px 0px 0px var(--dark), /* Bayangan luar hilang */
        inset 2px 2px 4px rgba(0,0,0,0.2); /* Muncul bayangan dalam (efek masuk ke frame) */
    background: #d0d0d0;
}

/* Penyesuaian Icon */
.download-main i {
    font-size: 1.3em;
    transition: transform 0.3s ease;
}

.download-main:hover i {
    transform: scale(1.1) rotate(5deg);
}

/* Responsif untuk layar sangat kecil */
@media (max-width: 400px) {
    .download-main {
        width: 100%; /* Tombol jadi full width di HP kecil */
        gap: 10px;
    }
}


.vintage-tag { font-size: 0.7rem; margin-bottom: 10px; font-weight: bold; opacity: 0.5; text-align: center;}

/* --- TAMBAHAN BARU: Footer Style -

*/

.site-footer {
    padding: 40px 0 20px 0; /* Menambah ruang atas agar tidak menempel tombol */
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
    width: 100%;
}

.motivation {
    text-transform: none; /* Biar motivasi tidak huruf besar semua (lebih estetik) */
    font-style: italic;
    opacity: 0.6;
    margin-bottom: 15px;
    letter-spacing: 0; /* Balikin ke normal untuk kalimat panjang */
}

.footer-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 800;
    transition: 0.3s;
}

.footer-link:hover { 
    opacity: 0.7; 
}

.vintage-tag { 
    font-size: 0.7rem; 
    margin-bottom: 10px; 
    font-weight: bold; 
    opacity: 0.5; 
    text-align: center;
    display: block; /* Memastikan dia baris sendiri */
}


/* Preview

/* Styling Modal Fullscreen */
.modal {
    display: none; 
    position: fixed; 
    z-index: 9999; 
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(18, 18, 18, 0.98); /* Hitam pekat vintage */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    border: 5px solid white;
    animation: zoomAnim 0.3s ease-out;
}

@keyframes zoomAnim {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 20px; right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-modal:hover { color: var(--accent); }

#caption {
    margin: auto;
    display: block;
    width: 80%;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    font-family: 'Syne';
    letter-spacing: 2px;
    font-size: 0.8rem;
}

/* Overlay Hover di Gambar Utama */
.overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: white; opacity: 0; transition: 0.3s; gap: 10px;
    font-family: 'Syne';
}
.cv-card:hover .overlay { opacity: 1; }


/* Responsive Mobile */
@media (max-width: 600px) {
    .frame-container { width: 95%; }
    .main-header h1 { font-size: 3rem; }
}

/* --- VINTAGE REVEAL SYSTEM --- */

/* State awal untuk semua elemen yang akan dianimasikan */
.main-header, 
.hero-preview, 
.action-zone, 
.site-footer {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
    animation: vintageEntrance 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Delay berjenjang agar muncul satu per satu */
.main-header { animation-delay: 0.3s; }
.hero-preview { animation-delay: 0.6s; }
.action-zone { animation-delay: 0.9s; }
.site-footer { animation-delay: 1.2s; }

/* Efek khusus untuk Frame Foto agar terasa "mendarat" di meja */
.frame-container {
    opacity: 0;
    animation: frameEntry 1.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

/* Keyframes */
@keyframes vintageEntrance {
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

@keyframes frameEntry {
    0% {
        opacity: 0;
        transform: rotate(-10deg) scale(0.8) translateY(50px);
    }
    100% {
        opacity: 1;
        transform: rotate(-1deg) scale(1) translateY(0);
    }
}

/* Animasi Grain agar terasa lebih 'hidup' */
.grain {
    animation: grainNoise 8s steps(10) infinite;
}

@keyframes grainNoise {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    30% { transform: translate(3%, -5%); }
    50% { transform: translate(-10%, 5%); }
    70% { transform: translate(8%, 10%); }
    90% { transform: translate(-3%, 7%); }
}
/* --- DARK MODE SYSTEM --- */

/* Variabel Warna Mode Gelap */
body.dark-mode {
    --bg: #121212;
    --dark: #e8e4d9;
    --accent: #ff6b4a;
}

/* Transisi warna agar tidak kaget saat klik */
/* Hilangkan transisi warna default agar tidak berbayang dengan animasi radial */
body {
    /* Perubahan warna dasar diperlambat agar terasa mewah */
    transition: color 1.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 1.2s cubic-bezier(0.4, 0, 0.2, 1); 
    position: relative;
    overflow-x: hidden;
}

/* Semua elemen teks dan container ikut melambat durasinya */
.main-header h1, 
.sub-name, 
.download-main, 
.site-footer, 
.vintage-tag, 
.mode-toggle, 
.frame-container {
    transition: 
        color 1.2s cubic-bezier(0.4, 0, 0.2, 1), 
        background-color 1.2s cubic-bezier(0.4, 0, 0.2, 1), 
        border-color 1.2s cubic-bezier(0.4, 0, 0.2, 1), 
        box-shadow 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ripple-circle {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    /* Sebaran lingkaran dibuat sedikit lebih lama dari teks (1.4s) 
       agar transisi warna teks selesai tepat saat lingkaran menyapu layar */
    transition: transform 1.4s cubic-bezier(0.15, 0, 0.15, 1);
    will-change: transform;
}


/* Pastikan konten tetap di atas */
.container {
    position: relative;
    z-index: 1;
}

/* Sesuaikan Mode Toggle agar tetap di paling depan */
.mode-toggle {
    z-index: 1000;
}


/* Memastikan Header adalah patokan posisi tombol */
.main-header {
    position: relative; /* Menjadi jangkar untuk tombol */
    width: 100%;
    padding-top: 50px; /* Memberi ruang di atas nama */
}

/* Tombol Mode di Kanan Atas Header */
.mode-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--dark);
    color: var(--bg);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20;
    
}

.mode-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* Perbaikan Detail Tampilan Mode Gelap */
body.dark-mode .frame-container { 
    background: #1e1e1e; 
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

body.dark-mode .download-main { 
    background: #252525; 
    border-color: var(--dark); 
    color: var(--dark); 
    box-shadow: 0px 6px 0px var(--dark); 
}

body.dark-mode .sub-name {
    border-color: var(--dark);
}

/* Penyesuaian di HP agar tidak terlalu mepet */
@media (max-width: 600px) {
    .mode-toggle {
        top: -10px;
        right: 10px;
    }
}

/* Styling Modal Konfirmasi */
.modal-confirm {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* Animasi background hitam memudar halus */
    animation: fadeInOverlay 0.4s ease;
}

.modal-confirm-content {
    background: var(--bg);
    color: var(--dark);
    padding: 40px;
    max-width: 400px;
    width: 100%;
    position: relative;
    border: 2px solid var(--dark);
    text-align: center;
    box-shadow: 20px 20px 0px rgba(0,0,0,0.2);
    /* MENGGUNAKAN ANIMASI CUSTOM BARU */
    animation: modalDrop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* --- ANIMASI BARU --- */
@keyframes modalDrop {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(-80px) rotate(-5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0) rotate(0deg);
    }
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* --- END ANIMASI --- */

.confirm-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.confirm-text {
    font-size: 0.9rem;
    margin-bottom: 30px;
    opacity: 0.8;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Animasi Keluar (Outro) */
.modal-confirm.closing {
    animation: fadeOutOverlay 0.4s ease forwards;
}

.modal-confirm.closing .modal-confirm-content {
    animation: modalFlyOut 0.5s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* Keyframes untuk terbang keluar */
@keyframes modalFlyOut {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.7) translateY(100px) rotate(5deg);
        filter: blur(10px);
    }
}

@keyframes fadeOutOverlay {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Tombol Khusus Modal */
.btn-vintage {
    padding: 10px 20px;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    cursor: pointer;
    border: 2px solid var(--dark);
    transition: all 0.3s ease;
}

.btn-vintage.primary {
    background: var(--dark);
    color: var(--bg);
}

.btn-vintage.secondary {
    background: transparent;
    color: var(--dark);
}

.btn-vintage:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 0 var(--dark);
}

.btn-vintage:active {
    transform: translateY(0);
    box-shadow: 0 0 0 var(--dark);
}
