/* =====================================================================
   PAGES PROJET (construites par app.js à partir de projects.js ; mode « un écran » seulement)
   Un écran par projet, la même mise en scène pour tous (plans : app.js → planOf) : des images entières dans une grande
   case, le nom et le texte à côté. Sur téléphone et tablette debout, tout se suit de haut en bas et l'écran défile.
   Cases : « s » = les images · « t » = le nom · « x » = le texte · « c » = colonne de deux moitiés (nom, texte).
   La case [data-fill] en bout de rangée ne prend de la place que pendant les transitions (les autres se replient).
   ===================================================================== */
html.onescreen .pj { flex: 1 0 auto; display: flex; flex-direction: column; }
html.onescreen .pj-row { flex: 1 1 0; display: flex; overflow: hidden; overflow: clip; }   /* jamais plus petite que son texte (clip : voir styles.css) */
.pj-row:not(:last-of-type) { border-bottom: 1px solid var(--line); }
/* largeur nulle au repos ; app.js lui donne « flex: 1 1 0 » pendant les transitions, quand les cases se replient */
.pj-fill { flex: 0 0 0; min-width: 0; }
.pj-cell { position: relative; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.pj-cell.has-l { border-left: 1px solid var(--line); }
.pj-row > [data-w="56"] { flex: 0 0 56%; }
.pj-row > [data-w="44"] { flex: 0 0 44%; }

/* ----- le nom ----- */
.pj-cell--t { justify-content: center; align-items: center; text-align: center; gap: 14px; padding: 48px 32px; }
.pj-logo { --logo: var(--logo-ui); width: var(--logo); height: var(--logo); object-fit: contain; margin-bottom: 6px; } /* même taille que les cartes (styles.css) */
/* sans logo : l'initiale dans un carré au filet d'1 px */
.pj-logo--ph {
  display: flex; align-items: center; justify-content: center; border: 1px solid var(--line);
  font-size: 28px; font-weight: 300; text-transform: uppercase; color: var(--text);
}
.pj-name { margin: 0; font-size: clamp(30px, calc(var(--vw) * 3.2), 54px); line-height: 1.05; font-weight: 400; text-transform: uppercase; letter-spacing: var(--ls-title); }
.pj-tag { margin: 0; font-size: var(--t-label); letter-spacing: var(--ls); text-transform: uppercase; color: var(--muted); }
/* retour à la grille : discret, dans le coin de la case du nom */
.pj-back {
  position: absolute; top: 22px; left: 24px; z-index: 1;
  font-size: var(--t-label); letter-spacing: var(--ls); text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.pj-back::before { content: ""; position: absolute; inset: -14px; }   /* plus facile à toucher */
.pj-back:hover, .pj-back:focus-visible { color: var(--accent); }
/* lien vers le site du projet : le seul élément doré de la case, souligné d'un filet qui se déploie au survol */
.pj-site {
  position: relative; margin-top: 10px; padding-bottom: 4px;
  font-size: max(13px, var(--t-label)); letter-spacing: var(--ls); text-transform: uppercase; color: var(--accent); white-space: nowrap;
}
.pj-site::before { content: ""; position: absolute; inset: -14px; }
.pj-site::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0.25); transform-origin: left center; transition: transform 0.45s cubic-bezier(0.77, 0, 0.18, 1);
}
.pj-site:hover, .pj-site:focus-visible { color: var(--accent-soft); }
.pj-site:hover::after, .pj-site:focus-visible::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { .pj-site::after { transition: none; } }

/* ----- le texte ----- */
.pj-cell--x { justify-content: center; padding: clamp(20px, 3.6vh, 40px) clamp(32px, calc(var(--vw) * 6), 120px); }
.pj-text { text-wrap: pretty; margin: 0; max-width: 36em; font-size: var(--t-body); line-height: 2; letter-spacing: var(--ls); text-transform: uppercase; color: var(--text); }

/* fenêtres étroites ou basses, menu ouvert : le texte se resserre (voir .preview__text p, styles.css) */
@media (min-width: 900px) and (max-width: 1099px), (min-width: 900px) and (max-height: 640px) {
  .pj-cell--x { padding: 20px calc(clamp(32px, calc(var(--vw) * 6), 120px) - 12px * var(--open)); }
  .pj-text { font-size: 14px; line-height: calc(1.8 - 0.2 * var(--open)); letter-spacing: calc(2px - 1.2px * var(--open)); }
}

