.heroWork {
  text-align: center;
}
.heroWork p {
  margin: 0 auto;
}

.works {
  position: relative;
  background: var(--sk-color-bg-warm);
}

/* Slide panel: unchanged behaviour (one screen tall, pinned by work.js) */
.work {
  /* Card width: capped by screen height too, so the whole card
     always fits inside one screen (panels clip anything taller). */
  --drag-card-w: min(940px, 92vw, calc((100vh - 6rem) / 0.72));

  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh; /* lock height if content fits */
  height: 100dvh;
  position: relative;
  overflow: hidden;
  display: flex;
  padding: 2.5rem 0;
  flex-direction: column;
  justify-content: center;
  transform-origin: center center;
  will-change: transform, opacity;
  background: transparent;
}

@supports (height: 100dvh) {
  .work {
    --drag-card-w: min(940px, 92vw, calc((100dvh - 6rem) / 0.72));
  }
}

/* Card: design comes from portfolio.css; these only place it in the panel
   and undo the panel's centred text / paragraph margins. */
.work .drag-card {
  flex: none;
  width: var(--drag-card-w);
  margin: 0 auto;
  text-align: left;
}

.work .drag-card p {
  margin: 0;
}

.work .drag-card-title {
  text-transform: unset;
  font-weight: 700;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0;
}

.work .drag-card-tag {
  display: inline-block;
  margin-bottom: 0.75rem;
}

.work .drag-card-tags {
  flex-wrap: wrap;
  margin: 0.9rem 0 1.15rem;
}

/* Phones and small screens: keep the whole card inside one screen */
@media (max-width: 768px) {
  .work {
    --drag-card-w: 92vw;
    padding: 4.5rem 0 1.5rem;
  }

  .work .drag-card-media {
    aspect-ratio: 16 / 9;
  }

  .work .drag-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .work .drag-card-result {
    display: none;
  }
}
