/* =============================================================================
   Pages work (/work/<slug>, projet.php) — complète css/sartine.css.
   --projet = couleur du projet, --suivant = couleur du projet suivant (posées par projet.php).
   ========================================================================== */

html { scroll-snap-type: none !important; }   /* pas d'aimantation du book sur une page projet */
body { background: var(--white); }
/* logo à la couleur du projet, smartphone compris : plus fort que la règle mobile de sartine-responsive.css
   (.site-header.site-header .header-logo #poisson path, qui le force au violet sur la home) */
html body .site-header.site-header .header-logo #poisson path { fill: var(--projet) !important; }
html body .site-header.site-header .header-logo #texte path { fill: var(--black) !important; }
::selection { background-color: var(--projet); color: #fff; }
/* « retour sur sartine » + flèche, comme sur le shop et le brief (le trait animé vient de sartine.css) */
.nav-retour { display: flex; align-items: center; gap: 10px; }

.projet { display: block; width: 100%; max-width: 1600px; margin: 0 auto; padding: 170px 50px 0; box-sizing: border-box; }

/* fil d'Ariane : work — n° 01 */
.ariane { display: flex; align-items: center; gap: 14px; font-family: var(--font-title); font-size: .8rem; font-weight: 700; letter-spacing: 1px; text-transform: lowercase; margin-bottom: 60px; }
.ariane a { color: var(--black); text-decoration: none; }
.ariane .trait { width: 60px; height: 1px; background: var(--projet); transform-origin: left; animation: projet-trait 1s cubic-bezier(.25,1,.5,1) .3s backwards; }
.ariane .num { color: var(--projet); }
.ariane .num b { font-weight: 800; }
@keyframes projet-trait { from { transform: scaleX(0); } }

/* en-tête : titre géant + description, puis la fiche */
.projet-tete { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 40px 80px; align-items: end; margin-bottom: 90px; }
.projet-tete .client-name { color: var(--projet); }
.projet-tete .title { font-size: clamp(4.5rem, 10vw, 10.5rem); letter-spacing: -.04em; margin: 0; }
.projet-tete .highlight { color: var(--projet); }
.projet-tete .description { margin: 0; }
.projet-tete > * { animation: projet-monte .9s cubic-bezier(.25,1,.5,1) backwards; }
.projet-tete > :nth-child(2) { animation-delay: .2s; }
.projet-tete > :nth-child(3) { animation-delay: .35s; }
@keyframes projet-monte { from { opacity: 0; transform: translateY(30px); } }

.fiche { grid-column: 1 / -1; position: relative; margin: 30px 0 0; padding: 22px 0 0; display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 18px 70px; }
.fiche::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--projet); transform-origin: left; animation: projet-trait 1.4s cubic-bezier(.25,1,.5,1) .5s backwards; }
.fiche dt { font-family: var(--font-title); font-size: .7rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--projet); margin-bottom: 8px; }
.fiche dd { margin: 0; font-family: var(--font-text); font-size: .95rem; line-height: 1.6; }
.fiche ul { list-style: none; margin: 0; padding: 0; }
.fiche .missions li { font-weight: 300; font-style: italic; text-transform: uppercase; font-size: .9rem; }
.fiche .project-link { margin: 0; }

/* galerie : rangées de même hauteur, chaque média dans SON format (--r = largeur / hauteur), jamais recadré.
   Largeur proportionnelle au format → hauteurs égales ; une rangée ne dépasse jamais 80 % de la hauteur
   d'écran (--somme = total des formats de la rangée) → une vidéo 9:16 reste entière. */
.galerie { display: flex; flex-direction: column; gap: 10px; }
.rang { display: flex; gap: 10px; width: min(100%, calc(80svh * var(--somme))); margin: 0 auto; }
.rang-seul { max-width: 1100px; }
.rang .item { flex: var(--r) 1 0; aspect-ratio: var(--r); min-width: 0; margin: 0; }
.galerie img, .galerie video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* apparition : un aplat à la couleur du projet monte depuis le bas puis se retire vers le haut
   en découvrant le média, qui se pose (léger zoom arrière). Décalé dans la rangée (--i). */
