body {
  background: #000;
  color: #fff;
  font-family: "Hanken Grotesk", sans-serif;
}

/* When lightbox is open, disable page scroll */
body.modal-open {
  overflow: hidden;
}

/* Push main content below fixed navbar */
main {
  padding-top: 90px;
  min-height: 100vh;
}

/* Portfolio section spacing */
.portfolio {
  padding: 40px 0 120px;
  overflow: visible;
}

/* Allow scaled tiles not to clip */
.portfolio-scroll {
  overflow-x: auto; /* ✅ trackpad works */
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;

  scrollbar-width: none;
  -ms-overflow-style: none;
}
.portfolio-scroll::-webkit-scrollbar {
  height: 0;
}
/* On this page, let thumbs overflow so scaled media can leave the box */
.portfolio .thumb {
  overflow: visible;
}

/* Ensure BOTH img and video look identical inside tiles */
.thumb img,
.thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* change to contain if you want no crop */
  display: block;
  opacity: 0.9;
  border-radius: inherit;
}

/* Portfolio header */
.portfolio-header {
  text-align: center;
  margin-bottom: 60px;
}
.portfolio-header h2 {
  font-size: 63px;
  font-weight: 400;
  letter-spacing: 1px;
}
.portfolio-header p {
  font-size: 24px;
  font-weight: 300;
  opacity: 0.85;
}

/* ===== Tiles ===== */
.portfolio .portfolio-item {
  position: relative;
  transition: transform 0.25s ease;
}

.portfolio .portfolio-item .thumb {
  position: relative;
  z-index: 1;
}

.portfolio .portfolio-item h3 {
  position: relative;
  z-index: 6;
}

/* Hover enlarge (restores “like before”) */
.portfolio .portfolio-item:hover .thumb {
  transform: scale(1.08);
  filter: brightness(1.15) saturate(1.2);
}
.portfolio .portfolio-item:hover .thumb img,
.portfolio .portfolio-item:hover .thumb video {
  opacity: 1;
}

/* ===== Click selection ===== */
.portfolio .portfolio-item.selected {
  position: relative;
  z-index: 5;
}

.portfolio .portfolio-item.selected .thumb {
  transform: scale(1.2);
  filter: brightness(1.2) saturate(1.2);
  border-radius: 0;
  transition:
    transform 0.25s ease,
    filter 0.25s ease,
    border-radius 0.25s ease;
}

.portfolio .portfolio-item.selected:hover .thumb {
  transform: scale(1.25);
}

.portfolio .portfolio-item.selected h3 {
  font-size: 28px;
  margin-top: 28px;
}

.portfolio.has-selection .portfolio-item:not(.selected) .thumb {
  transform: scale(0.9);
  filter: brightness(0.9) saturate(0.95);
  transition:
    transform 0.25s ease,
    filter 0.25s ease;
}

.portfolio.has-selection .portfolio-item:not(.selected):hover .thumb {
  transform: scale(1);
  filter: brightness(1.05) saturate(1.05);
}

.portfolio.has-selection .portfolio-item:not(.selected) h3 {
  opacity: 0.8;
  transition:
    opacity 0.2s ease,
    font-size 0.2s ease,
    margin-top 0.2s ease;
}

/* ===== Project grids ===== */
.portfolio-projects {
  max-width: 1400px;
  margin: 70px auto 0;
  padding: 0 10px;
  display: none;
}

.portfolio-projects.active {
  display: block;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 1100px) {
  .projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 800px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.project-item {
  background: #000;
}

/* Thumbs forced 16:9 like before */
.project-thumb {
  position: relative;
  overflow: hidden;
  background: #000;
  border-radius: 0;
  aspect-ratio: 16 / 9;
  cursor: pointer;
}

.project-thumb img,
.project-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.95;
  transition:
    transform 0.35s ease,
    opacity 0.35s ease,
    filter 0.35s ease;
}

.project-thumb:hover img,
.project-thumb:hover video {
  transform: scale(1.12);
  opacity: 1;
  filter: brightness(1.05);
}

/* Top / bottom fades */
.project-fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 0;
}

.project-fade.top {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0.35) 10%,
    rgba(0, 0, 0, 0.15) 20%,
    rgba(0, 0, 0, 0) 32%
  );
}

.project-fade.bottom {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.45) 12%,
    rgba(0, 0, 0, 0.2) 24%,
    rgba(0, 0, 0, 0) 40%
  );
}

/* ===== Lightbox ===== */
.project-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.project-lightbox.open {
  display: flex;
  pointer-events: auto;
}

.project-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.project-lightbox-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  width: 92%;
  max-height: 92vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.project-lightbox-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.project-lightbox-inner {
  position: relative;
  width: 100%;
  padding: 20px 0;
}

.project-lightbox-inner img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.project-lightbox-inner video {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .project-lightbox-content {
    max-width: 100%;
    width: 96%;
  }
}
