/* General Styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #333;
    --background-start-color: #e9eef1;
    --background-end-color: #f4f4f8;
    --text-color: #333;
    --light-text-color: #fff;
    --container-bg: #ffffff;
    --font-family: 'Poppins', sans-serif;
    --card-bg: rgba(255, 255, 255, 0.9);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    background: var(--background-start-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* Screen-reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* CSS Animated Background - replaces Vanta.js (saves ~620KB JS) */
#animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0, 123, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 123, 255, 0.06) 0%, transparent 50%),
        linear-gradient(135deg, #f0f4f8 0%, #e8edf2 50%, #f0f4f8 100%);
}

/* SVG icon styling */
.skill-icon {
    color: var(--primary-color);
    margin-right: 15px;
    flex-shrink: 0;
}

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

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

section {
    padding: 5rem 0;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    position: relative;
    content-visibility: auto;
    contain-intrinsic-size: auto 500px;
}

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

section h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.8rem;
    color: var(--secondary-color);
    font-weight: 600;
}

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: var(--light-text-color);
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
}

.btn:hover {
    background: #0055b0;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

/* Header & Navigation */
header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-color);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: top 0.3s;
}

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

nav .logo a {
    color: var(--secondary-color);
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
}

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

nav .nav-links li {
    margin-left: 20px;
}

nav .nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 5px;
}

nav .nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

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

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

.burger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}

.burger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--secondary-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* Home Section */
.home-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: transparent;
    padding-top: 60px;
}

.home-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1100px;
    margin: auto;
    padding: 0 2rem;
}

.home-text {
    max-width: 60%;
}

.home-text h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.typing-container {
    height: 50px;
    margin: 1rem 0;
}

.typing-effect {
    font-size: 1.8rem;
    color: var(--primary-color);
    overflow: hidden;
    border-right: .15em solid var(--primary-color);
    white-space: nowrap;
    margin: 0;
    letter-spacing: .1em;
    animation:
        typing 4s steps(40, end) infinite,
        blink-caret .75s step-end infinite;
}

@keyframes typing {
    from, to { width: 0 }
    50% { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color); }
}

.home-text .intro {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.social-links a {
    color: var(--secondary-color);
    font-size: 2rem;
    margin-right: 20px;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.home-img {
    max-width: 35%;
}

.home-img img {
    width: 400px;
    height: 400px;
    border-radius: 55%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.home-img img:hover {
    box-shadow: 0 15px 45px rgba(0,0,0,0.25);
    transform: scale(1.02);
}

/* About Section */
#about {
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.07);
}

.about-content {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.about-content p, .about-content ul {
    flex: 1;
}

.about-content ul {
    list-style: none;
    margin-top: 0;
    padding-left: 1rem;
    border-left: 3px solid var(--primary-color);
}

.about-content ul li {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

/* Timeline Section */
.timeline {
    position: relative;
    max-width: 750px;
    margin: 2rem auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #e9eef1;
}

.timeline-item {
    margin-bottom: 2.5rem;
    position: relative;
    padding-left: 50px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 1.5rem;
    padding-left: 50px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid #fff;
    z-index: 1;
}

.timeline-item h3 {
    color: var(--primary-color);
    font-weight: 600;
}

.timeline-item p {
    margin: 0.5rem 0;
}

/* Projects Section */
#projects {
    background: transparent;
}

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

.project-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.project-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.project-card h3 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.project-card h3 a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Skills Section */
.skills-content {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
}

.skills-category {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
    flex: 1;
    min-width: 250px;
    border: 1px solid rgba(0,0,0,0.05);
}

.skills-category h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 600;
}

.skills-category ul {
    list-style: none;
}

.skills-category ul li {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
}

.skills-category ul li svg {
    color: var(--primary-color);
    margin-right: 15px;
    width: 20px;
    flex-shrink: 0;
}

/* Contact Section */
#contact {
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.07);
}

.contact-info {
    text-align: center;
    margin-bottom: 2rem;
}

.contact-info p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

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

form {
    max-width: 600px;
    margin: auto;
    display: flex;
    flex-direction: column;
}

form input, form textarea {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: var(--font-family);
    background: #f9f9f9;
    transition: border-color 0.3s, box-shadow 0.3s;
}

form input:focus, form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

form textarea {
    resize: vertical;
    min-height: 150px;
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: var(--light-text-color);
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

/* Responsive Design */
@media(max-width: 768px) {
    .nav-links {
        position: fixed;
        right: 0px;
        height: 100vh;
        top: 0;
        background-color: var(--container-bg);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 60%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    }

    .nav-links li {
        opacity: 0;
        margin: 2rem 0;
        max-width: 100%;
    }

    .burger {
        display: block;
    }

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

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

    .toggle .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    .toggle .line2 {
        opacity: 0;
    }
    .toggle .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }

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

    .home-text {
        max-width: 100%;
    }

    .home-img {
        max-width: 50%;
        margin-bottom: 2rem;
    }

    .home-img img {
        width: 220px;
        height: 220px;
    }

    .home-text h1 {
        font-size: 2.8rem;
    }

    .typing-effect {
        font-size: 1.6rem;
    }

    .about-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .about-content ul {
        border-left: none;
        padding-left: 0;
        text-align: left;
    }
}

@media(max-width: 480px) {
    section h2 {
        font-size: 2.2rem;
    }

    .home-text h1 {
        font-size: 2.2rem;
    }

    .typing-effect {
        font-size: 1.3rem;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}