/* Fichier css/projet.css · chargé par : les 9 pages projet-* */
/* =========================================================
   IAI — Page projet (projet-<id>.html, générée par tools/build-realisations.cjs)
   Ouverture plein cadre (même image que l'écran cliqué), repères, contexte et livrables, galerie qui défile de côté,
   résultat, projet suivant, appel final recouvert par le pied de page. Mascotte : orb3d.js via window.IAI.orbTarget (projet.js).
   ========================================================= */
.pd { position: relative; z-index: 2; }

/* ---------- ouverture ---------- */
.pd-hero { position: relative; height: var(--fh, 100svh); min-height: 520px; overflow: hidden; display: grid; align-items: end; }
.pd-hero__media { position: absolute; inset: 0; z-index: 0; }
.pd-hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transform: scale(calc(1 + var(--hp, 0) * .12)) translateY(calc(var(--hp, 0) * 6%)); }
.pd-hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgb(var(--bg-rgb)) 2%, rgb(var(--bg-rgb) / .86) 32%, rgb(var(--bg-rgb) / .35) 70%, rgb(var(--bg-rgb) / .55) 100%); opacity: calc(.9 + var(--hp, 0) * .1); }
.pd-hero__in { position: relative; z-index: 2; width: 100%; padding-top: calc(100px + var(--sat, 0px)); padding-bottom: clamp(70px, 12svh, 130px); }
/* retour à toutes les réalisations : toujours en bas de l'écran */
.pd-back { position: fixed; z-index: 44; left: 50%; bottom: max(16px, calc(var(--sab, 0px) + 10px)); transform: translateX(-50%); white-space: nowrap; display: inline-flex; gap: 10px; align-items: center; padding: 11px 18px; border-radius: 99px; background: rgb(var(--bg-rgb) / .78); box-shadow: 0 14px 40px -12px rgb(0 0 0 / .6); border: 1px solid rgb(var(--text-rgb) / .16); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: rgb(var(--text-rgb) / .85); }
.pd-back:hover { border-color: rgb(var(--acc-rgb)); color: rgb(var(--text-rgb)); }
.pd-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: rgb(var(--text-rgb) / .7); }
.pd-meta span + span::before { content: "·"; margin-right: 16px; }
.pd-t { margin-top: 14px; font-size: clamp(2.6rem, .8rem + 6.4vw, 8.4rem); font-weight: 680; line-height: .88; letter-spacing: -.055em; text-transform: uppercase; max-width: 14ch; text-wrap: balance; }
.pd-acc { margin-top: 18px; max-width: 30ch; font-size: clamp(1.25rem, .9rem + 1.2vw, 2.2rem); font-weight: 560; line-height: 1.1; letter-spacing: -.02em; color: rgb(var(--text-rgb) / .9); }
.pd-hero__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 26px; }
.pd-liv { color: rgb(var(--text-rgb) / .7); }
.pd-hero__foot { position: absolute; z-index: 2; left: 50%; bottom: max(18px, calc(var(--sab, 0px) + 12px)); }
.pd-hero__in > * { opacity: 0; transform: translateY(24px); transition: opacity .9s, transform 1s var(--ease); }
html.pd-ready .pd-hero__in > * { opacity: 1; transform: none; }
html.pd-ready .pd-hero__in > :nth-child(2) { transition-delay: .1s; } html.pd-ready .pd-hero__in > :nth-child(3) { transition-delay: .18s; }
html.pd-ready .pd-hero__in > :nth-child(4) { transition-delay: .3s; } html.pd-ready .pd-hero__in > :nth-child(5) { transition-delay: .4s; }
html.f-short .pd-hero__in { padding-top: 60px; padding-bottom: 30px; }
html.f-short .pd-back { bottom: max(8px, calc(var(--sab, 0px) + 6px)); padding: 7px 14px; }
html.f-short .pd-t { font-size: clamp(2rem, 6vw, 3.2rem); max-width: 22ch; }
html.f-short .pd-acc { margin-top: 8px; font-size: 1.1rem; max-width: 50ch; }
html.f-short .pd-hero__row { margin-top: 12px; }
html.f-short .pd-hero__foot { display: none; }

/* ---------- repères ---------- */
.pd-kpis { padding-top: clamp(80px, 14svh, 160px); padding-bottom: clamp(60px, 10svh, 120px); }
.pd-sous { max-width: 32ch; font-size: clamp(1.5rem, .9rem + 2.2vw, 3.2rem); font-weight: 560; line-height: 1.12; letter-spacing: -.03em; }
.pd-kpis__l { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 28px); margin-top: clamp(40px, 7svh, 80px); }
.pd-kpis__l li { padding: clamp(20px, 2.4vw, 34px); border-radius: clamp(14px, 1.6vw, 24px); background: rgb(var(--text-rgb) / .04); border: 1px solid rgb(var(--text-rgb) / .1); }
.pd-kpis__l b { display: block; font-size: clamp(2rem, 1rem + 3vw, 4.4rem); font-weight: 700; line-height: 1; letter-spacing: -.05em; color: rgb(var(--acc-rgb)); white-space: nowrap; }
.pd-kpis__l span { display: block; margin-top: 12px; font-size: .9375rem; line-height: 1.35; color: rgb(var(--text-rgb) / .68); }
html.f-phone .pd-kpis__l { grid-template-columns: 1fr; }
html.f-phone .pd-kpis__l li { display: flex; align-items: baseline; gap: 16px; }
html.f-phone .pd-kpis__l span { margin-top: 0; }

