@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;700&family=Space+Mono:wght@400;700&display=swap');

:root {
    --jaune: #ffd000;
    --noir: #1a1a1a;
    --blanc: #ffffff;
    --gris-fond: #f5f5f0;
    --gris-carte: #ffffff;
    --orange-accent: #ff6b35;
    --rayure: repeating-linear-gradient(
        -45deg,
        var(--jaune),
        var(--jaune) 10px,
        var(--noir) 10px,
        var(--noir) 20px
    );
}

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

body {
    font-family: "Space Grotesk", system-ui, sans-serif;
    background-color: var(--gris-fond);
    color: var(--noir);
    line-height: 1.6;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

/* Bande de chantier */
body::before,
body::after {
    content: "";
    display: block;
    width: 100%;
    height: 12px;
    background: var(--rayure);
}

/* Header */
.entete-officiel {
    text-align: center;
    padding: 2.5rem 1rem 2rem;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.tampon {
    display: inline-block;
    border: 4px solid var(--orange-accent);
    color: var(--orange-accent);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.2rem 0.8rem;
    border-radius: 3px;
    font-family: "Space Mono", monospace;
    transform: rotate(3deg) scale(1);
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
    animation: stamp-press 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.3s both;
}

@keyframes stamp-press {
    0% {
        transform: rotate(3deg) scale(2.5);
        opacity: 0;
    }
    60% {
        transform: rotate(3deg) scale(0.9);
        opacity: 1;
    }
    100% {
        transform: rotate(3deg) scale(1);
        opacity: 1;
    }
}

.ministere {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #888;
    margin-bottom: 0.2rem;
}

.sous-titre {
    font-size: 0.7rem;
    color: #aaa;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--noir);
    line-height: 1.1;
    margin-bottom: 0.8rem;
    background: var(--jaune);
    display: inline-block;
    padding: 0.3rem 0.5rem;
    transform: rotate(-1deg);
}

.reference {
    font-family: "Space Mono", monospace;
    font-size: 0.7rem;
    color: #999;
    margin-top: 0.8rem;
}

/* Sections */
main {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 0.8rem 3rem;
}

.section-officielle {
    margin-bottom: 1.5rem;
    padding: 1.2rem;
    background: var(--gris-carte);
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #eee;
}

.section-officielle h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--noir);
    margin-bottom: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    cursor: default;
}

.section-officielle h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 3px;
    background: var(--jaune);
    transition: width 0.3s ease;
}

.section-officielle h2:hover::after {
    width: 100%;
}

.section-officielle p {
    margin-bottom: 0.6rem;
    color: #444;
    font-size: 0.9rem;
}

/* Encadrés infos */
.encadre {
    background: var(--gris-fond);
    border-left: 4px solid var(--jaune);
    padding: 1rem;
    margin-top: 0.8rem;
    border-radius: 0 8px 8px 0;
}

