html {
    scroll-behavior: smooth;
}

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

:root {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --accent: #007aff;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --text-primary: #f5f5f7;
    --text-secondary: #98989d;
    --accent: #0a84ff;
    --glass-bg: rgba(28, 28, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
    --nav-bg: rgba(28, 28, 30, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
}

/* Navigation */
nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    padding: 12px 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--shadow);
    transition: all 0.3s ease;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 8px;
    align-items: center;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 16px;
    font-weight: 500;
    display: inline-block;
}

nav a:hover {
    background: var(--glass-bg);
    transform: translateY(-2px);
}

nav a.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

/* Theme toggle container */
.theme-toggle-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px var(--shadow);
    background: var(--accent);
}

/* Fix for touch devices - prevent hover state from sticking */
@media (hover: none) and (pointer: coarse) {
    .scroll-to-top:hover {
        transform: translateY(0);
        box-shadow: 0 8px 32px var(--shadow);
        background: var(--nav-bg);
    }
}

.scroll-to-top .scroll-icon {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

/* Theme toggle */
.theme-toggle {
    position: relative;
    width: 80px;
    height: 40px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 8px 32px var(--shadow);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow);
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.theme-toggle.active::before {
    transform: translateX(40px);
}

.theme-toggle .icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle .sun-icon {
    left: 8px;
    opacity: 1;
}

.theme-toggle .moon-icon {
    right: 8px;
    opacity: 0;
}

.theme-toggle.active .sun-icon {
    opacity: 0;
}

.theme-toggle.active .moon-icon {
    opacity: 1;
}

.theme-toggle .icon svg {
    width: 100%;
    height: 100%;
    fill: white;
}

/* Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 120px 40px 120px;
    min-height: 100vh;
}

/* Single page sections */
.page-section {
    margin-bottom: 120px;
    scroll-margin-top: 100px;
}

.page-section:last-child {
    margin-bottom: 60px;
}

/* Glass cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    padding: 40px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px var(--shadow);
}

/* About section */
.about-section {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 40px;
}

.about-content {
    flex: 1;
    text-align: left;
}

.about-content h1 {
    font-size: 64px;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, #ff2d55 50%, #af52de 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 8s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradientText {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.about-content h2 {
    font-size: 24px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 32px;
}

/* Typing animation styles */
.typing-animation {
    position: relative;
    display: inline-block;
}

.typing-animation::after {
    content: '|';
    color: var(--accent);
    animation: blink 1s infinite;
    font-weight: 300;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.about-content p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.8;
}

.profile-picture {
    flex-shrink: 0;
    width: 300px;
    height: 300px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-picture:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px var(--shadow);
}

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

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

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    margin-top: 60px;
    padding: 40px 0;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.social-icon:hover {
    transform: translateY(-8px) scale(1.1);
    color: var(--accent);
}

.social-icon svg {
    width: 64px;
    height: 64px;
    transition: transform 0.3s ease;
}

.social-icon:hover svg {
    transform: scale(1.1);
}

/* Legacy hero styles for other pages */
.hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 64px;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, #ff2d55 50%, #af52de 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 8s ease infinite;
    background-size: 200% 200%;
}

.hero h2 {
    font-size: 24px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 20px;
    line-height: 1.8;
}

.cta-button {
    display: inline-block;
    padding: 16px 36px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    /* margin-top: 24px; */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.cta-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.4);
}

/* Projects section */
.project-category {
    margin-bottom: 60px;
}

.category-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 32px;
}

.project-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    padding: 40px;
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px var(--shadow);
    border-color: var(--accent);
}

.project-card img,
.project-card video {
    width: 100%;
    height: 250px;
    object-fit: contain;
    border-radius: 16px;
    margin-bottom: 24px;
    transition: transform 0.3s ease;
}

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

.project-card h3 {
    font-size: 28px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.7;
    font-size: 16px;
}

.project-tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
    margin-top: 8px;
}

/* CV section */
.cv-section {
    margin-bottom: 40px;
}