/* ---------- contexte et livrables ---------- */
.pd-story { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(30px, 6vw, 110px); padding-bottom: clamp(80px, 14svh, 160px); }
.pd-story__a { position: sticky; top: 120px; align-self: start; }
.pd-defi { font-size: clamp(1.125rem, .95rem + .6vw, 1.5rem); line-height: 1.45; color: rgb(var(--text-rgb) / .84); }
.pd-h { font-size: clamp(2rem, 1rem + 3vw, 4.4rem); font-weight: 650; line-height: .95; letter-spacing: -.045em; text-transform: uppercase; }
.pd-livre { list-style: none; counter-reset: l; margin-top: clamp(24px, 4svh, 44px); border-top: 1px solid rgb(var(--text-rgb) / .14); }
.pd-livre li { counter-increment: l; display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 20px 0; border-bottom: 1px solid rgb(var(--text-rgb) / .14); font-size: clamp(1rem, .92rem + .3vw, 1.25rem); line-height: 1.42;
  opacity: 0; transform: translateY(20px); transition: opacity .7s, transform .8s var(--ease); }
.pd-livre li::before { content: counter(l, decimal-leading-zero); font-size: .75rem; font-weight: 700; letter-spacing: .08em; color: rgb(var(--acc-rgb)); padding-top: .35em; }
.pd-livre li.is-in { opacity: 1; transform: none; }
html.f-stack .pd-story { grid-template-columns: 1fr; }
html.f-stack .pd-story__a { position: static; }
html.f-phone .pd-livre li { grid-template-columns: 40px 1fr; padding: 16px 0; }

/* ---------- galerie : la piste défile de côté pendant que la section reste collée ---------- */
.pd-gal { position: relative; height: calc(var(--fh, 100svh) * (1 + var(--ng, 4) * .42)); }
.pd-gal__stick { position: sticky; top: 0; height: var(--fh, 100svh); overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; padding: calc(96px + var(--sat, 0px)) 0 max(28px, calc(var(--sab, 0px) + 20px)); }
.pd-gal__head { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.pd-gal__track { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 40px); padding: 0 var(--gutter); width: max-content; transform: translate3d(calc(var(--gx, 0) * -1px), 0, 0); will-change: transform; }
.pd-shot { position: relative; flex: none; display: block; --gh: min(calc(64vw / 2.1), calc(var(--fh, 100svh) - 300px), 500px); width: auto; padding: 0; border: 0; text-align: left; cursor: zoom-in; color: inherit; background: none;
  transform: perspective(1400px) rotateY(calc(var(--sk, 0) * 10deg)) scale(calc(1 - var(--sd, 0) * .08)); transition: transform .3s; }
