.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.project-modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: rgba(26, 46, 66, 0.95);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(134, 202, 191, 0.3);
  border-radius: 24px;
  max-width: 800px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform var(--transition-fast);
}

.project-modal.active .modal-content {
  transform: scale(1);
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--accent-color, var(--color-dev));
  border-radius: 10px;
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: var(--color-text);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 77, 77, 0.3);
  border-color: #ff4d4d;
  transform: rotate(90deg);
}

.modal-header {
  display: flex;
  gap: 2rem;
  padding: 2.5rem;
  border-bottom: 1px solid rgba(134, 202, 191, 0.2);
  align-items: center;
}

.modal-image {
  width: 130px;
  height: 130px;
  object-fit: contain;
  border-radius: 16px;
  background:
    linear-gradient(
      to top,
      color-mix(in srgb, var(--accent-color, var(--color-dev)) 15%, transparent) 0%,
      rgba(0, 0, 0, 0.5) 70%
    );
  padding: 1.2rem;
  border: 2px solid var(--accent-color, var(--color-dev));
  filter: drop-shadow(0 0 12px var(--accent-color, var(--color-dev)));
}

.modal-header-text {
  flex: 1;
}

/* Landscape logo: image above title, rectangular frame */
/* Design Planet modal layout: title → image → tech → button */
.project-modal.design-layout .modal-header {
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: none;
}

.project-modal.design-layout .modal-header-text {
  order: -1;
}

.project-modal.design-layout .modal-short-desc {
  display: none;
}

.project-modal.design-layout .modal-image {
  width: 200px;
  height: 200px;
}

.project-modal.design-layout .modal-body .modal-section:first-child {
  display: none;
}

.project-modal.design-layout .modal-body .modal-section:first-child.expanded {
  display: block;
}

.project-modal.design-layout .modal-tech-list {
  justify-content: center;
}

/* Design Planet + landscape logo: hero-sized rectangular frame */
.project-modal.design-layout.landscape-logo .modal-image {
  width: 340px;
  max-width: 90%;
  height: 170px;
}

/* Landscape logo: image above title, rectangular frame */
.project-modal.landscape-logo .modal-header {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.project-modal.landscape-logo .modal-image {
  width: 220px;
  max-width: 100%;
  height: 110px;
  border-radius: 16px;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.5rem 0;
  background: linear-gradient(135deg, var(--color-dev), var(--color-arts));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-short-desc {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: #c2c2c2;
  margin: 0;
}

.modal-body {
  padding: 2rem 2.5rem;
}

.modal-section {
  margin-bottom: 2rem;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--accent-color, var(--color-dev));
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-section h3::before {
  content: "";
  width: 4px;
  height: 1.3rem;
  background: var(--accent-color, var(--color-dev));
  border-radius: 2px;
}

.modal-full-desc {
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.8;
  color: #d2d2d2;
  white-space: pre-line;
}

.modal-tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.modal-tech-badge {
  padding: 0.6rem 1rem;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid;
  background: rgba(0, 0, 0, 0.4);
  transition: all var(--transition-fast);
}

.modal-tech-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(134, 202, 191, 0.3);
}

.modal-footer {
  padding: 1.5rem 2.5rem 2.5rem 2.5rem;
  border-top: 1px solid rgba(134, 202, 191, 0.2);
}

.modal-link-btn {
  display: block;
  width: 100%;
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.modal-link-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s ease,
    height 0.6s ease;
}

.modal-link-btn:hover::before {
  width: 400px;
  height: 400px;
}

.modal-link-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .modal-header {
    padding: 2rem 1.5rem;
  }

  .modal-image {
    width: 110px;
    height: 110px;
  }

  .project-modal.landscape-logo .modal-image {
    width: 200px;
    height: 100px;
  }

  .project-modal.design-layout.landscape-logo .modal-image {
    width: 300px;
    max-width: 90%;
    height: 150px;
  }

  .modal-title {
    font-size: 1.5rem;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .modal-footer {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
  }

  .modal-close {
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .modal-content {
    width: 98%;
  }

  .modal-header {
    padding: 1.5rem 1rem;
    gap: 1.2rem;
  }

  .modal-image {
    width: 90px;
    height: 90px;
  }

  .project-modal.landscape-logo .modal-image {
    width: 100%;
    max-width: 180px;
    height: 90px;
  }

  .project-modal.design-layout.landscape-logo .modal-image {
    width: 100%;
    max-width: 260px;
    height: 130px;
  }

  .modal-title {
    font-size: 1.3rem;
  }

  .modal-body {
    padding: 1rem;
  }
}
