/* Font face declaration */
@font-face {
    font-family: 'BebasKai';
    src: url('../fonts/BebasKai2.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'BebasKai', 'Arial', sans-serif;
    background-color: #0f0f0f;
    color: white;
    font-weight: 400;
    opacity: 0.95;
}

/* Site header - three column grid */
.site-header {
    display: grid;
    grid-template-columns: 150px auto 150px; /* Fixed widths instead of 1fr */
    margin: 50pt 50pt 0 50pt;
    padding-top: 10pt;
    padding-left: 2rem; /* Match gallery padding */
    padding-right: 2rem; /* Match gallery padding */
    min-width: 680px; /* Minimum width before switching to mobile layout */
    align-items: center; /* Vertically center items */
    position: relative; /* Add this to create a new stacking context */
    z-index: 10; /* Give it a higher z-index */
}

/* Left nav section */
.nav-section {
    justify-self: start;
    width: 150px; /* Fixed width */
    padding-left: 0; /* Remove any default padding */
    display: flex; /* Add this to ensure proper alignment */
    align-items: center; /* Add this to vertically center content */
}

/* Center title section */
.title-section {
    justify-self: center;
    text-align: center;
    min-width: 280px; /* Minimum width for the title */
    padding: 0 10px;
}

/* Title section link styling */
.title-section a {
    text-decoration: none;
    color: inherit;
}

/* Title section link hover behavior */
.title-section a:hover {
    color: inherit;
    opacity: inherit;
}

/* Right spacer section */
.spacer-section {
    justify-self: end;
    width: 150px; /* Balanced with nav */
    min-width: 100pt; /* Minimum width of 100pt as requested */
}

/* Site title */
.site-title {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    opacity: 0.95;
    white-space: nowrap;
    font-weight: 400;
    font-style: normal;
    font-size: 35px;
}

/* Ensure site title links maintain styling */
a.site-title, .site-title a {
    text-decoration: none;
    color: white;
    opacity: 0.95;
}

/* Ensure site title links hover state doesn't change styling */
a.site-title:hover, .site-title a:hover {
    color: white;
    opacity: 0.95;
    text-decoration: none;
}

/* Navigation */
nav {
    display: flex;
    align-items: center;
    padding-left: 0;
}

/* Two-line navigation container for medium screens */
.two-line-nav {
    flex-wrap: wrap;
    max-width: 150px;
}

/* Style for two-line navigation links */
.two-line-nav a {
    margin-bottom: 8px;
}

/* Style for active tab */
nav a.active {
    color: white;
}

/* Default navigation link styles */
nav a {
    text-decoration: none;
    margin-right: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 19px;
    font-weight: 400;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    color: #999999;
    opacity: 0.95;
    white-space: nowrap;
}

/* Hover effect for navigation links */
nav a:hover {
    color: white;
}

/* Project title and year styles */
.project-title {
    text-align: center;
    text-transform: uppercase;
    padding: 2rem 0 0.5rem 0;
}

.project-title h2 {
    color: white;
    font-weight: 400;
    opacity: 0.95;
}

.project-year {
    text-align: center;
    opacity: 0.7;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.project-year p {
    color: white;
    font-weight: 400;
    opacity: 0.95;
}

/* Gallery styles */
.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 2rem;
    margin: 0 50pt;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    height: 400px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.item-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.item-title h1, .item-title h3 {
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px; /* Reduced from 1px */
    color: white;
    font-weight: 400;
    opacity: 0.95;
}

.item-title p {
    font-size: 0.95rem;
    color: white;
    font-weight: 400;
    opacity: 0.95;
}

/* Desktop hover behavior */
@media (min-width: 769px) {
    .gallery-item:hover .item-title {
        transform: translateY(0);
    }
    
    .gallery-item:hover img {
        transform: scale(1.05);
    }
}

/* Lightbox styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    position: relative;
    width: 80%;
    max-width: 900px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.close-lightbox {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 30px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.95;
}

/* Link styles for content */
.bio-text a, .gallery-item p a, .page-footer a, .error-message a, .home-link a {
    color: white;
    text-decoration: underline;
    transition: opacity 0.3s ease;
}

.bio-text a:hover, .gallery-item p a:hover, .page-footer a:hover, .error-message a:hover, .home-link a:hover {
    opacity: 0.8;
}

/* Bio page styles */
.bio-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.bio-text {
    margin: 2rem 0;
    line-height: 1.5;
    font-size: 1.1rem;
}

.bio-image {
    width: 400px;
    height: auto;
    margin: 2rem auto;
    display: block;
}

.bio-section {
    margin-bottom: 1.5rem;
}

.bio-footer, .page-footer {
    margin-top: 3rem;
    text-align: center;
    font-size: 1rem;
    opacity: 0.8;
    padding-bottom: 2rem;
}

/* Landing page styles */
.landing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Changed from center to flex-start */
    min-height: calc(100vh - 150px); /* Use min-height instead of fixed height */
    text-align: center;
    margin-top: 80px; /* Add margin-top to create space between header and content */
    padding: 0 20px; /* Add horizontal padding */
}

/* Updated icon container styles for 3 items per row */
.icon-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6rem;
    margin: 0; /* Changed from 2rem 0 */
    max-width: 1200px;
    width: 100%;
    padding-top: 2rem; /* Add padding at the top */
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease;
    text-decoration: none;
    width: calc(33.333% - 8rem);
    min-width: 120px;
    margin-bottom: 3rem;
}

