:root {
    --primary: #1B6F93;
    --primary-light: #2484ad;
    --text: #E0E0E0;
    --text-muted: #A0A0A0;
    --bg-dark: #121212;
    --bg-darker: #050505;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-darker);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.loader-circle {
    width: 60px;
    height: 60px;
    border: 3px solid var(--text-muted);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: loader-spin 1s infinite linear, loader-fade-out 0.5s ease-out forwards 2s;
}

.loader-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--text);
    animation: text-reveal 2s ease-out;
}

@keyframes loader-spin {
    to { transform: rotate(360deg); }
}

@keyframes text-reveal {
    0% {
        opacity: 0;
        letter-spacing: 1em;
    }
    50% {
        opacity: 0.5;
        letter-spacing: 0.5em;
    }
    100% {
        opacity: 1;
        letter-spacing: 0.2em;
    }
}
html {
    scroll-behavior: smooth;
    /* Optimize scroll padding for better anchor points */
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    background-color: var(--bg-dark);
    font-family: 'Inter', sans-serif;
    color: var(--text);
    line-height: 1.6;
    /* Adjusted padding for optimized navbar height */
    padding-top: 70px;
}

/* Scroll reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-in-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll to top button */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

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

.scroll-top:hover {
    background: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(27,111,147,0.4);
}

.scroll-top svg {
    transition: transform 0.3s ease;
}

.scroll-top:hover svg {
    transform: translateY(-2px);
}

nav {
    background-color: var(--bg-darker);
    padding: 1rem var(--space-md);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    transition: padding 0.3s ease;
}

/* Shrink navbar on scroll */
nav.scrolled {
    padding: 0.7rem var(--space-md);
    background-color: rgba(5,5,5,0.95);
    backdrop-filter: blur(10px);
}

.nav-links {
    display: flex;
    gap: var(--space-sm);
}

nav a {
    color: var(--text);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.7rem 1.5rem;
    text-decoration: none;
    border-radius: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

nav a:hover {
    background-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27,111,147,0.3);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 24px;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 101;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text);
    margin: 6px 0;
    transition: 0.3s;
    border-radius: 2px;
}

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

    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-darker);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--space-md);
        transition: 0.3s ease-in-out;
    }

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

    /* Hamburger animation */
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

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

    nav a {
        font-size: 1.3rem;
        padding: 1rem 2rem;
    }
}
.content {
    width: 100%;
    position: relative;
    height: 100vh;
    overflow: hidden;
    margin-top: -80px; /* Offset the body padding */
}

.background {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.6);
    transform: scale(1.1);
    animation: zoomBg 20s infinite alternate linear;
}

@keyframes zoomBg {
    from { transform: scale(1.1); }
    to { transform: scale(1.2); }
}

.intro {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text);
    z-index: 1;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
    animation: fadeInUp 1s ease-out;
}

.intro h1 {
    font-size: 4.5rem;
    font-family: 'Orbitron', sans-serif;
    margin: 0;
    font-weight: 600;
    background: linear-gradient(120deg, var(--text), var(--primary-light));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.about, .education, .projects, .contact {
    padding: var(--space-lg) var(--space-md);
    background: linear-gradient(to bottom, var(--bg-dark), var(--bg-darker));
}
.about h1, .education h1, .projects h1, .contact h1 {
    text-align: center;
    font-weight: 500;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: var(--space-lg);
    font-size: 2.5rem;
    background: linear-gradient(120deg, var(--text), var(--primary-light));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInUp 1s ease-out;
}
.about .about-me-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    padding: var(--space-md);
    animation: fadeInUp 1s ease-out 0.3s backwards;
}

.about .about-me-content {
    flex: 1 1 600px;
    max-width: 600px;
}

.about h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    margin-bottom: var(--space-md);
    color: var(--primary-light);
}

.about p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin: 0;
}

