/* ==================================
   Core Variables & Design Tokens
   ================================== */
:root {
    --text-primary: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.75);

    /* Glassmorphism settings */
    --glass-bg: rgba(20, 20, 20, 0.35);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-blur: 16px;

    /* Accent color */
    --accent: #6c63ff;
    --accent-hover: #574bfa;
}

/* ==================================
   Resets & Base Styles
   ================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    background-color: #050505;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* ==================================
   Video Background & Overlay
   ================================== */
.video-container {
    /* MEMBUAT VIDEO STABIL 100%:
       Menggunakan 'fixed' membuat kontainer terkunci pada viewport layar
       dan sama sekali tidak terpengaruh oleh scroll halaman bawah. */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    /* Mencegah elemen berlebih dari video bocor */
}

.bg-video {
    /* Memastikan video memenuhi layar seluruhnya */
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;

    /* Push video ke tengah agar terpusat */
    transform: translate(-50%, -50%) scale(1.15);

    /* scale(1.15) digunakan untuk memotong logo watermark Veo di tepi layar. 
       translate(-50%, -50%) menjaga titik potong tetap balance di semua sisi */

    object-fit: cover;
    filter: brightness(0.85) saturate(1.2);

    /* Transisi fade out dihapus, biar looping terus jernih */
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Overlay statis default */
    background: linear-gradient(135deg,
            rgba(0, 0, 0, 0.65) 0%,
            rgba(0, 0, 0, 0.4) 50%,
            rgba(0, 0, 0, 0.8) 100%);
    transition: background 0.2s ease-out;
    /* Respon sangat cepat tanpa delay kaku */
}

/* ==================================
   Layout & Components
   ================================== */
.app-content {
    /* Relatif agar konten tetap bisa digulir di atas background fixed */
    position: relative;
    z-index: 1;
}

/* Navigasi */
.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;

    background: transparent;
    transition: padding 0.4s ease, background 0.4s ease, backdrop-filter 0.4s ease;
}

.glass-nav.scrolled {
    padding: 1rem 5rem;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    cursor: pointer;
    background: linear-gradient(90deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 400;
    font-size: 1.05rem;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ==================================
   Hero Section
   ================================== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
    padding-top: 80px;
}

.glass-panel {
    /* EFEK KACA SOLID & RAPIH (TANPA BOCOR TEPI) */
    background: radial-gradient(100% 100% at 0% 0%,
            rgba(255, 255, 255, 0.12) 0%,
            rgba(255, 255, 255, 0.0) 100%), rgba(10, 10, 10, 0.5);

    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);

    /* BORDER CAHAYA PANTULAN tegas untuk mendefinisikan batas */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    border-left: 1px solid rgba(255, 255, 255, 0.25);

    border-radius: 30px;
    padding: 7rem 5rem;
    max-width: 950px;
    text-align: center;
    position: relative;

    /* MENGHILANGKAN BOCOR: Potong semua render visual di luar border melengkung */
    overflow: hidden;
    /* Perbaikan WebKit Safari: Paksa browser memotong blur tepat di perbatasan radius */
    clip-path: inset(0 round 30px);
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);

    /* Shadow dirubah agar tidak memencar keluar dan menyebabkan halo/blur kotor */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);

    /* Hapus transform-style: preserve-3d karena menyebabkan konflik render blur pada WebKit */
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
}

/* EFEK KLIK (ANIMASI PENCET OLEH USER YANG MENGASIKAN) */
.glass-panel:active {
    /* Saat ditekan, panel mengecil dan solid hilang sepenuhnya */
    transform: scale(0.96) translateY(5px) !important;
    background: transparent;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    box-shadow: none;
    border-color: transparent !important;
    transition: all 0.1s ease-out;
}

.greeting {
    display: block;
    font-size: 1.2rem;
    color: var(--accent);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    font-weight: 600;
}

.name {
    font-size: 4.8rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 4px 20px rgba(0, 0, 0, 0.4);
}

.tagline {
    font-size: 1.3rem;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 3.5rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

/* Tombol CTA */
.action-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.cta-button {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.cta-button.primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
    border: 1px solid var(--accent);
}

.cta-button.primary:hover {
    background: var(--accent-hover);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.6);
}

.cta-button.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

.cta-button.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    border-color: #fff;
}

/* ==================================
   Sec & Containers (Menghilangkan Ruang Kosong!)
   ================================== */
.section-spacer {
    /* Kurangi Spacer agar user tidak merasa kosong lama saat scroll */
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    position: relative;
}

/* Tambahan hiasan "Glow Orbs" di belakang section (pengisi kekosongan) */
.section-spacer::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    top: -50px;
    left: 10%;
    filter: blur(40px);
    z-index: 0;
    pointer-events: none;
}

.section-spacer::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(200, 200, 255, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    bottom: -100px;
    right: 5%;
    filter: blur(60px);
    z-index: 0;
    pointer-events: none;
}

.glass-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;

    /* Menerapkan Kaca Keren pada Panel About & Contact (Pengisi Konten Kosong) */
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
    /* Di atas glow orbs */
}

/* Buat Container Projects/Cards Transparent agar List menonjol */
#projects .glass-container {
    background: transparent;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.section-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    color: #fff;
    /* Efek Gradasi pada Judul Section untuk mengisi estetika ruang */
    background: linear-gradient(135deg, #ffffff 0%, #a8a8a8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 3.5rem;
}

.about-content p {
    font-size: 1.4rem;
    color: var(--text-muted);
    line-height: 1.8;
    max-width: 900px;
}

/* ==================================
   Github Projects Grid
   ================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: rgba(25, 25, 25, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border-color: rgba(108, 99, 255, 0.5);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.repo-icon {
    font-size: 2rem;
    color: var(--accent);
}

.repo-link {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: color 0.3s;
}

.repo-link:hover {
    color: #fff;
}

.project-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: #fff;
}

.project-desc {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

.project-language {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--accent);
}

/* ==================================
   Animations (Intersection Observer)
   ================================== */
.hidden {
    opacity: 0;
    transform: translateY(60px);
    filter: blur(8px);
    /* Meningkatkan dramatis membaur */
    /* Kurva transisi disempurnakan buat pergerakan selambat dan selembut air */
    transition:
        opacity 1.2s cubic-bezier(0.25, 1, 0.35, 1),
        transform 1.2s cubic-bezier(0.25, 1, 0.35, 1),
        filter 1.2s cubic-bezier(0.25, 1, 0.35, 1);
}

.show {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0px);
}

.delay-1 {
    transition-delay: 0.15s;
}

.delay-2 {
    transition-delay: 0.3s;
}

.delay-3 {
    transition-delay: 0.45s;
}

/* Responsive */
@media (max-width: 768px) {
    .glass-nav {
        padding: 1.5rem 2rem;
    }

    .glass-nav.scrolled {
        padding: 1rem 2rem;
    }

    .nav-links {
        display: none;
    }

    .name {
        font-size: 3rem;
    }

    .glass-panel {
        padding: 3rem 2rem;
    }

    .action-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .section-title {
        font-size: 2.2rem;
    }
}