/* =====================================================
   BASE / ROOT / GLOBAL
   ===================================================== */

:root {
    --primary-color: #911fad;
    --secondary-color: #e5c8fc;
    --grid-color: #f8f8fa41;
    --white-color: #e7e2dc;
    --text: #e7e2;
    --bg-color: #d2b5d89c;
    --black-color: #241a33;
}

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

/* Aucune barre de scroll quand on est sur la page d'accueil */
html:has(body.index-page) {
    overflow: hidden;
}

html,
body {
    cursor: url('img/cursor.png') 0 0, auto;
}

body {
    font-family: 'Gotham', sans-serif;
    margin: 0;
    padding: 0px 40px;
    background-color: var(--bg-color);
    background-size: 40px 40px;
    color: var(--black-color);
    box-sizing: border-box;
}

body *,
body *::before,
body *::after {
    box-sizing: inherit;
}

/* Empêcher le scroll vertical sur la page projets */
body:has(.projects-container) {
    overflow: hidden;
    height: 100vh;
}

/* =====================================================
   TYPOGRAPHIE
   ===================================================== */

p {
    font-size: 1.2em;
    line-height: 1.4;
    font-weight: 300;
}

h1 {
    font-family: 'Neuton', serif;
    font-style: italic;
    font-weight: normal;
    letter-spacing: -0.05em;
    font-size: 48px;
    margin: 0;
}

/* =====================================================
   LIENS / INTERACTIONS
   ===================================================== */

a {
    text-decoration: none;
    color: var(--black-color);
    transition: color 0.2s ease;
}

a,
button {
    cursor: url('img/cursor-click.png') 0 0, pointer;
}

a:hover {
    text-decoration: underline;
}

/* =====================================================
   NAVIGATION
   ===================================================== */

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 20px 0px;
    font-size: 16px;
    font-weight: 500;

    img {
        width: 64px;
        height: 64px;
        object-fit: contain;
    }
}

nav a:not(.logo) {
    position: relative;
}

/* =====================================================
   FOOTER (GLOBAL)
   ===================================================== */

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    gap: 100px;
    align-items: center;
    width: 100%;
    padding: 30px 40px;
    font-size: 14px;
}

/* =====================================================
   PAGE INDEX (ACCUEIL)
   ===================================================== */

/* Page index : vidéo en plein écran (fixed pour toujours couvrir le viewport) */
body.index-page {
    padding: 0;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

body.index-page main {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    z-index: 1;
}

body.index-page main section {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

body.index-page main video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

body.index-page header {
    position: relative;
    z-index: 10;
    padding: 0 40px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45) 0%, transparent 100%);
}

body.index-page footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

/* Textes en blanc sur la page index */
body.index-page header a,
body.index-page footer a {
    color: var(--white-color);
}

/* Logo blanc sur la page index */
body.index-page .logo img {
    filter: brightness(0) invert(1);
}

/* Logo couleur primaire sur les autres pages */
body:not(.index-page) .logo img {
    filter: brightness(0) saturate(100%) invert(9%) sepia(95%) saturate(7158%) hue-rotate(270deg) saturate(15%) brightness(75%) contrast(110%);
}

/* =====================================================
   FOND LIQUID / LOGO (INDEX)
   ===================================================== */

/* --- FOND ECRAN LIQUID METAL --- */
/* On donne un fond plein uniquement à l'accueil pour éviter la superposition de transparences */
html:has(body.index-page) {
    background-color: var(--bg-color);
}

/* Le body devient transparent (mais garde la grille) et laisse passer la souris */
body.index-page {
    background-color: transparent !important;
    pointer-events: none;
}

body.index-page header,
body.index-page footer {
    pointer-events: auto;
    /* Garde tes liens cliquables par dessus l'effet ! */
}

/* 1. Le VRAI logo, intouchable et parfaitement net */
#front-logo {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 35vh;
    /* Taille généreuse, s'adapte à l'écran */
    max-width: 350px;
    z-index: 5;
    pointer-events: none;
    /* Laisse passer la souris pour interagir avec le fond */
    filter: drop-shadow(0px 10px 30px rgba(0, 0, 0, 0.9));
    /* Ombre portée pour le détacher */
}

/* 2. Le canvas en fond opaque */
#logo-liquid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    background-color: var(--black-color);
}

/* =====================================================
   INDICATEUR DE SCROLL
   ===================================================== */