.profile-photo {
    flex: 0 0 300px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 32px rgba(27,111,147,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-photo:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 40px rgba(27,111,147,0.4);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
    transform: scale(1.3);
    transition: transform 0.3s ease;
}

.profile-photo:hover img {
    transform: scale(1.2);
}

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

/* Small screens: stack the photo above the text */
@media (max-width: 768px) {
    .about .about-me-container {
        flex-direction: column;
        text-align: center;
        gap: var(--space-md);
        padding: var(--space-md) var(--space-sm);
    }
    
    .about .about-me-content {
        max-width: 100%;
        order: 2; /* Makes content appear after the photo */
    }
    
    .profile-photo {
        width: 250px;
        height: 250px;
        flex: 0 0 250px;
        order: 1; /* Makes photo appear first */
        margin: 0 auto;
    }
    
    .intro h1 {
        font-size: 3rem;
    }

    .about h2 {
        font-size: 1.8rem;
    }

    .about p {
        font-size: 1.1rem;
        padding: 0 var(--space-sm);
    }
}
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: var(--space-lg);
    animation: fadeInUp 1s ease-out 0.6s backwards;
}

.social-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-darker);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(27,111,147,0.4);
    background: var(--primary);
}

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

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

/* Education section - Timeline */
.timeline {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-md);
    position: relative;
}

/* Timeline vertical line */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--primary), var(--primary), transparent);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.timeline-item:nth-child(even) {
    justify-content: flex-start;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: calc(50% + 2rem);
    margin-right: 0;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--primary);
    border: 4px solid var(--bg-darker);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 0 4px var(--primary-light), 0 0 20px rgba(27,111,147,0.5);
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-dot {
    transform: translateX(-50%) scale(1.3);
    box-shadow: 0 0 0 6px var(--primary-light), 0 0 30px rgba(27,111,147,0.8);
}

.timeline-content {
    background: var(--bg-darker);
    border-radius: 1rem;
    padding: 1.5rem;
    width: calc(50% - 2rem);
    margin-right: calc(50% + 2rem);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    position: relative;
}

/* Timeline arrow */
.timeline-content::before {
    content: '';
    position: absolute;
    top: 20px;
    right: -10px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--bg-darker);
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -10px;
    right: auto;
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--bg-darker) transparent transparent;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(27,111,147,0.3);
}

.timeline-content h3 {
    color: var(--primary-light);
    margin: 0 0 0.5rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
}

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

.timeline-content .duration {
    color: var(--primary-light);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0.5rem 0;
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(27,111,147,0.2);
    border-radius: 1rem;
}

.timeline-content .description {
    color: var(--text-muted);
    margin: 1rem 0 0;
    line-height: 1.6;
}

/* Mobile timeline */
@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        justify-content: flex-start !important;
        margin-bottom: 2rem;
    }
    
    .timeline-dot {
        left: 20px;
    }
    
    .timeline-content {
        width: calc(100% - 60px);
        margin-left: 60px !important;
        margin-right: 0 !important;
    }
    
    .timeline-content::before {
        left: -10px !important;
        right: auto !important;
        border-width: 10px 10px 10px 0 !important;
        border-color: transparent var(--bg-darker) transparent transparent !important;
    }
}

/* Projects section */
.projects-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-md);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-md);
}

.project-item {
    background: var(--bg-darker);
    border-radius: 1rem;
    padding: var(--space-md);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    border: 1px solid rgba(27,111,147,0.2);
}

.project-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(27,111,147,0.4);
    border-color: var(--primary);
}

.project-item h3 {
    color: var(--primary-light);
    margin: 0 0 1rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
}

.project-item .description {
    color: var(--text-muted);
    margin: 1rem 0;
    line-height: 1.6;
}

.project-links {
    display: flex;
    gap: 1rem;
    margin-top: var(--space-md);
    flex-wrap: wrap;
}

.project-link {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--primary);
    color: var(--text);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.project-link:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27,111,147,0.4);
}

/* Contact section */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-md);
    text-align: center;
}

.contact-container p {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: var(--space-md);
}

.contact-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-darker);
    border-radius: 2rem;
    transition: all 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27,111,147,0.2);
}

.contact-item svg {
    color: var(--primary-light);
}

.contact-item a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: var(--primary-light);
}