/* =========================================
   1. POLICES & VARIABLES GLOBALES
   ========================================= */
@font-face { font-family: 'ArticulatCF-Bold';   src: url('Police/ArticulatCF-Bold.ttf')        format('truetype'); }
@font-face { font-family: 'ArticulatCF-DBold';  src: url('Police/ArticulatCF-Demi-Bold.ttf')   format('truetype'); }
@font-face { font-family: 'ArticulatCF-Normal'; src: url('Police/ArticulatCF-Normal.ttf')      format('truetype'); }
@font-face { font-family: 'ArticulatCF-Medium'; src: url('Police/ArticulatCF-Medium.ttf')      format('truetype'); }
@font-face { font-family: 'ArticulatCF-Thin';   src: url('Police/ArticulatCF-Regular.otf')     format('opentype'); }

:root {
    --space-global:     clamp(15px, 1vw, 20px);
    --space-page:       clamp(10px, 1vw, 20px);
    --top-space-page:   clamp(10px, 4.5vw, 88px);

    --font-h1: clamp(1.5rem, 3vw, 3rem);
    --font-h3: clamp(1.1rem, 1.5vw, 1.4rem);
    --font-h5: clamp(1rem, 1.2vw, 1.25rem);
    --font-h4: clamp(0.9rem, 1.1vw, 1.15rem);
    --font-h6: clamp(0.8rem, 1vw, 1.1rem);
    --font-p:  clamp(0.8rem, 1vw, 1rem);

    --svg-menu: clamp(120px, 10vw, 190px);
    --svg-rs:   clamp(40px, 3.1vw, 60px);
}

/* =========================================
   2. RESET & STRUCTURE
   ========================================= */
body {
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    overflow-x: hidden;
}

/* overflow:hidden sur desktop : le scroll se fait dans les panneaux,
   pas sur le body (split-screen fixe) */
@media screen and (min-width: 901px) {
    body { overflow: hidden; }
}

/* =========================================
   3. TYPOGRAPHIE GLOBALE
   ========================================= */
p, h2, h3, h4, h5, h6, .simple-list li, #saveZone p {
    color: #000;
    font-weight: normal;
    margin: 0;
}

p, h4, h6, .simple-list li, #saveZone p {
    font-family: 'ArticulatCF-Normal', sans-serif;
    text-transform: none;
}
h2, h3, h5 { font-family: 'ArticulatCF-Medium', sans-serif; }

h1 { font-family: 'ArticulatCF-Bold', sans-serif; font-size: var(--font-h1); text-transform: uppercase; margin: 0; }
h2 { font-size: var(--font-h4); display: inline; margin: 50px 0 20px 0; }
h3 { font-size: var(--font-h3); text-transform: uppercase; margin: 40px 0 20px 0; }
h4 { font-size: var(--font-h4); margin-bottom: 20px; }
h5 { font-size: var(--font-h5); margin-bottom: 5px; }
h6 { font-size: var(--font-h6); }
p  { font-size: var(--font-p);  line-height: 1.5; }

.arrows-right { display: block; text-align: center; }
.credits      { margin-top: 70px; }

/* =========================================
   4. SCROLLBAR
   ========================================= */
