/* =========================================================
   REFONTE GRAPHIQUE : « poulailler moderne »
   Chargée APRÈS style.css, uniquement sur les pages publiques
   (l'admin ne la charge pas et reste donc inchangé).
   Principes : coins arrondis, ombres « socle » colorées,
   pastilles, œufs et empreintes de poulet comme motifs.
   ========================================================= */

:root {
    --papier: #FFF9E8;
    --papier-creux: #FFEFC7;
    --poussin-clair: #FFF0BF;
    --ciel: #E4ECFF;
    --rayon: 24px;
    --oeuf: 50% 50% 50% 50% / 60% 60% 40% 40%;
    --vague: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='12'%3E%3Cpath d='M2 7 C 14 0 26 12 38 6 S 62 0 74 6 S 88 10 94 5' fill='none' stroke='%23E4572E' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */
body {
    background-image: radial-gradient(circle, rgba(35, 33, 40, .09) 1.3px, transparent 1.6px);
    background-size: 28px 28px;
}
html::before { opacity: .2; }
.section { scroll-margin-top: 5.5rem; }

.titre-section::after,
.apropos-section-titre::after {
    content: "";
    display: block;
    width: 96px;
    height: 12px;
    margin-top: .35rem;
    background: var(--vague) no-repeat left center / contain;
}

/* ---------- Navigation : pastille flottante ---------- */
.barre-nav {
    position: sticky;
    top: 12px;
    width: min(1180px, calc(100% - 1.5rem));
    margin: 12px auto 0;
    padding: .55rem .8rem .55rem 1.1rem;
    background: rgba(255, 255, 255, .8);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
    border: 2px solid var(--encre);
    border-radius: 999px;
    box-shadow: 0 4px 0 var(--encre);
}
.marque-poulet { width: 42px; height: 42px; }
.barre-nav .bouton { padding: .45em 1.05em; font-size: .92rem; box-shadow: 0 2px 0 var(--encre); }
.barre-nav .bouton:hover { box-shadow: 0 4px 0 var(--encre); }

/* ---------- Boutons ---------- */
.bouton {
    border: 2px solid var(--encre);
    border-radius: 999px;
    padding: .65em 1.4em;
    background-color: #fff;
    box-shadow: 0 4px 0 var(--encre);
    transition: transform .15s ease, box-shadow .15s ease, background-color .2s ease;
}
.bouton:hover { background-color: var(--poussin-clair); transform: translateY(-2px); box-shadow: 0 6px 0 var(--encre); }
.bouton:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--encre); }
.bouton--principal { background-color: var(--crete); color: #fff; }
.bouton--principal:hover { background-color: #F06B45; }
.heros-actions .bouton--principal::after { content: " →"; }

.selecteur-langue { border-width: 2px; padding: 2px; gap: 2px; background: #fff; }
.lang-btn { border-radius: 999px; padding: .3em .75em; }
.lang-btn + .lang-btn { border-left: 0; }

.cv-menu-liste { border-radius: 18px; box-shadow: 0 6px 0 var(--encre); border-width: 2px; background: #fff; }
.cv-menu-liste a { border-radius: 12px; }

/* ---------- Accueil : en-tête ---------- */
.heros-salut {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .3rem .95rem;
    font-size: .95rem;
    color: var(--encre);
    background: #fff;
    border: 2px solid var(--encre);
    border-radius: 999px;
    box-shadow: 0 3px 0 var(--encre);
    margin-bottom: 1.1rem;
}
.heros-salut::before {
    content: "";
    width: 10px;
    height: 13px;
    background: var(--crete);
    border: 2px solid var(--encre);
    border-radius: var(--oeuf);
}
.titre-geant { font-size: clamp(3rem, 8.5vw, 5.6rem); letter-spacing: -.035em; line-height: 1.02; }
.heros-metier { color: var(--crete); }

.heros-figure { position: relative; isolation: isolate; padding: 1.4rem 1.2rem 0; }
.heros-figure::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 0;
    width: 92%;
    height: 90%;
    transform: translateX(-50%);
    background: var(--ciel);
    border: 2px solid var(--encre);
    border-radius: var(--oeuf);
    box-shadow: 10px 10px 0 var(--poussin);
}
.heros-figure::after {
    content: "";
    position: absolute;
    right: 0;
    top: 4%;
    width: 30px;
    height: 38px;
    background: var(--crete);
    border: 2px solid var(--encre);
    border-radius: var(--oeuf);
    transform: rotate(18deg);
}
.heros-figure figcaption { margin-top: 1rem; }
html.arrivee-poulet .poulet-vedette { animation-delay: .75s; }

/* ---------- Accueil : filtres ---------- */
.filtre-puce {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: #fff;
    border-width: 2px;
    padding: .45em 1.1em;
    box-shadow: 0 3px 0 var(--encre);
}
.filtre-puce::before {
    content: "";
    width: 10px;
    height: 12px;
    border: 1.5px solid var(--encre);
    border-radius: var(--oeuf);
    background: var(--poussin);
}
.filtre-puce[data-filtre="web"]::before { background: var(--plume); }
.filtre-puce[data-filtre="audiovisuel"]::before { background: var(--crete); }
.filtre-puce[data-filtre="redaction"]::before { background: var(--grain); }
.filtre-puce:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--encre); background: var(--poussin-clair); }
.filtre-puce.actif { background: var(--encre); color: var(--papier); box-shadow: 0 3px 0 var(--poussin); }

/* ---------- Accueil : cartes projets ---------- */
.grille-projets { align-items: stretch; gap: 2rem; }

.fiche {
    --accent: var(--encre);
    position: relative;
    padding: 0;
    overflow: hidden;
    max-width: none;
    background: #fff;
    border: 2px solid var(--encre);
    border-radius: var(--rayon);
    box-shadow: 0 6px 0 var(--accent), 0 6px 0 2px var(--encre);
    transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s ease;
}
.fiche[data-categories~="web"] { --accent: var(--plume); }
.fiche[data-categories~="audiovisuel"] { --accent: var(--crete); }
.fiche[data-categories~="redaction"] { --accent: var(--grain); }

.grille-projets .fiche:nth-child(n) { transform: none; }
.grille-projets .fiche:nth-child(n):hover,
.grille-projets .fiche:nth-child(n):focus-within {
    transform: translateY(-5px);
    box-shadow: 0 11px 0 var(--accent), 0 11px 0 2px var(--encre);
}

.fiche-image {
    border: 0;
    border-bottom: 2px solid var(--encre);
    border-radius: 0;
    margin: 0 0 1.1rem;
}
.fiche-image img { transition: transform .5s ease; }
.fiche:hover .fiche-image img { transform: scale(1.06); }

.fiche > .fiche-meta,
.fiche > .fiche-titre,
.fiche > .fiche-resume,
.fiche > .fiche-lien { margin-left: 1.3rem; margin-right: 1.3rem; }
.fiche > .fiche-lien { margin-bottom: 1.3rem; }
.fiche-meta { justify-content: space-between; }
.graine { width: 11px; height: 14px; }

/* Toute la carte est cliquable (lien étiré) */
.fiche-lien .lien-stylo { display: inline-flex; align-items: center; gap: .6rem; color: var(--encre); border-bottom: 0; }
.fiche-lien .lien-stylo::before { content: ""; position: absolute; inset: 0; z-index: 1; }
.fiche-lien .lien-stylo::after {
    content: "→";
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    line-height: 1;
    background: var(--poussin);
    border: 2px solid var(--encre);
    border-radius: 50%;
    transition: transform .25s ease, background-color .2s ease, color .2s ease;
}
.fiche:hover .lien-stylo::after { transform: translateX(5px); background: var(--crete); color: #fff; }
.fiche-lien .lien-stylo:hover { color: var(--encre); }
.fiche:focus-within { outline: 3px dashed var(--plume); outline-offset: 4px; }

/* ---------- Séparateur : traces de pattes ---------- */
.separateur-poulet {
    height: 28px;
    background-size: 56px 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='28'%3E%3Cg fill='none' stroke='%23E4572E' stroke-width='3' stroke-linecap='round' opacity='.7'%3E%3Cpath d='M6 8 L20 8 M12 8 L20 2 M12 8 L20 14'/%3E%3Cpath d='M34 21 L48 21 M40 21 L48 15 M40 21 L48 27'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Accueil : compétences ---------- */
.bloc-competence {
    --accent: var(--poussin);
    background: #fff;
    border: 2px solid var(--encre);
    border-radius: var(--rayon);
    box-shadow: 0 6px 0 var(--accent), 0 6px 0 2px var(--encre);
}
.bloc-competence:nth-child(even) { background: #fff; }
.bloc-competence:nth-child(1) { --accent: var(--plume); }
.bloc-competence:nth-child(2) { --accent: var(--crete); }
.bloc-competence:nth-child(3) { --accent: var(--grain); }
.bloc-competence:nth-child(4) { --accent: var(--poussin); }
.bloc-competence-titre { display: flex; align-items: center; gap: .6rem; }
.bloc-competence-titre::before {
    content: "";
    flex-shrink: 0;
    width: 14px;
    height: 18px;
    background: var(--accent);
    border: 2px solid var(--encre);
    border-radius: var(--oeuf);
}
.competence { background: var(--papier); border-width: 2px; transition: transform .15s ease, background-color .15s ease; }
.bloc-competence:nth-child(even) .competence { background: var(--papier); }
.competence--simple, .bloc-competence:nth-child(even) .competence--simple { background: var(--poussin-clair); }
.competence:hover { transform: translateY(-2px); background: var(--poussin); }
.oeufs i { width: 8px; height: 10px; background-color: #fff; }
.competence[data-exemple]::after { border-radius: 10px; }

/* ---------- Pages projets ---------- */
.fil-ariane {
    display: inline-flex;
    max-width: 100%;
    padding: .3rem 1rem;
    background: #fff;
    border: 2px solid var(--encre);
    border-radius: 999px;
    box-shadow: 0 3px 0 var(--encre);
}
.entete-projet-titre { letter-spacing: -.03em; }
.entete-projet-outils {
    display: inline-block;
    margin: .4rem 0 0;
    padding: .2rem .9rem;
    color: #B8401F;
    background: rgba(228, 87, 46, .12);
    border-radius: 999px;
}
.badge-assistant {
    display: inline-block;
    padding: .2rem .9rem;
    font-family: var(--font-main);
    font-size: .9rem;
    background: var(--ciel);
    border: 2px solid var(--encre);
    border-radius: 999px;
}

.etape {
    padding: 1.1rem 1.1rem 1.3rem;
    background: #fff;
    border: 2px solid var(--encre);
    border-radius: 20px;
    box-shadow: 0 5px 0 var(--poussin), 0 5px 0 2px var(--encre);
    transition: transform .2s ease;
}
.etape:hover { transform: translateY(-4px); }
.etape-numero { transition: transform .25s ease; }
.etape:hover .etape-numero { transform: rotate(-8deg) scale(1.1); }

.remarque {
    background: var(--papier-creux);
    border: 2px solid var(--encre);
    border-left: 10px solid var(--crete);
    border-radius: 20px;
    box-shadow: 0 5px 0 var(--encre);
}
.remarque--bleue { background: #EEF3FF; border-left-color: var(--plume); }

.galerie img {
    border: 2px solid var(--encre);
    border-radius: 22px;
    box-shadow: 0 6px 0 var(--poussin), 0 6px 0 2px var(--encre);
    transition: transform .3s ease, box-shadow .3s ease;
}
.galerie img:hover { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 10px 0 var(--poussin), 0 10px 0 2px var(--encre); }
.video-projet {
    border: 2px solid var(--encre);
    border-radius: 22px;
    box-shadow: 0 8px 0 var(--poussin), 0 8px 0 2px var(--encre);
}

.nav-projets .lien-stylo {
    display: inline-block;
    padding: .85rem 1.2rem;
    color: var(--encre);
    background: #fff;
    border: 2px solid var(--encre);
    border-radius: 18px;
    box-shadow: 0 4px 0 var(--encre);
    transition: transform .15s ease, box-shadow .15s ease, background-color .2s ease;
}
.nav-projets .lien-stylo:hover { background: var(--poussin); transform: translateY(-3px); box-shadow: 0 7px 0 var(--encre); }

/* ---------- À propos ---------- */
.apropos-cote { top: 6.5rem; }
.apropos-section { scroll-margin-top: 6.5rem; }
.photo-epinglee {
    border-width: 2px;
    border-radius: 20px;
    box-shadow: 0 6px 0 var(--poussin), 0 6px 0 2px var(--encre);
    transform: rotate(-1.5deg);
}
.photo-epinglee img { border-radius: 12px; }
.photo-epinglee::before { border-radius: 6px; }
.apropos-onglet { border-radius: 999px; }
.apropos-onglet.actif { box-shadow: 0 3px 0 var(--encre); }
.note-marge { border-radius: 20px; transform: none; box-shadow: 0 5px 0 var(--encre); }

/* ---------- Pied de page ---------- */
.pied {
    margin-top: 2.5rem;
    color: var(--papier);
    background: var(--encre);
    border: 0;
    border-radius: 32px 32px 0 0;
}
.pied-poulet { width: 64px; height: 64px; padding: 8px; background: var(--papier); border-radius: 50%; }
.pied .lien-stylo { color: var(--poussin); border-color: var(--poussin); }
.pied .lien-stylo:hover { color: #FF8A65; border-color: #FF8A65; }
.pied .pied-admin-lien { color: #CFCBD6; opacity: .6; }
.pied .pied-admin-lien:hover { color: #fff; opacity: 1; }

.bouton-haut { border-radius: 50%; box-shadow: 0 4px 0 var(--encre); }

/* ---------- Page 404 ---------- */
.page-perdue { position: relative; isolation: isolate; }
.page-perdue::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: clamp(2rem, 6vw, 4.5rem);
    left: 50%;
    width: min(300px, 80%);
    height: 320px;
    transform: translateX(-50%);
    background: var(--ciel);
    border: 2px solid var(--encre);
    border-radius: var(--oeuf);
    box-shadow: 8px 8px 0 var(--poussin);
}
.code-erreur {
    color: var(--poussin);
    -webkit-text-stroke: 3px var(--encre);
    paint-order: stroke fill;
    text-shadow: 4px 4px 0 var(--encre);
}

/* =========================================================
   ANIMATIONS (toutes finies, aucune boucle infinie)
   ========================================================= */

/* --- Apparition douce au défilement --- */
.js-reveal .revele:not(.revele--vu) { opacity: 0; }
.js-reveal .revele--vu { animation: apparition .6s cubic-bezier(.2, .7, .2, 1) var(--delai, 0ms) backwards; }
@keyframes apparition { from { opacity: 0; transform: translateY(26px) scale(.98); } }

/* --- Transition de page : le poulet tire un rideau jaune --- */
html.transition-entrante::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--poussin);
    animation: secours 0s 1.5s forwards;
}
@keyframes secours { to { opacity: 0; visibility: hidden; } }

.rideau {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: var(--poussin);
    transform: translateX(-101%);
    pointer-events: none;
}
.rideau::before,
.rideau::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 48px;
    background-repeat: repeat-y;
    background-size: 48px 64px;
}
/* bord d'attaque (droite) et bord de fuite (gauche) ondulés */
.rideau::after {
    left: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='64'%3E%3Cpath d='M0 0 H10 C 42 8 42 24 10 32 C 42 40 42 56 10 64 H0 Z' fill='%23FFC93C'/%3E%3Cpath d='M10 0 C 42 8 42 24 10 32 C 42 40 42 56 10 64' fill='none' stroke='%23232128' stroke-width='4'/%3E%3C/svg%3E");
}
.rideau::before {
    right: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='64'%3E%3Cpath d='M48 0 H38 C 6 8 6 24 38 32 C 6 40 6 56 38 64 H48 Z' fill='%23FFC93C'/%3E%3Cpath d='M38 0 C 6 8 6 24 38 32 C 6 40 6 56 38 64' fill='none' stroke='%23232128' stroke-width='4'/%3E%3C/svg%3E");
}
.rideau--couvre { transform: translateX(0); }
.rideau--entre { animation: rideau-entre .6s cubic-bezier(.65, 0, .35, 1) forwards; }
.rideau--sort { animation: rideau-sort .75s cubic-bezier(.65, 0, .35, 1) .15s forwards; }
@keyframes rideau-entre { from { transform: translateX(-101%); } to { transform: translateX(0); } }
@keyframes rideau-sort { from { transform: translateX(0); } to { transform: translateX(101%); } }

.rideau-poulet { position: absolute; top: 50%; right: 10%; width: clamp(120px, 20vw, 190px); transform: translateY(-50%); }
.rideau-poulet svg { display: block; width: 100%; height: auto; overflow: visible; }
.patte { transform-box: fill-box; transform-origin: 50% 0; }

/* Le poulet trottine uniquement pendant le déplacement du rideau */
.rideau--entre svg { animation: sautille .15s ease-out 0s 4 alternate; }
.rideau--sort svg { animation: sautille .15s ease-out .15s 5 alternate; }
.rideau--entre .patte-a { animation: patte .15s ease-in-out 0s 4 alternate; }
.rideau--entre .patte-b { animation: patte .15s ease-in-out 0s 4 alternate-reverse; }
.rideau--sort .patte-a { animation: patte .15s ease-in-out .15s 5 alternate; }
.rideau--sort .patte-b { animation: patte .15s ease-in-out .15s 5 alternate-reverse; }
@keyframes sautille { to { transform: translateY(-12px) rotate(-3deg); } }
@keyframes patte { from { transform: rotate(-28deg); } to { transform: rotate(28deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .barre-nav { border-radius: 28px; }
    .apropos-cote { top: 0; }
}
@media (max-width: 620px) {
    .barre-nav { position: static; border-radius: 24px; }
    .nav-projets .lien-stylo { display: block; }
    .heros-figure::after { right: 8%; }
}

@media (prefers-reduced-motion: reduce) {
    .revele, .revele--vu { animation: none !important; opacity: 1 !important; }
    .fiche-image img, .galerie img { transition: none; }
}