/* Indicateur de scroll */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    /* À 30px du bas de l'écran */
    left: 50%;
    transform: translateX(-50%);
    /* Centrage horizontal parfait */
    z-index: 10;
    font-size: 40px;
    color: var(--white-color);
    animation: bounce 2s infinite;
    pointer-events: none;
    /* Ne gêne pas le clic */
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translate(-50%, 0);
    }

    40% {
        transform: translate(-50%, -15px);
    }

    60% {
        transform: translate(-50%, -7px);
    }
}

/* Sur mobile, on peut l'agrandir un peu pour la visibilité */
@media (max-width: 768px) {
    .scroll-indicator {
        margin-top: 20px;
        font-size: 28px;
    }
}

/* =====================================================
   PROJETS (LISTING / SCROLL HORIZONTAL)
   ===================================================== */

.projects-container {
    width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
    padding: 20px 0;
}

.projects-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 40px;
    width: max-content;
    will-change: transform;
}

/* Animation de défilement automatique en boucle (optionnel) */
.projects-container.auto-scroll .projects-wrapper {
    animation: scroll-horizontal 30s linear infinite;
}

@keyframes scroll-horizontal {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.project {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    flex-shrink: 0;
    /* Empêche les projets de rétrécir */
    width: 500px;
    /* Largeur fixe pour chaque projet */
    gap: 15px;

    video {
        width: 100%;
        height: 300px;
        object-fit: cover;
        transition: transform 0.2s ease-in-out;
    }

    video:hover {
        transform: scale(0.95);
        transition: transform 0.2s ease-in-out;
    }

    .project-title {
        font-size: 18px;
        font-weight: 500;
        margin: 0;
    }

    .project-description {
        font-size: 14px;
        margin: 0;
        color: var(--black-color);
        opacity: 0.7;
    }

    .project-link {
        display: block;
        width: 100%;
    }
}

/* Lien projet global (carte entière) : pas de soulignement sur la carte */
a.project.project-link {
    text-decoration: none;
    color: inherit;
}

a.project.project-link:hover {
    text-decoration: none;
}

/* =====================================================
   TEXTE / INTRO PROJETS
   ===================================================== */

.project-lien {
    display: block;
    /* Transforme le lien en bloc pour activer le centrage */
    max-width: 800px;
    /* Même largeur que tes textes */
    margin: 10px auto 40px auto;
    /* Centre le bloc et ajoute de l'espace en bas */
    font-size: 18px;
    font-weight: 500;
    font-style: italic;
    color: var(--primary-color);
    text-decoration: underline;
}

.project-lien:hover {
    color: #410450;
}

/* =====================================================
   GALERIE
   ===================================================== */

.gallery-description {
    width: 40%;
}

.gallery {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    padding: 20px 0px 20px 0px;

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        cursor: url('img/cursor-white.svg') 0 0, pointer;
        transition: transform 0.3s ease;
    }

    img:hover {
        transform: scale(0.95);
    }
}

/* Overlay pour afficher l'image en plein écran */
.gallery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-overlay.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.gallery-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    z-index: 9999;
}

.gallery-overlay-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white-color);
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
}

.gallery-overlay-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* Galerie et pages projet : footer en bas de page (relatif), pas fixe */
body:has(.gallery) footer,
body:has(.project-page) footer {
    position: relative;
    a {
        color: var(--black-color);
    }
}

body:has(.gallery) footer{
    padding: 40px 0px;
}

/* =====================================================
   PAGE PROJET (DETAIL)
   ===================================================== */

/* Header et footer sur les pages projet */
body:has(.project-page) {
    padding: 0;
}

body:has(.project-page) header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 0 40px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, transparent 100%);
}

body:has(.project-page) header a {
    color: var(--white-color);
}

body:has(.project-page) .logo img {
    filter: brightness(0) invert(1);
}

body:has(.project-page) footer {
    background: transparent;
}

body:has(.project-page) footer a {
    color: var(--white-color);
}

.project-page {
    padding: 0;
    margin: 0;
}

.project-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.project-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
}

.project-video::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 35%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    pointer-events: none;
}

.project-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-header {
    position: fixed;
    top: 70%;
    left: 40px;
    z-index: 5;
    text-align: left;
    color: var(--white-color);
    max-width: 900px;
    pointer-events: none;
}