::-webkit-scrollbar       { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background-color: #ffffff; }
::-webkit-scrollbar-thumb { background-color: #000; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background-color: #333; }
* { scrollbar-width: thin; scrollbar-color: #000 #f0f0f0; }

/* =========================================
   5. LAYOUT — SPLIT SCREEN DESKTOP
   ========================================= */
#back {
    position: fixed;
    top: var(--space-global);
    left: var(--space-global);
    z-index: 1000;
}

#svg {
    display: block;
    width: var(--svg-menu);
    transition: transform 0.4s ease, filter 0.4s ease;
}
#svg:hover { transform: scale(1.1); filter: invert(1); }

.page-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

.texte_left {
    width: 40%;
    min-width: 30%;
    height: 100%;
    overflow-y: auto;
    padding: calc((var(--space-global) * 2) + (var(--svg-menu) / 4)) var(--space-global) 20px var(--space-global);
    box-sizing: border-box;
}

.image-grid {
    flex: 1;
    max-width: 70%;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-left: var(--space-global);
    box-sizing: border-box;
}

.image-grid img, .image-grid > img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.flex-zone {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    flex-direction: row-reverse;
    align-items: flex-start;
    margin-bottom: 50px;
    gap: 20px;
}

.info { flex: 1; text-align: left; min-width: 200px; }

/* =========================================
   6. BARRE DE REDIMENSIONNEMENT
   ========================================= */
.resizer {
    width: 15px;
    background-color: transparent;
    cursor: col-resize;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.resizer-handle {
    height: 250px;
    width: 4px;
    background-color: #000;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.resizer:hover .resizer-handle,
.resizer:active .resizer-handle {
    background-color: #ff0000;
    height: 125px;
    width: 5px;
}

/* =========================================
   7. VIDÉOS & COMPOSANTS
   ========================================= */
.ytb_resp { 
    width: 100%; 
    aspect-ratio: 16/9; 
    background-color: #000; /* Masque les arrondis avec du noir */
}

.ytb_resp iframe { 
    display: block; /* Annule le comportement "texte" et supprime l'espace en dessous */
    width: 100%; 
    height: 100%; 
    border: none;
}

.simple-list { list-style-type: none; padding-left: 20px; margin: 20px 0; }
.simple-list li {
    font-size: var(--font-h4);
    margin-bottom: 5px;
    line-height: 1.5;
    position: relative;
}
.simple-list li::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0.6em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: black;
}

#saveZone p {
    font-family: 'ArticulatCF-Normal', sans-serif;
    font-size: var(--font-p);
    margin: 0;
    padding-bottom: 10px;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 9999;
    pointer-events: none;
    color: white;
    mix-blend-mode: difference;
}

/* =========================================
   8. CAS SPÉCIFIQUE : P5JS DESKTOP
   La .image-grid passe en CSS grid 2 colonnes au lieu de flex colonne.
   Les canvas p5 ont besoin d'un parent avec dimensions explicites
   (aspect-ratio + position:relative) sinon p5 lit offsetWidth = 0.
   ========================================= */
.page-p5js .image-grid {
    flex: 1;
    max-width: none;
    width: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background-color: #000;
    padding: 20px;
    align-content: start;
}

.page-p5js .grille-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: black;
}

.page-p5js .grille-item canvas {
    width: 90% !important;
    height: 90% !important;
    display: block;
}
.page-p5js .image-grid img { aspect-ratio: 1/1; }
.page-p5js .ytb_resp { grid-column: span 2; margin-top: 20px; }

/* =========================================
   9. RESPONSIVE MOBILE (< 900px)
   ========================================= */
@media screen and (max-width: 900px) {
    .page-container { flex-direction: column; height: auto; }
    .resizer { display: none; }

    .texte_left, .image-grid {
        width: 100%;
        max-width: 100%;
        height: auto;
        overflow-y: visible;
    }

    .texte_left { padding-top: 35px; padding-bottom: 0px; }
    .image-grid { padding: 50px 0 0 0; }

    h1 { text-align: right; }

    .image-grid img, .image-grid > img { margin-bottom: 0px; display: block; }

    .flex-zone {
        flex-direction: column;
        align-items: flex-start;
        margin: 20px 0;
        gap: 15px;
        padding: 0 var(--space-global);
    }
    .credits  { margin-top: 40px; }
    h4        { margin-bottom: 5px; }

    .page-p5js .image-grid { padding: var(--space-global); }
}

/* =========================================
   10. SMARTPHONES FINS (< 480px)
   ========================================= */
@media screen and (max-width: 480px) {
    .texte_left { padding-left: 15px; padding-right: 15px; padding-top: 35px; }
    .flex-zone  { padding: 0; }

    /* Grille p5 passe en 1 colonne sur petits écrans */
    .page-p5js .image-grid { grid-template-columns: 1fr; padding: 15px; }
    .page-p5js   { grid-column: span 1; }
}