.projects-grid-shell {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

.projects-grid-shell::before,
.projects-grid-shell::after {
  content: "";
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: var(--space-md);
  width: clamp(48px, 6vw, 96px);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.projects-grid-shell::before {
  left: 0;
  background: linear-gradient(to right, var(--surface-dark), transparent);
}

.projects-grid-shell::after {
  right: 0;
  background: linear-gradient(to left, var(--surface-dark), transparent);
}

.projects-grid-shell.is-at-start::before,
.projects-grid-shell.is-at-end::after {
  opacity: 0;
}

.projects-grid {
  display: flex;
  gap: var(--space-md);
  margin: 0;
  padding: 0 max(24px, calc((100vw - var(--wide-content-width)) / 2 + 24px)) var(--space-md);
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  scrollbar-color: var(--surface-dark-elevated) transparent;
  scrollbar-width: thin;
  scroll-padding-inline: max(24px, calc((100vw - var(--wide-content-width)) / 2 + 24px));
  scroll-snap-type: inline mandatory;
  overscroll-behavior-inline: contain;
  touch-action: pan-x pan-y;
}

.projects-grid.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.projects-grid::-webkit-scrollbar {
  height: 6px;
}

.projects-grid::-webkit-scrollbar-track {
  background: transparent;
}

.projects-grid::-webkit-scrollbar-thumb {
  border-radius: var(--radius-pill);
  background: var(--surface-dark-elevated);
}

.projects-grid::-webkit-scrollbar-button {
  display: none;
}

.project-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex: 0 0 clamp(340px, 32vw, 440px);
  flex-direction: column;
  justify-content: space-between;
  width: clamp(340px, 32vw, 440px);
  aspect-ratio: 1 / 1.1;
  padding: var(--space-lg);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface-dark-elevated);
  color: var(--on-dark);
  scroll-snap-align: start;
  -webkit-user-drag: none;
}

.project-card:active {
  background: var(--surface-dark-soft);
}

.project-card-art {
  position: absolute;
  z-index: -3;
  inset: 0 0 auto;
  width: 100%;
  max-width: none;
  height: 64%;
  object-fit: cover;
  -webkit-user-drag: none;
}

.project-card-shade {
  position: absolute;
  z-index: -2;
  inset: 0;
  background: linear-gradient(to bottom, rgba(37, 35, 32, 0) 38%, var(--surface-dark-elevated) 64%);
}

.project-card-top {
  display: flex;
  align-items: flex-start;
}

.project-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  line-height: 1.4;
  text-transform: uppercase;
}

.project-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-soft);
}

.project-status--active::before {
  background: var(--success);
}

.project-status--dormant::before {
  background: var(--muted-soft);
}

.project-status--complete::before {
  background: var(--accent-amber);
}

.project-card-copy {
  display: grid;
  gap: var(--space-sm);
}

.project-card-copy > p {
  display: -webkit-box;
  max-width: 38ch;
  min-height: calc(3 * 1.55em);
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--on-dark-soft);
  font-size: 14px;
  line-height: 1.55;
}

.project-card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  order: -1;
}

.project-card-heading h4 {
  min-width: 0;
  margin: 0;
  color: var(--on-dark);
  font-size: 36px;
  line-height: 1.1;
}

.project-card-heading time {
  flex: 0 0 auto;
  color: var(--on-dark-soft);
  font-size: 13px;
  font-weight: 500;
}

@media (max-width: 768px) {
  .projects-grid {
    padding: 0 16px var(--space-md);
    scroll-padding-inline: 16px;
  }

  .project-card {
    flex-basis: min(86vw, 360px);
    width: min(86vw, 360px);
    padding: 20px;
  }

  .project-card-heading h4 {
    font-size: 32px;
  }
}
