/* Global Styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --gray-color: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
    --header-height: 72px;
}

/* Dark theme variables (overrides) */
body.dark {
    --light-color: #0b1220;
    --dark-color: #e5e7eb;
    --gray-color: #94a3b8;
    --border-color: #1f2a44;
    --primary-color: #60a5fa;
    --secondary-color: #3b82f6;
    background-color: var(--light-color);
    color: var(--dark-color);
}



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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 15px;
    position: relative;
}

.underline {
    height: 4px;
    width: 70px;
    background-color: var(--primary-color);
    margin: 0 auto;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

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

.primary-btn:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

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

.secondary-btn:hover {
    background-color: var(--dark-color);
    color: var(--light-color);
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--light-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px 0;
    transition: var(--transition);
}

header.sticky {
    padding: 10px 0;
    background-color: rgba(255, 255, 255, 0.95);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.logo span {
    color: var(--primary-color);
}

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

.nav-links a {
    font-weight: 500;
    position: relative;
    padding: 5px 0;
    transition: var(--transition);
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

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

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--dark-color);
    margin: 5px 0;
    transition: var(--transition);
}

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

.theme-toggle:hover { background-color: rgba(99, 102, 241, 0.08); }

/* Scroll progress bar */
#progressBar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    width: 0;
    background: linear-gradient(90deg, #22d3ee, #3b82f6, #9333ea);
    z-index: 1200;
}

/* Hero Section */
.hero {
    padding-top: calc(var(--header-height) + 40px);
    padding-bottom: 100px;
    position: relative;
    /* Layered background: dark overlay + color glows + image */
    background:
      linear-gradient(180deg, rgba(2,6,23,0.65), rgba(2,6,23,0.65)),
      radial-gradient(1200px 600px at 10% 10%, rgba(59,130,246,0.18), transparent),
      radial-gradient(1000px 500px at 90% 20%, rgba(34,211,238,0.18), transparent),
      radial-gradient(900px 600px at 50% 110%, rgba(147,51,234,0.18), transparent),
      url('https://images.pexels.com/photos/546819/pexels-photo-546819.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=1920&h=1080&fit=crop') center / cover no-repeat;
    animation: floatBG 12s ease-in-out infinite alternate;
    overflow: hidden;
    min-height: calc(100vh - var(--header-height));
}

@keyframes floatBG {
    0% { background-position: 0px 0px, 0px 0px, 0px 0px; }
    100% { background-position: 30px -20px, -40px 30px, 20px 40px; }
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    position: relative;
    z-index: 1;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    /* Always light title in hero, independent of theme */
    color: #e5e7eb;
}

.hero-text h1 span {
    color: var(--primary-color);
}

.hero-text h2 {
    font-size: 1.5rem;
    font-weight: 500;
    /* Always light-subtle subtitle in hero */
    color: rgba(226, 232, 240, 0.85);
    margin-bottom: 20px;
}

.hero-text p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: 600px;
    /* Always light-subtle body in hero */
    color: rgba(226, 232, 240, 0.78);
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.hero-image {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.hero-image img {
    border-radius: 20px;
    box-shadow: var(--box-shadow);
    position: relative;
    z-index: 1;
}

.hero-image::before {
    content: '';
    position: absolute;
    top: -15px;
    right: -15px;
    width: 100%;
    height: 100%;
    border: 5px solid var(--primary-color);
    border-radius: 20px;
    z-index: 0;
}

.social-icons {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 2;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    /* Always light indicator */
    color: rgba(226, 232, 240, 0.92);
    z-index: 2;
    opacity: 0.85;
    animation: scrollBounce 1.6s ease-in-out infinite;
}

.scroll-indicator i { opacity: 0.9; }
.scroll-indicator span { letter-spacing: 0.08em; font-weight: 500; }

@keyframes scrollBounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, 6px); }
}

/* Disable fixed background behavior on small devices for perf */
@media (max-width: 768px) {
  .hero { background-attachment: scroll; padding-bottom: 80px; }
}

/* Scroll Down marquee just below hero */
.scroll-marquee {
    width: 100%;
    overflow: hidden;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(99,102,241,0.08), transparent);
}

.scroll-marquee .marquee-inner {
    display: flex;
    gap: 40px;
    white-space: nowrap;
    animation: marqueeMove 18s linear infinite;
    padding: 10px 0;
}

.scroll-marquee span {
    color: var(--gray-color);
    font-weight: 600;
    letter-spacing: 0.12em;
}

@keyframes marqueeMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 576px) {
  .scroll-marquee { display: none; }
}

.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
    transform: translateY(-5px);
}

