/* Variables for easy color changes */
:root {
    --primary-text-color: #333;
    --secondary-text-color: #555;
    --background-color: #ffffff;
    --secondary-background: #f9f9f9;
    --accent-color: #007bff; /* A clean blue, similar to his site's subtle accents */
    --hover-color: #0056b3;
    --border-color: #e0e0e0;
    --shadow-light: rgba(0,0,0,0.05);
    --shadow-medium: rgba(0,0,0,0.1);
    --heading-font: 'Inter', sans-serif;
    --body-font: 'Inter', sans-serif;
}

/* Basic Reset & Body Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
}

body {
    font-family: var(--body-font);
    line-height: 1.6;
    color: var(--primary-text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased; /* Better font rendering */
    -moz-osx-font-smoothing: grayscale;
}

/* Base Link Styles */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Container for Centering Content */
.container {
    width: 90%;
    max-width: 1200px; /* Slightly wider max-width for more spacious feel */
    margin: 0 auto;
    padding: 40px 0; /* More vertical padding */
}

/* Header Styles */
header {
    background: var(--background-color);
    color: var(--primary-text-color);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-light);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0; /* Remove container padding from header to control directly */
}

.logo {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
}

.logo a {
    color: var(--primary-text-color);
    transition: color 0.3s ease;
}

.logo a:hover {
    color: var(--accent-color);
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 30px; /* Space out nav items */
}

header nav ul li a {
    color: var(--secondary-text-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding-bottom: 5px; /* Space for underline */
}

header nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    bottom: 0;
    left: 0;
    transition: width 0.3s ease-in-out;
}

header nav ul li a:hover::after {
    width: 100%;
}


/* Section Styling */
section {
    padding: 80px 0; /* Generous vertical spacing */
    text-align: center;
}

section:nth-of-type(even) { /* Alternate background for sections */
    background-color: var(--secondary-background);
}

.section-heading {
    font-family: var(--heading-font);
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 60px; /* More space below heading */
    color: var(--primary-text-color);
    position: relative;
    display: inline-block;
    padding-bottom: 10px; /* Space for underline if desired */
}
/* Removed the ::after underline for headings for a cleaner look,
   but you can uncomment the below if you want it back: */
/*
.section-heading::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--accent-color);
    margin: 10px auto 0;
    border-radius: 2px;
}
*/

/* Hero Section */
.hero {
    min-height: 85vh; /* Taller hero section */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--background-color);
    text-align: center;
}

.hero-content {
    max-width: 800px;
    animation: fadeIn 1.5s ease-out;
}

.hero .intro-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--accent-color);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero h1 {
    font-family: var(--heading-font);
    font-size: 4.5rem; /* Larger and bolder name */
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.1;
    color: var(--primary-text-color);
}

.hero .tagline {
    font-size: 1.8rem;
    font-weight: 300; /* Lighter weight for tagline */
    color: var(--secondary-text-color);
    margin-bottom: 40px;
}

/* Buttons */
.button {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px; /* Slightly more rounded */
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.95rem;
    border: none;
}

.primary-button {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 10px var(--shadow-medium);
}

.primary-button:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px var(--shadow-medium);
}

.secondary-button {
    background: none;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    padding: 10px 20px; /* Smaller padding for project links */
    font-size: 0.85rem;
    margin: 0 5px; /* Space between buttons */
}

.secondary-button:hover {
    background: var(--accent-color);
    color: #fff;
    transform: translateY(-2px);
}

.large-button {
    font-size: 1.2rem;
    padding: 18px 40px;
    margin-top: 30px;
}


/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto 50px auto; /* More space below about text */
    text-align: left;
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--secondary-text-color);
}

.about-content p {
    margin-bottom: 20px;
}

.skills {
    text-align: center; /* Center skills section content */
}

.skills-heading {
    font-family: var(--heading-font);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 30px;
    color: var(--primary-text-color);
}

.skills-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px; /* More consistent spacing */
    max-width: 800px;
    margin: 0 auto;
}

.skills-list li {
    background: var(--secondary-background);
    color: var(--primary-text-color);
    padding: 10px 20px;
    border-radius: 5px; /* Less rounded */
    font-size: 0.95em;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.skills-list li:hover {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}


/* Portfolio Section */
.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr; /* Start with single column for all sizes */
    gap: 60px; /* More vertical space between projects */
    margin-top: 60px;
}

.portfolio-item {
    display: flex; /* Use flex for image and info side-by-side */
    flex-direction: column; /* Default stack, reverse on larger screens */
    background: var(--background-color);
    border-radius: 10px;
    box-shadow: 0 8px 20px var(--shadow-medium);
    overflow: hidden;
    transition: transform 0.3s ease;
    text-align: left;
}

