/* --- CSS Reset & Variables --- */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f3f4f6;
    --white: #ffffff;
    --nav-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    line-height: 1.6;
    color: var(--text-dark);
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.95);
    /* Slight transparency */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 1000;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Underline animation for links */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Mobile Menu Toggle (Hamburger) */
.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    margin: 5px;
    transition: all 0.3s ease;
}

/* --- Sections Layout --- */
section {
    padding: 100px 5% 50px 5%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

p {
    max-width: 700px;
    margin: 0 auto 1.5rem auto;
    color: var(--text-light);
}

/* --- Animation Classes (Scroll Reveal) --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Specific Section Styling --- */
.home {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://images.unsplash.com/photo-1498050108023-c5249f4df085?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    transition: background-image 1s ease-in-out;
    color: var(--white);
}

.home h1 {
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.home p {
    color: #e5e7eb;
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

.home-content {
    max-width: 800px;
    z-index: 10;
}

.about {
    background-color: var(--white);
}

.about ul {
    list-style: none;
    margin-top: 1rem;
}

.about ul li {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.services {
    background-color: var(--bg-light);
}

/* Skills Tags */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-width: 800px;
}

.skill-tag {
    background: var(--white);
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-weight: 600;
    color: var(--primary-color);
    border: 1px solid #e5e7eb;
    transition: transform 0.3s, background 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-tag:hover {
    transform: translateY(-5px);
    background: var(--primary-color);
    color: var(--white);
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    width: 100%;
    max-width: 1200px;
    margin-top: 2rem;
}

.card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

a.card {
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-placeholder {
    height: 180px;
    background-color: var(--bg-light);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

/* Contact Section */
.contact {
    background-color: #111827;
    color: var(--white);
}

.contact p {
    color: #9ca3af;
}

.contact-links {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.social-icons {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.social-icons a {
    color: var(--white);
    font-size: 1.5rem;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: var(--primary-color);
}

.contact-btn {
    padding: 12px 35px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.2s;
    display: inline-block;
}

.contact-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

/* Footer */
footer {
    padding: 20px;
    text-align: center;
    background-color: #000;
    color: #fff;
    font-size: 0.9rem;
}

/* --- Responsive Design --- */

/* Tablet & Smaller Laptops (max-width: 1024px) */
@media screen and (max-width: 1024px) {
    section {
        padding: 80px 5%;
    }

    h1 {
        font-size: 2.5rem;
    }

    .home {
        background-attachment: scroll;
        /* Fix for parallax issues on touch devices */
    }
}

/* Mobile Devices (max-width: 768px) */
@media screen and (max-width: 768px) {

    /* Navigation */
    .nav-links {
        position: absolute;
        right: 0px;
        height: 100vh;
        top: 0;
        background-color: var(--white);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 70%;
        /* Wider menu for mobile */
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }

    .nav-links li {
        margin: 25px 0;
        opacity: 0;
    }

    .burger {
        display: block;
        z-index: 1001;
    }

    /* Layout & Typography */
    section {
        padding: 60px 20px 40px 20px;
    }

    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    p {
        font-size: 1rem;
        max-width: 100%;
    }

    .home h1 {
        font-size: 2rem;
    }

    .home p {
        font-size: 1.1rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
        /* Force stack on mobile */
        gap: 2rem;
    }

    .skills-container {
        gap: 10px;
    }

    .skill-tag {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* Small Mobile (max-width: 480px) */
@media screen and (max-width: 480px) {
    .nav-brand a {
        font-size: 1.3rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .home h1 {
        font-size: 1.6rem;
    }

    .contact-btn {
        padding: 10px 25px;
    }
}

/* Animation Classes & Toggle States */
.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);
}