/* ── 04 · Projects we draw for ────────────────────────────
   Dark section. A list of 12 project types; on desktop, hover/focus swaps a sticky
   photo preview. On tablets and phones each row shows a thumbnail instead. */
.proj { position: relative; isolation: isolate; overflow: clip; padding-block: var(--msp-section-y); background: var(--msp-secondary); color: var(--msp-on-dark-muted); }
.proj::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(rgb(255 255 255 / .045) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .045) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(60% 50% at 90% 0%, #000, transparent 75%);
  mask-image: radial-gradient(60% 50% at 90% 0%, #000, transparent 75%);
}
.proj__head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: end; gap: clamp(28px, 5vw, 96px); }
.proj__title { margin-top: 20px; font-size: var(--msp-fs-h2); line-height: 1.04; letter-spacing: -.01em; color: #fff; }
.proj__lead { max-width: 48ch; font-size: var(--msp-fs-lead); line-height: 1.6; }

.proj__body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; gap: clamp(32px, 5vw, 80px); margin-top: clamp(48px, 5vw, 80px); }
.proj__list { border-top: 1px solid var(--msp-on-dark-line); }

.proj-row {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: 40px 48px minmax(0, 1fr) 46px; align-items: center; gap: 18px;
  padding: 18px 12px 18px 6px;
  border-bottom: 1px solid var(--msp-on-dark-line);
  color: #fff;
}
.proj-row::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgb(155 213 5 / .12), rgb(155 213 5 / 0) 85%);
  transform: scaleX(0); transform-origin: left;
  transition: transform .6s var(--msp-ease-out);
}
.proj-row__num { font-size: 14px; font-weight: 500; color: #7C8893; font-variant-numeric: tabular-nums; transition: color .3s; }
.proj-row__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: rgb(255 255 255 / .06); color: #fff; transition: background-color .35s, color .35s; }
.proj-row__icon .icon { width: 24px; height: 24px; }
.proj-row__thumb { display: none; }
.proj-row__text { min-width: 0; }
.proj-row__name { display: block; font-size: clamp(1.375rem, 1.1rem + .9vw, 1.875rem); line-height: 1.15; color: #fff; transition: transform .45s var(--msp-ease-out); }
.proj-row__note { display: block; margin-top: 5px; font-size: 14.5px; line-height: 1.45; color: var(--msp-on-dark-muted); transition: transform .45s var(--msp-ease-out); }
.proj-row__arrow { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid rgb(255 255 255 / .18); border-radius: 50%; color: #fff; transition: background-color .35s, border-color .35s, color .35s; }
.proj-row__arrow .icon { width: 18px; height: 18px; transition: transform .45s var(--msp-ease-inout); }

/* Hover / keyboard focus everywhere; the persistent "active" row only matters next to the preview. */
.proj-row:hover::before, .proj-row:focus-visible::before { transform: scaleX(1); }
.proj-row:hover .proj-row__arrow, .proj-row:focus-visible .proj-row__arrow { background: var(--msp-primary); border-color: var(--msp-primary); color: var(--msp-secondary); }
.proj-row:hover .proj-row__arrow .icon, .proj-row:focus-visible .proj-row__arrow .icon { transform: rotate(45deg); }
@media (min-width: 1024px) {
  .proj-row.is-active::before { transform: scaleX(1); }
  .proj-row.is-active .proj-row__num { color: var(--msp-primary); }
  .proj-row.is-active .proj-row__icon { background: var(--msp-primary); color: var(--msp-secondary); }
  .proj-row.is-active .proj-row__name, .proj-row.is-active .proj-row__note { transform: translateX(6px); }
  .proj-row.is-active .proj-row__arrow { background: var(--msp-primary); border-color: var(--msp-primary); color: var(--msp-secondary); }
  .proj-row.is-active .proj-row__arrow .icon { transform: rotate(45deg); }
}

/* Sticky preview */
.proj__preview { position: sticky; top: calc(var(--msp-header-h) + 24px); }
.proj-preview { position: relative; overflow: hidden; aspect-ratio: 4 / 5; border-radius: var(--msp-radius-lg); background: var(--msp-secondary-2); }
.proj-preview::after { content: ""; position: absolute; inset: 18px; z-index: 2; border: 1.5px dashed rgb(255 255 255 / .38); border-radius: 14px; pointer-events: none; }
.proj-preview__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity .6s ease, transform 1.4s var(--msp-ease-out); }
.proj-preview__img.is-active { opacity: 1; transform: none; }
.proj-preview__cap {
  position: absolute; inset: auto 0 0 0; z-index: 1;
  padding: 120px 40px 40px;
  background: linear-gradient(180deg, rgb(8 17 25 / 0) 0%, rgb(8 17 25 / .88) 70%);
  color: #fff;
  transition: opacity .3s ease;
}
.proj-preview__cap.is-swapping { opacity: 0; }
.proj-preview__num { display: inline-flex; padding: 6px 12px; border-radius: var(--msp-radius-pill); background: var(--msp-primary); color: var(--msp-secondary); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.proj-preview__name { margin-top: 16px; font-size: var(--msp-fs-h3); line-height: 1.1; }
.proj-preview__label { margin-top: 14px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--msp-primary); }
.proj-preview__note { margin-top: 4px; font-size: 16px; line-height: 1.5; color: rgb(255 255 255 / .86); }

/* Footer row */
.proj__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 14px; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--msp-on-dark-line); }
.proj__foot p { flex: 1 1 360px; font-size: 17px; line-height: 1.5; }
.proj__foot-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.proj__foot strong { font-weight: 500; color: #fff; }

@media (max-width: 1023px) {
  .proj__head, .proj__body { grid-template-columns: 1fr; }
  .proj__head { align-items: start; }
  .proj__preview { display: none; }
  .proj-row { grid-template-columns: 64px minmax(0, 1fr) 40px; gap: 16px; padding: 14px 0; }
  .proj-row__num, .proj-row__icon { display: none; }
  .proj-row__thumb { display: block; width: 64px; height: 64px; overflow: hidden; border-radius: 14px; background: var(--msp-secondary-2); }
  .proj-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
  .proj-row__name { font-size: 20px; }
  .proj-row__note { font-size: 14px; }
  .proj-row__arrow { width: 40px; height: 40px; }
}
@media (max-width: 1023px) {
  .proj__foot p { flex-basis: 100%; }
}
@media (max-width: 639px) {
  .proj__foot-actions { width: 100%; }
  .proj__foot .btn { flex: 1 1 100%; }
  .proj__foot .btn--icon { justify-content: space-between; padding-left: 26px; }
}