.portfolio-item:nth-child(even) {
    flex-direction: column-reverse; /* For alternating image/text layout */
}


.portfolio-item:hover {
    transform: translateY(-8px); /* More pronounced lift */
    box-shadow: 0 12px 25px var(--shadow-medium);
}

.project-image-wrapper {
    flex: 1; /* Takes equal space in flex layout */
    min-width: 0; /* Allow shrinking */
}

.portfolio-item img {
    width: 100%;
    height: 350px; /* Larger project images */
    object-fit: cover;
    display: block;
    border-bottom: 1px solid var(--border-color); /* Separator */
}

.project-info {
    flex: 1;
    padding: 30px;
    display: flex; /* Use flex for content within info */
    flex-direction: column;
    justify-content: space-between; /* Pushes links to bottom */
}

.portfolio-item h3 {
    font-family: var(--heading-font);
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary-text-color);
}

.project-description {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--secondary-text-color);
    margin-bottom: 25px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
    justify-content: flex-start; /* Align tags to left */
}

.project-tags span {
    background: var(--secondary-background);
    color: var(--accent-color);
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: 500;
    border: 1px solid var(--accent-color);
}

.project-links {
    margin-top: auto; /* Pushes links to the bottom of the flex container */
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}


/* Contact Section */
.contact {
    background-color: var(--secondary-background);
}

.contact-intro {
    max-width: 700px;
    margin: 0 auto 50px auto;
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--secondary-text-color);
}

.social-links {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.social-links a {
    color: var(--secondary-text-color);
    transition: color 0.3s ease, transform 0.2s ease;
}

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

.social-links svg {
    width: 30px; /* Size for social icons */
    height: 30px;
    vertical-align: middle; /* Align with text if any */
}

/* Footer Styles */
footer {
    background: var(--primary-text-color); /* Darker footer */
    color: #fff;
    padding: 40px 0;
    text-align: center;
    font-size: 0.9em;
}

/* Responsive Design */
@media (min-width: 768px) {
    /* For screens wider than 768px, switch portfolio items to row layout */
    .portfolio-item {
        flex-direction: row; /* Image and info side by side */
    }

    .portfolio-item:nth-child(even) {
        flex-direction: row-reverse; /* Reverse for alternating layout */
    }

    .project-image-wrapper {
        border-bottom: none; /* Remove bottom border */
        border-right: 1px solid var(--border-color); /* Add right border */
    }
    .portfolio-item:nth-child(even) .project-image-wrapper {
        border-right: none;
        border-left: 1px solid var(--border-color); /* Left border for reversed layout */
    }
}

@media (max-width: 992px) {
    .hero h1 {
        font-size: 3.5rem;
    }
    .hero .tagline {
        font-size: 1.5rem;
    }
    .section-heading {
        font-size: 2.2rem;
    }
    .portfolio-item img {
        height: 280px; /* Adjust image height for medium screens */
    }
    .portfolio-item h3 {
        font-size: 1.7rem;
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }
    header nav ul {
        flex-direction: column; /* Stack nav items vertically */
        gap: 15px;
        margin-top: 20px;
    }
    header nav ul li a::after { /* Remove underline on small screens */
        display: none;
    }
    .hero {
        padding: 80px 0;
    }
    .hero h1 {
        font-size: 2.8rem;
    }
    .hero .tagline {
        font-size: 1.3rem;
    }
    .section-heading {
        font-size: 1.8rem;
        margin-bottom: 40px;
    }
    .about-content {
        font-size: 1rem;
        margin-bottom: 40px;
    }
    .skills-heading {
        font-size: 1.6rem;
    }
    .skills-list {
        gap: 10px;
    }
    .portfolio-grid {
        gap: 40px;
    }
    .portfolio-item {
        flex-direction: column; /* Always stack on small screens */
    }
    .portfolio-item:nth-child(even) {
        flex-direction: column; /* Ensure it's always column */
    }
    .portfolio-item img {
        height: 250px;
    }
    .project-image-wrapper {
        border-right: none !important; /* Override borders for small screen */
        border-left: none !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    .project-info {
        padding: 20px;
    }
    .portfolio-item h3 {
        font-size: 1.5rem;
    }
    .project-description {
        font-size: 0.95rem;
    }
    .contact-intro {
        font-size: 1rem;
        margin-bottom: 40px;
    }
    .social-links {
        gap: 20px;
    }
    .social-links svg {
        width: 25px;
        height: 25px;
    }
    .button {
        padding: 12px 25px;
        font-size: 0.85rem;
    }
    .large-button {
        font-size: 1rem;
        padding: 15px 30px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
