/* Ultra-Minimalist Portfolio Cards Section */
.projects-grid-section {
  width: 100%;
  margin: 0;
  padding: clamp(6rem, 10vw, 8rem) clamp(2rem, 5vw, 4rem);
  background: var(--white);
  position: relative;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
}

.projects-container {
  max-width: 1200px;
  width: 100%;
}

.projects-grid-header {
  margin-bottom: 5rem;
  position: relative;
  z-index: 10;
  text-align: left;
  border-bottom: 1px solid var(--light-grey);
  padding-bottom: 3rem;
}

.section-subtitle,
.projects-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--mid-grey);
  margin-bottom: 1rem;
}

.projects-grid-header h2 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  margin: 0 0 1rem 0;
  letter-spacing: -2px;
  color: var(--dark);
  line-height: 1.1;
}

.projects-grid-header h2 span {
  font-weight: 800;
}

.section-desc {
  font-size: 1.1rem;
  color: var(--color-2); /* Muted blue-grey */
  line-height: 1.6;
  max-width: 600px;
  font-weight: 300;
}

/* Stat Grid System */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
  margin-top: 4rem;
}

/* Stat Card - Modern Compact Design */
.stat-card {
  background: var(--white);
  border: 1px solid var(--light-grey);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  padding: 0;
  border-radius: 14px;
  cursor: pointer;
  height: 420px;
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
  border-color: transparent;
}

/* Image Section - Shorter Top */
.card-banner {
  height: 200px;
  overflow: hidden;
  background: #f8f9fa;
  position: relative;
}

.card-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.stat-card:hover .card-banner img {
  transform: scale(1.06);
}

/* Fallback Abstract Visuals */
.abstract-visual {
  width: 100%;
  height: 100%;
  background: #111; /* Very dark */
  position: relative;
}

.security-visual::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 1px solid #fff;
  border-radius: 50%;
}

.network-visual::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 20px;
  border: 1px solid #fff;
}

/* Card Content - Minimal Bottom Section */
.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--white);
}

.card-tag {
  display: inline-block;
  align-self: flex-start;
  color: var(--color-2);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.card-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-1);
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

/* Card Actions */
.card-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: auto;
  padding-top: 1rem;
}

.btn-read-more {
  flex: 1;
  padding: 0.75rem 1.2rem;
  background: var(--color-1);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-read-more:hover {
  background: #1a1f3a;
  transform: translateY(-1px);
}

.btn-view-demo {
  flex: 1;
  padding: 0.75rem 1.2rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.btn-view-demo:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.coming-soon-badge {
  flex: 1;
  padding: 0.75rem 1.2rem;
  background: #f0f0f0;
  color: #999;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.stat-val {
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
  letter-spacing: -1.5px;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--color-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Responsive Rules */
@media (max-width: 1024px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .stat-card {
    height: 400px;
  }

  .card-body {
    padding: 1.6rem;
  }

  .card-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 768px) {
  .stat-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .stat-card {
    height: auto;
  }

  .card-banner {
    height: 200px;
  }

  .card-body {
    padding: 1.5rem;
  }

  .card-title {
    font-size: 1.3rem;
  }

  .card-desc {
    font-size: 0.9rem;
  }

  .projects-grid-header {
    margin-bottom: 3rem;
  }
}

/* Project Details Modal - Compact & Modern */
.project-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 9999;
  padding: 2rem;
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
}

.project-modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-modal {
  background: var(--white);
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  position: relative;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.project-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  color: var(--color-1);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.project-modal-close:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

.project-modal-content {
  display: flex;
  flex-direction: column;
}

.project-modal-image {
  background: #f8f9fa;
  overflow: hidden;
  height: 240px;
}

.project-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-modal-details {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.modal-project-tag {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.modal-project-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-1);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.modal-project-desc {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  margin: 0;
}

.modal-tech-stack {
  padding-top: 1rem;
  border-top: 1px solid var(--light-grey);
}

.modal-tech-stack h3 {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-2);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0 0 0.8rem 0;
}

.modal-tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  background: var(--grey-bg);
  color: var(--color-1);
  border: 1px solid var(--light-grey);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tech-badge:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}

.modal-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.75rem;
}

.modal-btn-primary {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  background: var(--color-1);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  gap: 0.5rem;
}

.modal-btn-primary:hover {
  background: #1a1f3a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Responsive */
@media (max-width: 768px) {
  .project-modal {
    margin: 1rem;
  }

  .project-modal-image {
    height: 200px;
  }

  .project-modal-details {
    padding: 1.5rem;
  }

  .modal-project-title {
    font-size: 1.4rem;
  }

  .tech-badge {
    font-size: 0.7rem;
    padding: 0.35rem 0.65rem;
  }

  .modal-btn-primary {
    font-size: 0.85rem;
    padding: 0.75rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .project-modal-overlay {
    padding: 0.75rem;
  }

  .project-modal-details {
    padding: 1.25rem;
  }

  .modal-project-title {
    font-size: 1.2rem;
  }

  .modal-actions {
    flex-direction: column;
  }

  .project-modal-image {
    height: 160px;
  }
}