.project-header h1 {
    color: var(--white-color);
    font-size: 64px;
    margin-bottom: 20px;
    font-family: 'Neuton', serif;
    font-weight: 700;
}

.project-domains {
    font-size: 18px;
    color: var(--white-color);
    opacity: 1;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.project-content {
    position: relative;
    z-index: 10;
    margin-top: 100vh;
    padding: 80px 40px;
    min-height: 100vh;
    margin: 0;
}

.project-description {
    max-width: 800px;
    margin: 0 auto 80px;
    font-size: 18px;
    line-height: 1.8;
}

.project-description p {
    margin-bottom: 30px;
}

.project-tagline {
    max-width: 800px;
    margin: -10px auto 12px;
    font-size: 16px;
    font-style: italic;
    color: var(--primary-color);
}

.project-section-title {
    max-width: 800px;
    margin: 0 auto 32px;
    font-family: 'Neuton', serif;
    font-style: italic;
    font-weight: normal;
    font-size: 32px;
    line-height: 1.2;
}

.project-vimeo {
    width: 100%;
    max-width: 800px;
    /* même largeur que le texte */
    margin: 0 auto 80px;
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.project-vimeo iframe,
.project-vimeo video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    object-fit: cover;
    box-shadow:
        0 24px 60px rgba(23, 5, 26, 0.25),
        0 0 0 1px rgba(200, 208, 252, 0.6);
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.project-gallery img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
}

/* =========================
   Animation d'entrée globale
   ========================= */

@keyframes page-fade-up {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* header / main / footer apparaissent en douceur sur toutes les pages */
body:not(.index-page) header,
body:not(.index-page) main:not(.project-page),
body:not(.index-page) footer {
    opacity: 0;
    animation: page-fade-up 1.5s cubic-bezier(0.22, 0.61, 0.36, 1) 0.1s forwards;
}

/* sur la page index : seulement header + footer (la vidéo reste instantanée) */
body.index-page header,
body.index-page footer {
    opacity: 0;
    animation: page-fade-up 1.5s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s forwards;
}

/* léger décalage pour la PFP sur À propos pour un effet plus vivant */
.apropos-pfp {
    animation: page-fade-up 3s cubic-bezier(0.22, 0.61, 0.36, 1) 0.3s forwards;
    opacity: 0;
}

/* =========================
   Page À propos
   ========================= */

.apropos-main {
    display: block;
    position: relative;
    max-width: 100%;
    margin-bottom: 60px;
}

.apropos-texte {
    display: block;
    line-height: 1.6;
    max-width: 70ch;
}

.apropos-cta {
    display: flex;
    gap: 20px;
    margin-top: 40px;
}

.pill-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    border-radius: 500px;
    background: rgba(179, 119, 197, 0.3);
    border: 2px solid rgba(171, 107, 184, 0.9);
    box-shadow:
        0 12px 30px rgba(171, 3, 237, 0.12),
        0 0 0 1px rgba(171, 107, 184, 0.9);
    backdrop-filter: blur(18px);
    transform-origin: center;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.pill-button-index {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    border-radius: 500px;
    background: rgba(240, 200, 252, 0.3);
    border: 2px solid rgba(243, 200, 252, 0.9);
    box-shadow:
        0 12px 30px rgba(171, 3, 237, 0.12),
        0 0 0 1px rgba(248, 200, 252, 0.7);
    backdrop-filter: blur(18px);
    transform-origin: center;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.pill-button span {
    font-size: 20px;
    font-weight: 400;
    color: var(--primary-color);
    text-decoration: underline;
}

.pill-button:hover {
    background: rgba(247, 246, 245, 0.9);
    box-shadow:
        0 18px 40px rgba(132, 3, 237, 0.18),
        0 0 0 1px rgba(171, 107, 184, 0.9);
    transform: rotate(-1deg) translateY(-4px);
}

.pill-button-index:hover {
    background: rgba(39, 4, 48, 0.9);
    box-shadow:
        0 18px 40px rgba(132, 3, 237, 0.18),
        0 0 0 1px rgba(248, 200, 252, 0.9);
    transform: rotate(-1deg) translateY(-4px);
}

.pill-button:active {
    transform: rotate(0deg) translateY(1px) scale(0.98);
    box-shadow:
        0 8px 18px rgba(163, 3, 237, 0.22),
        0 0 0 1px rgb(246, 200, 252);
}

.pill-linkedin span .pill-cv span {
    color: var(--primary-color);
}

/* scroll sur la page À propos (desktop) */
@media (min-width: 769px) {

    html:has(.apropos-main),
    body:has(.apropos-main) {
        overflow-y: auto;
        height: 100vh;
    }
}

@keyframes highlight-once {
    0% {
        background-size: 0% 0%;
    }

    100% {
        background-size: 100% 140%;
    }
}

.highlight-word {
    position: relative;
    cursor: url('img/cursor-white.svg') 0 0, pointer;
    font-weight: 400;
    background-image: linear-gradient(120deg, var(--secondary-color));
    background-repeat: no-repeat;
    background-size: 0% 140%;
    background-position: 0 50%;
    transition: color 0.2s ease;
    border-bottom: 1px dashed rgba(151, 3, 237, 0.4);
}

/* animation unique au chargement, puis le highlight reste */
.highlight-word {
    animation: highlight-once 1s ease-out forwards;
    animation-delay: calc(var(--i, 0) * 0.15s);
}

.highlight-word:hover {
    color: var(--primary-color);
    border-bottom-color: transparent;
}

/* curseur en couleur secondary pendant le clic */
a:active,
button:active,
footer a:active,
.highlight-word:active,
.gallery img:active,
.project-link:active {
    cursor: url('img/cursor-secondary.svg') 0 0, pointer;
}

/* État actif du lien de navigation (page courante) */
.nav-link-active {
    background-image: linear-gradient(120deg, var(--secondary-color));
    background-repeat: no-repeat;
    background-size: 0% 140%;
    background-position: 0 50%;
    animation: highlight-once 0.8s ease-out forwards;
}

.apropos-pfp {
    position: fixed;
    right: 40px;
    bottom: 40px;
    width: 500px;
    max-width: 35vw;
    height: auto;
    object-fit: contain;
    pointer-events: none;
}

/* couche d'effets (burst) */
#burst-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
}

.burst-item {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--size, 150px);
    height: calc(var(--size, 150px) * 0.72);
    object-fit: cover;
    border-radius: 14px;
    transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(0.85);
    opacity: 0;
    filter: saturate(1.05) contrast(1.02);
    box-shadow:
        0 24px 60px rgba(18, 5, 26, 0.16),
        0 0 0 1px rgba(240, 200, 252, 0.55);
    animation: burst-pop 1.55s cubic-bezier(0.22, 0.61, 0.36, 1) var(--delay, 0ms) forwards;
}

.burst-item-cell {
    width: var(--size, 0px);
    height: var(--size, 0px);
    border-radius: 999px;
    object-fit: contain;
}

.burst-item-icon {
    width: var(--size, 64px);
    height: var(--size, 64px);
    object-fit: contain;
}

@keyframes burst-pop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(0.75);
    }

    18% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -60%) rotate(var(--rot, 0deg)) scale(0.98);
    }
}


