/* Fichier css/projects.css · chargé par : index */
/* =========================================================
   Réalisations : à l'intérieur de la mascotte, interface « tech »
   Cadre lumineux (lueurs qui en font le tour, coins, graduations, indicateurs), particules à l'extérieur du cadre
   (canvas 3D), chemin lumineux au sol, et 3 éléments par projet (image, texte, chiffre) « construits » en direct.
   La perspective CSS des cartes est la même que celle de la caméra 3D ; positions et tailles calculées par projects.js
   selon le format d'écran. Hauteur de la section (longueur du défilement) : voir responsive.css.
   (Fichier nettoyé : les règles des versions précédentes, empilées et contradictoires, ont été fusionnées.)
   ========================================================= */
.pj3 { position: relative; z-index: 4; background: radial-gradient(70% 60% at 50% 55%, rgb(var(--space-glow) / .16), transparent 70%), var(--bg); }
.pj3__stick { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.pj3__gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; pointer-events: none; opacity: 0; }

/* titre d'arrivée */
.pj3__intro { position: absolute; left: 0; right: 0; top: 24%; z-index: 4; text-align: center; pointer-events: none; opacity: var(--ti, 1); transform: translateY(calc(var(--tu, 0) * -1px)) scale(calc(1 + var(--ts, 0) * .25)); }
.pj3__intro .eyebrow { margin-bottom: 14px; }
.pj3__title { margin: 0; font-size: clamp(3rem, 1rem + 9vw, 10rem); font-weight: 700; line-height: .85; letter-spacing: -.06em; text-transform: uppercase; }

/* le monde 3D des cartes */
.pj3__world { position: absolute; inset: 0; z-index: 3; perspective: var(--persp, 900px); perspective-origin: 50% 50%; transform-style: preserve-3d; pointer-events: none; }

/* compteur et commandes */
.pj3__k { color: var(--action); font-weight: 800; }
.pj3__back, .pj3__skip { position: absolute; z-index: 5; bottom: var(--ui-b, 34px); opacity: 0; pointer-events: none; min-height: 44px; display: inline-flex; align-items: center; padding: 8px 14px; color: rgb(var(--text-rgb) / .65) !important; letter-spacing: .12em; transition: color .3s; }
.pj3__back { right: calc(50% + 24px); } .pj3__skip { left: calc(50% + 24px); }
.pj3__back.is-on, .pj3__skip.is-on { pointer-events: auto; }
.pj3__back:hover, .pj3__skip:hover { color: var(--action) !important; }

/* badges de statut */
@keyframes projPulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes projBlink { 50% { opacity: .3; } }

/* la lueur de la mascotte sur les bords : on est à l'intérieur */
.pj3__glow { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0;
  background: radial-gradient(75% 70% at 50% 50%, transparent 52%, rgb(var(--acc-rgb) / .16) 78%, rgb(var(--acc-rgb) / .34) 100%), radial-gradient(120% 40% at 50% 110%, rgb(var(--space-glow) / .4), transparent 70%); }
:is(html[data-da="neon"], html[data-da="horizon"]) .pj3__glow { background: radial-gradient(75% 70% at 50% 50%, transparent 52%, rgb(var(--c2-rgb) / .16) 78%, rgb(var(--c1-rgb) / .34) 100%), radial-gradient(120% 40% at 50% 110%, rgb(var(--c3-rgb) / .3), transparent 70%); }

