.home-portfolio {
  position: relative;
  isolation: isolate;
  padding: clamp(16px, 2vw, 32px) 0 clamp(40px, 5vw, 88px);
  background: #fdfcfb;
  scroll-margin-top: 100px;
}

.home-portfolio-container {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 88px);
  width: min(1720px, 90%);
  margin-inline: auto;
  padding-bottom: clamp(40px, 5vw, 80px);
}

.home-portfolio-media {
  position: relative;
  min-width: 0;
}

.home-portfolio-media::before {
  content: "";
  position: absolute;
  left: 45%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 64%;
  height: 84%;
  background: linear-gradient(145deg, #b29b78, #213e4c);
  opacity: .2;
  -webkit-mask: url("../img/login-mark.svg") center / contain no-repeat;
  mask: url("../img/login-mark.svg") center / contain no-repeat;
  pointer-events: none;
}

.home-portfolio-media img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  aspect-ratio: 6 / 5;
  padding: 12px;
  object-fit: contain;
  object-position: center;
  background: transparent;
}

.home-portfolio-content {
  min-width: 0;
  padding-block: 16px;
}

.home-portfolio-content h2 {
  max-width: 20ch;
  margin: 0 0 26px;
  color: #103747;
  font: 400 clamp(32px, 3.3vw, 58px)/1.12 Georgia, serif;
  letter-spacing: -.025em;
}

.home-portfolio-description {
  max-width: 56ch;
  margin: 0 0 32px;
  color: var(--muted);
  font-size: clamp(16px, 1.15vw, 19px);
  line-height: 1.8;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.home-portfolio-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 48px;
  padding: 13px 25px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--card);
  font-size: 15px;
  font-weight: 600;
  transition: background-color .2s ease;
}

.home-portfolio-button svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: #efddb6;
  transition: transform .2s ease;
}

.home-portfolio-button:hover {
  background: #304e5b;
}

.home-portfolio-button:hover svg {
  transform: translateX(4px);
}

.home-portfolio:not(.has-image) .home-portfolio-container {
  grid-template-columns: minmax(0, 1fr);
}

.home-portfolio:not(.has-image) .home-portfolio-content {
  max-width: 850px;
}

.home-portfolio:not(.has-image) h2 {
  max-width: 28ch;
}

@media (max-width: 800px) {
  .home-portfolio-container {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .home-portfolio-media img {
    aspect-ratio: 4 / 3;
  }

  .home-portfolio-content {
    padding: 0;
  }

  .home-portfolio-content h2 {
    max-width: 100%;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(22px, 7.4vw, 30px);
  }

  .home-portfolio-description {
    font-size: clamp(12px, 3.733333vw, 16px);
    line-height: 1.65;
    white-space: normal;
    text-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-portfolio-button, .home-portfolio-button svg {
    transition: none;
  }
}
