/* ===== CSS Variables ===== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #06b6d4;
    --accent-2: #8b5cf6;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-card: #1e293b;
    --bg-light: #f8fafc;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-dark: #1e293b;
    --text-dark-secondary: #64748b;
    --gradient-1: linear-gradient(135deg, #6366f1, #06b6d4);
    --gradient-2: linear-gradient(135deg, #8b5cf6, #ec4899);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 10px 40px;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-brand i {
    -webkit-text-fill-color: initial;
    color: var(--primary-light);
    margin-right: 4px;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.15);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-primary);
    font-size: 1.25rem;
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-darker);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 8s ease-in-out infinite;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -100px;
    right: -100px;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    bottom: -50px;
    left: -100px;
    animation-delay: -3s;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: var(--accent-2);
    top: 40%;
    left: 50%;
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 20px;
    max-width: 800px;
}

.hero-badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50px;
    color: var(--primary-light);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.hero-badge i {
    margin-right: 6px;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -2px;
}

.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 36px;
    font-weight: 400;
    min-height: 2rem;
}

/* Typed.js cursor */
.typed-cursor {
    color: var(--primary-light);
    font-weight: 300;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 60px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.stat { text-align: center; }

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-number i {
    color: #fbbf24;
    font-size: 1.4rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: var(--text-secondary);
    font-size: 1.2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(10px); }
    60% { transform: translateX(-50%) translateY(5px); }
}

/* ===== Sections ===== */
.section {
    padding: 100px 0;
}

.section-dark {
    background: var(--bg-darker);
    color: var(--text-primary);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-dark-secondary);
    margin-bottom: 48px;
    font-size: 1.05rem;
}

.section-subtitle i {
    margin-right: 6px;
}

.section-dark .section-subtitle {
    color: var(--text-secondary);
}

/* ===== About Section ===== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-lead {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.7;
}

.about-text p {
    color: var(--text-dark-secondary);
    margin-bottom: 24px;
    line-height: 1.8;
}

.about-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.detail-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.detail-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-1);
    border-radius: 10px;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.detail-item div {
    display: flex;
    flex-direction: column;
}

.detail-item strong {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.detail-item span {
    font-size: 0.9rem;
    color: var(--text-dark-secondary);
}

/* Floating Cards */
.about-card-stack {
    position: relative;
    height: 400px;
}

.floating-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    font-size: 1rem;
    animation: cardFloat 6s ease-in-out infinite;
    transition: var(--transition);
}

.floating-card:hover {
    transform: scale(1.08) !important;
    box-shadow: var(--shadow-glow);
}

.floating-card i {
    font-size: 1.5rem;
    width: 32px;
    text-align: center;
}

.card-java { top: 20px; left: 40px; }
.card-java i { color: #b07219; }
.card-dsa { top: 100px; right: 20px; animation-delay: -1s; }
.card-dsa i { color: var(--primary); }
.card-spring { top: 190px; left: 20px; animation-delay: -2s; }
.card-spring i { color: #6db33f; }
.card-react { top: 270px; right: 40px; animation-delay: -3s; }
.card-react i { color: #61dafb; }
.card-python { top: 340px; left: 80px; animation-delay: -4s; }
.card-python i { color: #3572A5; }

@keyframes cardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ===== Skills Section ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.skill-category {
    padding: 32px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.skill-category:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.skill-category-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.skill-category-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-light);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.skill-tag:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

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

.project-card {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.project-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.project-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.project-links {
    color: var(--text-dark-secondary);
    font-size: 1.1rem;
    transition: var(--transition);
}

.project-card:hover .project-links {
    color: var(--primary);
}

.project-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.project-card p {
    font-size: 0.95rem;
    color: var(--text-dark-secondary);
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 20px;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.project-lang {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-dark-secondary);
}

.lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.project-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--text-dark-secondary);
}

.project-stat i {
    font-size: 0.8rem;
}

/* Loading Spinner */
.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: var(--text-dark-secondary);
}

.loading-spinner i {
    color: var(--primary);
    margin-bottom: 16px;
    display: block;
}

/* ===== Certificates Section ===== */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.cert-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 36px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.cert-card:hover {
    transform: translateY(-6px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-glow);
}

.cert-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cert-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.cert-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.cert-badge {
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-gold {
    background: rgba(234, 179, 8, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.badge-silver {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.badge-coursera {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.cert-link {
    color: var(--primary-light);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cert-link:hover {
    color: var(--accent);
    gap: 10px;
}

/* ===== Contact Section ===== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.contact-card {
    padding: 40px 24px;
    background: white;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
    display: block;
}

.contact-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.contact-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    transition: var(--transition);
}

.contact-card:hover .contact-icon {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.contact-card h3 {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.contact-card p {
    color: var(--text-dark-secondary);
    font-size: 0.9rem;
    word-break: break-word;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-darker);
    color: var(--text-secondary);
    text-align: center;
    padding: 40px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-brand {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.footer-socials {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 16px;
}

.footer-socials a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer-socials a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.footer p {
    font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .navbar {
        padding: 12px 20px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(15, 23, 42, 0.98);
        padding: 16px;
        gap: 4px;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .hero-title {
        letter-spacing: -1px;
    }

    .hero-stats {
        gap: 20px;
    }

    .stat-divider {
        display: none;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-card-stack {
        display: none;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 60px 0;
    }

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

@media (max-width: 480px) {
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}
