body.overlay-is-open {
  overflow: hidden;
}

.project-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  font-family: "Inter", sans-serif;
}

.project-overlay.is-open {
  display: flex;
}

.project-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 5, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.project-overlay__panel {
  position: relative;
  z-index: 1;
  width: min(1248px, 100%);
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 88px 80px 64px;
  border: 1px solid rgba(57, 232, 212, 0.92);
  border-radius: 30px;
  background:
    radial-gradient(circle at 78% 30%, rgba(9, 92, 74, 0.72) 0%, rgba(9, 92, 74, 0.15) 36%, transparent 62%),
    linear-gradient(105deg, rgba(27, 29, 29, 0.98) 0%, rgba(19, 29, 29, 0.98) 46%, rgba(6, 54, 45, 0.98) 100%);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.56),
    inset 0 0 0 1px rgba(57, 232, 212, 0.05);
}

.project-overlay__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  align-items: center;
  gap: 76px;
}

.project-overlay__close {
  position: absolute;
  top: 64px;
  right: 86px;
  width: 34px;
  height: 34px;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.project-overlay__close span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 27px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
  transform-origin: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.project-overlay__close span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.project-overlay__close span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.project-overlay__close:hover span,
.project-overlay__close:focus-visible span {
  background: var(--accent);
}

.project-overlay__close:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 8px;
  border-radius: 999px;
}

.project-overlay__number {
  display: block;
  margin-bottom: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(72px, 8vw, 116px);
  line-height: 0.86;
  font-weight: 700;
  letter-spacing: -0.08em;
  color: var(--accent);
}

.project-overlay__title {
  margin: 0 0 36px;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(48px, 5.2vw, 68px);
  line-height: 0.88;
  font-weight: 700;
  letter-spacing: -0.06em;
  color: #ffffff;
}

.project-overlay__question {
  margin: 0 0 20px;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(20px, 2vw, 25px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.project-overlay__text {
  max-width: 510px;
  margin: 0 0 30px;
  font-family: "Inter", sans-serif;
  font-size: 17px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
}

.project-overlay__stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-bottom: 40px;
}

.project-overlay__stack-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
}

.project-overlay__stack-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.project-overlay__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.project-overlay__button {
  min-width: 130px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: "Inter", sans-serif;
  font-size: 17px;
  line-height: 1;
  text-decoration: none;
  color: #ffffff;
  background: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.project-overlay__button span {
  display: none;
}

.project-overlay__button::after {
  content: "";
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
  background: url("../assets/imgs/projects/arrow_outward green.png") center / contain no-repeat;
  transition: transform 0.22s ease;
}

.project-overlay__button:hover,
.project-overlay__button:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(57, 232, 212, 0.04);
  outline: none;
}

.project-overlay__button:hover::after,
.project-overlay__button:focus-visible::after {
  transform: translate(4px, -4px);
}

.project-overlay__media {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.project-overlay__preview {
  width: min(520px, 100%);
  min-height: 370px;
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.project-overlay__preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-overlay__preview-text {
  padding: 32px;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
  font-weight: 700;
  text-align: center;
  color: #102221;
}

.project-overlay__next {
  margin: 60px 8px 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  font-family: "Inter", sans-serif;
  font-size: 18px;
  line-height: 1;
  color: #ffffff;
  cursor: pointer;
  transition: color 0.2s ease;
}

.project-overlay__next-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.22s ease;
}

.project-overlay__next:hover,
.project-overlay__next:focus-visible {
  color: #ffffff;
  outline: none;
}

.project-overlay__next:hover .project-overlay__next-icon,
.project-overlay__next:focus-visible .project-overlay__next-icon {
  transform: translateX(6px);
}

body.overlay-is-open main {
  z-index: 3000;
}

body.overlay-is-open .project-overlay {
  z-index: 4000;
}

@media (max-width: 980px) {
  .project-overlay {
    padding: 30px 24px;
  }

  .project-overlay__panel {
    width: min(100%, 820px);
    max-height: calc(100vh - 60px);
    padding: 74px 40px 46px;
  }

  .project-overlay__content {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .project-overlay__close {
    top: 36px;
    right: 38px;
  }

  .project-overlay__media {
    justify-content: center;
  }

  .project-overlay__preview {
    width: min(100%, 540px);
    min-height: 310px;
  }
}

@media (max-width: 768px) {
  .project-overlay {
    align-items: center;
    justify-content: center;
    padding: 24px 14px;
  }

  .project-overlay__backdrop {
    background: rgba(2, 4, 5, 0.82);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  .project-overlay__panel {
    width: min(100%, 306px);
    min-height: 0;
    max-height: calc(100svh - 80px);
    padding: 54px 14px 20px;
    border-radius: 14px;
    overflow-y: auto;
    background:
      radial-gradient(circle at 92% 4%, rgba(2, 95, 78, 0.82), transparent 42%),
      linear-gradient(180deg, rgba(14, 24, 23, 0.99), rgba(27, 28, 28, 0.99) 62%, rgba(4, 63, 53, 0.99));
  }

  .project-overlay__close {
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
  }

  .project-overlay__close span {
    width: 19px;
    height: 2px;
  }

  .project-overlay__content {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .project-overlay__media {
    order: -1;
    width: 100%;
    justify-content: center;
  }

  .project-overlay__preview {
    width: 230px;
    height: 128px;
    min-height: 0;
    border-radius: 9px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
  }

  .project-overlay__copy {
    width: 100%;
  }

  .project-overlay__number {
    margin-bottom: 2px;
    font-size: 38px;
    line-height: 0.9;
  }

  .project-overlay__title {
    margin: 0 0 18px;
    font-size: 34px;
    line-height: 0.9;
  }

  .project-overlay__question {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.25;
  }

  .project-overlay__text {
    margin-bottom: 14px;
    font-size: 12px;
    line-height: 1.24;
  }

  .project-overlay__stack {
    gap: 9px 11px;
    margin-bottom: 16px;
  }

  .project-overlay__stack-item {
    gap: 4px;
    font-size: 12px;
  }

  .project-overlay__stack-icon {
    width: 17px;
    height: 17px;
  }

  .project-overlay__actions {
    justify-content: space-between;
    gap: 10px;
  }

  .project-overlay__button {
    min-width: 92px;
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  .project-overlay__button::after {
    width: 13px;
    height: 13px;
  }

  .project-overlay__next {
    margin: 18px 8px 0 auto;
    gap: 10px;
    font-size: 12px;
    color: var(--accent);
  }

  .project-overlay__next-icon {
    width: 24px;
    height: 24px;
  }
}