.project-section {
  width: 100%;
}

.project-section-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 72px;
  padding-bottom: 0;
  box-sizing: border-box;
  position: relative;
}

.project-header {
  width: min(100%, 880px);
  max-width: 880px;
  margin: 0 0 44px;
  color: #3dcfb6;
  font-family: "Karla", sans-serif;
}

.project-header p {
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.project-section h2 {
  margin: 0 0 38px;
  color: #3dcfb6;
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.projects-description {
  max-width: 640px;
  margin: 0;
  color: #ffffff;
  font-size: 20px;
  font-weight: 400;
  line-height: 140%;
}

.project-list {
  width: min(100%, 880px);
  max-width: 880px;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.project-item {
  position: relative;
  display:flex;
  justify-content: space-between;  
  align-items: flex-start;
  gap: 32px;
  width: 100%;
  padding: 40px 32px;
  min-height: 109px;
  box-sizing: border-box;
  border-bottom: 1px solid #3dcfb6;
  cursor: default;
  outline: none;
  overflow: visible;
}

.project-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.project-item:first-child {
  border-top: 1px solid #3dcfb6;
}

.project-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(61, 207, 182, 0.3);
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
}

.project-item:hover::before,
.project-item:focus-visible::before {
  opacity: 1;
}

.project-row-preview {
  position: absolute;
  left: calc(100% + 72px);
  top: 50%;
  width: 320px;
  height: 220px;
  transform: translateY(-50%);
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  isolation: isolate;
}

.project-row-preview::before {
  content: "";
  position: absolute;
  right: -20px;
  top: 20px;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: repeating-linear-gradient(
    135deg,
    rgba(61, 207, 182, 0.8) 0 1px,
    transparent 2px 12px
  );
}

.project-row-image {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  border: 1px solid rgba(61, 207, 182, 0.55);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.project-item:hover .project-row-preview,
.project-item:focus-visible .project-row-preview {
  opacity: 1;
  transform: translateY(-50%) translateX(-4px);
}

.project-name {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-family: "Fira Code", monospace;
  font-size: 40px;
  font-weight: 700;
  white-space: nowrap;
}

.project-name::after {
  content: url("../assets/icon/arrow_outward.svg");
  color: #ffffff;
  font-size: 0.72em;
  font-weight: 700;
  opacity: 0;
  transform: translateY(1px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.project-item:hover .project-name::after,
.project-item:focus-visible .project-name::after {
  opacity: 1;
  transform: translateY(1px);
}

.project-stack {
  position: relative;
  justify-self: end;
  color: #ffffff;
  font-family: "Karla", sans-serif;
  font-size: 16px;
  font-weight: 400;
  white-space: nowrap;
  text-align: right;
}

html.project-modal-open,
body.project-modal-open {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.project-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  box-sizing: border-box;
  height: 100vh;
  height: 100svh;
  z-index: 12000;
}

.project-modal.is-open {
  display: flex;
}

.project-modal-backdrop {
  position: absolute;
  inset: 0;
  background: #000000;
  z-index: 0;
}

.project-modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1248px;
  min-height: 600px;
  max-height: 90vh;
  max-height: 90svh;
  border: 1px solid #3dcfb6;
  border-radius: 32px;
  padding: 54px 46px 40px;
  box-sizing: border-box;
  background: linear-gradient(90deg, #1c1c1c 0%, #123f38 100%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.project-modal-close {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 2;
  border: 0;
  padding: 0;
  background: transparent;
  color: #ffffff;
  font-family: "Karla", sans-serif;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.project-modal-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}

.project-modal-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.project-modal-number {
  margin: 0 0 2px;
  color: #3dcfb6;
  font-family: "Karla", sans-serif;
  font-size: 88px;
  font-weight: 700;
  line-height: 0.9;
}

.project-modal-name {
  margin: 0 0 28px;
  color: #ffffff;
  font-family: "Fira Code", monospace;
  font-size: 56px;
  line-height: 1;
}

.project-modal-about {
  margin: 0 0 14px;
  color: #3dcfb6;
  font-family: "Fira Code", monospace;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.project-modal-description {
  margin: 0 0 20px;
  min-height: 4.05em;
  color: #ffffff;
  font-family: "Karla", sans-serif;
  font-size: 16px;
  line-height: 1.35;
}

.project-modal-technologies {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 32px;
}

.project-tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ffffff;
  font-family: "Karla", sans-serif;
  font-size: 16px;
  line-height: 1;
}

.project-tech-image {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(0) saturate(100%) invert(70%) sepia(69%) saturate(392%) hue-rotate(120deg) brightness(93%) contrast(91%);
}

.project-modal-actions {
  display: flex;
  gap: 18px;
}

.project-modal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 106px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  color: #ffffff;
  text-decoration: none;
  font-family: "Karla", sans-serif;
  font-size: 18px;
}

.project-modal-button:hover {
  color: #3dcfb6;
  border-color: #3dcfb6;
}

.project-modal-button-arrow {
  width: 14px;
  height: 14px;
  display: inline-block;
  background-color: rgba(61, 207, 182, 1);
  -webkit-mask: url("../assets/icon/arrow_outward.svg") center / contain no-repeat;
  mask: url("../assets/icon/arrow_outward.svg") center / contain no-repeat;
}

.project-modal-preview {
  align-self: center;
  justify-self: end;
}

.project-modal-preview img {
  display: block;
  width: 100%;
  max-width: 760px;
  margin-left: auto;
  border-radius: 22px;
}

.project-modal-next {
  position: absolute;
  right: 74px;
  bottom: 34px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #3dcfb6;
  font-family: "Karla", sans-serif;
  font-size: 16px;
  cursor: pointer;
}

@media (max-width: 1378px) {
  .project-row-preview {
    display: none;
  }
}

@media (max-width: 1200px) {
  .project-section-inner {
    padding: 80px 40px;
    align-items: center;
  }

  .project-header p {
    font-size: 20px;
  }

  .project-section h2 {
    font-size: 56px;
  }

  .projects-description {
    font-size: 18px;
  }

  .project-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
  }

  .project-name {
    font-size: 32px;
  }

  .project-stack {
    font-size: 16px;
  }

  .project-row-preview {
    width: 280px;
    height: 200px;
    left: calc(100% + 24px);
  }

  .project-modal {
    padding: 28px;
  }

  .project-modal-panel {
    max-width: 1080px;
    min-height: 540px;
    padding: 48px 36px 34px;
  }

  .project-modal-content {
    gap: 40px;
  }

  .project-modal-number {
    font-size: 72px;
  }

  .project-modal-name {
    font-size: 46px;
    margin-bottom: 22px;
  }

  .project-modal-preview img {
    max-width: 560px;
  }

  .project-modal-next {
    right: 44px;
    bottom: 24px;
  }
}

@media (max-width: 900px) {
  .project-section-inner {
    padding: 56px 20px;
    align-items: center;
  }

  .project-header {
    margin-bottom: 28px;
    text-align: center;
  }

  .project-header p {
    font-size: 18px;
  }

  .project-section h2 {
    font-size: 48px;
    margin-bottom: 24px;
  }

  .projects-description {
    font-size: 16px;
    line-height: 120%;
    margin: 0 auto;
  }

  .project-item {
    grid-template-columns: 1fr;
    align-items: flex-start;
    justify-items: start;
    gap: 12px;
    padding: 24px 0;
    text-align: left;
  }

  .project-name {
    font-size: 24px;
    white-space: normal;
  }

  .project-stack {
    justify-self: start;
    white-space: normal;
    text-align: left;
  }

  .project-row-preview {
    display: none;
  }

  .project-modal {
    padding: 20px;
  }

  .project-modal-panel {
    display: flex;
    flex-direction: column;
    height: 90vh;
    height: 90svh;
    max-height: 90vh;
    max-height: 90svh;
    padding: 22px 18px 84px;
    border-radius: 24px;
    overflow-y: auto;
  }

  .project-modal-close {
    top: 12px;
    right: 14px;
    font-size: 38px;
  }

  .project-modal-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: flex-start;
    flex: 1;
  }

  .project-modal-copy,
  .project-modal-preview {
    width: 100%;
    justify-self: stretch;
  }

  .project-modal-preview {
    order: -1;
  }

  .project-modal-preview img {
    width: 100%;
    max-width: none;
    margin-left: 0;
    border-radius: 16px;
  }

  .project-modal-number {
    font-size: 58px;
  }

  .project-modal-name {
    font-size: 42px;
    line-height: 1;
    margin-bottom: 16px;
  }

  .project-modal-about {
    margin-bottom: 10px;
    font-size: 16px;
  }

  .project-modal-description {
    margin-bottom: 18px;
    font-size: 16px;
  }

  .project-modal-technologies {
    gap: 12px;
    margin-bottom: 24px;
  }

  .project-modal-actions {
    flex-wrap: wrap;
    gap: 12px;
  }

  .project-modal-button {
    min-width: 92px;
    height: 40px;
    font-size: 16px;
  }

  .project-modal-next {
    right: 24px;
    bottom: 20px;
    font-size: 16px;
  }
}

@media (min-width: 701px) and (max-width: 900px) {
  .project-modal {
    padding: 12px;
  }

  .project-modal-panel {
    width: min(760px, calc(100vw - 24px));
    max-height: calc(100svh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 18px 16px 16px;
    border-radius: 20px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .project-modal-content {
    gap: 12px;
  }

  .project-modal-preview {
    width: min(520px, 100%);
    justify-self: center;
    margin: 0 auto;
  }

  .project-modal-preview img {
    width: 100%;
    max-width: 520px;
    height: clamp(170px, 30vh, 230px);
    object-fit: cover;
  }

  .project-modal-number {
    font-size: 46px;
  }

  .project-modal-name {
    font-size: 34px;
    margin-bottom: 8px;
  }

  .project-modal-description {
    max-height: 7.5em;
    overflow-y: auto;
  }

  .project-modal-technologies {
    max-height: 64px;
    overflow-y: auto;
    margin-bottom: 16px;
  }

  .project-modal-next {
    position: static;
    margin-top: 8px;
    margin-left: auto;
  }
}

@media (max-width: 700px) {
  .project-modal {
    padding: 8px;
  }

  .project-modal-panel {
    width: min(366px, calc(100vw - 16px));
    display: flex;
    flex-direction: column;
    height: 90svh;
    height: 90dvh;
    max-height: 90svh;
    max-height: 90dvh;
    padding: 40px 14px 14px;
    border-radius: 20px;
    border-width: 1px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .project-modal-close {
    top: 10px;
    right: 12px;
    font-size: 30px;
  }

  .project-modal-number {
    margin-bottom: 0;
    font-size: 46px;
    line-height: 0.95;
  }

  .project-modal-name {
    margin-bottom: 8px;
    font-family: "Fira Code", monospace;
    font-weight: 700;
    font-style: normal;
    font-size: 46px;
    line-height: 0.86;
    letter-spacing: -0.03em;
    max-width: 100%;
    word-break: break-word;
    height: 1.8em;
  }

  .project-modal-about {
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.2;
  }

  .project-modal-description {
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.4;
    max-width: 100%;
    height: 6em;
    overflow-y: auto;
  }

  .project-tech-badge {
    font-size: 15px;
    max-width: 100%;
  }

  .project-tech-image {
    width: 16px;
    height: 16px;
  }

  .project-modal-preview {
    order: -1;
    margin-bottom: 10px;
    flex: 0 0 auto;
  }

  .project-modal-preview img {
    width: 100%;
    height: clamp(136px, 24vh, 170px);
    object-fit: cover;
    border-radius: 18px;
  }

  .project-modal-technologies {
    gap: 8px 10px;
    margin-bottom: 14px;
    min-height: 0;
    height: 44px;
    overflow-y: auto;
  }

  .project-modal-content {
    gap: 10px;
    width: 100%;
    height: auto;
    min-width: 0;
  }

  .project-modal-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
  }

  .project-modal-button {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    font-size: 15px;
    box-sizing: border-box;
  }

  .project-modal-next {
    position: static;
    margin-top: 8px;
    margin-left: auto;
    font-size: 15px;
  }

  .project-modal-copy,
  .project-modal-preview,
  .project-modal-technologies {
    width: 100%;
    min-width: 0;
  }

  .project-modal-copy {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .project-item {
    align-items: flex-start;
    justify-items: start;
    text-align: left;
  }

  .project-stack {
    justify-self: start;
    text-align: left;
  }
}

@media (max-width: 420px) {
  .project-section-inner {
    padding: 12px 16px 44px;
    align-items: stretch;
  }

  .project-header {
    margin-bottom: 22px;
    text-align: left;
  }

  .project-header p {
    margin-bottom: 10px;
    font-size: 18px;
  }

  .project-section h2 {
    margin-bottom: 16px;
    font-size: clamp(52px, 14vw, 66px);
    line-height: 0.95;
  }

  .projects-description {
    margin: 0;
    font-size: 16px;
    line-height: 120%;
  }

  .project-item {
    padding: 22px 0;
    gap: 10px;
    align-items: flex-start;
    justify-items: start;
    text-align: left;
  }

  .project-name {
    font-size: 24px;
    line-height: 1;
  }

  .project-stack {
    justify-self: start;
    text-align: left;
    font-size: 16px;
  }

  .project-modal {
    padding: 8px;
  }

  .project-modal-panel {
    width: min(366px, calc(100vw - 16px));
    height: 90svh;
    height: 90dvh;
    max-height: 90svh;
    max-height: 90dvh;
    padding: 38px 10px 12px;
    border-radius: 20px;
    border-width: 1px;
  }

  .project-modal-close {
    top: 10px;
    right: 12px;
  }

  .project-modal-description {
    height: 97px;
    overflow-y: auto;
  }

  .project-modal-preview img {
    height: 140px;
  }

  .project-modal-technologies {
    min-height: 0;
    height: 40px;
    gap: 8px 10px;
  }

  .project-modal-name {
    font-family: "Fira Code", monospace;
    font-weight: 700;
    font-style: normal;
    font-size: 34px;
    line-height: 0.9;
    letter-spacing: -0.03em;
    height: 1.85em;
  }

  .project-tech-badge {
    font-size: 14px;
  }

  .project-modal-button {
    height: 40px;
    font-size: 14px;
  }

  .project-modal-next {
    font-size: 14px;
  }
}