/* Stats Section */
.stats {
    background: linear-gradient(180deg, rgba(59,130,246,0.06), transparent 60%);
    padding-top: 60px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat {
    background: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--box-shadow);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label { color: var(--gray-color); margin-top: 6px; }

/* About Section */
.about {
    background-color: var(--light-color);
}

.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.about-image {
    flex: 1;
    position: relative;
}

.about-image img {
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

.about-text {
    flex: 1;
}

.about-text h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.about-text p {
    margin-bottom: 20px;
    color: var(--gray-color);
}

.about-details {
    margin-top: 30px;
}

.detail {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.detail i {
    width: 40px;
    height: 40px;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    margin-right: 15px;
}

/* Experience Section */
.experience {
    background-color: var(--light-color);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
}

.timeline-dot {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--primary-color);
    z-index: 1;
    animation: dotPulse 1s ease-in-out infinite;
    will-change: transform, box-shadow;
}

@keyframes dotPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.25);
    }
    50% {
        transform: translateX(-50%) scale(0.75);
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0.08);
    }
}

.timeline-content {
    position: relative;
    width: calc(50% - 40px);
    padding: 30px;
    background-color: var(--light-color);
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

.timeline-item:nth-child(odd) .timeline-content {
    left: 0;
}

.timeline-item:nth-child(even) .timeline-content {
    left: calc(50% + 40px);
}

.timeline-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.timeline-date {
    display: block;
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 500;
}

.timeline-content ul {
    padding-left: 20px;
}

.timeline-content ul li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
    color: var(--gray-color);
}

.timeline-content ul li::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-color);
}

/* Skills Section */
.skills {
    background-color: var(--light-color);
}

.skills-content {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.skills-category h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    text-align: center;
    color: var(--dark-color);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
}

.skill-item {
    background-color: var(--light-color);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
    will-change: transform;
}

.skill-item:hover {
    transform: translateY(-5px);
}

.skill-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.skill-icon i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.skill-item h4 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--dark-color);
}

/* Education Section */
.education {
    background-color: var(--light-color);
}

.education-content {
    max-width: 800px;
    margin: 0 auto;
}

.education-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 40px;
    background-color: var(--light-color);
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.education-item:hover {
    transform: translateY(-5px);
}

.education-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
}

.education-icon i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.education-details h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.education-details h4 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.education-details p {
    margin-bottom: 5px;
    color: var(--gray-color);
}

.education-date {
    font-size: 0.9rem;
    color: var(--gray-color);
    font-weight: 500;
}

/* Projects Section */
.projects {
    background-color: var(--light-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--light-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
    will-change: transform;
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-image {
    height: 200px;
    overflow: hidden;
}

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

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

.project-info {
    padding: 20px;
}

.project-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.project-info p {
    margin-bottom: 15px;
    color: var(--gray-color);
    font-size: 0.95rem;
}

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

.project-tags span {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Contact Section */
.contact {
    background-color: var(--light-color);
}

.contact-content {
    display: flex;
    gap: 50px;
}

.contact-info {
    flex: 1;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
}

.contact-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(37, 99, 235, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
}

.contact-icon i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.contact-text h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.contact-text p {
    color: var(--gray-color);
}

.contact-form {
    flex: 1;
    background-color: var(--light-color);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

/* Dark mode polish for contact section */
body.dark .contact-icon { background-color: rgba(96, 165, 250, 0.18); }
body.dark .contact-text h3 { color: var(--dark-color); }
body.dark .contact-text p { color: var(--gray-color); }
body.dark .section-header .underline { background-color: var(--primary-color); }
body.dark .contact-form {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
}
body.dark .contact-item { border-bottom: 1px solid rgba(255, 255, 255, 0.06); padding-bottom: 18px; }
body.dark .contact-item:last-child { border-bottom: none; padding-bottom: 0; }

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: var(--dark-color);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    height: 150px;
    resize: none;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 50px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.footer-logo h2 {
    font-size: 2rem;
    font-weight: 700;
}

.footer-logo span {
    color: var(--primary-color);
}

.footer-social {
    display: flex;
    gap: 20px;
}

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

.footer-social a:hover {
    background-color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Back to top */
#backToTop {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    display: grid;
    place-items: center;
    box-shadow: var(--box-shadow);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1100;
}

#backToTop.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Responsive Styles */
@media screen and (max-width: 992px) {
    .section-header h2 {
        font-size: 2rem;
    }
    
    .hero-content {
        flex-direction: column;
    }
    
    .hero-text {
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-image {
        margin: 0 auto;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .about-text {
        text-align: center;
    }
    
    .detail {
        justify-content: center;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-dot {
        left: 20px;
    }
    
    .timeline-content {
        width: calc(100% - 60px);
        left: 60px !important;
    }
    
    .contact-content {
        flex-direction: column;
    }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--light-color);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        z-index: 999;
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .hamburger {
        display: block;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .hero-text h2 {
        font-size: 1.2rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
    }

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

@media screen and (max-width: 576px) {
    section {
        padding: 70px 0;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .hero-text h1 {
        font-size: 1.8rem;
    }
    
    .hero-text h2 {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
}