/* =========================
   Version Mobile (<= 768px)
   ========================= */

@media (max-width: 768px) {

    /* Désactiver les curseurs personnalisés sur mobile */
    html,
    body,
    a,
    button {
        cursor: auto !important;
    }

    /* Padding général réduit, pas de dépassement horizontal */
    body {
        padding: 0px 20px;
        background-size: 30px 30px;
        overflow-x: hidden;
        max-width: 100%;
    }

    /* Page accueil */
    body.index-page {
        padding: 0;
    }

    body.index-page header {
        padding: 0 20px;
    }

    main {
        padding-top: 24px;
    }

    /* Navigation mobile */
    nav {
        padding: 15px 0px;
        font-size: 14px;
    }

    nav img {
        width: 48px;
        height: 48px;
    }

    /* Typographie mobile */
    h1 {
        font-size: 32px;
    }

    p {
        font-size: 16px;
    }

    /* Galerie mobile */
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 0px 0px 40px 0px;
    }

    .gallery-description {
        width: 100%;
        margin-bottom: 20px;
    }

    /* Page projets mobile */
    body:has(.projects-container) {
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
    }

    body:has(.projects-container) main {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }

    .projects-intro {
        margin-top: auto;
        padding-bottom: 24px;
    }

    .projects-intro h1 {
        font-size: 42px;
        margin-bottom: 12px;
    }

    .projects-intro p {
        font-size: 18px;
        line-height: 1.5;
    }

    .projects-container {
        overflow-x: visible;
        overflow-y: visible;
        padding: 20px 0;
        max-width: 100%;
    }

    .projects-wrapper {
        flex-direction: column;
        gap: 30px;
        width: 100%;
        max-width: 100%;
    }

    .project {
        width: 100%;
        max-width: 100%;
    }

    .project video {
        height: 250px;
    }

    video {
        object-fit: cover;
    }

    /* Pages projet individuelles */
    body:has(.project-page) header {
        padding: 0 20px;
    }

    .project-header {
        top: 60%;
        left: 20px;
        max-width: calc(100% - 40px);
    }

    .project-header h1 {
        font-size: 48px;
        margin-bottom: 12px;
    }

    .project-domains {
        font-size: 16px;
    }

    .project-section-title {
        font-size: 26px;
        line-height: 1.1;
        margin: 0 auto 24px;
    }

    .project-content {
        padding: 60px 20px;
    }

    .project-description {
        font-size: 16px;
        margin-bottom: 40px;
    }

    .project-vimeo {
        margin-bottom: 40px;
    }

    .project-gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Footer mobile */
    body:has(.gallery) footer,
    body:has(.projects-container) footer,
    body:has(.project-page) footer,
    body:has(.apropos-main) footer {
        position: relative;
    }

    footer {
        padding: 0px;
        gap: 20px;
        font-size: 12px;
        flex-wrap: wrap;
        max-width: 100%;
        box-sizing: border-box;
    }

    body.index-page footer {
        padding: 20px 20px;
    }

    footer a {
        font-size: 12px;
    }

    /* Page À propos mobile */
    .apropos-main {
        min-height: auto;
        padding-bottom: 40px;
        overflow-x: hidden;
        max-width: 100%;
    }

    .apropos-texte {
        font-size: 16px;
        max-width: 100%;
    }

    .apropos-cta {
        flex-direction: column;
        gap: 15px;
        margin-top: 30px;
        align-items: center;
    }

    .pill-button {
        padding: 12px 30px;
        max-width: 90%;
        justify-content: center;
        box-sizing: border-box;
    }

    .pill-button span {
        font-size: 16px;
    }

    .apropos-pfp {
        display: block;
        position: relative;
        right: auto;
        bottom: auto;
        width: 100%;
        max-width: min(280px, 85vw);
        margin: 30px auto 0;
    }

    /* Overlay galerie mobile */
    .gallery-overlay img {
        max-width: 95vw;
        max-height: 85vh;
    }

    .gallery-overlay-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 26px;
    }

    body.index-page main video {
        object-fit: cover;
    }

    .project-video video {
        object-fit: cover;
    }
}

