:root {
  --primary: #0073ff;
  --primary-hover: #005ed6;
  --bg-page: #ffffff;
  --card-bg: #ffffff;
  --text: #333;
  --text-light: #666;
  --radius: 16px;
  --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.05);
  --gold: #FFD700;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 40px 20px;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-page);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  background-color: rgba(240,240,240,0.95);
  padding: 40px 25px;
  border-radius: 25px;
  width: 100%;
  max-width: 1000px;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
}

.header {
  text-align: center;
  margin-bottom: 40px;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
  font-weight: 800;
  letter-spacing: -1px;
}

.highlight {
  color: var(--primary);
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 25px;
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 25px;
}


.project-card {
  background: var(--card-bg);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  width: 280px;
  flex-grow: 1;
  max-width: 350px;
  position: relative;
  border: 2px solid transparent;
}

.project-card.pinned {
  border: 2px solid var(--gold);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
  overflow: visible;
  z-index: 1;
}

.pin-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gold), #FDB931);
  color: #333;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 10;
  white-space: nowrap;
  border: 1px solid #fff;
  letter-spacing: 0.5px;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 115, 255, 0.15);
}

.project-card.pinned:hover {
  box-shadow: 0 10px 25px rgba(255, 215, 0, 0.3);
}

.card-image-header {
  height: 160px;
  background-size: cover;
  background-position: center;
  background-color: #e0e0e0;
  border-top-left-radius: 13px;
  border-top-right-radius: 13px;
}

.card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.card-content h3 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
}

.card-content p {
  margin: 0 0 20px 0;
  color: var(--text-light);
  font-size: 0.9rem;
  flex: 1;
  text-align: center;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 115, 255, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-link {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  background-color: #e6f0ff;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.btn-link:hover {
  background-color: #d0e1ff;
}

.btn-details {
  flex: 1;
  border: 1px solid #ddd;
  background: transparent;
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-details:hover {
  border-color: var(--primary);
  color: var(--primary);
}

footer {
  text-align: center;
  padding-top: 40px;
  color: #999;
  font-size: 0.85rem;
}


.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background-color: #fff;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  border-radius: 20px;
  padding: 30px;
  position: relative;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: scale(0.95);
  transition: transform 0.3s ease;
  text-align: center;
}

.modal.active .modal-content {
  transform: scale(1);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #ccc;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 10;
}

.close-modal:hover {
  color: #333;
}

.modal-hint {
  font-size: 0.85rem;
  color: var(--primary);
  background-color: #e6f0ff;
  display: inline-block;
  padding: 5px 15px;
  border-radius: 20px;
  margin-bottom: 15px;
  font-weight: 600;
}

.modal-gallery {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 20px 0;
}

.modal-figure {
  margin: 0;
  width: 100%;
}

.modal-gallery img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  cursor: zoom-in;
  transition: transform 0.2s;
}

.modal-gallery img:hover {
  transform: scale(1.02);
}

.modal-figure figcaption {
  text-align: center;
  margin-top: 8px;
  color: var(--text-light);
  font-size: 0.9rem;
  font-style: italic;
}

.modal-desc {
  text-align: center;
  margin-top: 20px;
  line-height: 1.7;
}

.modal-footer {
  margin-top: 20px;
  text-align: center;
}


.lightbox {
  display: none;
  position: fixed;
  z-index: 3000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: zoom-out;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox img {
  max-width: 95%;
  max-height: 95%;
  border-radius: 5px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  object-fit: contain;
}

@media (max-width: 600px) {
  body { padding: 10px; }
  .container { padding: 30px 15px; border-radius: 20px; }
  h1 { font-size: 1.8rem; }
  .project-card { width: 100%; margin-top: 15px; }
}