/* --- Variable de style --- */
:root {
    --bg-color: #0a0a0a;
    --text-main: #e5e5e5;
    --text-muted: #888888;
    --accent: #ff3c00;
    --border-color: #333333;
    --grid-gap: 1px;
}

body {
    background-color: var(--border-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    background-color: var(--bg-color);
    position: sticky;
    top: 0;
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    /* Haut, Milieu (vide), Bas */
    align-content: space-between;
    border-right: 1px solid var(--border-color);
}

/* Passage à une seule colonne */
@media (max-width: 1024px) {
    body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .sidebar {
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        grid-template-rows: auto;
        gap: 2rem;
    }
}

h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 3rem;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1rem;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: color 0.3s ease, padding-left 0.3s ease;
    display: inline-block;
}

nav a:hover,
nav a.active {
    color: var(--text-main);
    padding-left: 10px;
    border-left: 2px solid var(--accent);
}

.meta-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 2rem;
}

/* --- Main content --- */
.main-content {
    background-color: var(--bg-color);
    /* Grille de la galerie */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--grid-gap);
    /* Crée les bordures via le fond du body */
    background-color: var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

@media (max-width: 640px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* --- Project card--- */
.card {
    background-color: var(--bg-color);
    position: relative;
    aspect-ratio: 4/5;
    /* Format portrait */
    overflow: hidden;
    display: grid;
    grid-template-rows: 1fr auto;
    transition: background-color 0.3s ease;
}

/* Effet monochrome avec accentuation au survol */
.card:hover {
    background-color: #0f0f0f;
}

.card-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Filtre N&B par défaut */
    filter: grayscale(100%) contrast(110%);
    transition: filter 0.5s ease;
}

/* Retrait du filtre au survol */
.card:hover .card-image-container {
    filter: grayscale(0%) contrast(100%);
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    position: absolute;
}

.card-img-no-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    position: absolute;
}

.card-img-no-logo:hover {
    opacity: 0%;
}

.card:hover img {
    transform: scale(1.05);
}

.card-details {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    background: var(--bg-color);
    z-index: 10;
}

.date-projet {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.titre-projet {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0;
    line-height: 1.1;
    transition: color 0.3s ease;
}

.card:hover .titre-projet {
    color: var(--accent);
    font-style: italic;
    /* Petite touche "élégante" au survol */
}

.arrow-icon {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    color: var(--accent);
}

.card:hover .arrow-icon {
    opacity: 1;
    transform: translateX(0);
}

/* --- Section autre (Ex: "About" ou Highlight) --- */
/* Span 2 colonnes */
.card.double-width {
    grid-column: span 2;
    aspect-ratio: 16/9.9878;
}

@media (max-width: 1100px) {
    .card.double-width {
        grid-column: span 1;
        aspect-ratio: 4/5;
    }
}

/* Overlay */
.overlay-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 20;
    backdrop-filter: blur(5px);
    box-shadow: inset 3px 3px 10px rgba(0, 0, 0, 0.2);
}

.card:hover .overlay-text {
    opacity: 1;
}

/* Typo spécifique pour le texte de labeur */
.body-text {
    font-size: 0.9rem;
    color: #999;
    max-width: 60ch;
    line-height: 1.6;
}