#work {
  padding: 0;
  max-width: 1400px;
  margin: 0 auto;
}

.category-content {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 40px 20px;
  background: rgba(255, 255, 255, 0.98);
  opacity: 0.9;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.category-description {
  text-align: center;
  max-width: 600px;
  min-height: 120px;
  position: relative;
}

.category-description .description {
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0s linear 0.5s;
}

.category-description .description.active {
  position: relative;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

@keyframes categoryFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes categoryFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.category-tag {
  display: inline-block;
  font-family: "font", system-ui;
  font-size: 2.2rem;
  margin-bottom: 8px;
  color: #ffffff !important;
  background-color: #0f131d00 !important;
  letter-spacing: 0.5px;
}

.category-description p {
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 300;
  letter-spacing: 0.2px;
}

.work-filters {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
  position: relative;
}

.filter-btn {
  padding: 6px 12px;
  border: none;
  background: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 0.95rem;
  position: relative;
  transition: color 0.3s ease;
}

.filter-btn::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.filter-btn:hover {
  color: #111827;
}

.filter-btn:hover::after {
  transform: scaleX(1);
}

.filter-btn.active {
  color: #111827;
}

.filter-btn.active::after {
  transform: scaleX(1);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: 0 20px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 3/5;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: white;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .item-overlay {
  opacity: 1;
}

.item-overlay h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-family: "font", system-ui;
}

.item-overlay p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

@media (max-width: 480px) {
  #work {
    padding: 60px 16px;
    margin-top: -120px;
    z-index: 1;
  }

  .category-content {
    gap: 20px;
    margin-bottom: 32px;
  }

  .category-tag {
    font-size: 1.5rem;
  }

  .work-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0;
  }

  .gallery-item {
    aspect-ratio: 4/3;
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .work-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    padding: 16px;
  }

  .filter-btn {
    padding: 8px 20px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .work-filters {
    gap: 8px;
    margin: 0;
  }

  .filter-btn {
    padding: 6px 16px;
    font-size: 0.85rem;
  }

  .work-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .item-overlay h3 {
    font-size: 1.1rem;
  }

  .item-overlay p {
    font-size: 0.85rem;
  }
}

.category-gallery.single-row {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-gallery.single-row::-webkit-scrollbar {
  display: none;
}

.category-gallery.single-row .gallery-item {
  flex: 0 0 280px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  aspect-ratio: 3/4;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Work section animations */
.gallery-item {
  opacity: 0;
  transform-style: preserve-3d;
  perspective: 1000px;
  transform: rotateX(-15deg) translateZ(-100px);
  transition: all 3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: itemReveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(var(--item-index, 0) * 0.15s);
}

.gallery-item.hidden {
  opacity: 0;
  transform: rotateX(-25deg) translateZ(-200px);
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes itemReveal {
  0% {
    opacity: 0;
    transform: rotateX(-15deg) translateZ(-100px);
  }

  100% {
    opacity: 1;
    transform: rotateX(0) translateZ(0);
  }
}

/* Category description transitions */
.category-description {
  min-height: 120px;
  position: relative;
}

.category-description .description {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.4s ease;
}

.category-description .description.active {
  opacity: 1;
  transform: translateY(0);
}

/* Animation keyframes */
@keyframes itemAppear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .work-category {
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 60px;
  }

  .category-title {
    position: static;
    font-size: 1.25rem;
  }

  .category-gallery {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
  }
}