* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --accent-color: #fd79a8;
    --dark-bg: #0f0e17;
    --light-text: #fff;
    --card-bg: #1a1927;
    --border-color: #2d2640;
}

/* System Dark Theme (default for dark mode preference) */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #6c5ce7;
        --secondary-color: #a29bfe;
        --accent-color: #fd79a8;
        --dark-bg: #0f0e17;
        --light-text: #fff;
        --card-bg: #1a1927;
        --border-color: #2d2640;
        --light-bg-secondary: #16141f;
    }
}

/* System Light Theme (default for light mode preference) */
@media (prefers-color-scheme: light) {
    :root {
        --primary-color: #5a67d8;
        --secondary-color: #7c8cff;
        --accent-color: #d946a6;
        --dark-bg: #f8f9fa;
        --light-text: #1a1a1a;
        --card-bg: #ffffff;
        --border-color: #e0e0e0;
        --light-bg-secondary: #f0f2f5;
    }
}

/* Light Theme (manual override) */
:root.light-theme {
    --primary-color: #5a67d8;
    --secondary-color: #7c8cff;
    --accent-color: #d946a6;
    --dark-bg: #f8f9fa;
    --light-text: #1a1a1a;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --light-bg-secondary: #f0f2f5;
}

.light-theme {
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 60% 70%, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 50% 50%, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 80% 10%, rgba(0, 0, 0, 0.09), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 90% 60%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 30% 80%, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 10% 90%, rgba(0, 0, 0, 0.09), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 40% 20%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)) !important;
    background-size: 200% 200% !important;
    background-attachment: fixed !important;
}

/* Dark Theme (manual override) */
:root.dark-theme {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --accent-color: #fd79a8;
    --dark-bg: #0f0e17;
    --light-text: #fff;
    --card-bg: #1a1927;
    --border-color: #2d2640;
    --light-bg-secondary: #16141f;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    color: var(--light-text);
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

html {
    scroll-behavior: smooth;
}



/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 14, 23, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

@media (prefers-color-scheme: light) {
    .navbar {
        background: rgba(248, 249, 250, 0.95);
    }
}

.light-theme .navbar {
    background: rgba(248, 249, 250, 0.95);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--light-text);
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s ease;
    position: relative;
}

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

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

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--light-text);
    margin: 5px 0;
    transition: 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.8rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(108, 92, 231, 0.3);
}

.theme-toggle span {
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.theme-toggle .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-toggle .sun-icon {
    opacity: 0.3;
    transform: rotate(180deg);
}

.light-theme .theme-toggle .moon-icon {
    opacity: 0.3;
    transform: rotate(-180deg);
}

.light-theme .theme-toggle .sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    margin-top: 60px;
    position: relative;
    overflow: hidden;
    background: var(--dark-bg);
    background-image: 
        radial-gradient(2px 2px at 20% 30%, #eee, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 60% 70%, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 50% 50%, #ddd, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 80% 10%, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 90% 60%, #eee, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 30% 80%, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 10% 90%, #eee, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 40% 20%, #fff, rgba(0, 0, 0, 0));
    background-size: 200% 200%;
    background-attachment: fixed;
    transition: background 0.3s ease;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    max-width: 1200px;
    width: 100%;
    z-index: 10;
    flex-wrap: wrap;
}

/* Profile Card with 3D Effect */
.profile-container {
    perspective: 1000px;
    flex: 0 0 300px;
}

.profile-card {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 20px;
    transform-style: preserve-3d;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotateX(5deg) rotateY(5deg);
    }
    50% {
        transform: translateY(-20px) rotateX(-5deg) rotateY(-5deg);
    }
}

.profile-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(108, 92, 231, 0.3);
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 20px;
    transition: transform 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.05);
}

.profile-border {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color), var(--secondary-color));
    border-radius: 20px;
    z-index: -1;
    animation: borderRotate 3s linear infinite;
}

@keyframes borderRotate {
    0% {
        background: linear-gradient(135deg, var(--primary-color), var(--accent-color), var(--secondary-color));
    }
    100% {
        background: linear-gradient(495deg, var(--primary-color), var(--accent-color), var(--secondary-color));
    }
}

.profile-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(108, 92, 231, 0.4), transparent 70%);
    border-radius: 20px;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Hero Text */
.hero-text {
    flex: 1;
    min-width: 300px;
    animation: slideInUp 1s ease-out;
}

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

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.highlight {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(108, 92, 231, 0.4);
}

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

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

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.scroll-indicator span {
    display: block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    animation: scroll-down 2s infinite;
}

