body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #c9d1d9;
  background: url('background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5em 1em 0.5em 1em;
  min-height: 75vh;
}

.modal {
  background-color: rgba(13, 17, 23, 0.4);
  padding: 1.2em 1.5em;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  max-width: 680px;
  margin-bottom: 0.5em;
}

h1 {
  font-size: 2.4em;
  margin-bottom: 0.4em;
}

p {
  font-size: 1.1em;
  max-width: 580px;
  margin-bottom: 1em;
  margin-left: auto;
  margin-right: auto;
}

button {
  background-color: #238636;
  color: white;
  border: none;
  padding: 0.6em 1.2em;
  font-size: 0.95em;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #2ea043;
}

/* ----------------------
   PORTFOLIO SECTION
----------------------- */
section#portfolio {
  background-color: rgba(13, 17, 23, 0.85);
  padding: 35px 15px;
  color: #c9d1d9;
  margin-top: 0;
  border-top: 1px solid #2ea04320;
}

section#portfolio h2 {
  text-align: center;
  font-size: 2em;
  margin-bottom: 30px;
}

/* Desktop: horizontal scrolling card row */
.projects-grid {
  display: flex;
  justify-content: flex-start;
  overflow-x: auto;
  gap: 20px;
  padding: 0 10px 1rem 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: #161b22;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 260px; /* fixed card width for desktop */
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease-in-out;
}

.project-card:hover {
  transform: scale(1.02);
}

/* Unified image style */
.project-card img {
  width: 100%;
  aspect-ratio: 16 / 9; /* consistent image box */
  object-fit: cover;
  display: block;
}

/* Text content */
.project-card .content {
  padding: 15px;
}

.project-card h3 {
  margin-top: 0;
  font-size: 1.15em;
  margin-bottom: 0.4em;
}

.project-card p {
  font-size: 0.95em;
  margin-bottom: 0.6em;
}

.project-card a {
  text-decoration: none;
  color: #58a6ff;
  font-size: 0.95em;
}

.project-card a:hover {
  text-decoration: underline;
}

/* Scrollbar styling */
.projects-grid::-webkit-scrollbar {
  height: 6px;
}
.projects-grid::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}
.projects-grid::-webkit-scrollbar-track {
  background: transparent;
}

/* ----------------------
   MOBILE LAYOUT
----------------------- */
@media (max-width: 768px) {
  .projects-grid {
    display: block;
    overflow-x: visible;
    scroll-snap-type: none;
    padding: 0 12px 1.5rem;
  }

  .project-card {
    flex: none;
    width: 100%;
    max-width: 480px;
    margin: 0 auto 16px;
  }

  .project-card:last-child {
    margin-bottom: 0;
  }

  /* Slightly taller aspect ratio for mobile */
  .project-card img {
    aspect-ratio: 4 / 3;
  }
}

/* ----------------------
   FOOTER
----------------------- */
footer {
  text-align: center;
  padding: 16px;
  font-size: 0.85em;
  color: #8b949e;
}