.pd-shot > .rl-shot__bar, .pd-shot > img, .pd-shot > video { display: block; }
.pd-shot > .rl-shot__bar { border-radius: 14px 14px 0 0; }
.pd-shot > img, .pd-shot > video { width: auto; height: var(--gh); max-width: 86vw; object-fit: contain; border-radius: 0 0 14px 14px; background: #0b0f18; box-shadow: 0 0 0 1px rgb(var(--text-rgb) / .12), 0 40px 80px -24px rgb(0 0 0 / .8); }
.pd-shot--vid { cursor: default; margin: 0; }
.pd-shot__cap { display: block; width: 0; min-width: 100%; margin-top: 14px; color: rgb(var(--text-rgb) / .72); }
.pd-shot:hover > img { box-shadow: 0 0 0 1px rgb(var(--acc-rgb) / .7), 0 40px 80px -24px rgb(0 0 0 / .8); }
.pd-gal__bar { margin: 18px auto 0; width: min(320px, 50vw); height: 2px; border-radius: 2px; background: rgb(var(--text-rgb) / .16); overflow: hidden; }
.pd-gal__bar i { display: block; height: 100%; background: rgb(var(--acc-rgb)); transform: scaleX(var(--gp, 0)); transform-origin: 0 50%; }
html.f-stack .pd-shot { --gh: min(calc(90vw / 2.1), calc(var(--fh, 100svh) - 320px), 380px); }
html.f-short .pd-gal__stick { padding-top: 58px; }
html.f-short .pd-gal__hint { display: none; }
html.f-short .pd-h { font-size: 1.6rem; }
html.f-short .pd-shot { --gh: min(calc(56vw / 2.1), calc(var(--fh, 100svh) - 170px)); }

/* ---------- résultat ---------- */
.pd-res { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(30px, 6vw, 100px); padding-top: clamp(90px, 16svh, 180px); padding-bottom: clamp(90px, 14svh, 160px); }
.pd-res__t { font-size: clamp(1.6rem, .9rem + 2.4vw, 3.4rem); font-weight: 600; line-height: 1.1; letter-spacing: -.03em; text-wrap: pretty; }
.pd-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.pd-res__tech ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.pd-res__tech li { padding: 8px 14px; border-radius: 99px; border: 1px solid rgb(var(--text-rgb) / .18); font-size: .875rem; color: rgb(var(--text-rgb) / .85); }
.pd-res__own { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgb(var(--text-rgb) / .14); font-size: .9375rem; line-height: 1.45; color: rgb(var(--text-rgb) / .7); }
html.f-stack .pd-res { grid-template-columns: 1fr; }

/* ---------- projet suivant ---------- */
.pd-next { padding: 0 var(--gutter) clamp(90px, 14svh, 160px); }
.pd-next__a { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: clamp(20px, 3vw, 50px); padding: clamp(16px, 2vw, 28px); border-radius: clamp(18px, 2vw, 30px); background: rgb(var(--text-rgb) / .04); border: 1px solid rgb(var(--text-rgb) / .1); transition: border-color .3s, background .3s; }
.pd-next__a:hover { border-color: rgb(var(--acc-rgb) / .6); background: rgb(var(--text-rgb) / .06); }
.pd-next__img { overflow: hidden; border-radius: 12px; }
.pd-next__img img { display: block; width: 100%; height: auto; transition: transform .8s var(--ease); }
.pd-next__a:hover .pd-next__img img { transform: scale(1.05); }
.pd-next__txt { display: grid; gap: 10px; }
.pd-next__txt b { font-size: clamp(1.8rem, 1rem + 2.6vw, 4rem); font-weight: 650; line-height: .95; letter-spacing: -.045em; text-transform: uppercase; }
.pd-next__txt b em { font-style: normal; color: rgb(var(--acc-rgb)); }
.pd-next__acc { color: rgb(var(--text-rgb) / .72); font-size: 1.0625rem; }
.pd-next__go { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgb(var(--acc-rgb)); color: #fff; font-size: 1.5rem; transition: transform .4s var(--ease); }
.pd-next__a:hover .pd-next__go { transform: translateX(6px); }
html.f-stack .pd-next__a { grid-template-columns: 1fr; }
html.f-stack .pd-next__go { position: absolute; right: 20px; bottom: 20px; width: 50px; height: 50px; }

/* ---------- visionneuse ---------- */
.pd-lb { position: fixed; inset: 0; z-index: 9500; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 60px max(10px, var(--gutter)) 30px; background: rgb(6 8 14 / .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pd-lb[hidden] { display: none; }
.pd-lb__fig { margin: 0; display: grid; justify-items: center; gap: 14px; min-width: 0; }
.pd-lb__fig img { max-width: 100%; max-height: calc(var(--fh, 100svh) - 150px); object-fit: contain; border-radius: 10px; box-shadow: 0 30px 90px rgb(0 0 0 / .7); animation: pdLb .45s var(--ease); }
@keyframes pdLb { from { opacity: 0; transform: scale(.96); } }
.pd-lb__fig figcaption { font-size: .8125rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgb(255 255 255 / .75); text-align: center; }
.pd-lb__arr, .pd-lb__x { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .25); background: rgb(255 255 255 / .06); color: #fff; font-size: 1.25rem; cursor: pointer; }
.pd-lb__arr:hover, .pd-lb__x:hover { border-color: rgb(var(--acc-rgb)); }
.pd-lb__x { position: absolute; top: 14px; right: 14px; font-size: 1.6rem; }
html.f-phone .pd-lb { grid-template-columns: 1fr 1fr; padding: 60px 12px 20px; }
html.f-phone .pd-lb__fig { grid-column: 1 / -1; grid-row: 1; }
html.f-phone .pd-lb__arr { grid-row: 2; justify-self: center; }

@media (prefers-reduced-motion: reduce) {
  .pd-hero__in > *, .pd-livre li { opacity: 1 !important; transform: none !important; transition: none; }
  .pd-hero__media img, .pd-shot { transform: none !important; }
}

/* téléphone : on décale vers la gauche pour laisser la place à la bulle de chat (coin bas droit) */
html.f-phone .pd-back { transform: translateX(calc(-50% - 34px)); padding: 10px 14px; }
html.f-short .pd-back { transition: opacity .35s, border-color .3s; }
html.f-short:not(.pd-past) .pd-back { opacity: 0; pointer-events: none; }
