/* --- ROOT VARIABLES & RESET --- */
:root {
    --bg-color: #0a0a0a;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary-glow: #00f0ff;
    --secondary-glow: #7000ff;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-smooth: cubic-bezier(0.25, 1, 0.5, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
}

/* --- CUSTOM SCROLLBAR --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary-glow), var(--secondary-glow));
    border-radius: 4px;
}

/* --- PRELOADER --- */
#loader {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}
.loader-content {
    text-align: center;
}
.loader-circle {
    width: 50px;
    height: 50px;
    border: 3px solid var(--card-border);
    border-top-color: var(--primary-glow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}
.loader-text {
    font-family: var(--font-heading);
    letter-spacing: 4px;
    font-size: 0.8rem;
    color: var(--primary-glow);
    text-shadow: 0 0 10px var(--primary-glow);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- BACKGROUND BACKGROUND EFFECTS --- */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    top: 0;
    left: 0;
}

#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow));
    z-index: 1000;
    width: 0%;
}

.mouse-follower {
    width: 20px;
    height: 20px;
    background: rgba(0, 240, 255, 0.3);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px var(--primary-glow);
    transition: transform 0.1s var(--transition-smooth);
    display: none;
}

@media (pointer: fine) { .mouse-follower { display: block; } }

/* --- REUSABLE COMPONENTS --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}
.section-padding {
    padding: 120px 0;
}
.section-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    letter-spacing: 2px;
    margin-bottom: 60px;
    text-align: center;
    position: relative;
}
.text-gradient {
    background: linear-gradient(45deg, var(--primary-glow), var(--secondary-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.glass {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.glass:hover {
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.1);
}

/* --- BUTTONS --- */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 500;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: all 0.3s var(--transition-smooth);
}
.btn-primary {
    background: #fff;
    color: #000;
}
.btn-primary:hover {
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}
.btn-secondary {
    background: transparent;
    color: #fff;
    border: 1px solid var(--card-border);
    margin-left: 15px;
}
.btn-secondary:hover {
    background: var(--card-border);
    border-color: var(--primary-glow);
}

/* --- NAVBAR --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 25px 0;
    transition: all 0.4s var(--transition-smooth);
}
.navbar.scrolled {
    padding: 15px 0;
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
}
.nav-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 1px;
}
.logo span { color: var(--primary-glow); }
.nav-menu { display: flex; gap: 35px; }
.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    transition: color 0.3s;
    position: relative;
}
.nav-link:hover, .nav-link.active { color: #fff; }
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-glow);
    transition: width 0.3s;
}
.nav-link.active::after, .nav-link:hover::after { width: 100%; }
.menu-toggle { display: none; color: #fff; font-size: 1.5rem; cursor: pointer; }

/* --- HERO SECTION --- */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 100px;
    position: relative;
}
.profile-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    margin-bottom: 30px;
}
.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 2;
    position: relative;
}
.profile-glow {
    position: absolute;
    inset: -5px;
    background: linear-gradient(45deg, var(--primary-glow), var(--secondary-glow));
    border-radius: 50%;
    z-index: 1;
    filter: blur(15px);
    opacity: 0.7;
    animation: float 4s ease-in-out infinite alternate;
}
.hero-title {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.1;
}
.hero-subtitle {
    font-size: 1.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin: 20px 0 30px;
}
#typing-text {
    color: var(--primary-glow);
    font-weight: 500;
}
.hero-desc {
    max-width: 600px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 40px;
    text-align: center;
}
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: var(--font-heading);
}
.mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--card-border);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}
.wheel {
    width: 4px;
    height: 8px;
    background: var(--primary-glow);
    border-radius: 2px;
    animation: scroll-anim 1.5s infinite;
}

@keyframes scroll-anim {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(12px); opacity: 0; }
}
@keyframes float {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(-10px) scale(1.05); }
}

/* --- ABOUT SECTION --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.about-card {
    padding: 50px;
}
.about-card h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--primary-glow);
}
.about-card p {
    color: var(--text-muted);
    line-height: 1.8;
}
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.stat-box {
    padding: 30px;
    text-align: center;
}
.stat-number {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
}
.stat-plus {
    color: var(--primary-glow);
    font-size: 1.8rem;
    font-weight: 700;
}
.stat-label {
    color: var(--text-muted);
    margin-top: 10px;
    font-size: 0.9rem;
}

/* --- SKILLS SECTION --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}
.skill-card {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform-style: preserve-3d;
}
.skill-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.1));
    transition: transform 0.3s;
}
.skill-card:hover .skill-icon {
    transform: translateZ(20px) scale(1.1);
}
.skill-name {
    font-family: var(--font-heading);
    font-weight: 500;
    margin-bottom: 15px;
}
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 2px;
    overflow: hidden;
}
.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow));
    border-radius: 2px;
    width: 0%; /* Diatur via HTML/JS */
}

