/* Base Styles */
:root {
    --primary-color: #3d3d3d;
    --accent-color: #857e72;
    --background-color: #f7f5f0;
    --text-color: #333;
    --link-color: #555;
    --link-hover-color: #000;
    --spacing-unit: 1rem;
    --font-family: 'Montserrat', sans-serif;
}

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

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: var(--spacing-unit);
}

h1 {
    font-size: 2rem;
    letter-spacing: 0.25rem;
    text-transform: uppercase;
}

h1 a {
    color: var(--text-color);
    text-decoration: none;
}

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

h2 {
    font-size: 1.75rem;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

p {
    margin-bottom: var(--spacing-unit);
    font-weight: 300;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Layout */
header {
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 2);
    text-align: center;
    position: relative;
}

.years {
    font-size: 1.2rem;
    letter-spacing: 0.15rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
    font-weight: 300;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

section {
    margin-bottom: calc(var(--spacing-unit) * 4);
}

/* Navigation */
nav {
    margin-top: calc(var(--spacing-unit) * 2);
}

nav ul {
    list-style-type: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: calc(var(--spacing-unit) * 1.5);
}

nav li {
    margin: 0 calc(var(--spacing-unit) * 0.5);
}

nav a {
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.1rem;
    padding: 0.5rem 0;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--link-hover-color);
    transition: width 0.3s ease;
}

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

nav a.active {
    font-weight: 600;
}

/* Portfolio */
.portfolio-intro {
    max-width: 800px;
    margin: calc(var(--spacing-unit) * 3) auto calc(var(--spacing-unit) * 5);
    text-align: center;
    padding: 0 var(--spacing-unit);
}

.profile-container {
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.profile-image {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.bio {
    font-size: 1.2rem;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto;
}

/* Project Layout */
.project {
    margin-bottom: calc(var(--spacing-unit) * 5);
}

.project-header {
    margin-bottom: calc(var(--spacing-unit) * 2);
    text-align: center;
}

.project-title {
    font-size: 1.8rem;
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.project-meta {
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    font-size: 0.9rem;
    color: var(--accent-color);
    text-align: center;
}

.project-description {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.project-gallery {
    margin-bottom: calc(var(--spacing-unit) * 3);
    display: flex;
    justify-content: space-between;
    gap: calc(var(--spacing-unit) * 2);
    flex-wrap: nowrap;
    align-items: flex-start;
}

.project-gallery figure {
    flex: 1;
    min-width: 0; /* Allows figure to shrink below content size */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gallery-item-wide {
    flex: 1.5;
}

.gallery-item-portrait {
    flex: 0.8;
}

.gallery-image {
    width: 100%;
    height: 350px; /* Fixed height for all images */
    object-fit: cover; /* This ensures the image covers the area without distortion */
    border-radius: 4px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

figure {
    margin: 0;
}

figcaption {
    margin-top: calc(var(--spacing-unit) * 0.5);
    font-size: 0.9rem;
    color: var(--accent-color);
    text-align: center;
}

/* Footer */
footer {
    text-align: center;
    padding: calc(var(--spacing-unit) * 3) var(--spacing-unit);
    margin-top: calc(var(--spacing-unit) * 5);
    font-size: 0.9rem;
    color: var(--accent-color);
}

.social {
    margin-top: var(--spacing-unit);
}

.social p {
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}

/* Media Queries */
@media screen and (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .bio {
        font-size: 1rem;
    }
    
    nav ul {
        flex-direction: column;
        gap: calc(var(--spacing-unit) * 0.8);
    }
    
    .project-gallery {
        flex-direction: column;
        align-items: center;
    }
    
    .project-gallery figure {
        max-width: 100%;
        margin-bottom: calc(var(--spacing-unit) * 2);
    }
    
    .gallery-item-wide, .gallery-item-portrait {
        flex: none;
        width: 100%;
    }
    
    .gallery-image {
        height: 300px; /* Slightly smaller height for mobile */
    }
    
    .profile-image {
        width: 200px;
        height: 200px;
    }
}

@media screen and (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    header {
        padding: calc(var(--spacing-unit) * 2) var(--spacing-unit);
    }
    
    .portfolio-intro {
        margin: calc(var(--spacing-unit) * 2) auto;
    }
    
    .profile-image {
        width: 180px;
        height: 180px;
    }
}
