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

/* Web Font: Standard - Complete Family (woff2 + woff fallback) */

/* Standard Book (Regular) */
@font-face {
    font-family: 'Standard';
    src: url('/fonts/standard-book-webfont.woff2') format('woff2'),
         url('/fonts/standard-book-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Standard Book Italic */
@font-face {
    font-family: 'Standard';
    src: url('/fonts/standard-book-italic-webfont.woff2') format('woff2'),
         url('/fonts/standard-book-italic-webfont.woff') format('woff');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

/* Standard Bold */
@font-face {
    font-family: 'Standard';
    src: url('/fonts/standard-bold-webfont.woff2') format('woff2'),
         url('/fonts/standard-bold-webfont.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

/* Standard Bold Italic */
@font-face {
    font-family: 'Standard';
    src: url('/fonts/standard-bold-italic-webfont.woff2') format('woff2'),
         url('/fonts/standard-bold-italic-webfont.woff') format('woff');
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}

body {
    background: #fff;
    font-family: 'Standard', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: normal; /* Standard Book */
    padding-bottom: 100px; /* Space for fixed bottom bar with extra padding */
}

#gallery {
    padding: 60px 50px 20px 40px; /* Right 50px min, left 40px (doubled) */
}

/* Fixed bottom bar for project title - three section layout */
#project-title-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 30px 50px 40px 40px; /* Match image padding: 40px left, 50px right */
    z-index: 999;
    color: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14pt;
}

#site-name {
    cursor: pointer;
    text-align: left;
    flex: 0 0 auto;
}

#project-info {
    display: flex;
    gap: 40px;
    cursor: pointer;
    flex: 1 1 auto;
    justify-content: center;
}

#project-prefix {
    text-align: right;
}

#project-type {
    text-align: left;
}

#index-link {
    cursor: pointer;
    text-align: right;
    flex: 0 0 auto;
}

.project {
    margin-bottom: 30px; /* 3x the 10px gap between rows */
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Line breaks - force new line */
.line-break {
    width: 100%;
    height: 0;
}

/* Image mode */
.image-container {
    position: relative;
    flex: 0 0 auto;
    cursor: pointer;
    height: 300px; /* Fixed height for all images */
}

.image-container img {
    display: block;
    width: auto;
    height: 100%;
    object-fit: cover;
}

/* Image groups - horizontal (default) */
.image-pair {
    display: flex;
    gap: 0;
    flex: 0 0 auto;
    height: 300px;
}

.image-pair .image-container {
    height: 100%;
}

/* Vertical image groups - stacked */
.image-pair-vertical {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 0 0 auto;
    align-items: flex-start;
}

.image-pair-vertical .image-container {
    height: 300px; /* Same as single portrait */
    width: auto;
}

.image-pair-vertical .image-container img {
    height: 100%;
    width: auto;
    max-width: none;
}

/* Remove hover title - no longer used */
.project-title {
    display: none;
}

/* Text mode */
body.text-mode .image-container {
    display: none;
}

body.text-mode .image-pair {
    display: none;
}

body.text-mode .image-pair-vertical {
    display: none;
}

.text-container {
    display: none;
}

body.text-mode .text-container {
    display: block;
}

/* Hide titles and categories in text mode */
body.text-mode .text-container h2,
body.text-mode .text-container .project-category {
    display: none;
}

/* Format text content - Responsive sizing for optimal line length */
.text-container .project-text-content {
    font-family: 'Standard', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: normal;
    /* Desktop: 65 characters per line (optimal readability) */
    /* Font size scales with viewport to maintain character count */
    font-size: clamp(18pt, 2.5vw, 28pt);
    line-height: 1.5;
    color: #000;
    /* Constrain width to optimal character count */
    max-width: 65ch; /* ch unit = character width in current font */
    
    /* Font rendering optimizations for sharpness */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1;
    font-kerning: normal;
}

/* Paragraph spacing - 0.75em between paragraphs (less than 30px project gap) */
.text-container .project-text-content p {
    margin: 0 0 0.75em 0;
}

.text-container .project-text-content p:first-child {
    margin-top: 0;
}

.text-container .project-text-content p:last-child {
    margin-bottom: 0;
}

/* Text containers occupy space like images */
body.text-mode .project {
    margin-bottom: 30px; /* Same as image mode */
    gap: 10px; /* Same as image mode */
}

body.text-mode .text-container {
    max-width: 800px; /* Readable text width */
}

/* Mobile-only top bar (hidden on desktop/tablet) */
#mobile-top-bar {
    display: none;
}

