/* ==========================================================
   PROJETS — en-tête « Découvrez mes PROJETS » + grille fixe
   ========================================================== */

.pj {
    position: relative;
    z-index: 1;
    background: var(--hx-bg);
    color: var(--hx-ink);
    overflow: clip;
    padding-bottom: 16vh;
    border-top: 1px solid rgba(28, 26, 25, 0.08);
}

/* ---------- En-tête « Découvrez mes PROJETS » ---------- */

.pj-head {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 9vh 24px 6vh;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr auto;
    row-gap: 2.5rem;
    min-height: 440px;
}

.pj-cross {
    position: absolute;
    left: calc(24px + var(--x) * (100% - 48px));
    top: calc(5vh + var(--y) * (100% - 8vh));
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    font-weight: 300;
    color: #8f8883;
}

.pj-kicker {
    margin: 0;
    font-family: var(--hx-display);
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.pj-badge {
    justify-self: end;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1.5px solid var(--hx-ink);
    border-radius: 50%;
    font-family: var(--hx-display);
    font-size: 0.9rem;
}

.pj-title-wrap {
    grid-column: 1 / -1;
    position: relative;
    display: grid;
    place-items: center;
}

.pj-block {
    position: absolute;
    left: 50%;
    top: -18%;
    bottom: -18%;
    width: clamp(110px, 17%, 220px);
    transform: translateX(-50%);
    background: var(--hx-ink);
}

.pj-title {
    position: relative;
    display: grid;
    margin: 0;
    font-family: var(--hx-display);
    font-weight: 400;
    font-size: clamp(4.5rem, 17vw, 15rem);
    line-height: 0.9;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.pj-title > span { grid-area: 1 / 1; display: flex; justify-content: center; }
.pj-title span span { display: inline-block; }

.pj-title-fill {
    color: #fff;
    mix-blend-mode: difference; /* sombre sur le fond, clair sur le bloc */
}

.pj-title-fill span { animation: pj-wave 3.6s ease-in-out infinite; animation-delay: calc(var(--i) * -0.32s); }

.pj-title-outline {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--hx-ink);
    transform: translateY(0.16em);
}

.pj-title-outline span { animation: pj-wave 3.6s ease-in-out infinite; animation-delay: calc(var(--i) * -0.32s - 1.8s); }

@keyframes pj-wave {
    0%, 100% { transform: translateY(0) scaleY(1); }
    50%      { transform: translateY(-0.1em) scaleY(0.82); }
}

.pj-foot {
    margin: 0;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--hx-ink-soft);
}

.pj-foot-right { justify-self: end; }

/* ---------- Grille des projets ---------- */

.pj-grid {
    max-width: 1200px;
    margin: 4vh auto 0;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(3rem, 7vh, 5rem) clamp(24px, 4vw, 56px);
}

.pj-item { display: flex; flex-direction: column; align-items: flex-start; }

/* décalage éditorial : la colonne de droite descend un peu */
.pj-item:nth-child(even) { transform: translateY(clamp(2rem, 8vh, 5rem)); }
.pj-item.ab-reveal.is-hidden:nth-child(even) { transform: translateY(calc(clamp(2rem, 8vh, 5rem) + 28px)); }

.pj-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 14px;
    background: var(--hx-ink);
    box-shadow: 0 16px 36px rgba(28, 26, 25, 0.14);
}

.pj-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: filter 0.6s ease, transform 0.8s var(--hx-ease);
}

.pj-item:hover .pj-thumb img,
.pj-item:focus-within .pj-thumb img { transform: scale(1.03); }

.pj-num {
    position: absolute;
    top: 14px;
    right: 16px;
    padding: 4px 8px;
    background: var(--hx-ink);
    color: #efece7;
    font-family: var(--hx-display);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pj-name {
    margin: 1.4rem 0 0.5rem;
    font-family: var(--hx-display);
    font-weight: 400;
    font-size: clamp(1.6rem, 2.6vw, 2.3rem);
    line-height: 1.05;
    text-transform: uppercase;
}

.pj-desc {
    margin: 0 0 0.9rem;
    max-width: 34em;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--hx-ink-soft);
}