.cv-section h2 {
    font-size: 36px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.cv-item {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    padding: 28px;
    border: 1px solid var(--glass-border);
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cv-item-two-col {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
}

.cv-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cv-left .date {
    margin-bottom: 0;
}

.cv-left .location {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.cv-right {
    flex: 1;
}

.cv-right h3 {
    font-size: 22px;
    margin-bottom: 8px;
    color: var(--text-primary);
    margin-top: 0;
}

.cv-right .institution {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-style: italic;
}

.cv-item h3 {
    font-size: 22px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.cv-item .institution {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-style: italic;
}

.cv-item .date {
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

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

.cv-right p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.cv-item ul {
    list-style: none;
    margin-top: 12px;
}

.cv-right ul {
    list-style: none;
    margin-top: 12px;
    margin-bottom: 0;
}

.cv-item ul li {
    color: var(--text-secondary);
    padding-left: 24px;
    position: relative;
    margin-bottom: 8px;
}

.cv-right ul li {
    color: var(--text-secondary);
    padding-left: 24px;
    position: relative;
    margin-bottom: 8px;
}

.cv-item ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

.cv-right ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

/* Overview section custom styling */
.overview-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.overview-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
    align-items: baseline;
}

.overview-label {
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
}

.overview-content {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
}

/* Responsive design */
@media (max-width: 768px) {
    nav {
        top: 10px;
        padding: 10px 16px;
        border-radius: 16px;
    }

    nav ul {
        gap: 4px;
    }

    nav a {
        padding: 8px 12px;
        font-size: 14px;
    }

    .container {
        padding: 100px 20px 20px;
    }

    /* Make theme toggle static on mobile */
    .theme-toggle-container {
        position: static;
        display: flex;
        justify-content: center;
        margin: 40px 0 20px;
    }

    .about-section {
        flex-direction: column;
        gap: 24px;
    }

    .about-content {
        text-align: center;
    }

    .about-content h1 {
        font-size: 40px;
    }

    .about-content h2 {
        font-size: 20px;
    }

    .about-content p {
        font-size: 16px;
    }

    .profile-picture {
        width: 250px;
        height: 250px;
        align-self: center;
    }

    .social-links {
        flex-wrap: wrap;
        gap: 20px;
        margin-top: 40px;
        padding: 30px 0 20px;
        max-width: 100%;
    }

    .social-icon svg {
        width: 56px;
        height: 56px;
    }

    .social-icon:hover {
        transform: translateY(-4px) scale(1.05);
    }

    .hero h1 {
        font-size: 40px;
    }

    .hero h2 {
        font-size: 20px;
    }

    .hero p {
        font-size: 16px;
    }

    .glass-card {
        padding: 24px;
    }

    .project-category {
        margin-bottom: 50px;
    }

    .category-title {
        font-size: 28px;
    }

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

    .cv-section h2 {
        font-size: 28px;
    }

    .cv-item-two-col {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cv-left {
        flex-direction: row;
        gap: 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--glass-border);
    }

    .cv-left .location::before {
        content: '• ';
        margin: 0 4px;
    }

    .overview-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .overview-label {
        font-size: 13px;
    }

    .overview-content {
        font-size: 15px;
    }

    /* Make footer static on mobile */
    footer {
        position: static !important;
        transform: none !important;
        margin: 20px auto !important;
        width: fit-content !important;
        bottom: auto !important;
        left: auto !important;
    }
}

/* Mobile landscape orientation - make footer static like mobile portrait */
@media (max-height: 768px) and (min-width: 768px) {
    /* Make theme toggle static on mobile landscape */
    .theme-toggle-container {
        position: static;
        display: flex;
        justify-content: center;
        margin: 40px 0 20px;
    }

    /* Make footer static on mobile landscape */
    footer {
        position: static !important;
        transform: none !important;
        margin: 20px auto !important;
        width: fit-content !important;
        bottom: auto !important;
        left: auto !important;
    }
}


/* Footer */
footer {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    padding: 12px 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--shadow);
    transition: all 0.3s ease;
}

footer p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    text-align: center;
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .social-links {
        gap: 16px;
        padding: 25px 10px 15px;
    }

    .social-icon svg {
        width: 48px;
        height: 48px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Rise animation keyframes - COMMENTED OUT
@keyframes riseUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation classes - COMMENTED OUT
.rise-animation {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.rise-animation.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations for multiple elements - COMMENTED OUT
.rise-animation.delay-1 {
    transition-delay: 0.1s;
}

.rise-animation.delay-2 {
    transition-delay: 0.2s;
}

.rise-animation.delay-3 {
    transition-delay: 0.3s;
}

.rise-animation.delay-4 {
    transition-delay: 0.4s;
}

.rise-animation.delay-5 {
    transition-delay: 0.5s;
}

.rise-animation.delay-6 {
    transition-delay: 0.6s;
}

/* Specific animations for different content types - COMMENTED OUT
.about-section {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-section.animate {
    opacity: 1;
    transform: translateY(0);
}

.social-links {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0.3s;
}

.social-links.animate {
    opacity: 1;
    transform: translateY(0);
}

.hero {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero.animate {
    opacity: 1;
    transform: translateY(0);
}

.project-category {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-category.animate {
    opacity: 1;
    transform: translateY(0);
}

.project-card {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card.animate {
    opacity: 1;
    transform: translateY(0);
}

.cv-section {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.cv-section.animate {
    opacity: 1;
    transform: translateY(0);
}

.cv-item {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.cv-item.animate {
    opacity: 1;
    transform: translateY(0);
}
*/

/* Gradient Descent Loading Screen */
#gradient-descent-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.loader-content {
    max-width: 800px;
    width: 90%;
    padding: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--shadow);
}

.loader-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 20px;
    text-align: center;
    font-family: 'Courier New', monospace;
}

.loader-logs {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    height: 320px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid var(--glass-border);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.8;
}

.log-line {
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    animation: fadeInLog 0.2s ease;
}

.log-line.success {
    color: #34C759;
    font-weight: 600;
    margin-top: 12px;
}

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

.loader-progress {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ff2d55);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 4px;
}

/* Scrollbar styling for loader logs */
.loader-logs::-webkit-scrollbar {
    width: 8px;
}

.loader-logs::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

.loader-logs::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.loader-logs::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

@media (max-width: 768px) {
    .loader-content {
        padding: 24px;
    }
    
    .loader-title {
        font-size: 18px;
    }
    
    .loader-logs {
        height: 240px;
        padding: 16px;
        font-size: 11px;
    }
}

/* Project Page Styles */
/* Back Button */
.back-button-container {
    margin-bottom: 40px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px var(--shadow);
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow);
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.back-button svg {
    transition: transform 0.3s ease;
}

.back-button:hover svg {
    transform: translateX(-2px);
}

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

.project-header h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, #ff2d55 50%, #af52de 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 8s ease infinite;
    background-size: 200% 200%;
}

