.project-page {
  padding-bottom: 0;
}

.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 34px;
  padding-top: 64px;
}

.project-hero .section-title {
  font-size: clamp(46px, 6vw, 82px);
}

.project-lead {
  max-width: 560px;
  margin-top: 20px;
  color: var(--gray);
  font-size: 16px;
  line-height: 1.7;
}

.project-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.project-filter button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--gray);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.25s ease;
}

.project-filter button.active,
.project-filter button:hover {
  background: var(--purple);
  color: white;
  border-color: var(--purple);
  transform: translateY(-2px);
}

.project-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 46px;
}

.detail-card {
  appearance: none;
  border: 1px solid var(--line);
  min-height: 360px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 50px rgba(40, 30, 20, 0.08);
  overflow: hidden;
  padding: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: 0.35s ease;
  position: relative;
}

.detail-card:hover {
  transform: translateY(-8px);
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 28px 80px rgba(139, 92, 246, 0.18);
}

.detail-card.is-hidden {
  display: none;
}

.detail-thumb {
  display: block;
  height: 210px;
  background-size: cover;
  background-position: center;
}

.thumb-5 {
  background-image: linear-gradient(rgba(0,0,0,.22), rgba(0,0,0,.22)), url("../image/khor.png");
}

.thumb-6 {
  background-image: linear-gradient(rgba(0,0,0,.22), rgba(0,0,0,.22)), url("../image/game.png");
}

.thumb-7 {
  background-image: linear-gradient(rgba(0,0,0,.22), rgba(0,0,0,.22)), url("../image/profile.png");
}

.detail-info {
  padding: 24px 28px 32px;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 18px;
}

.detail-info strong {
  font-size: 24px;
  line-height: 1.2;
}

.detail-info span {
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--purple-light);
  color: var(--purple);
  font-size: 14px;
  font-weight: 900;
}

.detail-card > i {
  position: absolute;
  top: 18px;
  right: 18px;
  left: auto;
  bottom: auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--black);
  color: white;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.featured-badge {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 2;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--purple);
  color: white;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.28);
}

.project-cta {
  margin-top: 72px;
}

.project-cta h2 {
  max-width: 620px;
}

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  place-items: center;
  padding: 32px;
}

.project-modal.is-open {
  display: grid;
}

.project-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 10, 0.48);
  backdrop-filter: blur(12px);
}

.project-modal-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 64px));
  overflow: hidden;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 34px 120px rgba(7, 7, 10, 0.28);
}

.project-modal-media {
  width: 100%;
  background: var(--purple-light);
}

.project-modal-media img {
  width: 100%;
  height: clamp(220px, 32vh, 300px);
  object-fit: cover;
}

.project-modal-content {
  max-height: calc(min(760px, 100vh - 64px) - clamp(220px, 32vh, 300px));
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.project-modal-content span {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--purple-light);
  color: var(--purple);
  font-size: 12px;
  font-weight: 900;
}

.project-modal-content h2 {
  margin-top: 16px;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.project-modal-content p {
  margin: 16px 0 22px;
  color: var(--gray);
  line-height: 1.7;
}

.project-modal-notes {
  margin: 0 0 22px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(234, 220, 255, 0.56);
  border: 1px solid rgba(139, 92, 246, 0.14);
}

.project-modal-notes h3 {
  margin: 0 0 8px;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.project-modal-notes p {
  margin: 0;
  font-size: 14px;
}

.project-demo-box {
  margin: 0 0 22px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(234, 220, 255, 0.56);
  border: 1px solid rgba(139, 92, 246, 0.14);
}

.project-demo-box h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.project-demo-box p {
  margin: 0 0 16px;
  color: var(--gray);
  line-height: 1.6;
}

.project-demo-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.project-demo-actions .btn {
  flex: 1;
  padding: 14px 18px;
  font-size: 13px;
}

.project-case-study {
  display: grid;
  gap: 16px;
  margin: 0 0 22px;
}

.project-case-study[hidden] {
  display: none;
}

.project-case-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.68);
}

