/* Abyss Section */
.text-with-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  text-align: center;
  z-index: 2;
}

.animated-line {
  width: calc(100% + 10rem);
  max-width: 20rem;
  height: 2px;
}

.line {
  stroke: var(--background-color, white);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawLine 3s ease-in-out infinite;
}

#abyss-section {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--primary-color);
  color: var(--background-color);
  position: relative;
  overflow: hidden;
}

@keyframes drawLine {
  0% {
    stroke-dashoffset: 100;
  }
  50% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: -100;
  }
}

/* Portfolio Section */
#portfolio-section {
  width: 100%;
  min-height: 100vh;
  background-color: var(--background-color);
  padding: 3rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#portfolio-section .text-with-line {
  margin-bottom: 2rem;
}

#portfolio-section h2 {
  color: var(--primary-color);
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
}

#portfolio-section .line {
  stroke: var(--primary-color);
}

.portfolio-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  width: 100%;
}

.portfolio-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background-color: #000;
  cursor: pointer;
  transition: all 0.5s ease;
  aspect-ratio: 3/2;
}

/* .portfolio-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
} */

.portfolio-image {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.portfolio-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  border-radius: 1rem;
  transform: translateZ(0);
  will-change: transform;
}

.portfolio-card:hover .portfolio-image img {
  transform: scale(1.1);
  /* filter: brightness(0.3); */
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(51, 51, 51, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.5s ease;
  border-radius: 1rem;
  padding: 2rem;
  will-change: opacity;
}

.portfolio-card:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  color: white;
  transform: translateY(20px);
  transform: translateY(20px) translateZ(0);
  transition: transform 0.5s ease;
  will-change: transform;
  text-align: left;
  opacity: 0;
}

.portfolio-card:hover .portfolio-info {
  transform: translateY(0);
}

.portfolio-tags {
  font-size: 0.9rem;
  color: #ccc;
  line-height: 1.4;
  font-weight: 300;
  opacity: 0.8;
}

.portfolio-content {
  font-size: 1.4rem;
  line-height: 1.5;
  color: white;
  margin-bottom: auto;
  flex-grow: 1;
  font-weight: 400;
  display: flex;
  align-items: center;
  text-align: left;
}

.portfolio-link {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  color: white;
  position: relative;
  /* display: inline-block; */
  padding: 0.5rem 0;
  transition: all 0.3s ease;
  cursor: pointer;
  margin-top: 1rem;
  align-self: flex-start;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

.portfolio-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: white;
  transition: width 0.3s ease;
}

.portfolio-link:hover::after {
  width: 100%;
}

.portfolio-link:hover {
  transform: translateY(-2px);
}

/* Portfolio Responsive Design */
@media screen and (max-width: 768px) {
  #portfolio-section {
    padding: 2.5rem 0rem;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: calc(100% - 2.5rem);
    margin: 0 auto;
  }

  .portfolio-card {
    aspect-ratio: 3/2;
  }

  .portfolio-overlay {
    padding: 1.5rem;
  }

  .portfolio-info {
    gap: 0.8rem;
  }

  .portfolio-tags {
    font-size: 0.7rem;
    opacity: 0.9;
  }

  .portfolio-content {
    font-size: 1.5rem;
    line-height: 1.4;
  }

  .portfolio-link {
    font-size: 1rem;
    padding: 0.4rem 0;
    margin-top: 0.8rem;
  }

  #portfolio-section h2 {
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
    font-size: 1.5rem;
  }
}

@media screen and (max-width: 480px) {
  #portfolio-section {
    padding: 2rem 0rem;
  }

  .portfolio-grid {
    max-width: calc(100% - 2rem);
    gap: 1.2rem;
  }

  .portfolio-card {
    aspect-ratio: 4/3;
  }

  .portfolio-overlay {
    padding: 1.2rem;
  }

  .portfolio-info {
    gap: 0.6rem;
  }

  .portfolio-content {
    font-size: 1rem;
    line-height: 1.3;
  }

  .portfolio-tags {
    font-size: 0.75rem;
    margin-bottom: 0rem;
  }

  .portfolio-link {
    font-size: 0.8rem;
    padding: 0.3rem 0;
    margin-top: 0.5rem;
  }
}

.portfolio-card:hover .portfolio-overlay,
.portfolio-card.active .portfolio-overlay {
  opacity: 1;
}

.portfolio-card:hover .portfolio-info,
.portfolio-card.active .portfolio-info {
  transform: translateY(0) translateZ(0);
  opacity: 1;
}

.portfolio-card.active .portfolio-image img {
  transform: scale(1.1);
  /* filter: brightness(0.3); */
}

.portfolio-card {
  -webkit-tap-highlight-color: transparent;
}

.portfolio-overlay {
  pointer-events: none;
}

.portfolio-info {
  pointer-events: auto;
}

.portfolio-content,
.portfolio-tags {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

.portfolio-link {
  pointer-events: auto;
}

.portfolio-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #0d0d0d;
  opacity: 0;
  transition: opacity 0.5s ease;
  border-radius: 1rem;
  pointer-events: none;
  will-change: opacity;
}

.portfolio-card:hover .portfolio-image-overlay {
  opacity: 0.75;
}

.portfolio-card.active .portfolio-image-overlay {
  opacity: 0.75;
}
