/* 1. CSS Variables (The modern replacement for Sass variables) */
:root {
    --font-stack: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --bg-color: #fafafa;
    --text-color: #333;
    --accent-color: #555;
    --nav-height: 70px;
}

/* 2. Global Reset & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;

    overflow-x: hidden;
}

/* 3. Container Utility */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 4. Sticky Navigation */
.main-header {
    position: sticky;
    top: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
    height: auto; /* Allow height to adjust on mobile */
    padding: 1rem 0; /* Add top/bottom padding for mobile */
}

/* Native CSS Nesting */
.main-header nav {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row; /* Keep row layout for logo and toggle button */
    position: relative;
}

.main-header .logo {
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hamburger Menu Button (Mobile Only) */
.mobile-menu-toggle {
    display: block;
    position: relative;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle .hamburger {
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
    left: 0;
}

.mobile-menu-toggle .hamburger:nth-child(1) {
    top: 0;
}

.mobile-menu-toggle .hamburger:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.mobile-menu-toggle .hamburger:nth-child(3) {
    bottom: 0;
}

/* Animated hamburger to X */
.mobile-menu-toggle.active .hamburger:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

.main-header .nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.main-header .nav-links.active {
    max-height: 300px;
    opacity: 1;
    padding: 1.5rem 0;
}

.main-header .nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.2s ease;
    padding: 0.75rem 2rem;
    display: block;
}

.main-header .nav-links a:hover {
    color: #999; /* Simple hover effect */
    background-color: rgba(0,0,0,0.02);
}

/* 5. Sections */
.section-block {
    padding: 5rem 0;
    min-height: 80vh; 
    
    /* This ensures the title isn't hidden behind the sticky header when you click a link */
    scroll-margin-top: var(--nav-height); 
}

.section-block.alt-bg {
    background-color: #f4f4f4;
}

.section-block h1 { 
    font-size: 3rem; 
    margin-bottom: 1rem; 
}

.section-block h2 { 
    font-size: 2rem; 
    margin-bottom: 2rem; 
    border-bottom: 2px solid var(--text-color); 
    display: inline-block; 
}

.intro-text { 
    font-size: 1.25rem; 
    max-width: 600px; 
    color: var(--accent-color); 
}


footer {
    padding: 2rem 0;
    text-align: center;
    background-color: #eee; 
    color: var(--accent-color);
    font-size: 0.85rem;
    border-top: 1px solid #ddd;
}

footer p {
    margin: 0;
    padding: 0;
}
@media (min-width: 768px) {
    
    .main-header {
        padding: 0;
        height: var(--nav-height);
    }

    .main-header nav {
        flex-direction: row; 
        justify-content: space-between; 
    }

    /* Hide hamburger menu on desktop */
    .mobile-menu-toggle {
        display: none;
    }

    .main-header .nav-links {
        position: static;
        flex-direction: row; 
        gap: 2rem;
        background: transparent;
        box-shadow: none;
        max-height: none;
        opacity: 1;
        overflow: visible;
        padding: 0;
    }

    .main-header .nav-links a {
        padding: 0;
    }
}


/* 8. Portfolio Gallery Styles */

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: 10px; /* Base row height for spanning */
    gap: 1.5rem;
    margin-top: 3rem;
}

.art-piece {
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Important for clean edges */
    margin-bottom: 0;
}

.art-piece img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.3s ease-in-out;
}

.art-piece img:hover {
    transform: scale(1.03);
}

.art-meta {
    padding-top: 0.75rem;
}
.art-title {
    font-weight: bold;
    display: block;
    font-size: 1rem;
}
.art-details {
    color: var(--accent-color);
    font-style: italic;
    font-size: 0.85rem;
}


.art-piece {
    grid-row-end: span 22; /* Default: Standard size (approx 220px height) */
}

.art-piece.tall {
    grid-row-end: span 40; /* Tall items span more rows (approx 400px) */
}

.art-piece.wide {
    grid-row-end: span 15; /* Wide items span fewer rows (approx 150px) */
}

/* Mobile Fix: Less extreme spanning on small screens */
@media (max-width: 600px) {
    .masonry-grid {
        grid-template-columns: 1fr; /* Single column on tiny screens */
        grid-auto-rows: 10px;
    }
    .art-piece, .art-piece.tall, .art-piece.wide {
        grid-row-end: span 30; /* Reset all to a more uniform mobile height */
    }
}