/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

@font-face {
    font-family: 'JetBrainMono Nerd Font';
    src: url('/fonts/JetBrainsMonoNerdFont-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

:root {
    --primary-color: #0071e3;
    --secondary-color: #2997ff;
    --background-dark: #000000;
    --background-light: #1d1d1f;
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --accent-color: #0071e3;
    --transition: all 0.3s ease;
    --bg: #000000;
    --bg-secondary: #1d1d1f;
    --navbar--transition-duration: 0.3s;
    
    /* Add the Skills section background color */
    --skills-bg: #1a1f2b;
    
    /* Typography */
    --font-system: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --h1-size: clamp(2.5rem, 5vw, 4.5rem);
    --h2-size: clamp(2rem, 4vw, 3.5rem);
    --h3-size: clamp(1.5rem, 3vw, 2.5rem);
    --p-size: clamp(1rem, 2vw, 1.125rem);
    --small-size: 0.875rem;
    --section-gradient-1: #121212;
    --section-gradient-2: #1a1a1a;
    --section-gradient-3: #202020;
    --transition-slow: all 0.5s cubic-bezier(0.42, 0, 0.58, 1);
    --transition-elastic: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-bounce: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --font-primary: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-text: "SF Pro Text", -apple-system, BlinkMacSystemFont, sans-serif;
    --headline-1: 800 48px/52px var(--font-display);
    --headline-2: 700 32px/36px var(--font-display);
    --headline-3: 600 24px/28px var(--font-display);
    --body-large: 400 17px/22px var(--font-text);
    --body-regular: 400 15px/20px var(--font-text);
    --body-small: 400 13px/18px var(--font-text);
    --letter-spacing-tight: -0.01em;
    --letter-spacing-normal: 0em;
    --letter-spacing-wide: 0.01em;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-system);
    background-color: var(--background-dark);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

h1 {
    font-size: var(--h1-size);
    font-weight: 700;
    letter-spacing: -0.03em;
}

h2 {
    font-size: var(--h2-size);
    font-weight: 600;
}

h3 {
    font-size: var(--h3-size);
    font-weight: 600;
}

p {
    font-size: var(--p-size);
    line-height: 1.5;
    color: var(--text-secondary);
}

.nav-brand {
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    text-decoration: none;
    opacity: 0.9;
}

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

.nav-links a {
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    opacity: 0.8;
}

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

.nav-links a:visited {
    color: var(--text-secondary);
}

/* Remove the underline animation */
.nav-links a::after {
    display: none;
    content: none;
    width: 0;
    height: 0;
    background: none;
    transition: none;
}

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

/* General link styles */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

a:visited {
    color: var(--text-secondary);
    opacity: 0.8;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    color: #ffffff !important;
}

.btn-primary:visited {
    color: #ffffff !important;
    opacity: 1;
}

/* Project links */
.project-links a {
    flex: 1;
    max-width: 200px;
    text-align: center;
    color: var(--text-primary);
    background-color: var(--primary-color);
    padding: 0.8rem 1.5rem;
    border-radius: 980px;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: var(--transition);
}

.project-links a.disabled {
    background-color: var(--background-light);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.7;
    pointer-events: none;
}

.project-links a:hover:not(.disabled) {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.project-links a:visited {
    color: var(--text-primary);
    opacity: 1;
}

.hero-content h1 {
    font-size: var(--h1-size);
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.hero-content h2 {
    font-size: var(--h2-size);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.hero-content p {
    font-size: var(--p-size);
    color: var(--text-secondary);
    line-height: 1.5;
}

.section-title {
    font-size: var(--h2-size);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

#resume .section-title {
    margin-bottom: 0;
}

.contact-section .section-title {
    margin-bottom: 0;
}

.projects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.project-card {
    background: var(--background-light);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 0 1 calc(33.333% - 2rem);
    min-width: 300px;
    max-width: 400px;
}

.project-content {
    padding: 2rem;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.project-card img {
    width: 100%;
    height: 240px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
}

.project-card h3 {
    font-size: var(--h3-size);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-card p {
    font-size: var(--p-size);
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.project-tech {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    align-items: center;
}

.project-tech i {
    font-size: 2rem;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: var(--background-light);
    border-radius: 0.75rem;
}

.project-tech i.nf-custom {
    font-family: "JetBrainsMono Nerd Font", monospace !important;
    font-size: 2.25rem;
}

.project-tech i:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: var(--p-size);
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.project-status, .project-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-status i {
    color: var(--primary-color);
}

.project-date i {
    color: var(--text-secondary);
}

.project-image-link {
    display: block;
    text-decoration: none;
    transition: var(--transition);
}

.project-image-link:hover {
    transform: scale(1.02);
}

.project-image-link img {
    width: 100%;
    height: 240px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
}

.project-links {
    display: flex;
    justify-content: center;
    padding: 0 2rem 2rem;
    margin-top: auto;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.2);
}

.btn {
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

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

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

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

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

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

.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition-slow);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 0.75rem 2rem;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.hidden {
    transform: translateY(-100%);
}

.nav-brand:hover {
    color: var(--text-secondaryr);
}

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

.nav-links a {
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    opacity: 0.8;
}

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

.nav-links a::after {
    display: none;
    content: none;
    width: 0;
    height: 0;
    background: none;
    transition: none;
}

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

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
    position: relative;
    overflow: hidden;
    background: var(--background-dark);
    opacity: 1 !important;
    /* transform: none !important;
    animation: none !important; */
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle at center, 
        rgba(0, 199, 190, 0.4) 0%, 
        rgba(0, 113, 227, 0.3) 30%, 
        rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: blobMove1 20s ease-in-out infinite;
    filter: blur(60px);
    z-index: 0;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle at center, 
        rgba(255, 45, 85, 0.3) 0%, 
        rgba(255, 149, 0, 0.25) 30%, 
        rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: blobMove2 18s ease-in-out infinite reverse;
    filter: blur(40px);
    z-index: 0;
}

.hero-section::before {
    animation: blobMove1 20s ease-in-out infinite;
}

.hero-section::after {
    animation: blobMove2 18s ease-in-out infinite reverse;
}

.hero-content {
    position: relative;
    z-index: 1;
    animation: scaleIn 3s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes blobMove1 {
    0% {
        transform: translate(-50%, -50%) scale(1) translate(0, 0);
        opacity: 0.8;
    }
    20% {
        transform: translate(-50%, -50%) scale(1.3) translate(100px, -50px);
        opacity: 0.7;
    }
    40% {
        transform: translate(-50%, -50%) scale(0.9) translate(-80px, 80px);
        opacity: 0.9;
    }
    60% {
        transform: translate(-50%, -50%) scale(1.2) translate(50px, 100px);
        opacity: 0.6;
    }
    80% {
        transform: translate(-50%, -50%) scale(0.8) translate(-100px, -30px);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) translate(0, 0);
        opacity: 0.8;
    }
}

@keyframes blobMove2 {
    0% {
        transform: translate(-50%, -50%) scale(1) translate(0, 0);
        opacity: 0.8;
    }
    25% {
        transform: translate(-50%, -50%) scale(1.4) translate(-120px, 40px);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50%, -50%) scale(0.7) translate(90px, -60px);
        opacity: 0.9;
    }
    75% {
        transform: translate(-50%, -50%) scale(1.1) translate(-40px, -100px);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) translate(0, 0);
        opacity: 0.8;
    }
}

/* Section Styles - explicitly setting all sections to have no animations */
.section, 
#about.section, 
#education.section, 
#projects.section, 
#skills.section, 
#resume.section {
    padding: 2rem;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--background-dark); /* Default background color */
    position: relative;
    z-index: 1;
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
    will-change: auto;
}

/* Default section backgrounds */
.section:not(#education):not(#projects):not(#skills):nth-child(odd) {
    background: linear-gradient(to bottom, var(--section-gradient-2), var(--section-gradient-3));
}

.section:not(#education):not(#projects):not(#skills):nth-child(even) {
    background: linear-gradient(to bottom, var(--section-gradient-1), var(--section-gradient-2));
}

/* Education section - improved transition to Projects section */
#education.section {
    background: linear-gradient(to bottom, 
        var(--section-gradient-2) 0%,
        var(--section-gradient-2) 60%,   /* Start transition earlier */
        var(--section-gradient-2) 70%,   /* Hold main color */
        var(--skills-bg) 90%,            /* More gradual transition */
        var(--skills-bg) 100%            /* End with Skills color */
    ) !important;
    margin-bottom: -1px;                 /* Prevent any gap between sections */
}

/* Projects section - solid background with slight gradient at edges */
#projects.section {
    background: linear-gradient(to bottom,
        var(--skills-bg) 0%,             /* Start with Skills color */
        var(--skills-bg) 100%            /* End with Skills color */
    ) !important;
    position: relative;
    overflow: hidden;
    margin-top: -1px;                    /* Prevent any gap with Education section */
    margin-bottom: -1px;                 /* Prevent any gap with Skills section */
}