/* =========================
   Très petits écrans (<= 480px)
   ========================= */

@media (max-width: 480px) {

    body {
        padding: 0px 15px;
    }

    body.index-page header {
        padding: 0 15px;
    }

    body.index-page footer {
        padding: 15px 15px;
    }

    body:has(.project-page) header {
        padding: 0 15px;
    }

    nav {
        padding: 12px 0px;
        font-size: 12px;
    }

    nav img {
        width: 40px;
        height: 40px;
    }

    h1 {
        font-size: 28px;
    }

    p {
        font-size: 14px;
    }

    .projects-intro h1 {
        font-size: 36px;
    }

    .projects-intro p {
        font-size: 16px;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .project video {
        height: 200px;
    }

    .project-title {
        font-size: 16px;
    }

    .project-description {
        font-size: 12px;
    }

    .project-header {
        top: 55%;
        left: 15px;
        max-width: calc(100% - 30px);
    }

    .project-header h1 {
        font-size: 48px;
        margin-bottom: 8px;
    }

    .project-domains {
        font-size: 20px;
    }

    .project-section-title {
        font-size: 22px;
        line-height: 1.1;
        margin: 0 auto 20px;
    }

    .project-content {
        padding: 40px 15px;
    }

    .project-description {
        font-size: 14px;
    }

    footer {
        padding: 15px 0px;
        gap: 15px;
        font-size: 11px;
        flex-direction: column;
        align-items: flex-start;
    }

    body:has(.gallery) footer {
        padding: 15px 0px;
    }

    body:has(.project-page) footer {
        padding: 15px;
    }

    footer a {
        font-size: 11px;
    }

    .apropos-texte {
        font-size: 14px;
    }

    .pill-button {
        padding: 10px 25px;
    }

    .pill-button span {
        font-size: 14px;
    }
}