/* ============================================
   FONTS & RESET
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* {
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
}

/* ============================================
   CSS VARIABLES — DARK & LIGHT MODE
   ============================================ */
:root {
    --bg-primary:    #0a0a0f;
    --bg-secondary:  #12121a;
    --text-primary:  #e2e8f0;
    --text-secondary:#94a3b8;
    --glass-bg:      rgba(255, 255, 255, 0.03);
    --glass-border:  rgba(255, 255, 255, 0.08);
    --glass-hover:   rgba(255, 255, 255, 0.08);
    --indigo:        #6366f1;
    --purple:        #a855f7;
    --pink:          #ec4899;
}

html[data-theme="light"] {
    --bg-primary:    #f8fafc;
    --bg-secondary:  #ffffff;
    --text-primary:  #1e293b;
    --text-secondary:#64748b;
    --glass-bg:      rgba(255, 255, 255, 0.7);
    --glass-border:  rgba(0, 0, 0, 0.08);
    --glass-hover:   rgba(99, 102, 241, 0.08);
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ============================================
   GLASSMORPHISM
   ============================================ */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    transition: background 0.3s ease, border-color 0.3s ease;
}

html[data-theme="light"] .glass {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* ============================================
   GRADIENT TEXT & BG
   ============================================ */
.gradient-text {
    background: linear-gradient(135deg, var(--indigo), var(--purple), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-bg {
    background: linear-gradient(135deg, var(--indigo), var(--purple));
}

.progress-bar {
    background: linear-gradient(90deg, var(--indigo), var(--purple), var(--pink));
}

/* ============================================
   GLOW
   ============================================ */
.glow {
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.35);
}

html[data-theme="light"] .glow {
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.25);
}

/* ============================================
   PROJECT CARD
   ============================================ */
.project-image {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-image {
    transform: scale(1.08);
}

/* ============================================
   SKILL BAR
   ============================================ */
.skill-bar {
    transition: width 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   NAV LINK
   ============================================ */
.nav-link {
    position: relative;
    color: var(--text-secondary);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: linear-gradient(135deg, var(--indigo), var(--purple));
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active,
.nav-link:hover {
    color: var(--text-primary);
}

/* ============================================
   BLOBS ANIMATION
   ============================================ */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 8s ease-in-out infinite;
}

html[data-theme="light"] .blob {
    opacity: 0.15;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(30px, -30px) scale(1.1); }
}

/* ============================================
   PULSE
   ============================================ */
@keyframes pulse-ring {
    0%   { transform: scale(0.95); opacity: 1; }
    50%  { transform: scale(1.05); opacity: 0.7; }
    100% { transform: scale(0.95); opacity: 1; }
}

.pulse {
    animation: pulse-ring 2s ease-in-out infinite;
}

/* ============================================
   FADE IN ANIMATION (untuk filter)
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   TAG
   ============================================ */
.tag {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

html[data-theme="light"] .tag {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline-item::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--indigo), var(--purple));
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
}

html[data-theme="light"] .timeline-item::before {
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--indigo), var(--purple));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--purple), var(--pink));
}

/* ============================================
   BACK TO TOP
   ============================================ */
#backToTop {
    transition: all 0.3s ease;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ============================================
   MOBILE MENU
   ============================================ */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.3s ease;
    background: var(--bg-secondary);
}

.mobile-menu.open {
    transform: translateX(0);
}

html[data-theme="dark"] .mobile-menu {
    background: rgba(10, 10, 15, 0.98);
}

html[data-theme="light"] .mobile-menu {
    background: rgba(255, 255, 255, 0.98);
}

/* ============================================
   FILTER BUTTON
   ============================================ */
.filter-btn {
    color: var(--text-secondary);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--indigo), var(--purple));
    color: white;
    border-color: transparent;
}

/* ============================================
   FORM INPUT
   ============================================ */
.form-input {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-input:focus {
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(20deg);
    background: var(--glass-hover);
}

.theme-toggle i {
    font-size: 1rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

/* ============================================
   BUTTON HOVER
   ============================================ */
a, button {
    transition: all 0.3s ease;
}

/* ============================================
   RESPONSIVE FIX
   ============================================ */
@media (max-width: 768px) {
    .blob {
        filter: blur(60px);
    }
    
    body {
        font-size: 15px;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}