/***********************/
/* 1. CSS Reset & Variables */
/***********************/
:root {
    /* Minimalist Color Palette */
    --color-text: #333333;        /* Primary text color (almost black) */
    --color-text-light: #767676;  /* Secondary text (gray) */
    --color-background: #f0ffff;  /* Main background */
    --color-surface: #f8f8f8;     /* Slightly off-white for sections */
    --color-accent: #2e2e2e;      /* For links, borders, highlights (dark gray) */
    --color-accent-hover: #555555;/* Slightly lighter on hover */

    /* Spacing - Using a modular scale for harmony */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    /* Max width for optimal line length (readability) */
    --max-width-text: 90ch;
    --max-width-content: 1000px;
    
    /* New variable for max image height */
    --max-image-height: 720px;
}

/* A more opinionated reset for true minimalism */
*, *::before, *::after {
    box-sizing: border-box;
}
body, h1, h2, h3, h4, p, ul, ol, li {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-background);
    font-weight: 400;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/***********************/
/* 2. Typography (The Star of the Show) */
/***********************/
h1, h2, h3, h4 {
    font-weight: 600; /* Semibold for headers */
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem); /* Responsive scaling */
    letter-spacing: -0.05em;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-top: var(--spacing-lg);
}

h3 {
    font-size: 1.25rem;
    margin-top: var(--spacing-md);
    color: var(--color-text-light);
    font-weight: 500;
}

p, li, td {
    max-width: var(--max-width-text); /* Limits line length for easy reading */
}

a {
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

a:hover {
    border-bottom: 1px solid var(--color-accent);
}

/***********************/
/* 3. Layout & Structure */
/***********************/
.container {
    max-width: var(--max-width-content);
    width: 100%;
    margin: 0 auto;
    padding: var(--spacing-md) 100px; /* Top/Bottom | Left/Right */
    border-left: 1px solid #e0e0e0; /* <- Add this line */
    border-right: 1px solid #e0e0e0; /* <- Add this line */
}

/* Header */
.site-header {
    padding: var(--spacing-lg) 0;
    text-align: center;
    border-bottom: 1px solid var(--color-surface);
    margin-bottom: var(--spacing-lg);
    width: 100%; /* NEW: Makes sure the header bar stretches across the centered container */
}

.site-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-bottom: var(--spacing-xs);
}

.site-tagline {
    font-size: 1.1rem;
    color: var(--color-text-light);
    font-weight: 400;
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin: var(--spacing-md) 0;
    flex-wrap: wrap;
}

.main-nav a {
    border-bottom: none;
    font-size: 1rem;
    color: var(--color-text-light);
}
.main-nav a:hover {
    color: var(--color-text);
}

/* Sections */
section {
    margin-bottom: var(--spacing-xl);
    width: 100%; /* NEW: Ensures sections fill the centered container */
}

.section-heading {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 280px);
    justify-content: center; /* Centers the fixed-size grid */
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.portfolio-item {
    background-color: var(--color-surface);
    overflow: hidden; /* Contains the image */
    display: flex; /* NEW: Helps with centering the image container */
    justify-content: center; /* NEW: Centers the image horizontally within its grid cell */
}

.portfolio-item img {
    width: 100%; /* Scales width to fill its container */
    height: auto; /* Maintains aspect ratio */
    display: block;
    transition: transform 0.5s ease;
    
    /* NEW: Caps the maximum height */
    max-height: var(--max-image-height);
    
    /* NEW: Ensures the image itself is centered within its container if it doesn't fill the width */
    object-fit: cover; /* OR use 'contain' based on your preference. See note below. */
}

.portfolio-item:hover img {
    transform: scale(1.02);
}

/* Price List Table */
.price-list {
    width: auto; /* Changed from 100% to auto */
    margin: var(--spacing-lg) auto; /* Centers the table */
    border-collapse: collapse;
    min-width: 400px; /* Prevents it from getting too narrow */
    max-width: 100%; /* Ensures it doesn't overflow on mobile */
}

.price-list th,
.price-list td {
    padding: var(--spacing-sm);
    text-align: left;
    border-bottom: 1px solid var(--color-surface);
}

.price-list th {
    font-weight: 600;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.price-list tr:last-child td {
    border-bottom: none;
}

/* Footer */
.site-footer {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-surface);
    color: var(--color-text-light);
    font-size: 0.9rem;
    width: 100%; /* NEW: Makes sure the footer bar stretches across the centered container */
}

/***********************/
/* 4. Utilities */
/***********************/
.text-center { text-align: center; }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

.lead {
    font-size: 1.25rem;
    color: var(--color-text-light);
    text-align: center;
    max-width: var(--max-width-text);
    margin: 0 auto var(--spacing-lg) auto;
}

/***********************/
/* 5. Responsive Design */
/***********************/
@media (max-width: 768px) {
    :root {
        --spacing-md: 1.5rem;
        --spacing-lg: 3rem;
        --spacing-xl: 5rem;
    }

    .container {
        padding: var(--spacing-sm);
    }

    .portfolio-grid {
        grid-template-columns: 1fr; /* Stack items on mobile */
        gap: var(--spacing-sm);
    }

    .main-nav {
        gap: var(--spacing-sm);
    }
    
    /* NEW: Adjust max-height for smaller screens if desired */
    .portfolio-item img {
        max-height: 60vh; /* Uses viewport height instead of a fixed pixel value on mobile */
    }
}