.icon-item:hover {
    transform: scale(1.05);
}

.icon-image {
    width: 120px;
    height: auto; /* Changed from fixed height to auto to maintain aspect ratio */
    margin-bottom: 1rem;
    object-fit: contain; /* Ensures the entire image is visible */
}

.icon-label {
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: white;
}

/* 404 Error page styles */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 70vh;
    text-align: center;
}

.error-image {
    max-width: 300px;
    margin-bottom: 2rem;
}

.error-message {
    margin-bottom: 2rem;
}

.error-message h2 {
    font-weight: 400;
    margin-bottom: 1rem;
}

.error-message p {
    opacity: 0.8;
}

.home-link {
    margin-top: 1rem;
}

/* Hamburger Menu Styles */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
}

.bar {
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-content {
    position: relative;
    width: 100%;
    max-width: 320px;
    padding: 2rem;
    padding-top: 3.5rem; /* Add more top padding to account for the repositioned close button */
}

.close-mobile-nav {
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 40px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.95;
    z-index: 1001; /* Ensure it's above other elements in the overlay */
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-top: 3rem;
}

.mobile-nav a {
    font-size: 24px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999999;
    transition: color 0.3s ease;
}

.mobile-nav a.active,
.mobile-nav a:hover {
    color: white;
}

/* Mobile tap behavior - disable hover effects */
@media (max-width: 768px) {
    /* Remove hover transform effects for mobile */
    .gallery-item:hover img {
        transform: none;
    }
    
    /* Make sure item-title stays hidden by default on mobile */
    .item-title {
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }
    
    /* Remove the indicator - as requested */
    .gallery-item::after {
        display: none;
    }
    
    /* Remove indicator when description is shown */
    .gallery-item.tapped::after {
        display: none;
    }
    
    /* Update landing container for mobile */
    .landing-container {
        margin-top: 40px; /* Less margin on mobile */
        min-height: calc(100vh - 100px); /* Adjust min-height for mobile */
    }
}

/* Responsive styles - in order of decreasing screen size */
@media (max-width: 1024px) {
    .site-header {
        margin: 30pt 30pt 0 30pt;
    }
    
    nav a {
        margin-right: 0.75rem;
        font-size: 17px;
    }
    
    .gallery {
        margin: 0 30pt;
    }
}

/* Medium screen breakpoint - switch to two-line navigation */
@media (max-width: 992px) and (min-width: 769px) {
    .nav-section nav {
        flex-wrap: wrap;
        max-width: 150px;
    }
    
    .nav-section nav a {
        margin-bottom: 8px;
    }
}

/* Small screen breakpoint - switch to hamburger only at true mobile width */
@media (max-width: 768px) {
    /* IMPORTANT: Switch to hamburger at this breakpoint */
    .mobile-nav-toggle {
        display: flex !important; /* Force display */
    }
    
    /* IMPORTANT: Always hide regular nav at this breakpoint */
    .site-header .nav-section {
        display: none !important; /* Force hiding */
    }
    
    .site-header {
        grid-template-columns: 1fr; /* Single column layout */
        min-width: 0; /* Remove min-width constraint */
        margin: 30pt 30pt 0 30pt;
        justify-items: center; /* Center the title */
    }
    
    .title-section {
        justify-self: center;
        min-width: 0;
        order: 1; /* Ensure title stays at the top */
    }
    
    .spacer-section {
        display: none;
    }
    
    /* Updated icon-item for mobile */
    .icon-item {
        width: calc(50% - 3rem);
    }
    
    .icon-container {
        gap: 3rem;
    }
}

/* Further adjustments for smaller screens */
@media (max-width: 768px) {
    .gallery {
        grid-template-columns: 1fr;
        padding: 0.5rem;
        margin: 0;
    }
    
    .site-header {
        margin: 40pt 0 0 0;
        padding: 0 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .title-section {
        padding: 0;
    }
    
    .project-title, .project-year {
        padding: 1rem 0;
        margin: 0;
    }
    
    .bio-container {
        padding: 1rem;
    }
    
    .bio-image {
        width: 90%;
    }
    
    .icon-container {
        gap: 2rem;
    }
    
    .icon-image {
        width: 100px;
    }
}

/* Mobile title size adjustment */
@media (max-width: 768px) {
    /* Updated title font size to 33px as requested */
    .site-title {
        font-size: 33px;
    }
    
    /* Project title adjustments for mobile */
    .project-title {
        margin-top: 20px; /* Increase margin between title-section and project-title */
        margin-bottom: 0; /* Remove margin between project-title and project-year */
        padding-bottom: 0; /* Remove bottom padding to ensure no extra space */
    }
    
    .project-title h2 {
        font-size: 20px;
    }
    
    /* Project year adjustments for mobile */
    .project-year {
        margin-top: 0; /* Remove top margin to eliminate space between title and year */
        padding-top: 0; /* Remove top padding to ensure no extra space */
        margin-bottom: 15pt; /* Increase margin between project-year and gallery *