/* Remove the radial gradient from Projects section */
#projects::before {
    content: none;
}

/* Skills section - improved transition from Projects section */
#skills.section {
    background: linear-gradient(to bottom,
        var(--skills-bg) 0%,             /* Start with Skills color */
        var(--skills-bg) 10%,            /* Hold Skills color */
        #0a0a0a 40%,                     /* Darker gradient */
        #121212 100%                     /* End with slightly lighter dark */
    ) !important;
    margin-top: -1px; 
    padding-bottom: 80px;                    /* Prevent any gap between sections */
}

/* About section */
#about.section {
    background: linear-gradient(to bottom, var(--section-gradient-1), var(--section-gradient-2));
}

/* Section animations */
.section {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
    will-change: auto;
}

.section.visible {
    opacity: 1;
    transform: none;
}

/* Section content animations - controls the inner content */
.section-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), 
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.section.visible .section-content {
    opacity: 1;
    transform: translateY(0);
}

/* Preserve About section specific animations */
.about-image, .about-text p {
    opacity: 0 !important;
    transform: translateY(30px) !important;
    transition: none !important;
}

.section.visible .about-image, 
.section.visible .about-text p {
    transition-property: transform, opacity !important;
    transition-duration: 0.6s !important;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.section.visible .about-image.animate-in, 
.section.visible .about-text p.animate-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Contact Form */
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition);
}

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

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