@keyframes scroll-down {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Section Title */
.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

/* About Section */
.about {
    padding: 6rem 2rem;
    background: var(--dark-bg);
    background-image: 
        radial-gradient(2px 2px at 20% 30%, #eee, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 60% 70%, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 50% 50%, #ddd, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 80% 10%, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 90% 60%, #eee, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 30% 80%, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 10% 90%, #eee, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 40% 20%, #fff, rgba(0, 0, 0, 0));
    background-size: 200% 200%;
    background-attachment: fixed;
    transition: background 0.3s ease;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--secondary-color);
}

.about-text p {
    margin-bottom: 1.5rem;
}

.education-box {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    margin-top: 2rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.education-box:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.2);
}

.education-box h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.university {
    color: var(--light-text);
    margin-top: 0.5rem;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    transform: translateY(0);
}

.stat-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 40px rgba(108, 92, 231, 0.2);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--secondary-color);
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Skills Section */
.skills {
    padding: 6rem 2rem;
    background: var(--dark-bg);
    background-image: 
        radial-gradient(2px 2px at 20% 30%, #eee, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 60% 70%, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 50% 50%, #ddd, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 80% 10%, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 90% 60%, #eee, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 30% 80%, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 10% 90%, #eee, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 40% 20%, #fff, rgba(0, 0, 0, 0));
    background-size: 200% 200%;
    background-attachment: fixed;
    transition: background 0.3s ease;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    transform: translateY(0);
}

.skill-category:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 40px rgba(108, 92, 231, 0.2);
}

.skill-category h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tag {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(162, 155, 254, 0.2));
    color: var(--secondary-color);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    border: 1px solid var(--primary-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.skill-tag:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    transform: scale(1.05);
}

/* Projects Section */
.projects {
    padding: 6rem 2rem;
    background: var(--dark-bg);
    background-image: 
        radial-gradient(2px 2px at 20% 30%, #eee, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 60% 70%, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 50% 50%, #ddd, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 80% 10%, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 90% 60%, #eee, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 30% 80%, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 10% 90%, #eee, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 40% 20%, #fff, rgba(0, 0, 0, 0));
    background-size: 200% 200%;
    background-attachment: fixed;
    transition: background 0.3s ease;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    transform: rotateX(0) rotateY(0);
    perspective: 1000px;
}

.project-card:hover {
    transform: translateY(-15px) rotateX(5deg);
    border-color: var(--primary-color);
    box-shadow: 0 20px 50px rgba(108, 92, 231, 0.3);
}

.project-image {
    width: 100%;
    height: 200px;
    transition: all 0.3s ease;
}

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

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    color: var(--light-text);
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

.project-content p {
    color: var(--secondary-color);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tags span {
    background: rgba(108, 92, 231, 0.2);
    color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

/* Contact Section */
.contact {
    padding: 6rem 2rem;
    background: var(--dark-bg);
    background-image: 
        radial-gradient(2px 2px at 20% 30%, #eee, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 60% 70%, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 50% 50%, #ddd, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 80% 10%, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 90% 60%, #eee, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 30% 80%, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 10% 90%, #eee, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 40% 20%, #fff, rgba(0, 0, 0, 0));
    background-size: 200% 200%;
    background-attachment: fixed;
    transition: background 0.3s ease;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.contact-info {
    display: grid;
    gap: 2rem;
}

.info-box {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-align: center;
}

.info-box:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 40px rgba(108, 92, 231, 0.2);
}

.icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.info-box h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.info-box p {
    color: var(--secondary-color);
}

.contact-form {
    display: grid;
    gap: 1.5rem;
}

.contact-form input,
.contact-form textarea {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--light-text);
    padding: 1rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.3);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--secondary-color);
}

/* Footer */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.social-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s ease;
}

.social-link:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}

.footer p {
    color: var(--secondary-color);
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        gap: 2rem;
    }

    .profile-container {
        flex: 0 0 200px;
    }

    .profile-card {
        width: 200px;
        height: 200px;
    }

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

    .hero-subtitle {
        font-size: 1rem;
    }

    .nav-menu {
        display: none;
    }

    .hamburger {
        display: flex;
    }

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

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

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

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

    .theme-toggle {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }

    .theme-toggle span {
        font-size: 1rem;
    }

    .nav-container {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .profile-container {
        flex: 0 0 150px;
    }

    .profile-card {
        width: 150px;
        height: 150px;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .about-text,
    .contact-form {
        font-size: 0.95rem;
    }

    .theme-toggle {
        padding: 0.3rem 0.5rem;
        gap: 0.3rem;
    }

    .theme-toggle span {
        font-size: 0.9rem;
    }

    .nav-menu {
        flex-direction: column;
        gap: 1rem;
    }
}
