/* Reference projects — rid-energy.uz
 *
 * The same photographic tile as the services wall, with three differences that
 * follow from what these are:
 *
 *   16/9, not 4/3   every one of these is a 1920x1080 render, so a 4/3 frame
 *                   would crop a third of each image away for no reason.
 *   figure/figcaption  the caption is the project's name, which is content,
 *                   not chrome — and the photo viewer reads <figcaption>
 *                   directly, so the name never has to be repeated in a
 *                   data- attribute.
 *   no link         a service card is a lead and goes to the contact form.
 *                   A reference project goes nowhere; it opens in the viewer,
 *                   and lightbox.js supplies the zoom-in cursor itself.
 */

.projects-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.proj {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 4px;
  background: #0b1218;
  isolation: isolate;
  transition: transform .28s cubic-bezier(.2, .7, .3, 1), box-shadow .28s ease;
}

.proj__shot {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.proj__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.001);            /* kills the 1px edge crawl on scale */
  transition: transform .5s cubic-bezier(.2, .7, .3, 1);
}

/* Sized to the caption rather than the whole tile: these are architectural
   renders and dimming the sky costs more than it buys. */
.proj__label {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: flex-end;
  min-height: 46%;
  padding: 20px 18px 16px;
  background: linear-gradient(to top,
              rgba(6, 11, 15, .92) 0%,
              rgba(6, 11, 15, .70) 40%,
              rgba(6, 11, 15, 0) 100%);
  transition: background .28s ease;
  pointer-events: none;               /* the click belongs to the image */
}

.proj__title {
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.01em;
  text-wrap: balance;
}

/* The live rail, same signal as the service cards: zero width at rest. */
.proj::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: #0066ff;
  transition: width .38s cubic-bezier(.2, .7, .3, 1);
  z-index: 2;
}

.proj:hover,
.proj:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px -12px rgba(0, 0, 0, .7);
}
.proj:hover .proj__shot img,
.proj:focus-within .proj__shot img { transform: scale(1.05); }

.proj:hover .proj__label,
.proj:focus-within .proj__label {
  background: linear-gradient(to top,
              rgba(4, 9, 13, .95) 0%,
              rgba(4, 9, 13, .76) 44%,
              rgba(4, 9, 13, .08) 100%);
}

.proj:hover::after,
.proj:focus-within::after { width: 100%; }

/* lightbox.js puts tabindex on the image, so the ring has to sit on the image
   rather than the figure — the figure is never the focused element. */
.proj .proj__shot img:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px #0066ff;
}

@media (max-width: 575px) {
  .projects-wall { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
  .proj__label { padding: 16px 14px 14px; min-height: 52%; }
  .proj__title { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .proj, .proj__shot img, .proj__label, .proj::after { transition: none; }
  .proj:hover { transform: none; }
  .proj:hover .proj__shot img { transform: scale(1.001); }
}
