.works-section {
  background: var(--works-bg);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-bottom: 60px;
  padding-top: 10px;
   background: linear-gradient(to bottom, #292c30 0%, #242b3a 100%);
}

.facts-grid-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2vw 60px 2vw;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.facts-section-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 32px;
  text-align: center;
  letter-spacing: 0.015em;
}

.facts-card:active {
  transform: scale(0.98);
  box-shadow: 0 0 12px rgba(86, 211, 100, 0.2);
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
   gap: 16px;
  width: 100%;
  min-width: 0;
  align-items: stretch;
  justify-items: stretch;
  margin: 0 auto;
}

/* Center the last two cards in the last row */
.facts-card.last-row-center {
  grid-column: span 2;
  justify-self: center;
  width: 90%;
}

/* If you want even more visual centering, you can use nth-child: */
.facts-grid > .facts-card:nth-child(9) {
  grid-column: 2 / 3;
  grid-row: 3 / 4;
}
.facts-grid > .facts-card:nth-child(10) {
  grid-column: 3 / 4;
  grid-row: 3 / 4;
}

/* Card Styling */
.facts-card {
  background: rgba(255,255,255,0.07);
  border-radius: 18px;
  border: 1.5px solid rgba(255,255,255,0.10);
  box-shadow: 0 6px 32px 0 rgba(80,90,120,0.07);
  display: flex;
  flex-direction: column;
  align-items: center;    /* Center horizontally */
  justify-content: center;/* Center vertically */
  min-height: 155px;
  padding: 34px 32px;
  position: relative;
  transition: box-shadow 0.19s, transform 0.14s;
  min-width: 0;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;     /* Center text inside */
}

.facts-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.facts-card:hover {
  box-shadow: 0 16px 40px 0 rgba(86,211,100,0.12);
  transform: translateY(-5px) scale(1.035);
}

.facts-number {
  font-size: 2.9rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 7px;
  min-height: 42px;
  line-height: 1.02;
}

.facts-card-title {
   color: #eaeaea;
  font-size: 1.21rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.facts-card-sub {
  color: var(--subtle);
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 0;
  line-height: 1.1;
}

/* Responsive: Tablet */
@media (max-width: 1200px) {
  .facts-grid-container {
    max-width: 98vw;
    padding: 0 12px 36px 12px;
  }
  .facts-grid {
    gap: 22px 16px;
  }
}

@media (max-width: 900px) {
  .facts-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 16px;
  }
  .facts-card.last-row-center {
    grid-column: span 1 !important;
    width: 100%;
    justify-self: stretch;
  }
}

@media (max-width: 600px) {
  .facts-grid-container {
    max-width: 100vw;
    padding: 0 4vw 24px 4vw;
  }
  .facts-section-title {
    font-size: 1.15rem;
    margin-bottom: 14px;
  }
  .facts-card {
    padding: 14px 7px;
    min-height: 90px;
  }
  .facts-number {
    font-size: 1.7rem;
  }
  .facts-card-title {
    font-size: 0.93rem;
  }
  .facts-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(10, 1fr);
    gap: 9px;
  }
}

@media (max-width: 480px) {
  .facts-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    gap: 14px;
  }

  .facts-card {
    width: 100% !important;
     grid-column: auto !important;
    grid-row: auto !important;
  }
}

@media (max-width: 400px) {
  .facts-section-title { font-size: 1.02rem; }
  .facts-card-title { font-size: 0.81rem; }
}
