.message {
    margin: 40px auto;
    /* espace autour et centrage horizontal */
    padding: 30px;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: #fff;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    /* largeur max pour rester lisible */
}

.message h1 {
    font-size: 2em;
    margin-bottom: 15px;
}

.message p {
    font-size: 1.1em;
    line-height: 1.6;
}

/* Portfolio Masonry Layout */
.portfolio-masonry {
    column-count: 3;
    column-gap: 15px;
    /* Petite marge "bord à bord" mais distincte */
    padding: 10px;
}

.portfolio-item {
    display: inline-block;
    /* Fixes masonry gaps and painting issues in Safari */
    width: 100%;
    break-inside: avoid;
    /* Revert to standard avoid, avoid-column sometimes tricky */
    margin-bottom: 15px;
    position: relative;
    border-radius: 8px;
    /* Optional: Slight rounding */
    overflow: hidden;
    /* Ensures overlay respects border radius */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;

    /* Removed backface-visibility as it caused white artifacts */
}

.portfolio-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.portfolio-item img {
    width: 100%;
    height: auto;
    display: block;
    /* Removes bottom space */
}

/* Overlay Styling */
.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
    padding: 20px 15px;
    color: white;
    opacity: 1;
    /* Always visible for better mobile UX, or could be 0 and hover: 1 */
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* Optional: Make overlay only on hover for desktop if desired
@media (min-width: 1024px) {
    .portfolio-overlay {
        opacity: 0;
    }
    .portfolio-item:hover .portfolio-overlay {
        opacity: 1;
    }
}
*/

.portfolio-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.portfolio-btn {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.2s;
    backdrop-filter: blur(4px);
}

.portfolio-btn:hover {
    background-color: rgba(255, 255, 255, 0.4);
    color: white;
}

/* Responsive Masonry */
@media screen and (max-width: 900px) {
    .portfolio-masonry {
        column-count: 2;
    }
}

@media screen and (max-width: 600px) {
    .portfolio-masonry {
        column-count: 1;
    }
}