.encadre p {
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.encadre strong {
    font-family: "Space Mono", monospace;
    font-size: 0.8rem;
}

/* Tally / RSVP */
.tally-container {
    margin-top: 1rem;
}

.bouton-tally {
    display: inline-block;
    background: var(--noir);
    color: var(--jaune);
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: "Space Grotesk", sans-serif;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.bouton-tally:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Galerie */
.galerie {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.galerie-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: var(--gris-fond);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.galerie-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.galerie-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.galerie-label {
    display: block;
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
    font-family: "Space Mono", monospace;
    color: #666;
    background: var(--gris-fond);
}

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

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

.lightbox img {
    max-width: 95%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 4px;
}

.placeholder {
    text-align: center;
    color: #bbb;
    font-style: italic;
    padding: 2rem 1rem;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: var(--gris-fond);
}

/* Équipe — Badges de chantier */
.equipe-liste {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
}

.badge {
    background: var(--blanc);
    border: 2px solid var(--noir);
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    transform-style: preserve-3d;
    will-change: transform;
    opacity: 0;
    transform: translateY(40px);
}

.badge.animate {
    opacity: 1;
    transform: translateY(0);
}

.badge:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.badge-header {
    background: var(--noir);
    color: var(--jaune);
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: "Space Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--jaune);
    margin: 1rem auto 0.6rem;
    display: block;
}

.badge-surnom {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--noir);
    margin-bottom: 0.1rem;
}

.badge-nom {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.3rem;
}

.badge-specialite {
    font-family: "Space Mono", monospace;
    font-size: 0.75rem;
    color: var(--noir);
    background: var(--jaune);
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.badge-stats {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.8rem 0.5rem;
    border-top: 1px dashed #ddd;
    border-bottom: 1px dashed #ddd;
    margin: 0 0.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stat-val {
    font-family: "Space Mono", monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--noir);
}

.stat-label {
    font-size: 0.6rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: center;
}

.badge-skills {
    padding: 0.8rem 1rem;
}

.skill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.skill:last-child {
    margin-bottom: 0;
}

.skill-name {
    font-size: 0.7rem;
    font-family: "Space Mono", monospace;
    color: #666;
    min-width: 70px;
    text-align: right;
}

.skill-bar {
    flex: 1;
    height: 8px;
    background: var(--gris-fond);
    border-radius: 4px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    background: var(--jaune);
    border-radius: 4px;
    width: 0%;
    transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.badge.animate .skill-fill {
    width: var(--skill-width);
}

.badge-citation {
    font-style: italic;
    font-size: 0.85rem;
    color: #555;
    padding: 0.8rem 1rem;
    margin: 0;
    border-left: none;
    position: relative;
}

.badge-citation::before {
    content: "« ";
    color: var(--jaune);
    font-weight: 700;
}

.badge-citation::after {
    content: " »";
    color: var(--jaune);
    font-weight: 700;
}

/* Footer */
footer {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    padding: 1.5rem 1rem 2rem;
}

footer::before {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    background: var(--jaune);
    margin: 0 auto 1.5rem;
}

.cachet {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.mentions {
    font-size: 0.65rem;
    color: #bbb;
    font-family: "Space Mono", monospace;
}

/* Fade-in on scroll */
.section-officielle {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease,
                box-shadow 0.25s ease;
}

.section-officielle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Smooth transitions on interactive elements */
a, button, .bouton-tally, .encadre {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* ============================================
   Desktop (min-width: 680px)
   ============================================ */
@media (min-width: 680px) {
    body::before,
    body::after {
        height: 16px;
    }

    .entete-officiel {
        padding: 4rem 2rem 3rem;
    }

    .tampon {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .ministere {
        font-size: 0.75rem;
    }

    .sous-titre {
        font-size: 0.8rem;
        margin-bottom: 2rem;
    }

    h1 {
        font-size: clamp(2rem, 6vw, 3.2rem);
    }

    .reference {
        font-size: 0.75rem;
    }

    main {
        padding: 0 1.5rem 4rem;
    }

    .section-officielle {
        margin-bottom: 2rem;
        padding: 2rem;
        border-radius: 12px;
    }

    .section-officielle h2 {
        font-size: 1.4rem;
    }

    .section-officielle p {
        font-size: 1rem;
    }

    .encadre {
        padding: 1.2rem 1.5rem;
    }

    .encadre p {
        font-size: 0.95rem;
    }

    .encadre strong {
        font-size: 0.85rem;
    }

    .galerie {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    }

    .galerie-item img {
        height: 220px;
    }

    .galerie-label {
        font-size: 0.8rem;
    }

    .lightbox img {
        max-width: 90%;
    }

    .equipe-liste {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .badge-photo {
        width: 150px;
        height: 150px;
        margin: 1.2rem auto 0.8rem;
    }

    .badge-surnom {
        font-size: 1.4rem;
    }

    .badge-nom {
        font-size: 0.9rem;
    }

    .badge-specialite {
        font-size: 0.8rem;
        padding: 0.3rem 1rem;
    }

    .badge-header {
        font-size: 0.75rem;
    }

    .badge-stats {
        gap: 1rem;
        padding: 0.8rem 1rem;
        margin: 0 1rem;
    }

    .stat-val {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .badge-skills {
        padding: 1rem 1.5rem;
    }

    .skill-name {
        min-width: 85px;
        font-size: 0.75rem;
    }

    .badge-citation {
        padding: 0.8rem 1.5rem;
    }

    footer {
        padding: 2rem 1.5rem 3rem;
    }

    .cachet {
        font-size: 0.9rem;
    }

    .mentions {
        font-size: 0.7rem;
    }
}
