h1{
    font-size: 20px;
    color: #000000;
}

.portfolio-page {
  padding-top: 10%;
  padding-bottom: 60px;
  min-height: 100vh;
  text-align: center;
  overflow-y: auto;
}

/* サムネイルグリッド */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  padding: 0 4%;
}

/* サムネイル画像 */
.portfolio-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.portfolio-thumb:hover {
  transform: scale(1.05);
  filter: brightness(1.05);
}

/* モーダル */
.portfolio-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 999;
}

.portfolio-modal.active {
  opacity: 1;
  pointer-events: auto;
}

/* モーダルコンテンツ */
.portfolio-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.portfolio-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

/* モーダル閉じるボタン */
.portfolio-content .modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  background-color: rgba(255,255,255,1);
  z-index: 1000;
}

/* スマホ表示パディング調整 */
@media (max-width: 900px) {
  .portfolio-page {  
    padding-top: calc(12% + 60px);
  }

.portfolio-content .modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 12px;
  cursor: pointer;
  background-color: rgba(255,255,255,0.5);
  z-index: 1000;
}

}

.portfolio-header {
  position: fixed;
  top: 10%;
  right: 4%;
  z-index: 1001;
  pointer-events: auto;
}

.external-link {
  display: inline-block;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.pixiv-icon {
  width: 32px;
  height: 32px;
  display: block;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.external-link:hover .pixiv-icon {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* レスポンシブ */
@media (max-width: 900px) {
  .portfolio-header {
    top: 8%;
    right: 4%;
  }
  .pixiv-icon {
    width: 26px;
    height: 26px;
  }
}
