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

body {
    font-family: 'Raleway', 'Helvetica Neue', Arial, sans-serif;
    background-color: #222831;
    color: #000;
    overflow-x: hidden;
}

/* --- Sticky Nav --- */
.main-header {
    position: fixed;
    top: 0; 
    width: 100%; 
    height: 50px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 0 clamp(20px, 5vw, 50px); 
    border-bottom: 0.6px solid #D8D7CC;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: clamp(32px, 6vw, 40px);             
    height: clamp(32px, 6vw, 40px);            
    object-fit: cover;       
}

.logo-text { 
    color: #D8D7CC;
    font-family: 'Raleway';
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 300;
    letter-spacing: clamp(6px, 2vw, 12px);
}

nav ul { 
    display: flex; 
    list-style: none; 
    gap: clamp(20px, 6vw, 50px); 
}

nav a { 
    text-decoration: none; 
    color: #D8D7CC; 
    font-size: clamp(14px, 3vw, 16px);
    letter-spacing: 1.5px;
    font-weight: 170; 
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }
    .logo { margin-bottom: 5px; }
    nav ul { gap: 20px; }
}

/* --- Projects Page Layout --- */
.projects-page {
    padding-top: clamp(80px, 10vw, 100px);
    padding-bottom: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

.title-container {
    position: relative;
    width: 100%;
    max-width: 1440px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: clamp(20px, 3vw, 40px);
}

.main-title {
    width: 100%;
    max-width: 788px;
    color: #D8D7CC;
    font-family: 'Raleway', sans-serif;
    font-size: clamp(48px, 12vw, 150px);
    font-weight: 100;
    text-align: center;
    z-index: 2;
    line-height: 0.9;
}

.title-line {
    position: absolute;
    width: clamp(400px, 70vw, 1048px);
    height: auto;
    z-index: 1;
}

.header-separator {
    width: clamp(300px, 90vw, 1200px);
    height: 1px;
    background: #D8D7CC;
    margin: 0 auto clamp(20px, 4vw, 40px) auto;
}

/* --- Filter Buttons --- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(15px, 3vw, 33px);
    justify-content: center;
    margin-bottom: clamp(40px, 6vw, 60px);
    padding: 0 15px;
}

.filter-btn {
    position: relative;
    padding: clamp(6px, 1vw, 12px) clamp(30px, 4vw, 45px);
    background-color: #d8d7cc1c;
    border: none;
    color: #D8D7CC;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: clamp(14px, 2.5vw, 18px);
    font-weight: 150;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.4s ease;
}

.filter-btn:hover, .filter-btn.active {
    background: #D8D7CC;
    color: #222831;
}

/* Corner decorations */
.filter-btn::before, .filter-btn::after, .filter-btn .btn-corners::before, .filter-btn .btn-corners::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 5px;
    border: 1px solid #D8D7CC;
}
.filter-btn::before { top: -7px; left: -7px; border-right: none; border-bottom: none; }
.filter-btn::after { top: -7px; right: -7px; border-left: none; border-bottom: none; }
.filter-btn .btn-corners::before { bottom: -7px; left: -7px; border-right: none; border-top: none; }
.filter-btn .btn-corners::after { bottom: -7px; right: -7px; border-left: none; border-top: none; }

/* --- Project Grid --- */
.projects-grid-container {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    border-left: 0.7px solid #D8D7CC;
    border-right: 0.7px solid #D8D7CC;
    padding: 0 clamp(20px, 4vw, 40px);
}

.projects-grid {
    display: grid;
    /* This allows the 256px columns to wrap when there's no space */
    grid-template-columns: repeat(auto-fit, 256px);
    gap: 35px;
    justify-content: center;
    padding-bottom: 50px;
}

.project-card {
    width: 256px;
    height: 450px;
    border-radius: 128px;
    background: #D9D9D9;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, opacity 0.4s ease;
    animation: floating 4s ease-in-out infinite;
    cursor: pointer;
}

.project-card:nth-child(even) { animation-delay: 1s; }
.project-card:nth-child(3n) { animation-delay: 1.5s; }
.project-card.hidden { display: none; }

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

.project-card:hover {
    animation-play-state: paused;
    transform: scale(1.02);
}

