/* =========================================
   1. Reset & Base Styles (Tetap Sama)
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #020617;
    color: #f8fafc;
    overflow: hidden; /* Penting saat loading */
    height: 100vh;
    width: 100vw;
}

/* Class untuk menonaktifkan interaksi saat loading */
body.loading {
    pointer-events: none;
}

/* =========================================
   2. NEW: PRELOADER (Teks Nabil Syah - Diperbarui)
   ========================================= */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #020617; /* Base super gelap */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Pastikan di atas segalanya */
    opacity: 1;
    transition: opacity 0.5s ease-in-out; /* Transisi saat preloader hilang */
}

/* Konten Preloader (Logo Teks) */
.preloader-content {
    text-align: center;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

/* Desain Logo Teks "Nabil Syah" dengan kapital N dan S */
.logo-text {
    font-size: 3rem; /* Sedikit lebih kecil agar teks muat */
    font-weight: 800;
    color: #38bdf8; /* Warna aksen biru */
    display: flex; /* Flexbox agar span sejajar */
    gap: 2px; /* Jarak antar huruf */
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
}

/* Gaya untuk setiap huruf (span) */
.logo-text span {
    opacity: 0;
    transform: translateX(-10px); /* Mulai dari sedikit kiri */
    animation: fadeInRight 0.5s ease-out forwards; /* Animasi muncul per huruf */
}

/* Animasi muncul per huruf (fadeInRight) */
@keyframes fadeInRight {
    to {
        opacity: 1;
        transform: translateX(0); /* Selesai di posisi normal */
    }
}

/* Menentukan animation-delay untuk setiap huruf secara manual agar bergantian (9 huruf) */
.logo-text span:nth-child(1) { animation-delay: 0s; }   /* N */
.logo-text span:nth-child(2) { animation-delay: 0.1s; } /* a */
.logo-text span:nth-child(3) { animation-delay: 0.2s; } /* b */
.logo-text span:nth-child(4) { animation-delay: 0.3s; } /* i */
.logo-text span:nth-child(5) { animation-delay: 0.4s; } /* l */
/* Spasi teks tidak dianmasikan */
.logo-text span:nth-child(6) { animation-delay: 0.5s; } /* S */
.logo-text span:nth-child(7) { animation-delay: 0.6s; } /* y */
.logo-text span:nth-child(8) { animation-delay: 0.7s; } /* a */
.logo-text span:nth-child(9) { animation-delay: 0.8s; } /* h */

/* Transisi Swipe Rounded (Tetap Sama) */
.swipe-transition {
    position: absolute;
    top: -100%; /* Mulai di luar layar atas */
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #020617;
    border-bottom-left-radius: 50% 10%; /* Rounded di bawah */
    border-bottom-right-radius: 50% 10%; /* Rounded di bawah */
    z-index: -1; /* Di belakang konten utama tapi di depan preloader */
    transform: translateY(0);
    transition: transform 0.8s cubic-bezier(0.7, 0, 0.3, 1); /* Cubic bezier untuk kesan "swipe" */
}

/* Class untuk memicu animasi swipe */
#preloader.swipe-active .swipe-transition {
    transform: translateY(100%); /* Menyapu ke bawah */
}

/* Class untuk menyembunyikan logo setelah swipe selesai */
#preloader.swipe-active .preloader-content {
    opacity: 0;
}

/* =========================================
   3. Konten Utama (Disembunyikan saat Loading - Tetap Sama)
   ========================================= */
/* Sembunyikan konten utama secara default */
.main-wrapper,
.bg-layer {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out;
}

/* Class untuk menampilkan konten setelah loading selesai */
body.loaded .main-wrapper,
body.loaded .bg-layer {
    opacity: 1;
    visibility: visible;
}

/* =========================================
   4. Dynamic Background (Aurora - Tetap Sama)
   ========================================= */
.bg-layer {
    position: absolute;
    top: -30%;
    left: -30%;
    width: 160%;
    height: 160%;
    background-color: #020617;
    background-image: 
        radial-gradient(at 10% 20%, rgba(6, 182, 212, 0.2) 0px, transparent 50%),
        radial-gradient(at 90% 10%, rgba(59, 130, 246, 0.25) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(139, 92, 246, 0.2) 0px, transparent 50%),
        radial-gradient(at 10% 90%, rgba(16, 185, 129, 0.15) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(2, 6, 23, 1) 0px, transparent 80%);
    background-size: 200% 200%;
    z-index: -1;
    transition: transform 0.15s ease-out; 
    will-change: transform;
    animation: auroraFlow 15s ease infinite alternate;
}

@keyframes auroraFlow {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 100%; }
}

/* =========================================
   5. Wrapper & Layout (Tetap Sama)
   ========================================= */
.main-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    padding: 20px;
    padding-bottom: 15px;
}

/* =========================================
   6. Shiny Central Container (Efek Berkilau - Tetap Sama)
   ========================================= */
.container {
    position: relative;
    text-align: center;
    width: 100%;
    max-width: 360px;
    margin: auto;
    padding: 2.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 28px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    transition: transform 0.15s ease-out;
    will-change: transform;
    overflow: hidden;
}

.container::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255, 255, 255, 0) 20%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 80%,
        transparent 100%
    );
    transform: skewX(-20deg);
    animation: shineSweep 6s ease-in-out infinite;
}

@keyframes shineSweep {
    0% { left: -150%; }
    30% { left: 150%; }
    100% { left: 150%; }
}

/* Profil & Teks (Tetap Sama) */
.profile-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid #38bdf8;
    margin-bottom: 1.2rem;
    object-fit: cover;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.name {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    color: #f1f5f9;
}

.desc {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

/* =========================================
   7. Links Buttons (Tetap Sama)
   ========================================= */
.links-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.link-btn:active, .link-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(56, 189, 248, 0.2);
}

/* Tombol Izin iOS (Tetap Sama) */
#ios-permission-btn {
    display: none;
    margin-top: 25px;
    padding: 12px;
    background: #38bdf8;
    color: #0f172a;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    font-size: 0.9rem;
}

/* =========================================
   8. Footer Profesional (Tetap Sama)
   ========================================= */
footer {
    width: 100%;
    padding-top: 20px;
    margin-top: auto;
}

.footer-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.social-icons {
    display: flex;
    gap: 25px;
}

.social-icons a {
    color: #475569;
    font-size: 1.4rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icons a:hover, .social-icons a:active {
    transform: scale(1.15) translateY(-3px);
}

.social-icons a[title="WhatsApp"]:hover { color: #25D366; }
.social-icons a[title="Instagram"]:hover { color: #E1306C; }
.social-icons a[title="LinkedIn"]:hover { color: #0077B5; }
.social-icons a[title="TikTok"]:hover { color: #ff0050; }

.copyright {
    font-size: 0.75rem;
    color: #334155;
    font-weight: 400;
}

/* Media Query untuk layar kecil (Tetap Sama) */
@media (max-height: 600px) {
    .container { padding: 1.5rem 1rem; }
    .profile-img { width: 75px; height: 75px; }
    .desc { margin-bottom: 1.5rem; }
}