/* --- Global Styles & Variables --- */
:root {
    --primary-color: #3498db; /* Blue */
    --secondary-color: #2c3e50; /* Dark Blue/Grey */
    --accent-color: #e74c3c; /* Red */
    --light-color: #ffffff;
    --dark-color: #333333;
    --grey-light: #f4f4f4;
    --grey-medium: #e9ecef;
    --grey-dark: #bdc3c7;
    --grey-darker: #7f8c8d;
    --grey-darkest: #2c3e50;
    --font-family: 'Poppins', sans-serif;
    --header-height: 70px;
    --transition-speed: 0.3s;
    --shadow-light: 0 2px 5px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 5px 15px rgba(0, 0, 0, 0.15);
}

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

html {
    scroll-behavior: smooth; /* Enable smooth scrolling natively */
    font-size: 16px; /* Base font size */
}

body {
    font-family: var(--font-family);
    line-height: 1.7;
    color: var(--dark-color);
    background-color: var(--light-color);
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

h1, h2, h3 {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; } /* Adjusted section title size */
h3 { font-size: 1.5rem; }

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after { /* Underline effect for section titles */
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.content-section {
    padding: 5rem 0;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: 2px solid transparent;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--light-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #2980b9; /* Darker blue */
    border-color: #2980b9;
    color: var(--light-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--light-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #1f2b38; /* Darker secondary */
    border-color: #1f2b38;
    color: var(--light-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-outline {
    background-color: transparent;
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

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

.btn-large {
    padding: 15px 35px;
    font-size: 1.1rem;
}


/* --- Header --- */
.site-header {
    background-color: var(--light-color);
    height: var(--header-height);
    position: fixed; /* Make header sticky */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow-light);
    transition: background-color var(--transition-speed) ease;
}

/*Header transparency that changes on scroll*/
.site-header {
    background-color: rgba(255, 255, 255, 1.0);
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

body.scrolled .site-header {
    background-color: rgba(255, 255, 255, 0.75);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}


.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0;
}

.main-nav ul {
    display: flex;
    gap: 25px; /* Spacing between nav items */
}

.nav-link {
    color: var(--dark-color);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    transition: color var(--transition-speed) ease;
}

.nav-link::after { /* Underline effect for nav links */
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-speed) ease;
}

.nav-link:hover,
.nav-link.active { /* Active state for JS */
    color: var(--primary-color);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* --- Hero Section --- */
.hero-section {
    background: linear-gradient(rgba(44, 62, 80, 0.85), rgba(44, 62, 80, 0.85)), url('images/hero_background.jpg') no-repeat center center/cover;
    color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh; /* Full viewport height */
    padding-top: var(--header-height); /* Account for fixed header */
    position: relative;
}

.hero-content {
    max-width: 700px;
}

.profile-pic {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 5px solid var(--light-color);
    margin: 0 auto 1.5rem auto;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    color: var(--light-color);
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.6rem;
    font-weight: 300;
    margin-bottom: 2rem;
    min-height: 2.4rem; /* Space for typing text */
}

/* Blinking cursor for typing effect */
.typing-text::after {
    content: '|';
    display: inline-block;
    animation: blink 0.7s infinite;
    margin-left: 3px;
    color: var(--primary-color);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- About Section --- */
.about-section {
    background-color: var(--grey-light);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr; /* Start single column */
    gap: 3rem;
    text-align: left;
    align-items: flex-start;
}

.about-text p {
    margin-bottom: 1rem;
    color: #1f2b38;
    font-size: 1.05rem;
}

.about-name {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.about-role{
    font-size: 1.4rem;
    color: var(--grey-darker);
    margin-bottom: 1rem;
}

.about-description-paragraph {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    text-align: justify;
}

.about-description-paragraph-header {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    text-align: justify;
    font-weight: 600;
}

.about-description-list{
    margin-bottom: 1.5rem;
    line-height: 1.6;
    text-align: justify;
    list-style-type: none;
    padding-top: 1rem;
}

.skills-list h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    background-color: var(--grey-medium);
    color: var(--secondary-color);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.skill-tag:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
}

/* --- Portfolio Section --- */
.portfolio-section {
    background-color: var(--light-color);
}

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

.project-card {
    background-color: var(--light-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

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

.project-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.project-info {
    padding: 1.5rem;
}

.project-title {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.project-description {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1.5rem;
    min-height: 60px; /* Give some consistent space */
}

.project-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* Allow buttons to wrap if needed */
}

/* --- Contact Section --- */
.contact-section {
    background-color: var(--secondary-color);
    color: var(--grey-light);
    text-align: center;
}

.contact-section .section-title {
    color: var(--light-color);
}
.contact-section .section-title::after {
    background-color: var(--primary-color);
}

.contact-text {
    max-width: 650px;
    margin: 0 auto 2.5rem auto;
    font-size: 1.1rem;
    color: var(--grey-dark);
}

.contact-action {
    margin-bottom: 2.5rem;
}

.contact-action .btn-primary {
    background-color: var(--primary-color);
    color: var(--light-color);
    border: none;
}
.contact-action .btn-primary:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.social-links p {
    margin-bottom: 1rem;
    font-weight: 500;
    color: var(--grey-dark);
}

.social-link {
    color: var(--grey-light);
    margin: 0 15px;
    font-size: 1.1rem;
    transition: color var(--transition-speed);
    display: inline-block; /* Make hover area better */
    padding: 5px;
}

.social-link:hover {
    color: var(--primary-color);
}

/* --- Footer --- */
.site-footer {
    background-color: #1f2b38; /* Darker than secondary */
    color: var(--grey-dark);
    text-align: center;
    padding: 2rem 0;
    font-size: 0.9rem;
}

.site-footer p {
    margin-bottom: 0.3rem;
}
.site-footer a {
     color: var(--grey-dark);
}
.site-footer a:hover {
     color: var(--primary-color);
}

/* --- Back to Top Button --- */
#back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: var(--primary-color);
    color: var(--light-color);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0; /* Hidden by default */
    visibility: hidden;
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease, background-color var(--transition-speed) ease;
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background-color: var(--secondary-color);
}

/* --- Fade-in Animation --- */
.fade-in-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-element.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .container {
        max-width: 960px;
    }
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.3rem; }
    .hero-title { font-size: 3rem; }
    .hero-subtitle { font-size: 1.4rem; }
}

@media (max-width: 768px) {
    html {
        font-size: 15px; /* Slightly smaller base font */
    }

    .header-container {
        /* Implement mobile menu logic here if needed (requires JS) */
        /* For now, just simple adjustments */
        padding: 0 15px;
    }

    .main-nav {
        /* Hide nav for now - would need JS for toggle */
        /* display: none; */
        /* Or make it simpler */
        position: absolute;
        top: var(--header-height);
        left: 0;
        background: var(--light-color);
        width: 100%;
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: var(--shadow-light);
        /* Temporary display for demo without JS toggle */
        display: none; /* Hide it - needs JS to show */
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .nav-link {
        padding: 10px 0;
    }

    .logo {
        font-size: 1.6rem;
    }

    .content-section {
        padding: 3.5rem 0;
    }

    .hero-section {
        min-height: 80vh;
    }

    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .profile-pic { width: 120px; height: 120px; }

    .about-content {
        grid-template-columns: 1fr; /* Stack about content */
        text-align: center;
    }
    .about-text {
         text-align: justify;
         margin-bottom: 2rem;
    }
    .skills-list {
        text-align: center;
    }
    .skills-tags {
        justify-content: center;
    }

    .portfolio-grid {
        grid-template-columns: 1fr; /* Stack projects */
        gap: 1.5rem;
    }

    .project-card {
        max-width: 400px; /* Limit width on mobile */
        margin: 0 auto; /* Center cards */
    }
    
    .contact-text {
        font-size: 1rem;
    }

    .btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
     .btn-large {
        padding: 12px 30px;
        font-size: 1rem;
    }

    #back-to-top {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        bottom: 15px;
        right: 15px;
    }
}

@media (max-width: 576px) {
    .hero-title { font-size: 2rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .profile-pic { width: 100px; height: 100px; }
    .section-title { font-size: 1.6rem; margin-bottom: 2rem; }
    .social-link { margin: 0 8px; font-size: 1rem;}
}