/* Mobile: centered, 1 column */
@media (max-width: 767px) {
    /* Show mobile top bar */
    #mobile-top-bar {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: #fff;
        padding: 30px 15px 30px 15px;
        z-index: 999;
        font-size: 10pt;
    }
    
    #mobile-site-name {
        cursor: pointer;
        text-align: left;
        flex: 0 0 auto;
    }
    
    #mobile-index-link {
        cursor: pointer;
        text-align: right;
        flex: 0 0 auto;
    }
    
    /* MOBILE BOTTOM BAR - Show PREFIX | WHAT only */
    #project-title-bar {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 30px 15px 40px 15px !important;
        font-size: 10pt !important;
    }
    
    /* Hide COLETTE from bottom bar (keep toggle) */
    #site-name-bio {
        display: none !important;
    }
    
    /* Hide COLETTE and INDEX from bottom bar */
    #site-name {
        display: none !important;
    }
    
    #index-link {
        display: none !important;
    }
    
    /* Center PREFIX | WHAT container */
    #project-info {
        display: flex !important;
        flex: 0 0 auto !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 20px !important;
    }
    
    /* CRITICAL: Force PREFIX and WHAT visible */
    #project-prefix {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        font-size: 10pt !important;
        text-align: center !important;
    }
    
    #project-type {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        font-size: 10pt !important;
        text-align: center !important;
    }
    
    #gallery {
        max-width: 100%;
        margin: 0 auto;
        padding: 90px 15px 20px 15px; /* 15px left/right, top accounts for fixed bar */
    }
    
    .project {
        max-width: 100%;
        margin-bottom: 15px; /* Same as side padding */
        gap: 0; /* No gap between images within project */
    }
    
    .image-container {
        width: 100% !important;
        height: auto !important;
    }
    
    .image-container img {
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    .image-pair {
        width: 100% !important;
        height: auto !important;
        flex-direction: row; /* Keep side-by-side */
    }
    
    .image-pair .image-container {
        width: auto !important;
        height: auto !important;
        flex: 1;
    }
    
    .image-pair .image-container img {
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    .image-pair-vertical {
        width: 100% !important;
        height: auto !important;
    }
    
    .image-pair-vertical .image-container {
        width: 100% !important;
        height: auto !important;
    }
    
    .image-pair-vertical .image-container img {
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    .text-container .project-text-content {
        /* Mobile landscape: same as desktop (65 CPL optimal) */
        font-size: clamp(16pt, 2.5vw, 26pt);
        max-width: 65ch;
    }
}

/* Mobile portrait: 50% of optimal line length (32-35 CPL) */
@media (max-width: 767px) and (orientation: portrait) {
    .text-container .project-text-content {
        font-size: clamp(18pt, 4vw, 24pt);
        max-width: 35ch; /* ~50% of 65ch */
    }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .image-container {
        height: 250px;
    }
    
    .image-pair {
        height: 250px;
    }
    
    .image-pair-vertical {
        height: auto;
    }
    
    .image-pair-vertical .image-container {
        height: 250px; /* Same as single tablet portrait */
    }
    
    .text-container .project-text-content {
        /* Tablet: optimal 65 CPL, scales with viewport */
        font-size: clamp(18pt, 2.2vw, 26pt);
        max-width: 65ch;
    }
}

/* Desktop: up to 7 columns */
@media (min-width: 1024px) {
    .image-pair-vertical {
        height: auto;
    }
}