.project-one-liner {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-style: italic;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.project-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    padding: 40px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--shadow);
    margin-bottom: 32px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-section h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.project-section p {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.implementation-list,
.features-list {
    list-style: none;
    padding: 0;
}

.implementation-list li,
.features-list li {
    color: var(--text-secondary);
    padding-left: 24px;
    position: relative;
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.6;
}

.implementation-list li::before,
.features-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

.project-actions {
    text-align: center;
    margin-top: 40px;
}

.view-code-btn {
    display: inline-block;
    padding: 16px 36px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.view-code-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.4);
}

/* Project Gallery Styles */
.project-gallery {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    padding: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--shadow);
    margin-bottom: 40px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Swipe Hint Info Window */
.swipe-hint {
    display: none; /* Hidden by default */
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 16px;
    box-shadow: 0 8px 32px var(--shadow);
    z-index: 100;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Fade out animation before hiding */
.swipe-hint.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.swipe-hint-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.swipe-hint .dark-icon {
    display: none;
}

[data-theme="dark"] .swipe-hint .dark-icon {
    display: block;
}

[data-theme="dark"] .swipe-hint .light-icon {
    display: none;
}

.swipe-hint-text {
    white-space: nowrap;
}

/* Only show on touchscreen devices */
@media (hover: none) and (pointer: coarse) {
    .swipe-hint {
        display: flex;
    }
}

.gallery-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.gallery-bottom-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    gap: 20px;
}