/* Dark Theme Adjustments */
.dark-theme {
    background: var(--background-dark);
    color: #ffffff;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.8;
    padding: 0.5rem;
}

.mobile-menu-btn:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        display: flex;
        position: fixed;
        top: 0;
        right: 0;
        width: 50%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1000;
        box-shadow: -3px 0 10px rgba(0,0,0,0.25);
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .hero-content h2 {
        font-size: 1.5rem;
        color: var(--text-secondary);
    }

    .project-card {
        flex: 0 1 100%;
    }
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.about-image {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 3/4;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.about-text {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-text p {
    font-size: var(--p-size);
    line-height: 1.6;
    color: var(--text-secondary);
}

.about-text .intro {
    font-size: var(--h3-size);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.about-text .cta {
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    .about-image {
        max-width: 300px;
        margin: 0 auto;
    }

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

#about.visible .about-content {
    opacity: 1;
    transform: translateX(0);
}

/* Education Section */
.education-content {
    max-width: 1200px;
    margin: 0 auto;

}

.education-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s cubic-bezier(0.42, 0, 0.58, 1), 
                transform 0.6s cubic-bezier(0.42, 0, 0.58, 1);
    will-change: opacity, transform;
}

.education-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.education-info h3 {
    font-size: var(--h2-size);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.education-info .degree {
    font-size: var(--h3-size);
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.education-info .date,
.education-info .location {
    font-size: var(--p-size);
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.education-image {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s cubic-bezier(0.42, 0, 0.58, 1), 
                transform 0.6s cubic-bezier(0.42, 0, 0.58, 1);
    will-change: opacity, transform;
}

.education-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.42, 0, 0.58, 1);
}

.education-image:hover img {
    transform: scale(1.02);
}

.education-description {
    max-width: 800px;
    margin: 0 auto 4rem;
    text-align: center;
}

.education-description p {
    font-size: var(--p-size);
    line-height: 1.6;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.education-courses {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 2rem;
    grid-auto-rows: 1fr; /* Ensure all cards in a row have the same height */
}
 
/* Add responsive breakpoints for education courses */
@media (min-width: 1800px) {
    .education-courses {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1799px) and (min-width: 1200px) {
    .education-courses {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1199px) and (min-width: 768px) {
    .education-courses {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .education-courses {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
}

.course-card {
    background: var(--background-light);
    border-radius: 18px;
    overflow: hidden;
    transition: opacity 0.7s cubic-bezier(0.42, 0, 0.58, 1), 
                transform 0.7s cubic-bezier(0.42, 0, 0.58, 1),
                box-shadow 0.3s cubic-bezier(0.42, 0, 0.58, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: scale(0.98) translateY(20px);
    will-change: opacity, transform, box-shadow;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.course-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.42, 0, 0.58, 1);
    flex-shrink: 0; /* Prevent image from shrinking */
}

.course-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 1.5rem;
    flex: 1; /* Take up remaining space */
}

.course-info h4 {
    font-size: var(--h3-size);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.4;
    letter-spacing: -0.01em;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
    flex: 1; /* Take up available space */
    display: flex;
    align-items: flex-start; /* Align to top */
}

.course-info p {
    font-size: var(--p-size);
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
    flex: 1; /* Take up available space */
    display: flex;
    align-items: flex-start; /* Align to top */
}

.course-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .education-header {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    .education-image {
        order: -1;
        aspect-ratio: auto;
        height: auto;
        max-height: 300px;
        margin: 0 auto;
        width: 100%;
    }

    .education-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        max-height: 300px;
    }

    .course-card img {
        height: auto;
        max-height: 200px;
        width: 100%;
        object-fit: contain;
        padding: 1rem;
    }

    .education-courses {
        padding: 0 1rem;
    }
}

#education.visible .education-content {
    opacity: 1;
    transform: none;
}

/* Skills Section Styles */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.skill-category {
    background: var(--background-light);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}


.skill-category h3 {
    color: var(--text-primary);
    margin-bottom: 2rem;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 600;
    text-align: center;
}

.skill-icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: clamp(1rem, 2vw, 2rem);
    justify-items: center;
    width: 100%;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    width: 100%;
}

.skill-item i {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    color: var(--text-primary);
    transition: all 0.3s ease;
    background: var(--background);
    padding: clamp(0.75rem, 1.5vw, 1rem);
    border-radius: 1rem;
    width: clamp(3.5rem, 5vw, 4.5rem);
    height: clamp(3.5rem, 5vw, 4.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.skill-item i.nf,
.skill-item i.nf-custom {
    font-family: "JetBrainsMono Nerd Font", monospace !important;
    font-size: clamp(2rem, 3.5vw, 3rem);
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(3.5rem, 5vw, 4.5rem);
    height: clamp(3.5rem, 5vw, 4.5rem);
    background: var(--background);
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.skill-item span {
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    color: var(--text-secondary);
    font-weight: 500;
}

.skill-item:hover i {
    transform: scale(1.1);
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .skills-grid {
        padding: 0 1rem;
    }
    
    .skill-icons {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    }
}

@media (max-width: 480px) {
    .skill-icons {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }
}

/* Splide.js Customization */
.splide {
    margin: 3rem auto;
    max-width: 1000px;
    padding: 0;
    position: relative;
}

.splide__track {
    overflow: hidden !important;
    position: relative;
}

.splide__list {
    display: flex;
    align-items: center;
}

.splide__slide {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: none;
    transform: none;
    z-index: -1;
}

.splide__slide.is-active {
    opacity: 1;
    visibility: visible;
    position: relative;
    z-index: 1;
}

/* Splide Navigation */
.splide__arrow {
    background: var(--background-light);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    opacity: 0.8;
    transition: none !important;
    transform: none !important;
}

.splide__arrow:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    opacity: 1;
    transform: none !important;
    transition: none !important;
}

.splide__arrow svg {
    fill: var(--text-primary);
    width: 24px;
    height: 24px;
}

/* Splide Pagination */
.splide__pagination {
    bottom: -3rem;
}

.splide__pagination__page {
    background: var(--text-secondary);
    width: 8px;
    height: 8px;
    margin: 0 6px;
    border-radius: 4px;
    opacity: 0.3;
    transition: none !important;
    transform: none !important;
}

.splide__pagination__page.is-active {
    background: var(--primary-color);
    opacity: 1;
    transform: none !important;
    transition: none !important;
}

.splide__pagination__page:hover {
    background: var(--primary-color);
    opacity: 0.8;
    transform: none !important;
    transition: none !important;
}

/* Resume & Contact Section */
.resume-contact-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
    min-height: auto;
}

.resume-download {
    margin: 2rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--primary-color);
    color: #ffffff;
    padding: 1rem 2rem;
    border-radius: 980px;
    font-size: 1.125rem;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-decoration: none;
}

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

.btn-primary:visited {
    color: #ffffff;
    opacity: 1;
}

.btn-primary i {
    font-size: 1.25rem;
}

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

.contact-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-link:hover {
    color: var(--text-primary);
    background: var(--primary-color);
    transform: translateY(-2px);
}

.contact-link i {
    font-size: 1.5rem;
    color: inherit;
}

.contact-link span {
    font-size: 0.9375rem;
    font-weight: 500;
    color: inherit;
}

.contact-link:visited {
    color: var(--text-secondary);
}

.contact-link:visited:hover {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .btn-primary{
        padding: 1rem;
    }
    .contact-links {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1.5rem;
        justify-content: center;
    }

    .contact-link {
        flex-direction: row;
        padding: 0.5rem 1rem;
        background: none;
        border: none;
        gap: 0.5rem;
        width: 30%;
    }

    .contact-link:hover {
        transform: none;
        background: none;
    }

    .contact-link i {
        font-size: 1.25rem;
    }

    .contact-link span {
        font-size: 0.875rem;
    }
}

/* Footer */
footer {
    background: var(--background-light);
    padding: 3rem 2rem;
    transition: var(--transition);
    z-index: 1000;
}

footer.hidden {
    transform: translateY(100%);
    position: fixed;
    bottom: 0;
    width: 100%;
}

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

.copyright {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: var(--transition);
    position: relative;
}

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

@media (max-width: 768px) {
    .resume-contact-content {
        padding: 0 1rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (min-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .project-card {
        flex: 0 1 calc(50% - 2rem);
    }
}

@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* Apple-like Animations */
@keyframes fadeUpIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes blurIn {
    from {
        opacity: 0;
        filter: blur(10px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

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

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

/* About Section Animations */
.about-image {
    will-change: transform, opacity;
    opacity: 0;
    transform: translateX(-50px);
    transition: transform 0.6s cubic-bezier(0.42, 0, 0.58, 1), opacity 0.6s cubic-bezier(0.42, 0, 0.58, 1);
    position: relative;
}

.about-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0, 113, 227, 0.15), transparent 70%);
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

.about-image.animate-in::after {
    opacity: 1;
}

.about-image img {
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.about-image.animate-in img {
    transform: scale(1.01);
}

.about-text p {
    will-change: transform, opacity;
    opacity: 0;
    transform: translateY(30px);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.about-text .intro {
    transition-delay: 0.1s;
}

.about-text p:nth-child(2) {
    transition-delay: 0.2s;
}

.about-text p:nth-child(3) {
    transition-delay: 0.3s;
}

.about-text p:nth-child(4) {
    transition-delay: 0.4s;
}

/* Animation Classes */
.about-image.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.about-text p.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Section animations */
.section {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
    will-change: auto;
}

.section.visible {
    opacity: 1;
    transform: none;
}

/* Specific about section animation refinements */
#about.visible {
    position: relative;
}

#about.visible::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at 70% 30%,
        rgba(37, 38, 43, 0.7) 0%,
        rgba(0, 0, 0, 0) 70%
    );
    opacity: 0;
    animation: fadeIn 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0.3s;
    pointer-events: none;
    z-index: -1;
}

/* Ensure animation performance is optimized */
.about-content {
    will-change: opacity, transform;
}

@media (prefers-reduced-motion: reduce) {
    .section,
    .about-image,
    .about-text p {
        transition: none !important;
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    #about.visible::before {
        animation: none !important;
        opacity: 0.5;
    }
}

/* Education Section Animation */
#education {
    background-color: var(--background-dark);
    animation: none;
    opacity: 1;
    transform: none;
}

/* Remove the education reveal animation */
@keyframes educationReveal {
    0%, 50%, 100% {
        opacity: 1;
        transform: none;
    }
}

.education-content {
    transition: none;
}

#education.visible .education-content {
    opacity: 1;
    transform: none;
}

/* Projects Section Animation */
#projects {
    background-color: var(--background-dark);
    animation: none;
    opacity: 1;
    transform: none;
}

/* Remove the projects reveal animation */
@keyframes projectsReveal {
    0%, 50%, 100% {
        opacity: 1;
        transform: none;
    }
}

.projects-grid {
    transition: none;
}

#projects.visible .projects-grid {
    opacity: 1;
    transform: none;
}

/* Skills Section Animation */
#skills {
    background-color: var(--background-dark);
    animation: none;
    opacity: 1;
    transform: none;
}

/* Remove the skills reveal animation */
@keyframes skillsReveal {
    0%, 50%, 100% {
        opacity: 1;
        transform: none;
    }
}

.skills-content {
    transition: none;
}

#skills.visible .skills-content {
    opacity: 1;
    transform: none;
}

