/* ---------- Réalisations ----------
   Chaque projet s'affiche dans une photo de bureau dont l'écran montre le site (assets/img/work/*-scene-*.webp,
   tools/work-scene.py) ou, en attendant sa photo, sur des appareils dessinés (assets/img/*-blank.svg) : ordinateur +
   tablette + téléphone posés sur le bureau pour les applications.
   Par défaut (téléphone, sans JavaScript, mouvement réduit) : une liste de projets.
   Grand écran avec animations : la section se fige (work-pinned.css). */
.work {
  position: relative;
  padding: 72px 0;
}
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 40px;
  width: 100%;
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0 var(--edge);
}
.work-kicker {
  letter-spacing: 0.35em;
  color: var(--ink-2);
}
/* Une ligne par phrase : « Du concret. » puis « À regarder. », jamais coupées. */
.work-title {
  margin: 12px 0 22px;
  font: 900 clamp(1.875rem, 0.5rem + 3.84vw, 5.25rem) / 0.9 var(--sans);
  letter-spacing: -0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.work-text {
  max-width: 420px;
  font-size: 16px;
  line-height: 26px;
  color: var(--ink-2);
}
.work-thumbs,
.work-intro .solid-btn,
.work-progress,
.work-hint {
  display: none;
}
.work-track {
  display: grid;
  gap: 44px;
}
.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  color: var(--ink);
}
.work-card-link {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.work-card-head {
  order: 2;
  padding-top: 16px;
}
.work-count {
  display: none;
}
.work-card h3 {
  font: 900 16px / 20px var(--sans);
  letter-spacing: -0.025em;
  text-transform: uppercase;
}
/* Deuxième ligne du titre de projet : ce que c'est, en retrait de couleur. */
.work-card h3 span {
  display: block;
  color: var(--ink-3);
}
/* « : » entre le nom et la description, seulement quand le titre tient sur une ligne (section figée). */
.work-card h3 .work-sep,
.work-backdrop {
  display: none;
}
.work-stack {
  margin-top: 8px;
  line-height: 16.25px;
  letter-spacing: 0.2em;
  color: var(--ink-2);
}
.work-tags {
  display: none;
}

/* La photo occupe tout le cadre. */
.work-visual.is-photo {
  padding: 0;
  background: #1a1714;
}
.work-photo {
  width: 100%;
  height: auto;
}

/* ---------- Appareils : le cadre (SVG) en fond, l'aperçu calé dans la zone d'écran du SVG ---------- */
.work-visual {
  order: 1;
  display: grid;
  place-items: center;
  padding: 7% 6% 3%;
  overflow: hidden;
  border-radius: 6px;
  background: radial-gradient(70% 60% at 50% 88%, #3b3733 0%, #171615 58%, #0c0c0c 100%);
}
.device-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1600 / 1000;
  transition: transform 0.7s var(--ease-out);
}
.device-scene.is-trio {
  aspect-ratio: 16 / 9.6;
}
/* Le bureau : une lueur horizontale sous les appareils. */
.device-scene.is-trio::before {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  top: 86%;
  height: 16%;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.06), rgb(255 255 255 / 0));
  border-top: 1px solid rgb(255 255 255 / 0.06);
}
.device {
  position: absolute;
}
.device-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.device-screen {
  position: absolute;
  margin: 0;
  object-fit: cover;
  object-position: top;
}
/* Reflet discret sur chaque dalle. */
.device::after {
  content: "";
  position: absolute;
  background: linear-gradient(118deg, rgb(255 255 255 / 0.1) 0%, rgb(255 255 255 / 0.02) 34%, rgb(255 255 255 / 0) 35%);
  pointer-events: none;
}
.device-mac {
  inset: 0;
  aspect-ratio: 1600 / 1000;
}
.device-mac .device-screen,
.device-mac::after {
  left: 14.5%;
  top: 9.6%;
  width: 71%;
  height: 71%;
  border-radius: 0.3%;
}
.device-tablet {
  aspect-ratio: 1000 / 1400;
}
.device-tablet .device-screen,
.device-tablet::after {
  left: 8.8%;
  top: 7.64%;
  width: 82.4%;
  height: 84.71%;
  border-radius: 2.7% / 1.9%;
}
.device-phone {
  aspect-ratio: 600 / 1220;
}
.device-phone .device-screen,
.device-phone::after {
  left: 7.33%;
  top: 3.61%;
  width: 85.33%;
  height: 92.79%;
  border-radius: 14.5% / 6.6%;
}
/* Îlot de la caméra, au-dessus de l'aperçu. */
.device-phone::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 40%;
  top: 5.6%;
  width: 20%;
  height: 2.8%;
  border-radius: 99px;
  background: #000;
}
.device-tablet .device-frame,
.device-phone .device-frame {
  filter: drop-shadow(0 14px 16px rgb(0 0 0 / 0.55));
}
/* Trio posé sur le bureau : l'ordinateur au fond, tablette à droite et téléphone à gauche, devant. */
.is-trio .device-mac {
  inset: auto;
  left: 10%;
  bottom: 4%;
  width: 70%;
}
.is-trio .device-tablet {
  right: 3%;
  bottom: 8%;
  width: 21%;
}
.is-trio .device-phone {
  left: 2.5%;
  bottom: 7.5%;
  width: 10.5%;
}
.work-card:hover .device-scene {
  transform: translateY(-6px);
}
.solid-btn {
  display: inline-flex;
  align-items: center;
  height: 38px;
  margin-top: 36px;
  padding: 0 20px;
  background: var(--ink);
  color: var(--bg);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  transition: opacity 0.2s ease;
}
.solid-btn:hover {
  opacity: 0.82;
}
/* Écran tactile : le bouton plein (ici et dans Contact) garde 44 px de haut sous le doigt (voir base.css). */
@media (pointer: coarse) {
  .solid-btn {
    position: relative;
  }
  .solid-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100%, 44px);
    height: max(100%, 44px);
    translate: -50% -50%;
  }
}
@media (min-width: 768px) {
  .work-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .work-grid {
    padding: 0 20px;
  }
  .work-title {
    letter-spacing: -0.05em;
  }
  .work-text {
    font-size: 14px;
    line-height: 22.75px;
  }
}


/* ---------- Animations (états posés par reveal.js ; rien n'est masqué sans .has-motion) ---------- */
/* Sans épinglage (téléphone, tablette), chaque projet monte en entrant. */
@media (max-width: 1023px) {
  .has-motion .work-card:not(.is-in) {
    opacity: 0;
    translate: 0 48px;
  }
  .has-motion .work-card {
    transition:
      opacity 0.9s var(--ease-out),
      translate 1.3s var(--ease-expo);
  }
}