.project-case-image {
  appearance: none;
  border: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: transparent;
  cursor: zoom-in;
  overflow: hidden;
}

.project-case-image img {
  width: 100%;
  height: 100%;
  min-height: 126px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 14px;
  background: var(--purple-light);
  display: block;
  transition: transform 0.25s ease;
}

.project-case-image:hover img {
  transform: scale(1.04);
}

.project-case-item h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.project-case-item p,
.project-video-box p {
  margin: 0;
  color: var(--gray);
  font-size: 14px;
  line-height: 1.6;
}

.project-video-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.68);
}

.project-video-box video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--black);
  object-fit: cover;
}

.leave-modal {
  position: fixed;
  inset: 0;
  z-index: 420;
  display: none;
  place-items: center;
  padding: 24px;
}

.leave-modal.is-open {
  display: grid;
}

.leave-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 10, 0.5);
  backdrop-filter: blur(10px);
}

.leave-modal-panel {
  position: relative;
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 30px 90px rgba(7, 7, 10, 0.28);
}

.leave-modal-panel h2 {
  margin: 0 0 12px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.leave-modal-panel p {
  margin: 0;
  color: var(--gray);
  line-height: 1.7;
}

.leave-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.leave-modal-actions > * {
  flex: 1;
}

.leave-modal-cancel {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--black);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 520;
  display: none;
  place-items: center;
  padding: 24px;
}

.image-lightbox.is-open {
  display: grid;
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(7, 7, 10, 0.72);
  backdrop-filter: blur(10px);
  cursor: zoom-out;
}

.image-lightbox-panel {
  position: relative;
  width: min(980px, 100%);
  margin: 0;
  z-index: 1;
}

.image-lightbox-panel img {
  width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  display: block;
  border-radius: 22px;
  background: white;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.36);
}

.image-lightbox-panel figcaption {
  margin-top: 12px;
  color: white;
  text-align: center;
  font-weight: 800;
}

.image-lightbox-close {
  position: absolute;
  top: -16px;
  right: -16px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--black);
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.project-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--black);
  color: white;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 980px) {
  .project-hero {
    grid-template-columns: 1fr;
  }

  .project-filter {
    justify-content: flex-start;
  }

  .project-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-modal-panel {
    width: min(640px, 100%);
    max-height: calc(100vh - 48px);
  }
}

@media (max-width: 720px) {
  .project-hero {
    padding-top: 28px;
    gap: 22px;
  }

  .project-hero .section-title {
    font-size: clamp(34px, 12vw, 48px);
  }

  .project-lead {
    margin-top: 14px;
    font-size: 14px;
  }

  .project-filter {
    gap: 8px;
  }

  .project-filter button {
    padding: 10px 13px;
    font-size: 12px;
  }

  .project-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 28px;
  }

  .detail-card {
    border-radius: 18px;
  }

  .detail-thumb {
    height: 130px;
  }

  .detail-info {
    padding: 14px;
    gap: 10px;
  }

  .detail-info strong {
    font-size: 15px;
  }

  .detail-info span {
    padding: 6px 9px;
    font-size: 10px;
  }

  .detail-card i {
    width: 28px;
    height: 28px;
  }

  .project-modal {
    padding: 18px;
  }

  .project-modal-panel {
    width: min(420px, 100%);
    max-height: calc(100vh - 36px);
    border-radius: 22px;
  }

  .project-modal-media img {
    height: clamp(170px, 32vh, 220px);
  }

  .project-modal-content {
    max-height: calc(100vh - 36px - clamp(170px, 32vh, 220px));
    padding: 24px;
  }

  .project-modal-content h2 {
    font-size: 30px;
  }

  .project-modal-close {
    width: 36px;
    height: 36px;
    top: 12px;
    right: 12px;
  }

  .project-case-item {
    grid-template-columns: 1fr;
  }

  .project-demo-actions,
  .leave-modal-actions {
    flex-direction: column;
  }
}