.gallery-btn {
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.gallery-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
    background: var(--accent);
}

.gallery-btn:hover .info-icon {
    color: white !important;
}

.info-icon {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.fullscreen-icon {
    width: 20px;
    height: 20px;
    transition: filter 0.3s ease;
}

.page-counter {
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 20px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 4px 16px var(--shadow);
}

.gallery-caption {
    flex: 1;
    text-align: center;
    transition: all 0.3s ease;
}

.gallery-caption p {
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 20px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    box-shadow: 0 4px 16px var(--shadow);
    display: inline-block;
}

.gallery-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio (9/16 = 0.5625) */
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.gallery-image.active {
    opacity: 1;
}

.gallery-image img,
.gallery-image video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.gallery-image:hover img,
.gallery-image:hover video {
    transform: scale(1.02);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
}


.gallery-nav:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px var(--shadow);
    background: var(--accent);
    color: white;
}

.gallery-nav.prev {
    left: 20px;
}

.gallery-nav.next {
    right: 20px;
}

.gallery-nav svg {
    width: 20px;
    height: 20px;
}

/* Gallery Dots Navigation */
.gallery-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 8px 16px;
    box-shadow: 0 4px 16px var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


.gallery-container.show-controls .gallery-nav,
.gallery-container.show-controls .gallery-dots {
    opacity: 1;
    visibility: visible;
}

/* Show controls on gallery hover (desktop only) */
@media (hover: hover) and (pointer: fine) {
    .project-gallery:hover .gallery-nav,
    .project-gallery:hover .gallery-dots {
        opacity: 1;
        visibility: visible;
    }
}

.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    padding: 0;
    opacity: 0.5;
}

.gallery-dot:hover {
    opacity: 0.8;
    transform: scale(1.2);
}

.gallery-dot.active {
    background: var(--accent);
    opacity: 1;
    transform: scale(1.3);
}

/* Fullscreen Gallery Styles */
.project-gallery.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    border-radius: 0;
    padding: 20px;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.project-gallery.fullscreen .gallery-container {
    width: 90vw;
    height: 90vh;
    max-width: 90vw;
    max-height: 90vh;
    padding-bottom: 0;
}

.project-gallery.fullscreen .gallery-nav {
    width: 60px;
    height: 60px;
}

.project-gallery.fullscreen .gallery-nav.prev {
    left: 40px;
}

.project-gallery.fullscreen .gallery-nav.next {
    right: 40px;
}

.project-gallery.fullscreen .gallery-nav svg {
    width: 24px;
    height: 24px;
}

/* Fullscreen bottom controls positioning */
.project-gallery.fullscreen .gallery-bottom-controls {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: transparent;
}

.project-gallery.fullscreen .swipe-hint {
    top: 20px;
}

.project-gallery.fullscreen .page-counter {
    position: fixed;
    bottom: 20px;
    left: 20px;
}

.project-gallery.fullscreen .fullscreen-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

.project-gallery.fullscreen .fullscreen-icon {
    width: 20px;
    height: 20px;
}

.project-gallery.fullscreen .gallery-caption {
    display: none;
}

