/* Import Google Font */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap");

:root {
    --bg-main: #0f0f11;
    --bg-secondary: #17171a;
    --color-primary: #5f1dde;
    --color-text: #d7d7db;
    --color-heading: #ffffff;
}

html, body {
    height: 100%;
}

#bg-canvas{
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: "Poppins", sans-serif;
    background: var(--bg-main);
    color: var(--color-text);
    line-height: 1.6;
}

main {
    flex: 1 1 auto;
}

.container { width: 90%; max-width: 1200px; margin-inline: auto; }


.site-header {
    background: var(--bg-main);
    position: sticky;
    top: 0;
    z-index: 10;
}
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; }
.nav-links { list-style: none; display: flex; gap: 1.5rem; }
.nav-links a { color: var(--color-text); text-decoration: none; transition: color .2s; }
.nav-links a:hover { color: var(--color-primary); }
.logo { font-weight: 700; font-size: 1.25rem; color: var(--color-heading); text-decoration: none; transition: color .5s}
.logo:hover{ color: var(--color-primary); }
.btn {
    padding: .5rem 1rem;
    border-radius: 6px;
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    transition: opacity .2s;
    text-decoration: none;
}
.btn:hover { opacity: .8; }

.btn-secondary{
    color: var(--color-primary);
    text-decoration: none;
}

/* Hero */
.hero { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; gap: 2rem; position: relative; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4rem); color: var(--color-heading); max-width: 600px; }
.hero p { max-width: 500px; }

/* Sections */
section { padding: 5rem 0; }
section h2 { font-size: 2.25rem; color: var(--color-heading); margin-bottom: 1.5rem; }

/* À propos */
.about-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: center; }
.about-grid img { width: 100%; border-radius: 12px; box-shadow: 0 8px 16px rgba(0,0,0,.4); }

.about-block {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.about-block + .about-block {        /* écart entre blocs */
    margin-top: 1.5rem;
}

/* ------------ MISE EN PAGE DES BLOCS À PROPOS ------------ */
.about-grid{
    /* 1 colonne sur mobile, 2 colonnes au-delà de 700 px */
    display:grid;
    gap:1.5rem;
    grid-template-columns:1fr;     /* par défaut : 1 bloc par ligne */
}

@media (min-width:700px){
    .about-grid{
        grid-template-columns:repeat(2,1fr); /* 2 blocs alignés */
    }
    .about-block + .about-block { margin-top: 0; }
}

/* chaque bloc occupe toute la cellule et a la même hauteur */
.about-block{
    display:flex;
    flex-direction:column;         /* le contenu reste vertical */
}



/* ——— Bloc générique déjà défini ——— */
.about-block {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

/* Projets */
.projects-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr; /* mobile : 1 colonne */
}

@media (min-width: 700px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr); /* desktop : 2 colonnes */
    }
}

.project-thumb iframe,
.project-thumb video {
    width: 100%;
    height: 160px; /* même hauteur que les images miniatures */
    object-fit: cover; /* pour bien couvrir le cadre */
    border-radius: 12px 12px 0 0; /* arrondir en haut comme les images */
    display: block;
}

.project-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.25);
    transition: transform 0.3s;
    outline: none;
    display: flex;
    flex-direction: column;
    height: 400px; /* même hauteur fixe */
}
.project-card:hover,
.project-card:focus {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgb(0 0 0 / 0.4);
}
.project-thumb {
    flex-shrink: 0;
    height: 220px; /* hauteur fixe de la miniature */
    overflow: hidden;
}
.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-body {
    padding: 1rem;
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex-grow: 1;
    overflow: hidden;
}
.card-body h3 {
    margin-bottom: 0.25rem;
    color: var(--color-heading);
}
.card-body span {
    font-weight: 600;
    color: var(--color-primary);
}
.card-body p {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    line-height: 1.3;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 5; /* limite le texte à 5 lignes */
    -webkit-box-orient: vertical;
}

/* MODALE */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
    z-index: 9999;
}
.modal.is-open {
    opacity: 1;
    pointer-events: auto;
}
.modal__content {
    position: relative;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    color: var(--color-text);
}

.modal__content iframe,
.modal__content video {
    width: 100%;
    aspect-ratio: 16 / 9; /* respect ratio vidéo */
    height: auto;
    display: block;
    border-radius: 12px;
}

.modal__content .video-responsive {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
}

.modal__content .video-responsive iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

.video-responsive {
    position: relative;
    width: 100%;
    height: 220px;         /* hauteur fixe de la miniature */
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.video-responsive iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}


.modal__close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 2.5rem;
    background: transparent;
    border: none;
    color: var(--color-heading);
    cursor: pointer;
    transition: transform 0.2s ease;
}
.modal__close:hover {
    transform: rotate(90deg) scale(1.2);
}

/* CARROUSEL */
.modal-carousel {
    position: relative;
    margin: 1rem 0;
    user-select: none;
}
.carousel-wrapper {
    overflow: hidden;
}
.carousel-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.carousel-item {
    display: none;
    text-align: center;
}
.carousel-item img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* Boutons précédent/suivant */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-primary);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 0 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    z-index: 10;
}
.carousel-btn.prev {
    left: 10px;
}
.carousel-btn.next {
    right: 10px;
}
.carousel-item.pdf-link a {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 1.2rem;
    text-decoration: none;
}
.carousel-item.pdf-link a:hover {
    text-decoration: underline;
}

/* Contact */
.contact {
    text-align: center;
    display: flex;
    flex-direction: column;
}
label {
    display: flex;
    flex-direction: column;
    align-self: center;
    max-width: 50%;
}
.sr-only {
    padding: 1rem;
}
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}
.contact-form input,
.contact-form textarea {
    max-width: 100%;
    min-width: 50%; /* ou supprime min-width */
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid var(--bg-secondary);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--color-text);
}

.contact-form textarea {
    min-height: 140px;
    resize: vertical;
}
.contact-form button {
    align-self: center;
    margin: 1rem;
}

.alert {
    margin: 1rem 0;
    padding: .75rem 1rem;
    border-radius: 8px;
}
.alert.success {
    background: #2ecc71;
    color: #fff;
}
.alert.error {
    background: #e74c3c;
    color: #fff;
}

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    padding: 2rem 0;
    margin-top: auto;
}
.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}
.social-links {
    list-style: none;
    display: flex;
    gap: 1rem;
}
.social-links a {
    color: var(--color-text);
    transition: color .2s;
    text-decoration: none;
}
.social-links a:hover {
    color: var(--color-primary);
}

/* Utilities */
.section-bg {
    background: var(--bg-secondary);
    border-radius: 20px;
}
