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

:root {
    --primary: #ff6b35;
    --secondary: #f7931e;
    --accent-pink: #ff1744;
    --accent-purple: #9c27b0;
    --accent-blue: #3d5afe;
    --bg-dark: #0a0a0a;
    --bg-light: #ffffff;
    --surface-dark: #1a1a1a;
    --surface-light: #f5f5f5;
    --text-dark: #ffffff;
    --text-light: #0a0a0a;
    --text-muted-dark: #b0b0b0;
    --text-muted-light: #6a6a6a;
    --card-dark: rgba(26, 26, 26, 0.85);
    --card-light: rgba(255, 255, 255, 0.85);
    --gradient: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent-pink), var(--accent-purple), var(--accent-blue));
    --squircle-radius: 16px;
}

[data-theme="dark"] {
    --bg-primary: var(--bg-dark);
    --bg-secondary: var(--surface-dark);
    --text-primary: var(--text-dark);
    --text-secondary: var(--text-muted-dark);
    --card-bg: var(--card-dark);
    --border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] {
    --bg-primary: var(--bg-light);
    --bg-secondary: var(--surface-light);
    --text-primary: var(--text-light);
    --text-secondary: var(--text-muted-light);
    --card-bg: var(--card-light);
    --border-color: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-primary);
}

#techCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: float 25s ease-in-out infinite;
    will-change: transform;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary), transparent);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-pink), transparent);
    top: 50%;
    right: 10%;
    animation-delay: 6s;
}

.orb-3 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, var(--accent-purple), transparent);
    bottom: 20%;
    left: 40%;
    animation-delay: 12s;
}

.orb-4 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--accent-blue), transparent);
    top: 70%;
    left: 20%;
    animation-delay: 18s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    25% { transform: translate(80px, -80px) scale(1.15) rotate(90deg); }
    50% { transform: translate(-60px, 80px) scale(0.85) rotate(180deg); }
    75% { transform: translate(70px, 60px) scale(1.05) rotate(270deg); }
}

.main-nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}

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

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

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

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

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

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.theme-toggle {
    background: var(--card-bg);
    border: 2px solid var(--primary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--squircle-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
}

.main-content {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
}

.section-title {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    animation: fadeInUp 0.8s ease;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.hero-bio {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
}

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

.btn {
    padding: 1rem 2rem;
    border-radius: var(--squircle-radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    font-size: 1rem;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.4);
}

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

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

.hero-image {
    display: flex;
    justify-content: center;
    animation: fadeIn 1s ease;
}

.profile-img-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 30%;
    object-fit: cover;
    border: 5px solid var(--primary);
    box-shadow: 0 0 50px rgba(255, 107, 53, 0.3);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 50px rgba(255, 107, 53, 0.3); }
    50% { box-shadow: 0 0 80px rgba(255, 107, 53, 0.6); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.about-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.about-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
}

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

.contact-info a,
.contact-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--squircle-radius);
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-icon {
    font-size: 1.2rem;
}

.contact-info a:hover,
.contact-links a:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.2);
}

.education-grid {
    display: grid;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.edu-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: var(--squircle-radius);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.edu-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.2);
}

.edu-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 1rem;
}

.edu-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

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

.skill-category {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: var(--squircle-radius);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.skill-category:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.2);
}

.skill-category h4 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary);
}

.skill-category p {
    color: var(--text-secondary);
    line-height: 1.6;
}

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

.project-preview-card {
    position: relative;
    height: 300px;
    border-radius: var(--squircle-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--border-color);
    text-decoration: none;
    display: block;
}

.project-preview-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(255, 107, 53, 0.3);
    border-color: var(--primary);
}

.project-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.95), rgba(10, 10, 10, 0.3));
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.project-role {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.project-desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.view-all-projects {
    text-align: center;
}

.experience-timeline {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    gap: 2rem;
}

.experience-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: var(--squircle-radius);
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
    position: relative;
}

.experience-card:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.2);
}

.experience-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.experience-card ul {
    list-style: none;
    padding-left: 0;
}

.experience-card li {
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.experience-card li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 1.2rem;
}

.contact-section {
    text-align: center;
}

.contact-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

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

.contact-links a {
    font-size: 1.1rem;
}

.main-footer {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}



.projects-page {
    padding-top: 80px;
}

.page-header {
    padding: 6rem 0 2rem;
    text-align: center;
}

.page-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    padding: 0;
    border-radius: var(--squircle-radius);
    border: 2px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

.project-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(255, 107, 53, 0.3);
}

.project-header {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.project-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.project-header-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.95), transparent);
}

.project-header h3 {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.project-content {
    padding: 2rem;
}

.project-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

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

.project-content ul {
    list-style: none;
    padding-left: 0;
}

.project-content li {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.project-content li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 1.2rem;
}

/* Additions for the static build: publications, links, image placeholder, anchors */
section[id],
.project-card {
    scroll-margin-top: 90px;
}

.pub-card h3 {
    font-size: 1.25rem;
    line-height: 1.4;
}

.pub-authors .me {
    color: var(--text-primary);
    font-weight: 600;
}

.pub-venue {
    font-style: italic;
}

.pub-status {
    color: var(--primary);
    font-weight: 600;
    margin-top: 0.5rem;
}

.item-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.item-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.35rem 0.9rem;
    border: 2px solid var(--primary);
    border-radius: var(--squircle-radius);
    transition: all 0.3s ease;
}

.item-links a:hover {
    background: var(--primary);
    color: white;
}

.experience-summary {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.project-placeholder {
    background: var(--gradient);
    opacity: 0.85;
}

.project-header .project-placeholder {
    position: absolute;
    inset: 0;
}

.load-error {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 1rem;
}

.contact-info a,
.contact-links a {
    max-width: 100%;
    overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
    .nav-links {
        gap: 1.25rem;
    }
}

@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image {
        order: -1;
    }

    .profile-img-wrapper {
        width: 300px;
        height: 300px;
    }

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

    .nav-links {
        gap: 0.9rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 900px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        flex-direction: column;
        background: var(--card-bg);
        backdrop-filter: blur(20px);
        width: 100%;
        padding: 2rem;
        gap: 1.5rem;
        font-size: 1rem;
        transition: left 0.3s ease;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
        margin-left: auto;
        margin-right: 1rem;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

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

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

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

    .page-title {
        font-size: 2.5rem;
    }

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

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

    .contact-info,
    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    .project-header h3 {
        font-size: 1.5rem;
    }

    .edu-card,
    .skill-category,
    .experience-card,
    .project-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 1rem;
    }

    .container {
        padding: 0 1rem;
    }

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

    .section {
        padding: 4rem 0;
    }

    .profile-img-wrapper {
        width: 250px;
        height: 250px;
    }

    .project-preview-card,
    .project-header {
        height: 250px;
    }

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

    .experience-card:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gradient-orb,
    .profile-img,
    .hero-content,
    .hero-image {
        animation: none;
    }

    html {
        scroll-behavior: auto;
    }
}