/* Responsive Design for Project Page */
@media (max-width: 768px) {
    .back-button-container {
        margin-bottom: 30px;
    }
    
    .back-button {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .project-header h1 {
        font-size: 32px;
    }
    
    .project-one-liner {
        font-size: 18px;
    }
    
    .project-tags {
        gap: 8px;
    }
    
    .project-section {
        padding: 24px;
    }
    
    .project-section h2 {
        font-size: 24px;
    }
    
    .project-section p {
        font-size: 16px;
    }
    
    .implementation-list li,
    .features-list li {
        font-size: 15px;
    }
    
    .project-gallery {
        padding: 16px;
    }
    
    .swipe-hint {
        top: 8px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .swipe-hint-icon {
        width: 14px;
        height: 14px;
    }
    
    .gallery-container {
        height: 0;
        padding-bottom: 56.25%; /* Maintain 16:9 aspect ratio on mobile */
    }
    
    .gallery-controls {
        margin-bottom: 16px;
    }
    
    .gallery-bottom-controls {
        margin-top: 16px;
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .gallery-btn {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
    
    .info-icon {
        font-size: 16px;
    }
    
    .fullscreen-icon {
        width: 16px;
        height: 16px;
    }
    
    .page-counter {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .gallery-caption p {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .gallery-nav {
        width: 36px;
        height: 36px;
        opacity: 0;
        visibility: hidden;
    }
    
    .gallery-nav.prev {
        left: 10px;
    }
    
    .gallery-nav.next {
        right: 10px;
    }
    
    .gallery-nav svg {
        width: 14px;
        height: 14px;
    }
    
    .gallery-dots {
        bottom: 12px;
        gap: 8px;
        padding: 6px 12px;
        opacity: 0;
        visibility: hidden;
    }
    
    .gallery-dot {
        width: 8px;
        height: 8px;
    }
    
    .project-gallery.fullscreen .gallery-container {
        width: 95vw;
        height: 95vh;
        max-width: 95vw;
        max-height: 95vh;
        padding-bottom: 0;
    }
    
    .project-gallery.fullscreen .gallery-nav {
        width: 48px;
        height: 48px;
    }
    
    .project-gallery.fullscreen .gallery-nav.prev {
        left: 20px;
    }
    
    .project-gallery.fullscreen .gallery-nav.next {
        right: 20px;
    }
    
    .project-gallery.fullscreen .gallery-nav svg {
        width: 20px;
        height: 20px;
    }
}

/* Disable hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    nav a:hover {
        background: transparent;
        transform: translateY(0);
        color: inherit;
    }
    
    nav a.active:hover {
        background: var(--accent);
        color: white;
        transform: translateY(0);
    }
    
    .scroll-to-top:hover {
        transform: translateY(0);
        box-shadow: 0 4px 16px var(--shadow);
    }
    
    .theme-toggle:hover {
        transform: scale(1);
    }
    
    .glass-card:hover {
        transform: translateY(0);
    }
    
    .profile-picture:hover {
        transform: scale(1);
    }
    
    .profile-picture:hover .profile-img {
        transform: scale(1);
    }
    
    .social-icon:hover {
        transform: translateY(0);
        color: var(--text-primary);
    }
    
    .social-icon:hover svg {
        transform: scale(1);
    }
    
    .cta-button:hover {
        transform: translateY(0) scale(1);
        box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
    }
    
    .project-card:hover {
        transform: translateY(0);
        box-shadow: 0 8px 32px var(--shadow);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .project-card:hover img,
    .project-card:hover video {
        transform: scale(1);
    }
    
    .back-button:hover {
        transform: translateX(0);
        color: inherit;
    }
    
    .back-button:hover svg {
        transform: translateX(0);
    }

    .view-code-btn:hover {
        transform: translateY(0);
        box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
    }
    
    .project-gallery:hover {
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .gallery-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: translateY(0);
        box-shadow: none;
    }
    
    .gallery-btn:hover .info-icon {
        color: inherit !important;
    }
    
    
    .gallery-image:hover img,
    .gallery-image:hover video {
        transform: scale(1);
    }
    
    .gallery-nav:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: translateY(-50%) scale(1);
        box-shadow: none;
        color: inherit;
    }
    
    .gallery-dot:hover {
        transform: scale(1);
    }
}