/* --- Modal (Respecting original sizes) --- */
.modal {
    display: none; 
    position: fixed;
    z-index: 2000;
    left: 0; 
    top: 0;
    width: 100%; 
    height: 100%;
    background-color: #F5F5F5;
    overflow-y: auto;
}

.modal.active { display: block; }

.modal-content {
    display: flex; 
    max-width: 1440px; 
    width: 100%;
    margin: 0 auto;
    padding: clamp(20px, 5vw, 60px); 
    gap: clamp(20px, 5vw, 80px);
}

/* Modal Desktop Layout */
.modal-left { 
    flex: 0 1 655px; /* Respects your original max-width */
    min-width: 300px;
}

.modal-right { 
    flex: 1;
    display: flex; 
    flex-direction: column;
    align-items: center;
    gap: 20px; 
    min-width: 300px;
}

/* Original Image Sizes */
.big-image {
    width: 100%;
    max-width: 800px;
    height: 707px; /* Restored original height */
    background: #000;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.3s ease;
}

#modal-title { font-family: 'Raleway'; font-size: clamp(40px, 8vw, 100px); font-weight: 400; color: #000; line-height: 0.95; }
#modal-subtitle { font-family: 'Raleway'; font-size: clamp(24px, 5vw, 35px); font-weight: 300; margin-bottom: 30px; }

.text-sections p {
    font-family: 'Raleway'; font-size: clamp(14px, 3vw, 18px); color: #000;
    text-align: justify; margin-bottom: 20px;
}

/* Responsive Modal (Tablet/Mobile) */
@media (max-width: 1024px) {
    .modal-content {
        flex-direction: column;
        align-items: center;
    }
    .modal-left, .modal-right {
        width: 100%;
        max-width: 100%;
    }
    .big-image {
        height: 500px; /* Adjust height slightly for smaller screens */
    }
}

@media (max-width: 768px) {
    .big-image {
        height: 350px;
    }
}

/* Thumbnail Row */
.thumbnail-row { 
    display: flex; 
    flex-wrap: wrap;
    gap: 15px; 
    justify-content: center;
}

.thumb {
    width: clamp(80px, 15vw, 138px);
    height: clamp(60px, 12vw, 100px);
    background: #D9D9D9;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border: 1px solid transparent;
}
.thumb:hover { border: 1px solid #222831; }

/* Modal Buttons */
.retour-btn, .pdf-btn {
    position: relative;
    padding: 12px 45px;
    background-color: #d8d7cc1c;
    border: none;
    color: #222831;
    font-family: "Helvetica Neue", sans-serif;
    font-size: 18px;
    letter-spacing: 2px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-top: 20px;
}

.retour-btn:hover, .pdf-btn:hover { background: #222831; color: white; }

/* Corner Decorations for Buttons */
.retour-btn::before, .retour-btn::after, .retour-btn .btn-corners::before, .retour-btn .btn-corners::after,
.pdf-btn::before, .pdf-btn::after, .pdf-btn .btn-corners::before, .pdf-btn .btn-corners::after {
    content: ""; position: absolute; width: 6px; height: 5px; border: 1px solid #222831;
}
.retour-btn::before, .pdf-btn::before { top: -7px; left: -7px; border-right: none; border-bottom: none; }
.retour-btn::after, .pdf-btn::after { top: -7px; right: -7px; border-left: none; border-bottom: none; }
.retour-btn .btn-corners::before, .pdf-btn .btn-corners::before { bottom: -7px; left: -7px; border-right: none; border-top: none; }
.retour-btn .btn-corners::after, .pdf-btn .btn-corners::after { bottom: -7px; right: -7px; border-left: none; border-top: none; }

.modal-actions { display: flex; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.site-btn { background-color: #222831; color: #D8D7CC; }

/* --- Footer --- */
.main-footer {
    width: 100%; 
    padding: 40px 0;
    display: flex; 
    flex-direction: column;
    align-items: center;
    color: #D8D7CC;
}

.footer-decoration { width: 100%; max-width: 1440px; display: flex; justify-content: center; margin-bottom: 10px; }
.footer-decoration svg { width: 90%; height: auto; }

.main-footer p {
    font-size: 10px;
    letter-spacing: 4px;
    text-transform: uppercase;
}