.hero {
  height: 60vh;
  background: url("projectshero.jpg") center/cover no-repeat;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.hero p {
  margin-bottom: 15px;
  font-size: 23px;
}

.hero .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 20px;
}

.fancy-underline {
  border-bottom: 2px solid white;
  display: inline-block;
  padding-bottom: 2px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(124, 115, 172, 0.85);
  transition: opacity 0.4s ease;
}

/* ===== PROJECTS ===== */
.projectss {
  width: 100%;
}

/* Each row */
.projects-row {
  display: flex;
  align-items: center;
  justify-content: space-between; /* spread image and text to opposite sides */
  padding: 55px 6%; /* reduce side padding so content can stretch more */
  gap: 40px;
}

.projects-row.reverse {
  flex-direction: row-reverse;
}

/* Image wrapper: give it a stable width so it anchors to a side */
.projects-image {
  flex: 0 0 40%; /* occupy ~40% of the row (adjust as needed) */
  display: flex;
  justify-content: center;
  align-items: center;
}

.projects-image img {
  width: 100%;
  height: 600px;
  max-width: 720px; /* cap image size on very large screens */
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Text wrapper: take remaining space and allow breathing room */
.projects-text {
  flex: 1 1 58%;
  color: #fff;
  max-width: none;
  padding: 0 40px;
}

/* Alternate background colors */
.projects-row:nth-child(odd) {
  background-color: #1e2235;
}

.projects-row:nth-child(even) {
  background-color: #2b2f48;
}

.projects-text h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  border-bottom: 2px solid white;
  display: inline-block;
}

.projects-text p {
  font-size: 1.1rem;
  line-height: 1.7;
}

.resume-buttons {
  display: inline-flex;      /* sit next to text and other inline content */
  align-items: center;       /* vertically center with text/form fields */
  gap: 12px;                 /* space between buttons */
  margin: 12px 0 90px 0;     /* remove large fixed left offset */
  vertical-align: middle;    /* align with surrounding text baseline */
}

/* ensure anchor behaves nicely in inline-flex context */
.resume-buttons a {
  text-decoration: none !important;
  color: inherit;
}

/* keep accessible focus/hover behaviour */
.resume-buttons a:hover,
.resume-buttons a:focus {
  text-decoration: none !important;
  outline: none;
}

/* button appearance */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 22px;
  margin: 0;
  border: 2px solid white;
  color: white;
  font-weight: bold;
  text-decoration: none !important;
  transition: all 0.18s ease;
  line-height: 1;
}

/* hover state */
.btn:hover {
  color: #96d9ee;
  border-color: #96d9ee;
}

/* responsive: center buttons on small screens */
@media (max-width: 900px) {
  .resume-buttons {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 18px 0 40px 0;
  }
}

/* GitHub link styling */
.projects-text a {
  text-decoration: none;
  font-weight: bold;
}

.projects-text a:hover {
  text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .projects-row {
    flex-direction: column;
    text-align: center;
    padding: 40px 5%;
  }

  .projects-row.reverse {
    flex-direction: column; /* disable reverse on small screens */
  }

  .projects-image {
    flex: 1 0 auto; /* image becomes full width in stacked layout */
    width: 100%;
  }

  .projects-image img {
    width: 100%;
    max-width: 450px;
    height: auto;
  }

  .projects-text {
    max-width: 70ch;
    width: 100%;
    margin: 20px auto 0;
    padding: 0 12px; /* reduced side padding on small screens */
    text-align: left; /* better reading flow on narrow widths */
  }

  .projects-text h2 {
    font-size: 1.4rem;
    margin-bottom: 14px;
    text-align: left;
  }

  .projects-text p {
    font-size: 0.98rem;
    line-height: 1.6;
    color: #dfe7ff;
    text-align: left;
  }
  /* align buttons to the left edge of the text/header on small screens */
  .resume-buttons {
    display: flex;
    justify-content: flex-start; /* left-align inside the .projects-text block */
    align-self: flex-start;      /* ensure the button group doesn't stretch/center in a flex column */
    width: 100%;
    margin: 18px 0 40px 0;
    gap: 12px;
  }

  /* small spacing for multiple buttons */
  .resume-buttons a {
    margin: 0;
  }
  .btn {
    align-items: center;      /* valid value instead of 'left' */
    justify-content: center;  /* valid value instead of 'left' */
    white-space: nowrap;
  }

  /* also prevent plain links inside the projects text from wrapping if they are short labels */
  .projects-text a,
  .resume-buttons a {
    white-space: nowrap;
  }
}