/* --- PROJECTS SECTION --- */
.project-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
}
.filter-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 10px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.3s;
}
.filter-btn.active, .filter-btn:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}
.project-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.project-img-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}
.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--transition-smooth);
}
.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.project-links { display: flex; gap: 20px; }
.project-link-icon {
    width: 50px;
    height: 50px;
    background: #fff;
    color: #000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 1.2rem;
    transition: transform 0.3s;
}
.project-link-icon:hover { transform: scale(1.1); background: var(--primary-glow); }
.project-card:hover .project-img { transform: scale(1.05); }
.project-card:hover .project-overlay { opacity: 1; }

.project-info { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.project-info h3 { font-family: var(--font-heading); margin-bottom: 10px; }
.project-info p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; margin-bottom: 20px; }
.project-tags { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.project-tags span {
    font-size: 0.75rem;
    background: rgba(255,255,255,0.05);
    padding: 5px 12px;
    border-radius: 20px;
    color: var(--text-muted);
    border: 1px solid var(--card-border);
}

/* --- EXPERIENCE TIMELINE --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}
.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--card-border);
    top: 0; bottom: 0; left: 50%;
    transform: translateX(-50%);
}
.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
}
.timeline-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    right: -8px;
    background: var(--bg-color);
    border: 3px solid var(--primary-glow);
    top: 25px;
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 10px var(--primary-glow);
}
.timeline-item.right { left: 50%; }
.timeline-item.right::after { left: -8px; }
.timeline-content { padding: 30px; position: relative; }
.timeline-date {
    color: var(--primary-glow);
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 10px;
}
.timeline-content h3 { font-family: var(--font-heading); margin-bottom: 5px; }
.timeline-content h4 { color: var(--text-muted); font-weight: 400; font-size: 0.95rem; margin-bottom: 15px; }
.timeline-content p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* --- CONTACT SECTION --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
}
.contact-form { padding: 40px; display: flex; flex-direction: column; gap: 30px; }
.form-group { position: relative; width: 100%; }
.form-group input, .form-group textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--card-border);
    padding: 12px 0;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-glow);
}
.form-group label {
    position: absolute;
    left: 0; top: 12px;
    color: var(--text-muted);
    transition: all 0.3s var(--transition-smooth);
    pointer-events: none;
}
.form-group input:focus ~ label, .form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label, .form-group textarea:not(:placeholder-shown) ~ label {
    top: -12px;
    font-size: 0.8rem;
    color: var(--primary-glow);
}
.submit-btn { border: none; cursor: pointer; align-self: flex-start; }
.contact-info-wrapper { display: flex; }
.contact-info { padding: 40px; display: flex; flex-direction: column; justify-content: center; width: 100%; }
.contact-info h3 { font-family: var(--font-heading); font-size: 1.8rem; margin-bottom: 20px; }
.contact-info p { color: var(--text-muted); line-height: 1.6; margin-bottom: 40px; }
.social-links { display: flex; gap: 15px; }
.social-icon {
    width: 50px;
    height: 50px;
    border: 1px solid var(--card-border);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s;
}
.social-icon:hover { border-color: var(--primary-glow); color: var(--primary-glow); box-shadow: 0 0 15px rgba(0,240,255,0.2); }

/* --- FOOTER --- */
.footer {
    border-top: 1px solid var(--card-border);
    padding: 40px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
#back-to-top {
    width: 45px;
    height: 45px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
}
#back-to-top:hover { border-color: var(--primary-glow); color: var(--primary-glow); }

/* --- ANIMATION REVEAL ENGINE --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s var(--transition-smooth);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 992px) {
    .hero-title { font-size: 3.5rem; }
    .about-grid, .contact-grid { grid-template-columns: 1fr; }
    .timeline::after { left: 40px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 0; }
    .timeline-item.right { left: 0; }
    .timeline-item::after { left: 32px; }
    .timeline-item.right::after { left: 32px; }
}
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0; right: -100%;
        width: 70%; height: 100vh;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s var(--transition-smooth);
    }
    .nav-menu.open { right: 0; }
    .menu-toggle { display: block; }
    .section-title { font-size: 2.2rem; }
}