:root {
    --background-color: #121212;
    --background-color-alt: #1e1e1e;
    --text-color: #e0e0e0;
    --secondary-text-color: #a0a0a0;
    --accent-color: #00aaff;
    --glow-color: rgba(0, 170, 255, 0.5);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    font-weight: 400;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(30, 30, 30, 0.7);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1440px;
    margin: 0 auto;
    padding: 1rem 2rem;
    position: relative; /* For the magic line */
}

.nav-magic-line {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%; /* Full height of the nav */
    background-color: var(--accent-color);
    opacity: 0.2;
    border-radius: 8px;
    transition: all 0.4s ease-in-out;
    pointer-events: none;
    opacity: 0;
    z-index: -1; /* Ensure it's behind other nav items */
}

/* Helper class to disable transitions during initial page load */
.magic-line-prep {
    transition: none !important;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: row; /* Explicitly set to row for desktop */
    gap: 2rem;
    margin: 0;
    padding: 0;
    position: relative;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
    z-index: 1;
}

.nav-links a:hover {
    color: var(--accent-color);
    text-shadow: 0 0 15px var(--glow-color);
}

.nav-links a.active {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--glow-color);
}

.nav-link-icon {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    vertical-align: middle;
    border-radius: 4px;
}

.selfie-icon {
    border-radius: 50%;
}

.body-nav-open main, .body-nav-open footer {
    filter: blur(5px);
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

main {
    padding-top: 80px;
    transition: filter 0.5s ease-in-out;
}

/* --- About Me Section --- */
#about-me {
    opacity: 1; /* Visible by default */
    transform: translateY(0);
    text-align: left;
}

.about-me-container {
    max-width: 900px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    justify-content: flex-start; /* Reverted to left alignment */
    align-items: center;
    gap: 2rem;
    margin-bottom: 4rem;
}

.profile-intro {
    display: flex;
    flex-direction: column; /* Changed to column */
    /* Removed align-items: center; */
    gap: 0.5rem; /* Adjusted gap for vertical spacing */
    align-items: flex-start; /* Align children to the start (left) */
}

.name-and-avatar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-pic {
    width: 2.5rem; /* Changed from 150px */
    height: 2.5rem; /* Changed from 150px */
    border-radius: 50%;
    /* Removed border: 4px solid var(--accent-color); */
    /* Removed box-shadow: 0 0 25px var(--glow-color); */
    object-fit: cover;
}

.profile-intro h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.profile-title {
    font-size: 1.25rem;
    color: var(--secondary-text-color);
    margin: 0 0 1rem 0;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-info span {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.contact-info i {
    color: var(--accent-color);
    width: 20px;
    text-align: center;
}

.resume-section {
    margin-bottom: 3rem;
}

.resume-section h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.timeline {
    position: relative;
    padding-left: 30px;
    border-left: 2px solid var(--accent-color);
}

.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -39px;
    top: 5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: 2px solid var(--background-color);
}

.timeline-content h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
}

.timeline-content h5 {
    font-size: 1rem;
    color: var(--secondary-text-color);
    margin: 0 0 0.5rem 0;
    font-weight: 400;
}

.timeline-content p {
    margin: 0;
    color: var(--text-color);
}

.project-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1.5rem;
}

.project-list li {
    background-color: var(--background-color-alt);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--accent-color);
}

.project-list h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.project-list p {
    margin: 0;
    color: var(--secondary-text-color);
}

/* --- Project Sections (Original) --- */
.project-section {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.project-section:nth-child(even) {
    background-color: var(--background-color-alt);
}

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

.project-header h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    text-shadow: 0 0 15px var(--glow-color);
}

.project-icon {
    height: 1.0em;
    width: auto;
    object-fit: contain;
    border-radius: 10%;
}

.project-header p {
    font-size: 1.25rem;
    color: var(--secondary-text-color);
    max-width: 600px;
    margin: 0 auto 4rem auto;
}



.project-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.gallery-item {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 0 30px var(--glow-color);
}

#back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: rgba(40, 40, 40, 0.8);
    backdrop-filter: blur(5px);
    color: var(--text-color);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    transform: translateY(10px);
    z-index: 999;
}

#back-to-top-btn:hover {
    background-color: var(--accent-color);
    color: var(--background-color);
    transform: translateY(0) scale(1.1);
    box-shadow: 0 0 20px var(--glow-color);
}

#back-to-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--secondary-text-color);
    background-color: var(--background-color-alt);
    transition: filter 0.5s ease-in-out;
}

/* Desktop Layout for Gallery */
@media (min-width: 769px) {
    .project-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .img-horizontal {
        grid-column: 1 / -1;
    }
}

/* Mobile & Tablet Layout */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 60%;
        background-color: var(--background-color-alt);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right 0.5s ease-in-out;
        gap: 0;
    }
    
    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        width: 100%;
        padding: 1.5rem 0;
        text-align: center;
        transition: background-color 0.2s ease, color 0.2s ease, text-shadow 0.2s ease;
    }

    .nav-links a:active, .nav-links a.active {
        background-color: rgba(0, 170, 255, 0.1);
        color: var(--accent-color);
        text-shadow: 0 0 15px var(--glow-color);
    }

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

    .hamburger {
        display: block;
        z-index: 1001;
    }

    .project-header h2 {
        font-size: 2.5rem;
        flex-direction: row; /* Set to row for mobile */
    }

    .project-icon {
        height: 0.8em;
    }

    .project-header p {
        font-size: 1rem;
    }
}