.project-back {
  padding: 1rem 2rem;
  padding-top: calc(var(--nav-h) + 1rem);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.back-link {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.82rem;
  transition: opacity 0.2s;
}

.back-link:hover {
  opacity: 0.7;
}

.project-nav-title {
  color: var(--text-3);
  font-family: var(--font-display);
  font-size: 0.82rem;
}

.project-hero {
  position: relative;
  width: 100%;
  min-height: 55vh;
  overflow: hidden;
  z-index: 1;
}

.project-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
}

.project-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3rem 2rem;
  background: linear-gradient(transparent, rgba(10, 10, 10, 0.95));
  z-index: 1;
}

.project-hero-overlay .project-category {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.project-hero-overlay h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 0.5rem;
}

.project-short-desc {
  color: var(--text-2);
  max-width: 600px;
  line-height: 1.6;
}

.project-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem;
  position: relative;
  z-index: 1;
}

.project-content h3 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.05em;
}

.project-overview {
  margin-bottom: 3rem;
}

.project-overview p {
  color: var(--text-2);
  line-height: 1.8;
  font-size: 1rem;
  white-space: pre-line;
}

.project-tools {
  margin-bottom: 3rem;
}

.tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tools-list .tag {
  font-family: var(--font-display);
  font-size: 0.68rem;
  padding: 5px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-2);
}

.project-gallery {
  margin-bottom: 3rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.gallery-item {
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: border-color 0.3s;
}

.gallery-item:hover {
  border-color: var(--accent);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s var(--ease);
}

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

.gallery-caption {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 0;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-display);
  background: var(--surface);
}

.project-wireframe {
  margin-bottom: 3rem;
}

.project-wireframe img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.project-textures {
  margin-bottom: 3rem;
}

.texture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.texture-item {
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.3s;
}

.texture-item:hover {
  border-color: var(--accent);
}

.texture-item img {
  width: 100%;
  height: auto;
  display: block;
}

.texture-label {
  font-family: var(--font-display);
  font-size: 0.68rem;
  color: var(--text-3);
  text-transform: uppercase;
  padding: 0.5rem;
  background: var(--surface);
}

.wip-section {
  text-align: center;
  padding: 4rem 2rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  margin-top: 2rem;
  position: relative;
}

.wip-section::before {
  content: attr(data-number);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 12rem;
  color: var(--text);
  opacity: 0.03;
  pointer-events: none;
  line-height: 1;
}

.wip-section h3 {
  border: none;
  padding: 0;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.wip-section p {
  color: var(--text-2);
  max-width: 480px;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
}

.wip-section .wip-link {
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--accent);
  padding: 10px 24px;
  border: 1px solid var(--accent);
  display: inline-block;
  transition: background 0.3s, color 0.3s;
}

.wip-section .wip-link:hover {
  background: var(--accent);
  color: var(--bg);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  cursor: zoom-out;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  font-family: var(--font-display);
}

.lightbox-close:hover {
  color: var(--accent);
}

@media (max-width: 768px) {
  .project-back {
    padding: 0.75rem 1rem;
    padding-top: calc(var(--nav-h) + 0.75rem);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .project-hero {
    min-height: 40vh;
  }

  .project-hero-overlay {
    padding: 2rem 1rem;
  }

  .project-content {
    padding: 2rem 1rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .texture-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .wip-section::before {
    font-size: 6rem;
  }
}

.project-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  text-decoration: none;
  transition: opacity 0.2s;
  min-width: 0;
}

.pagination-link:hover {
  opacity: 0.7;
}

.pagination-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pagination-label {
  font-family: var(--font-display);
  font-size: 0.55rem;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pagination-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pagination-arrow {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent);
  flex-shrink: 0;
}

.pagination-prev {
  justify-content: flex-start;
}

.pagination-next {
  justify-content: flex-end;
  text-align: right;
}

.pagination-home {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--text-2);
  letter-spacing: 0.05em;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color 0.2s, color 0.2s;
}

.pagination-home:hover {
  border-color: var(--accent);
  color: var(--text);
}

.pagination-spacer {
  flex: 1;
}

@media (max-width: 768px) {
  .project-pagination {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  .pagination-spacer {
    display: none;
  }

  .pagination-prev,
  .pagination-next {
    width: 100%;
  }

  .pagination-home {
    order: -1;
  }
}