/* ---------- cadre « tech » ---------- */
.pj4__hud { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; --fx0: 60px; --fy0: 96px; --fx1: 60px; --fy1: 60px; }
.pj4__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pj4__rect { fill: none; stroke: rgb(var(--text-rgb) / .14); stroke-width: 1; }
.pj4__run { fill: none; stroke: var(--action); stroke-width: 2; stroke-linecap: round; stroke-dasharray: .1 .9; filter: drop-shadow(0 0 6px rgb(var(--acc-rgb) / .9)) drop-shadow(0 0 18px rgb(var(--acc-rgb) / .5)); animation: pj4Run 7s linear infinite; }
.pj4__run--b { stroke: var(--copper); stroke-dasharray: .05 .95; animation-duration: 11s; animation-direction: reverse; opacity: .8; }
:is(html[data-da="neon"], html[data-da="horizon"]) .pj4__run--a { stroke: rgb(var(--c2-rgb)); } :is(html[data-da="neon"], html[data-da="horizon"]) .pj4__run--b { stroke: rgb(var(--c1-rgb)); }
@keyframes pj4Run { to { stroke-dashoffset: -1; } }
/* coins en équerre */
.pj4__corner { position: absolute; width: 26px; height: 26px; border: 2px solid var(--action); filter: drop-shadow(0 0 6px rgb(var(--acc-rgb) / .7)); }
.pj4__corner--tl { left: calc(var(--fx0) - 6px); top: calc(var(--fy0) - 6px); border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.pj4__corner--tr { right: calc(var(--fx1) - 6px); top: calc(var(--fy0) - 6px); border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.pj4__corner--bl { left: calc(var(--fx0) - 6px); bottom: calc(var(--fy1) - 6px); border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.pj4__corner--br { right: calc(var(--fx1) - 6px); bottom: calc(var(--fy1) - 6px); border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
/* graduations sur les côtés */
.pj4__ruler { position: absolute; top: calc(var(--fy0) + 60px); bottom: calc(var(--fy1) + 60px); width: 10px; opacity: .5;
  background: repeating-linear-gradient(180deg, rgb(var(--text-rgb) / .5) 0 1px, transparent 1px 12px), repeating-linear-gradient(180deg, rgb(var(--text-rgb) / .8) 0 1px, transparent 1px 60px); background-size: 6px 100%, 10px 100%; background-repeat: no-repeat; }
.pj4__ruler--l { left: calc(var(--fx0) + 10px); } .pj4__ruler--r { right: calc(var(--fx1) + 10px); transform: scaleX(-1); }
/* libellés */
.pj4__lab { position: absolute; color: rgb(var(--text-rgb) / .82) !important; letter-spacing: .14em; display: inline-flex; align-items: center; gap: 8px; }
.pj4__lab b { color: var(--action); font-weight: 800; }
.pj4__lab--tl { left: calc(var(--fx0) + 34px); top: calc(var(--fy0) + 16px); }
.pj4__lab--tr { right: calc(var(--fx1) + 34px); top: calc(var(--fy0) + 16px); }
.pj4__lab--bl { left: calc(var(--fx0) + 34px); bottom: calc(var(--fy1) + 16px); font-variant-numeric: tabular-nums; }
.pj4__lab--br { right: calc(var(--fx1) + 34px); bottom: calc(var(--fy1) + 16px); }
.pj4__rec { width: 7px; height: 7px; border-radius: 50%; background: var(--action); box-shadow: 0 0 10px var(--action); animation: projBlink 1.2s steps(1) infinite; }
/* petit anneau qui tourne au milieu du bord haut */
.pj4__ring { position: absolute; left: 50%; top: calc(var(--fy0) - 13px); width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; border: 1px dashed rgb(var(--text-rgb) / .5); animation: mxSpin 6s linear infinite; background: var(--bg); }
.pj4__ring i { position: absolute; inset: 7px; border-radius: 50%; background: var(--action); box-shadow: 0 0 12px var(--action); }

/* ---------- les 3 éléments d'un projet : séparés dans l'espace du cadre ---------- */
.pj4__scene { position: absolute; inset: 0; transform-style: preserve-3d; }
.pj4__grp { --b: 0; position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; visibility: hidden; }
.pj4__grp.is-on { visibility: visible; }
.pj4__card { position: absolute; left: 0; top: 0; margin: 0; border-radius: 20px; transform-style: preserve-3d; will-change: transform, opacity, filter; }
/* construction sans saut : la carte passe en douceur d'atténuée à nette (--b, piloté par le défilement) ;
   seuls les coins et la ligne de balayage jouent la construction, par-dessus */
.pj4__in { position: relative; height: 100%; border-radius: inherit; overflow: hidden;
  filter: saturate(calc(.55 + .45 * var(--b))) brightness(calc(.75 + .25 * var(--b))); opacity: calc(.7 + .3 * var(--b)); }
/* coins de construction */
.pj4__card::before { content: ""; position: absolute; inset: -8px; border-radius: 26px; pointer-events: none; opacity: 0; transform: scale(1.06); transition: opacity .4s, transform .6s var(--ease);
  background: linear-gradient(var(--action), var(--action)) 0 0 / 18px 2px, linear-gradient(var(--action), var(--action)) 0 0 / 2px 18px,
    linear-gradient(var(--action), var(--action)) 100% 0 / 18px 2px, linear-gradient(var(--action), var(--action)) 100% 0 / 2px 18px,
    linear-gradient(var(--action), var(--action)) 0 100% / 18px 2px, linear-gradient(var(--action), var(--action)) 0 100% / 2px 18px,
    linear-gradient(var(--action), var(--action)) 100% 100% / 18px 2px, linear-gradient(var(--action), var(--action)) 100% 100% / 2px 18px; background-repeat: no-repeat; filter: drop-shadow(0 0 6px rgb(var(--acc-rgb) / .8)); }
/* ligne de balayage qui « imprime » le contenu */
.pj4__card::after { content: ""; position: absolute; left: -4px; right: -4px; top: 0; height: 2px; border-radius: 2px; background: var(--action); box-shadow: 0 0 16px 2px rgb(var(--acc-rgb) / .8); opacity: 0; pointer-events: none; }
.pj4__grp.is-built .pj4__card::before { opacity: 1; transform: none; }
.pj4__grp.is-built .pj4__card::after { animation: pj4Scan 1s cubic-bezier(.7, 0, .2, 1) both; }
.pj4__grp.is-built .pj4__txt::after { animation-delay: .35s; }
.pj4__grp.is-built .pj4__det::after { animation-delay: .7s; }
.pj4__grp.is-built .pj4__txt::before { transition-delay: .25s; } .pj4__grp.is-built .pj4__det::before { transition-delay: .55s; }
@keyframes pj4Scan { 0% { top: 0; opacity: 1; } 92% { top: 100%; opacity: 1; } 100% { top: 100%; opacity: 0; } }

/* image */
.pj4__img .pj4__in { background: var(--surface); box-shadow: 0 50px 100px -40px rgb(0 0 0 / .8), 0 0 0 1px rgb(var(--text-rgb) / .1); }
.pj4__img img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.08); transition: transform 2.4s var(--ease); }
.pj4__grp.is-built .pj4__img img { transform: none; }
.pj4__tag { position: absolute; left: 14px; top: 12px; padding: 4px 9px; border-radius: 99px; background: rgb(0 0 0 / .55); color: #fff !important; font-size: .75rem; backdrop-filter: blur(6px); }
/* titre + texte */
.pj4__txt .pj4__in { padding: clamp(18px, 2vw, calc(32px * var(--fs, 1))); display: grid; align-content: center; gap: 12px; justify-items: start;
  background: linear-gradient(160deg, rgb(var(--surface-rgb) / .82), rgb(var(--bg-rgb) / .66)); border: 1px solid rgb(var(--text-rgb) / .1);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
.pj4__txt .pj4__in > * { margin: 0; opacity: calc(.55 + .45 * var(--b)); }
.pj4__t { font-size: clamp(1.3rem, .8rem + 1.5vw, calc(2.5rem * var(--fs, 1))); font-weight: 680; line-height: .95; letter-spacing: -.04em; text-transform: uppercase; }
.pj4__r { font-size: clamp(.9rem, .8rem + .25vw, calc(1.05rem * var(--fs, 1))); line-height: 1.45; color: var(--muted-space); max-width: 38ch; }
/* chiffre : carte-bouton */
.pj4__det { pointer-events: auto; color: var(--on-action); }
.pj4__det .pj4__in { display: grid; grid-template-columns: 1fr auto; align-content: center; column-gap: 14px; row-gap: 2px; padding: 20px 22px; background: var(--action); box-shadow: 0 28px 60px -20px rgb(var(--acc-rgb) / .7); transition: filter .3s; }
.pj4__det:hover .pj4__in { filter: brightness(1.08); }
:is(html[data-da="neon"], html[data-da="horizon"]) .pj4__det .pj4__in { background: var(--grad); color: var(--on-grad); }
.pj4__lbl { grid-column: 1; color: inherit !important; opacity: 1; font-size: .78rem; }
.pj4__fig { grid-column: 1; font-size: clamp(1.9rem, 1.2rem + 1.8vw, calc(3.2rem * var(--fs, 1))); font-weight: 800; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.pj4__fu { grid-column: 1; font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.pj4__det small { grid-column: 1; font-size: .8rem; opacity: 1; }
.pj4__det em { grid-column: 2; grid-row: 1 / span 4; font-style: normal; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / .16); font-size: 1.1rem; }

/* 5e étape : la mascotte annonce les autres projets (le bloc est posé au-dessus des commandes du bas) */
.pj4__more { position: absolute; left: 50%; top: auto; bottom: calc(var(--ui-b, 34px) + 64px); z-index: 6; width: min(calc(520px * var(--fs, 1)), calc(100% - 2 * var(--gutter))); transform: translate(-50%, calc(var(--mu, 1) * 30px));
  text-align: center; display: grid; justify-items: center; gap: 14px; opacity: var(--mo, 0); pointer-events: none; }
.pj4__more.is-on { pointer-events: auto; }
.pj4__more p { margin: 0; }
.pj4__more-k { color: var(--action); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; }
.pj4__more-t { font-family: var(--f-display, inherit); font-size: clamp(1.9rem, 3.6vw, calc(3.1rem * var(--fs, 1))); line-height: 1.02; letter-spacing: -.02em; color: rgb(var(--text-rgb)); }
.pj4__more-p { color: rgb(var(--muted-rgb)); max-width: 40ch; line-height: 1.5; }
.pj4__more-go { margin-top: 8px; }

/* ---------- petits formats : le cadre ne garde que l'essentiel (rien n'est écrit sur les cartes) ---------- */
html.f-stack .pj4__ruler, html.f-stack .pj4__ring, html.f-stack .pj4__lab--tl, html.f-stack .pj4__lab--bl, html.f-stack .pj4__lab--br,
html.f-short .pj4__ruler, html.f-short .pj4__ring, html.f-short .pj4__lab { display: none; }
html.f-stack .pj3__title { font-size: clamp(2.6rem, 14vw, 6rem); }
html.f-stack.f-phone .pj4__txt .pj4__in { padding: 14px 16px; gap: 8px; }
html.f-stack.f-phone .pj4__t { font-size: clamp(1.15rem, 5.6vw, 1.5rem); }
html.f-stack.f-phone .pj4__r { font-size: .875rem; line-height: 1.4; }
html.f-stack.f-phone .pj4__det .pj4__in { padding: 12px 16px; }
html.f-stack.f-phone .pj4__fig { font-size: 1.7rem; }
html.f-stack.f-phone .pj4__more { gap: 10px; }
html.f-stack.f-phone .pj4__more-p { font-size: .92rem; }
/* téléphone en paysage : tout est compact */
html.f-short .pj3__intro { top: 20%; }
html.f-short .pj3__title { font-size: clamp(2.2rem, 16vh, 4rem); }
html.f-short .pj4__txt .pj4__in { padding: 10px 14px; gap: 6px; }
html.f-short .pj4__t { font-size: 1.05rem; }
html.f-short .pj4__r { font-size: .8125rem; line-height: 1.35; }
html.f-short .pj4__det .pj4__in { padding: 10px 12px; column-gap: 8px; }
html.f-short .pj4__fig { font-size: 1.5rem; }
html.f-short .pj4__det em { width: 32px; height: 32px; }
html.f-short .pj4__tag { display: none; }
html.f-short .pj4__more { bottom: calc(var(--ui-b) + 50px); gap: 6px; left: 60%; width: min(420px, 60vw); }
html.f-short .pj4__more-t { font-size: clamp(1.3rem, 7vh, 1.8rem); }
html.f-short .pj4__more-p { font-size: .85rem; line-height: 1.35; }
html.f-short .pj4__more-go { margin-top: 2px; }

/* textes des cartes : multipliés par --pjk (calculé par projects.js) pour compenser la réduction due à la perspective */
.pj4__card .mono, .pj4__card .proj__st { font-size: calc(.75rem * var(--pjk, 1)); }
.pj4__card .pj4__t { font-size: calc(clamp(1.3rem, .8rem + 1.5vw, calc(2.5rem * var(--fs, 1))) * var(--pjk, 1)); }
.pj4__card .pj4__r { font-size: calc(clamp(.9rem, .8rem + .25vw, calc(1.05rem * var(--fs, 1))) * var(--pjk, 1)); }
.pj4__card .pj4__fig { font-size: calc(clamp(1.9rem, 1.2rem + 1.8vw, calc(3.2rem * var(--fs, 1))) * var(--pjk, 1)); }
.pj4__card .pj4__fu, .pj4__card small { font-size: calc(.8rem * var(--pjk, 1)); }
html.f-stack.f-phone .pj4__card .pj4__t { font-size: calc(clamp(1.15rem, 5.6vw, 1.5rem) * var(--pjk, 1)); }
html.f-stack.f-phone .pj4__card .pj4__r { font-size: calc(.875rem * var(--pjk, 1)); }
html.f-stack.f-phone .pj4__card .pj4__fig { font-size: calc(1.7rem * var(--pjk, 1)); }
html.f-short .pj4__card .pj4__t { font-size: calc(1.05rem * var(--pjk, 1)); }
html.f-short .pj4__card .pj4__r { font-size: calc(.8125rem * var(--pjk, 1)); }
html.f-short .pj4__card .pj4__fig { font-size: calc(1.5rem * var(--pjk, 1)); }