/* ----- la colonne : le nom, puis le texte ----- */
.pj-half { flex: 1 1 50%; position: relative; box-sizing: border-box; overflow: hidden; overflow: clip; display: flex; flex-direction: column; }
.pj-half + .pj-half { border-top: 1px solid var(--line); }
.pj-half.pj-cell--t { justify-content: space-between; padding: 22px 24px; gap: 12px; }
.pj-half.pj-cell--t::after { content: ""; height: 1.5em; }   /* autant que le lien de retour : le nom reste au centre */
.pj-half .pj-back { position: relative; top: auto; left: auto; align-self: flex-start; }
/* fenêtres d'ordinateur basses : chaque moitié prend la hauteur de son texte, pour tenir sans défiler */
@media (min-width: 900px) and (max-height: 690px) {
  .pj-half { flex: 1 1 auto; }
  .pj-half.pj-cell--t { padding: 14px 24px; gap: 4px; }
  .pj-half.pj-cell--t::after { height: 0; }
  .pj-half .pj-id { gap: 8px; }
}
.pj-id { display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* ----- les images : toutes à la même hauteur, la plus grande qui tienne (en hauteur comme en largeur) sans rien couper
   (cqh / cqw : la taille de .pj-show, marges déduites). Même habillage que les icônes : coins arrondis, contour discret,
   lueur du produit. Elle est peinte sur .pj-show, que app.js tient en place pendant que la case s'ouvre. ----- */
.pj-show {
  --pad: clamp(28px, calc(var(--vw) * 3.4), 64px); --gap: clamp(16px, calc(var(--vw) * 3), 56px);
  flex: 1 1 0; min-height: 0; box-sizing: border-box; padding: var(--pad); container-type: size;
  display: flex; align-items: center; justify-content: center; gap: var(--gap);
  background: radial-gradient(farthest-side,
    color-mix(in srgb, var(--glow) 40%, transparent) 0%,
    color-mix(in srgb, var(--glow) 31%, transparent) 40%,
    color-mix(in srgb, var(--glow) 12%, transparent) 72%,
    transparent 100%);
}
.pj-shot {
  --h: min(100cqh, calc((100cqw - (var(--n) - 1) * var(--gap)) / var(--rs)));
  flex: none; height: var(--h); width: calc(var(--h) * var(--r)); max-width: none;
  border-radius: clamp(8px, calc(var(--vw) * 0.9), 16px); outline: 1px solid rgba(255, 255, 255, 0.16); outline-offset: -1px;
}
.pj-show > .ph { font-size: 12px; letter-spacing: var(--ls); text-transform: uppercase; color: var(--muted); }
/* un site vitrine, affiché en vrai puis réduit (--x fois plus grand que sa case : on voit sa version ordinateur).
   39 px : le bandeau « Site vitrine d'exemple » reste au-dessus, le texte de la page le dit déjà */
.pj-live { --x: 2; position: relative; overflow: hidden; background: var(--panel); }
.pj-live iframe {
  position: absolute; top: calc(-39px / var(--x)); left: 0; border: 0; width: calc(100% * var(--x)); height: calc(100% * var(--x) + 39px);
  transform: scale(calc(1 / var(--x))); transform-origin: 0 0; pointer-events: none;
}
@container (max-width: 600px) { .pj-live { --x: 3; } }
@container (max-width: 400px) { .pj-live { --x: 4; } }
.pj-shot--phone { border-radius: 13% / calc(13% * var(--r)); }   /* l'arrondi d'un écran de téléphone, sans dessiner le téléphone */

/* ----- carte d'un projet : elle mène à sa page ----- */
.card--link { cursor: pointer; }

/* ----- repère de progression : en page projet, pas de segments (ils comptent les 4 écrans du site) ----- */
html.in-project .progress::after { display: none; }

/* ----- tablette et téléphone ----- */
@media (max-width: 899px) {
  .pj-cell { flex: var(--g) 1 0; }   /* part de la rangée, posée par app.js */
  .pj-cell--t { padding: 64px 24px 36px; gap: 10px; }
  .pj-name { font-size: clamp(30px, 6vw, 46px); }
  .pj-tag, .pj-site, .pj-back { letter-spacing: 1.5px; }
  .pj-tag { line-height: 1.6; text-wrap: balance; }
  .pj-back { top: 20px; left: 24px; }
  .pj-cell--x { padding: 32px 24px; }
  .pj-text { font-size: clamp(14px, 1.9vw, 16px); line-height: 1.85; letter-spacing: 1.2px; }
}
/* téléphone et tablette debout : la case des images prend la hauteur de ses images (le calcul de .pj-shot, depuis la
   largeur de l'écran ; 2 px : les bords du cadre), 60 % de l'écran au plus ; le nom et le texte se partagent le reste */
@media (max-width: 599px), (max-width: 899px) and (orientation: portrait) {
  html.onescreen .pj-row { flex: 1 0 auto; }
  html.onescreen .pj-row--show { flex: none; }
  .pj-show {
    --pad: 24px; --gap: 16px;
    flex: none; height: calc(2 * var(--pad) + min(60vh, (100vw - 2px - 2 * var(--pad) - (var(--n) - 1) * var(--gap)) / var(--rs)));
  }
}
/* téléphone couché : les images et le nom occupent un écran entier */
@media (min-width: 600px) and (max-width: 899px) and (orientation: landscape) {
  .pj-row--show { min-height: max(250px, calc(100vh - var(--hdr))); }
  .pj-show { --pad: 24px; }
  .pj-cell--t { padding: 52px 20px 20px; gap: 8px; }
  .pj-name { font-size: clamp(26px, 4vw, 36px); }   /* « Nimo Cleaner » tient sur une ligne */
}
