/* ── Portfolio Showcase ── */

#ps-video-preview {
  position: fixed;
  width: 380px;
  aspect-ratio: 16/10;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform: translate(-50%, -55%) scale(0.9);
  transition:
    opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 4px;
  overflow: hidden;
  /* box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.06); */
}

#ps-video-preview.visible {
  opacity: 1;
  transform: translate(-50%, -55%) scale(1);
}

#ps-video-preview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.15s ease;
}

#ps-video-preview video.active {
  opacity: 1;
}

.ps-wrap {
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ── Top bar: view toggle + filters ── */
.ps-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  gap: 24px;
}

/* ── View toggle ── */
.ps-views {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.ps-view {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
}

.ps-view:hover {
  color: rgba(255, 255, 255, 0.7);
}

.ps-view.active {
  color: #ffffff;
}

/* ── Filter bar ── */
.ps-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.ps-filter {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
}

.ps-filter:hover {
  color: rgba(255, 255, 255, 0.7);
}

.ps-filter.active {
  color: #ffffff;
}

/* ── Grid thumbnail — hidden in list view ── */
.ps-grid-thumb {
  display: none;
}

/* ── Grid view ── */
.ps-list.ps-grid-view {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.ps-list.ps-grid-view .ps-item {
  border: none;
}

.ps-list.ps-grid-view .ps-item:last-child {
  border: none;
}

.ps-list.ps-grid-view .ps-link {
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  gap: 10px;
}

.ps-list.ps-grid-view .ps-grid-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 2px;
}

.ps-list.ps-grid-view .ps-grid-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ps-list.ps-grid-view .ps-name {
  font-size: clamp(16px, 1.6vw, 24px);
  white-space: normal;
  line-height: 1.1;
  letter-spacing: -1px;
}

.ps-list.ps-grid-view .ps-type {
  display: block;
  font-size: 10px;
  opacity: 1;
}

/* No hover dimming in grid view */
.ps-list.ps-grid-view:has(.ps-item:hover) .ps-item:not(:hover) .ps-name,
.ps-list.ps-grid-view:has(.ps-item:hover) .ps-item:not(:hover) .ps-type {
  opacity: 0.2;
}

/* ── Project list ── */
.ps-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ps-item {
  border-top: 1px solid rgba(240, 236, 228, 0.18);
  transition: opacity 0.3s ease;
}

.ps-item:last-child {
  border-bottom: 1px solid rgba(240, 236, 228, 0.18);
}

.ps-item.ps-hidden {
  display: none;
}

.ps-item.ps-fading {
  opacity: 0;
}

.ps-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  text-decoration: none;
  color: inherit;
  gap: 40px;
}

.ps-name {
  font-weight: normal;
  font-size: clamp(24px, 3.4vw, 50px);
  line-height: 1;
  letter-spacing: -2.5px;
  color: #ffffff;
  opacity: 1;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

/* Dim non-hovered rows */
.ps-list:has(.ps-item:hover) .ps-item:not(:hover) .ps-name,
.ps-list:has(.ps-item:hover) .ps-item:not(:hover) .ps-type {
  opacity: 0.2;
}

.ps-item:hover .ps-name,
.ps-item:hover .ps-type {
  opacity: 1;
}

.ps-type {
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #ffffff;
  opacity: 1;
  flex-shrink: 0;
  transition: opacity 0.3s ease;
}

.ps-video-mobile {
  display: none;
}

.ps-type-mobile {
  display: none;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  #ps-video-preview {
    display: none !important;
  }

  .ps-type {
    display: none;
  }

  .ps-views {
    display: none;
  }

  /* Full-width scrollable filter bar on mobile */
  .ps-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding-bottom: 0;
  }

  .ps-filters {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .ps-filters::-webkit-scrollbar {
    display: none;
  }

  .ps-filter {
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 20px 8px 0;
  }

  .ps-filter:first-child {
    padding-left: 0;
  }

  /* Remove top border from first item so there's no double line */
  .ps-item:first-child {
    border-top: none;
  }

  .ps-video-mobile {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 2px;
  }

  .ps-type-mobile {
    display: block;
    font-size: 11px;
    letter-spacing: 0;
    text-transform: uppercase;
    color: rgba(255,255,255,1);
  }

  .ps-link {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 0 28px;
    gap: 10px;
  }

  .ps-name {
    font-size: 24px;
    white-space: normal;
    line-height: normal;
    font-weight: bold;
    letter-spacing: -1px;
  }

  .ps-list:has(.ps-item:hover) .ps-item:not(:hover) .ps-name {
    opacity: 1;
  }
}