.pj-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 1.1rem;
    padding: 0;
}

.pj-tags li {
    padding: 4px 9px;
    border: 1px solid rgba(28, 26, 25, 0.25);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--hx-ink-soft);
}

.pj-links { display: flex; gap: 22px; }

.pj-link {
    position: relative;
    font-family: var(--hx-display);
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hx-ink);
}

.pj-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 1.5px;
    background: currentColor;
    transform: scaleX(0.35);
    transform-origin: left;
    transition: transform 0.4s var(--hx-ease);
}

.pj-link:hover::after,
.pj-link:focus-visible::after { transform: scaleX(1); }
.pj-link:focus-visible { outline: none; color: var(--hx-accent); }

/* ---------- Couleurs propres à chaque projet (--pc) ---------- */

.pj-item {
    --pc: var(--hx-ink);
    --pc-text: color-mix(in srgb, var(--pc) 72%, #000); /* version plus sombre, lisible sur le fond pierre */
}

.pj-link { display: inline-flex; align-items: center; gap: 6px; }

/* bloc de couleur décalé derrière la capture */
.pj-thumb { overflow: visible; isolation: isolate; }
.pj-thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: var(--pc);
    transform: translate(0, 0);
    transition: transform 0.5s var(--hx-ease);
}
.pj-thumb img { border-radius: inherit; }
.pj-item:hover .pj-thumb::before,
.pj-item:focus-within .pj-thumb::before { transform: translate(12px, 12px); }

.pj-thumb .pj-num { background: var(--pc); border-radius: 4px; }

/* fin liseré coloré sous le nom */
.pj-name { position: relative; padding-bottom: 0.45rem; }
.pj-name::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 42px;
    height: 3px;
    background: var(--pc);
    transition: width 0.5s var(--hx-ease);
}
.pj-item:hover .pj-name::after { width: 96px; }
.pj-item:hover .pj-name .dd-ch { color: var(--pc-text); }
.pj-name .dd-ch { transition: color 0.3s ease; transition-delay: calc(var(--i) * 20ms); }

/* technos avec pastille de couleur */
.pj-tags li { display: inline-flex; align-items: center; gap: 6px; }
.pj-tags li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pc);
}

.pj-link::after { background: var(--pc); }
.pj-link:hover { color: var(--pc-text); }

/* cartes spéciales */
.pj-thumb-soon {
    display: grid;
    place-items: center;
    background: #2b2826;
}

.pj-soon-label {
    font-family: var(--hx-display);
    font-size: clamp(3rem, 7vw, 5.5rem);
    text-transform: uppercase;
    color: transparent;
    -webkit-text-stroke: 1.2px #8f8883;
}

.pj-thumb-cta {
    display: grid;
    place-items: center;
    background: transparent;
    border: 1.5px dashed var(--hx-ink);
    box-shadow: none;
    color: var(--hx-ink);
    transition: background 0.4s ease, color 0.4s ease;
}

.pj-thumb-cta:hover,
.pj-thumb-cta:focus-visible { background: var(--hx-ink); color: var(--hx-bg); outline: none; }

.pj-cta-plus {
    font-family: var(--hx-display);
    font-size: clamp(4rem, 8vw, 6.5rem);
    line-height: 1;
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
    .pj-head { min-height: 300px; row-gap: 1.5rem; padding-top: 7vh; }
    .pj-grid { grid-template-columns: 1fr; }
    .pj-item:nth-child(even),
    .pj-item.ab-reveal.is-hidden:nth-child(even) { transform: none; }
    .pj-item.ab-reveal.is-hidden:nth-child(even) { transform: translateY(28px); }
}

@media (prefers-reduced-motion: reduce) {
    .pj-title span span { animation: none; }
    .pj-thumb img { transition: none; }
}