.js .rang .item { --d: calc(var(--i, 0) * .14s); clip-path: inset(100% 0 0 0 round var(--radius)); box-shadow: none; }
.js .rang .item::after { content: ''; position: absolute; inset: 0; background: var(--projet); transform-origin: top; z-index: 1; }
.js .rang .item > * { transform: scale(1.18); }
.js .rang .item.vu { clip-path: inset(0 0 0 0 round var(--radius)); transition: clip-path .8s cubic-bezier(.77,0,.18,1) var(--d); }
.js .rang .item.vu::after { transform: scaleY(0); transition: transform .75s cubic-bezier(.77,0,.18,1) calc(var(--d) + .55s); }
.js .rang .item.vu > * { transform: none; transition: transform 1.8s cubic-bezier(.16,1,.3,1) calc(var(--d) + .5s); }

/* projet suivant : titre en grand + la flèche du site, à la couleur du projet suivant */
.suivant { display: block; text-decoration: none; color: var(--black); margin: 140px 0 0; padding: 50px 0 10px; border-top: 1px solid #ddd; }
.suivant-label { font-family: var(--font-title); font-size: .8rem; font-weight: 700; letter-spacing: 1px; text-transform: lowercase; display: block; margin-bottom: 30px; }
.suivant .client-name { color: var(--suivant); margin-bottom: 14px; }
.suivant-ligne { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.suivant .title { font-size: clamp(3rem, 7vw, 7rem); margin: 0; }
.suivant .title .highlight { color: var(--suivant); }
.suivant .fleche-suivant { width: 70px; margin-bottom: 12px; transition: transform .4s cubic-bezier(.25,1,.5,1); }
.suivant .fleche-suivant polyline { stroke: var(--suivant); }
.suivant:hover .fleche-suivant, .suivant:focus-visible .fleche-suivant { transform: translateX(14px); }

.pied { max-width: 1600px; margin: 120px auto 0; padding: 0 50px 30px; box-sizing: border-box; }
.pied .copyright { font: inherit; }

@media (max-width: 1023px) {
    .site-header { padding: 20px; }
    .projet { padding: 130px 20px 0; }
    .projet-tete { grid-template-columns: 1fr; gap: 30px; margin-bottom: 50px; }
    .fiche { margin-top: 10px; grid-template-columns: 1fr 1fr; }
    .pied { padding: 0 20px 30px; }
}
/* smartphone : un média par ligne, entier, jamais plus haut que 75 % de l'écran */
@media (max-width: 760px) {
    .rang { flex-direction: column; align-items: center; width: 100%; }
    .rang .item { flex: none; width: min(100%, calc(75svh * var(--r))); }
    .js .rang .item { --d: 0s; }
    /* titres moins hauts : « t'embauche » ou « Exotique » tiennent dans la largeur ; le fil d'Ariane passe sous le logo */
    .projet { padding-top: 160px; }
    .projet-tete .title { font-size: clamp(2.9rem, 12.5vw, 5rem); letter-spacing: -.03em; }
    .suivant .title { font-size: clamp(2.4rem, 10vw, 4rem); }
}
@media (max-width: 480px) {
    .header-nav { gap: 20px; }
    .fiche { grid-template-columns: 1fr; }
    .suivant { margin-top: 90px; }
    .suivant .fleche-suivant { width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .js .rang .item, .js .rang .item.vu { clip-path: none; transition: none; }
    .js .rang .item::after { display: none; }
    .js .rang .item > *, .js .rang .item.vu > * { transform: none; transition: none; }
    .projet-tete > *, .ariane .trait, .fiche::before { animation: none; }
}
