* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  padding: 20px;
  min-height: 100vh;
}

.page {
  max-width: 1400px;
  margin: 0 auto;
}

.page__head {
  background: rgba(255,255,255,0.95);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 30px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.back-btn {
  background: #2c3e50;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  margin-bottom: 20px;
  font-size: 16px;
  transition: 0.3s;
}

.back-btn:hover {
  background: #1a2a3a;
}

.toolbar {
  background: rgba(255,255,255,0.9);
  border-radius: 15px;
  padding: 15px 20px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.tool-btn {
  background: #2c3e50;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 25px;
  cursor: pointer;
  transition: 0.3s;
}

.tool-btn:hover {
  background: #1a2a3a;
}

.loader {
  font-weight: bold;
  color: #2c3e50;
}

.projects-container.grid-view .projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
}

.projects-container.list-view .projects-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background-color: #e9ecef;
  display: block;
}

.project-info {
  padding: 20px;
  flex: 1;
}

.project-info h3 {
  font-size: 22px;
  margin-bottom: 10px;
  color: #1e3c72;
}

.project-info p {
  margin: 8px 0;
  color: #555;
  font-size: 15px;
  line-height: 1.5;
}

.project-info strong {
  color: #2c3e50;
}

.list-view .project-card {
  flex-direction: row;
  align-items: stretch;
}

.list-view .project-card img {
  width: 280px;
  aspect-ratio: 16 / 9;
  height: auto;
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: 0.3s;
}

.lightbox.is-open {
  visibility: visible;
  opacity: 1;
}

.lightbox__toolbar {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 15px;
}

.lightbox__close, .lightbox__ctrl {
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  transition: 0.3s;
}

.lightbox__close:hover, .lightbox__ctrl:hover {
  background: rgba(255,255,255,0.4);
  transform: scale(1.1);
}

.lightbox__nav {
  position: absolute;
  bottom: 30px;
  display: flex;
  gap: 30px;
  align-items: center;
  background: rgba(0,0,0,0.6);
  padding: 10px 20px;
  border-radius: 50px;
  color: white;
}

.lightbox__nav button {
  background: none;
  border: none;
  color: white;
  font-size: 36px;
  cursor: pointer;
  width: 50px;
  transition: 0.3s;
}

.lightbox__nav button:hover {
  transform: scale(1.2);
}

.lightbox__img {
  max-width: 90%;
  max-height: 85%;
  object-fit: contain;
}

footer {
  text-align: center;
  margin-top: 40px;
  color: white;
  padding: 20px;
}

@media (max-width: 768px) {
  .projects-container.grid-view .projects-grid {
    grid-template-columns: 1fr;
  }
  .list-view .project-card {
    flex-direction: column;
  }
  .list-view .project-card img {
    width: 100%;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .page__head h1 {
    font-size: 24px;
  }
}