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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #475569;
    --text-color: #1e293b;
    --bg-color: #ffffff;
    --light-bg: #f8fafc;
    --dark-bg: #0f172a;
    --dark-surface: #1e293b;
    --border-color: #e2e8f0;
    --dark-border: #334155;
    --max-width: 1200px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --light-bg: #1e293b;
    --text-color: #f1f5f9;
    --secondary-color: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.4);
}

/* Improved Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: var(--transition);
    overflow-x: hidden;
}

/* Loading Animation */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-inner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Enhanced Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Enhanced Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    transition: var(--transition);
    padding: 1rem 0;
}

[data-theme="dark"] .navbar {
    background-color: rgba(15, 23, 42, 0.9);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
    padding: 0.75rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    animation: fadeInLeft 0.8s ease-out;
}

.logo:hover {
    transform: translateX(5px);
    color: var(--primary-color);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 20px;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: var(--transition);
}

.sun-icon { display: block; }
.moon-icon { display: none; }

[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

/* Enhanced Nav Links */
.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    animation: fadeInDown 0.8s ease-out;
}

.nav-links a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

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

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

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Enhanced Hero Section with Parallax */
.hero {
    padding: 120px 0 80px;
    text-align: center;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, var(--primary-color) 0%, transparent 25%),
                radial-gradient(circle at 80% 20%, #7c3aed 0%, transparent 25%);
    opacity: 0.1;
    animation: float 20s ease-in-out infinite;
}

.hero-content {
    width: 100%;
    position: relative;
    z-index: 1;
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 4px solid var(--light-bg);
    object-fit: cover;
    animation: scaleIn 0.8s ease-out, float 6s ease-in-out infinite;
    transition: var(--transition);
}

.profile-pic:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.3);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Enhanced Section Styles with Animations */
section {
    padding: 100px 0;
    position: relative;
}

section:nth-child(even) {
    background-color: var(--light-bg);
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
    position: relative;
    animation: fadeInUp 0.8s ease-out;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

/* Enhanced About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.about-content p {
    font-size: 1.125rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease-out;
}

/* Enhanced Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

.skill-category {
    text-align: center;
    padding: 2rem;
    background: var(--bg-color);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    animation: scaleIn 0.8s ease-out;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.skill-category li {
    padding: 0.5rem 0;
    color: var(--secondary-color);
    font-size: 1.1rem;
    transition: var(--transition);
}

.skill-category li:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

/* Enhanced Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    animation: fadeInUp 0.8s ease-out;
}

.project-card {
    background-color: var(--bg-color);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: scaleIn 0.8s ease-out;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 3px;
    background: var(--gradient);
    transition: left 0.5s ease;
}

.project-card:hover::before {
    left: 0;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.project-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.project-card p {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.project-tech span {
    background: var(--gradient);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    transition: var(--transition);
}

.project-tech span:hover {
    transform: scale(1.05);
}

/* Enhanced Music Section */
.music {
    background-color: var(--light-bg);
    position: relative;
    overflow: hidden;
}

.music::before {
    content: '♪';
    position: absolute;
    font-size: 300px;
    color: var(--primary-color);
    opacity: 0.05;
    top: -100px;
    right: -100px;
    animation: float 10s ease-in-out infinite;
}

.music-intro {
    text-align: center;
    font-size: 1.25rem;
    color: var(--secondary-color);
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease-out;
}

.music-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    animation: fadeInUp 0.8s ease-out;
    max-width: 800px;
    margin: 0 auto;
}

.music-card {
    background: var(--bg-color);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    animation: scaleIn 0.8s ease-out;
    text-align: center;
}

.music-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.music-player {
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.music-artwork {
    position: relative;
    width: 100%;
    height: 225px;
    background: var(--light-bg);
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.music-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.music-artwork:hover img {
    transform: scale(1.05);
}

.music-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.music-link {
    padding: 0.5rem 1rem;
    background: var(--gradient);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.music-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

/* Enhanced Contact Section */
.contact {
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.contact p {
    font-size: 1.25rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--light-bg);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 1.125rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.contact-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: var(--primary-color);
}

.contact-link svg {
    width: 24px;
    height: 24px;
    transition: var(--transition);
}

.contact-link:hover svg {
    transform: scale(1.1);
}

/* Enhanced Footer */
.footer {
    background-color: var(--light-bg);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* Mobile Responsive Enhancements */
/* Smaller music card text */
.music-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

.music-card p {
    font-size: 0.95rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        margin-top: 1rem;
        gap: 1rem;
        font-size: 0.9rem;
        justify-content: center;
    }
    
    .theme-toggle {
        margin-left: auto;
        order: 2;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .skills-grid,
    .projects-grid,
    .music-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .profile-pic {
        width: 120px;
        height: 120px;
    }
}

/* Scroll animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}