/* Resume & Contact Section Animation */
#resume {
    background-color: var(--background-dark);
    animation: none;
    opacity: 1;
    transform: none;
}

/* Remove the resume reveal animation */
@keyframes resumeReveal {
    0%, 50%, 100% {
        opacity: 1;
        transform: none;
    }
}

.resume-contact-content {
    transition: none;
}

#resume.visible .resume-contact-content {
    opacity: 1;
    transform: none;
}

/* About Content needs special handling to avoid animation conflicts */
.about-content.section-content {
    /* Override section-content animations for about section */
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* Skills Section additional overrides */
#skills-splide {
    visibility: hidden;
}

#skills-splide.is-initialized {
    visibility: visible;
}

/* Ensure no loading animation for the content wrapper within the projects section */
#projects .section-content {
    display: flex;
    justify-content: center;
    align-items: stretch; 
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Mobile Animation Disabler */
@media (max-width: 768px) {
    /* Disable all animations and transitions */
    * {
        animation: none !important;
        transition: none !important;
    }

    /* Ensure content is immediately visible */
    .section,
    .section-content,
    .about-image,
    .about-text p,
    .education-header,
    .education-image,
    .education-courses,
    .course-card,
    .skill-item,
    .project-card {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }

    /* Remove hover effects */
    .project-card:hover,
    .course-card:hover,
    .skill-item:hover,
    .about-image:hover img,
    .education-image:hover img,
    .btn:hover,
    .nav-links a:hover,
    .footer-links a:hover {
        transform: none !important;
        transition: none !important;
    }

    /* Ensure smooth scrolling still works */
    html {
        scroll-behavior: smooth;
    }

    /* Remove parallax effects */
    .about-image,
    .about-text {
        transform: none !important;
    }
}
