.page-header {
  padding: 160px 0 60px;
  text-align: center;
}

.page-header h1 {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 900;
  margin-bottom: 16px;
}

.page-header h1 span {
  background: linear-gradient(135deg, var(--orange), var(--pink), var(--purple), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header p {
  color: var(--text-muted);
  font-size: 18px;
  max-width: 500px;
  margin: 0 auto;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.portfolio-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}

.portfolio-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 107, 53, 0.3);
}

.portfolio-card video,
.portfolio-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.portfolio-card video {
  background: #000;
  object-fit: contain;
}

.portfolio-card video:fullscreen {
  object-fit: contain;
  width: 100vw;
  height: 100vh;
}

.portfolio-card video:-webkit-full-screen {
  object-fit: contain;
  width: 100vw;
  height: 100vh;
}

.portfolio-card video:-moz-full-screen {
  object-fit: contain;
  width: 100vw;
  height: 100vh;
}

.portfolio-card-body {
  padding: 24px;
}

.portfolio-card-body h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.portfolio-card-body p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.portfolio-card-body .card-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}

.tag-video {
  background: rgba(0, 212, 255, 0.12);
  color: var(--cyan);
}

.tag-game {
  background: rgba(123, 47, 247, 0.12);
  color: var(--purple);
}

.tag-ai {
  background: rgba(255, 107, 53, 0.12);
  color: var(--orange);
}

.tag-site {
  background: rgba(255, 215, 0, 0.12);
  color: var(--yellow);
}

.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--orange), var(--pink));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
  border: none;
  cursor: pointer;
}

.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 46, 99, 0.35);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 50px;
  background: transparent;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(0, 212, 255, 0.3);
  transition: background .2s, border-color .2s;
  cursor: pointer;
}

.btn-ghost:hover {
  background: rgba(0, 212, 255, 0.08);
  border-color: var(--cyan);
}

.ai-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.ai-gallery-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  transition: transform .3s, box-shadow .3s, border-color .3s;
  cursor: pointer;
}

.ai-gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 107, 53, 0.25);
}

.ai-gallery-item img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}

.ai-gallery-item:hover img {
  transform: scale(1.03);
}

.ai-gallery-item-body {
  padding: 20px;
}

.ai-gallery-item-body h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.ai-gallery-item-body p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  transform: scale(0.9);
  transition: transform .3s ease;
}

.lightbox.open img {
  transform: scale(1);
}

.lightbox .lb-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  opacity: .6;
  transition: opacity .2s;
  line-height: 1;
}

.lightbox .lb-close:hover {
  opacity: 1;
}

.lightbox .lb-caption {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  text-align: center;
  max-width: 80%;
}

.lightbox .lb-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.35);
  font-size: 14px;
}

.card-carousel {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
  background: #000;
}

.card-carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity .6s ease;
}

.card-carousel img.carousel-active {
  opacity: 1;
  z-index: 1;
}

@media (max-width: 768px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .ai-gallery {
    grid-template-columns: 1fr;
  }

  .page-header {
    padding: 120px 0 40px;
  }
}

@media (max-width: 480px) {
  .ai-gallery-item img {
    height: 220px;
  }
}
