.portfolio {
  width: 100%;
  padding: 5% 10% 5% 10%;
  display: flex;
  flex-direction: column;
  gap: 120px;
  margin-top: -80px;
}

.portfolio-contents {
  display: flex;
  flex-direction: column;
  gap: 120px;
  justify-content: center;
  align-items: center;
}
.portfolio-profile {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
}

.portfolio-photo {
  width: 400px;
  min-width: 400px;
  height: 574px;
  border-radius: 10px;
  box-shadow: var(--box-shadow-common);
  display: block;
  margin-right: 40px;
}

.portfolio-text {
  width: 600px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.portfolio-text h3 {
  font-size: 35px;
  font-family: var(--font-primary);
  line-height: 1;
  z-index: 889;
}

.portfolio-text h3::before {
  content: "Profile";
  background: var(--gradient-sub2);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: blur(4px);
  opacity: 0.5;
  font-size: 85px;
  position: fixed;
  top: -7%;
  z-index: 888;
}

.portfolio-works h3 {
  font-size: 35px;
  font-family: var(--font-primary);
  line-height: 1;
  z-index: 889;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.portfolio-works h3::before {
  content: "Works";
  background: var(--gradient-sub2);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: blur(4px);
  opacity: 0.5;
  font-size: 85px;
  z-index: 888;
  margin-bottom: -30px;
}

.portfolio-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portfolio-table-item {
  display: flex;
  gap: 10px;
  width: 100%;
  padding-bottom: 8px;
  border-bottom: 1px solid #d9d9d9;
  align-items: center;
}

.portfolio-table-item dt {
  font-family: var(--font-primary);
  font-size: 18px;
  background: var(--gradient-sub2);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  width: 100px;
}

.portfolio-description {
  width: 100%;
  padding: 0 5%;
  line-height: 2;
}

.portfolio-project-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portfolio-project-title h4:first-of-type {
  font-size: 20px;
  font-family: var(--font-primary);
  background: var(--gradient-sub2);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  width: 100px;
}
.portfolio-project-title h4:last-of-type {
  font-size: 18px;
  font-weight: bold;
  color: var(--color-main);
}

.portfolio-works {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.portfolio-works-list {
  display: flex;
  flex-direction: column;
  gap: 120px;
}

.portfolio-works-item {
  display: flex;
  justify-content: space-around;
  gap: 40px;
}

.portfolio-works-item.row-reverse {
  flex-direction: row-reverse;
}

.scrollable-image {
  width: 100%;
  max-width: 400px;
  max-height: 600px;
  overflow-y: scroll;
  padding-right: 8px;
  box-sizing: content-box;
}
.scrollable-image img {
  width: 100%;
  height: auto;
  display: block;
}

dd {
  width: 100%;
}
.portfolio-table-wrap {
  padding-top: 100px;
}

/* スクロールバーの装飾 */
.scrollable-image::-webkit-scrollbar {
  width: 6px;
}

.scrollable-image::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.scrollable-image::-webkit-scrollbar-thumb {
  background: var(--gradient-sub2);
  border-radius: 4px;
  transition: all 30ms ease;
}

/* モーダル */
.modal-overlay {
  padding: 5%;
  display: flex;
  align-items: flex-start;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  justify-content: center;
  z-index: 9999;
  transition: all 200ms ease;
  pointer-events: none;
  overflow-y: scroll;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-image {
  max-width: 100%;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.modal-close {
  position: fixed;
  top: 20px;
  right: 30px;
  font-size: 32px;
  color: #fff;
  cursor: pointer;
  z-index: 10000;
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media screen and (max-width: 786px) {
  .fade-in {
    opacity: 1;
  }
  .portfolio {
    padding: 5% 5% 40% 5%;
    gap: 30px;
  }
  .portfolio-profile {
    flex-direction: column;
    gap: 40px;
  }

  .portfolio-contents {
    gap: 200px;
    justify-content: center;
    align-items: center;
  }

  .portfolio-photo {
    width: 100%;
    min-width: 295px;
    height: auto;
    border-radius: 5px;
    margin-right: 0px;
  }

  .portfolio-text {
    width: 100%;
    gap: 20px;
  }

  .portfolio-text h3::before,
  .portfolio-works h3::before {
    display: none;
  }

  .portfolio-works-item {
    flex-direction: column;
  }
  .scrollable-image {
    height: 400px;
  }
  .portfolio-table-wrap {
    padding-top: 0px;
  }
  .portfolio-works-item.row-reverse {
    flex-direction: column;
  }
}
