:root {
  --bg: #0b0e14; --fg: #e6edf3; --muted: #a9b1ba; --card: #111826; --accent: #7aa2f7;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif; }
img { display: block; max-width: 100%; height: auto; border-radius: 12px; }

.site-header { padding: 48px 20px 16px; text-align: center; }

/* ナビゲーション */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 16px;
}

.site-title { margin: 0; font-size: 28px; }

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.site-lead { margin: 16px 0 0; color: var(--muted); }

.section { padding: 24px 20px; max-width: 1100px; margin: 0 auto; }
/* セクション見出し + 下線装飾 */
.section h1 { 
  font-size: 24px; 
  margin: 0 0 24px; 
  position: relative; 
  display: inline-block; 
  padding-bottom: 6px; 
}
.section h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 4px;
}

/* フィルタボタン */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  background: var(--card);
  color: var(--fg);
  border: 2px solid transparent;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  white-space: nowrap;
}

.filter-btn:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-1px);
}

.filter-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat( auto-fit, minmax(240px, 1fr) );
  gap: 16px;
}

/* ギャラリーカード */
.card {
  display: block;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 外部リンクインジケーター */
.card[target="_blank"]::after {
  content: "🔗";
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card[target="_blank"]:hover::after {
  opacity: 1;
}

.card img, .card video { 
  width: 100%; 
  aspect-ratio: 3/2; 
  object-fit: cover; 
}

/* GIFアニメーション用スタイル */
.gif-animation {
  /* GIFは自動で再生されるので特別なスタイルは不要 */
  /* 必要に応じてボーダーやエフェクトを追加 */
}

.gif-lightbox {
  /* ライトボックス内のGIF用スタイル */
}

.caption { 
  display: block; 
  margin-top: 8px; 
  color: var(--muted); 
  font-size: 14px; 
}

.site-footer { 
  padding: 24px 20px 40px; 
  text-align: center; 
  color: var(--muted); 
}

/* Lightbox */
.lightbox { 
  position: fixed; 
  inset: 0; 
  display: none; 
  align-items: center; 
  justify-content: center; 
  background: rgba(0,0,0,.85); 
  z-index: 9999; 
  padding: 24px; 
}

.lightbox.open { 
  display: flex; 
}

.lightbox img, .lightbox video { 
  max-width: min(1200px, 95vw); 
  max-height: 85vh; 
  border-radius: 16px; 
}

.lightbox__close { 
  position: absolute; 
  top: 16px; 
  right: 16px; 
  background: #000; 
  color: #fff; 
  border: 0; 
  width: 40px; 
  height: 40px; 
  border-radius: 50%; 
  font-size: 24px; 
  cursor: pointer; 
}

.lightbox__cap { 
  color: var(--muted); 
  margin-top: 12px; 
  text-align: center; 
  max-width: min(1200px, 90vw); 
}

/* アニメーション */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .site-nav {
    flex-direction: column;
    text-align: center;
  }
  
  .nav-links {
    gap: 16px;
  }
  
  .filter-buttons {
    gap: 6px;
  }
  
  .filter-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
  }
  
  .site-title {
    font-size: 24px;
  }
  
  .contact-links {
    flex-direction: column;
    gap: 12px;
  }
}

/* コンタクトセクション */
.contact-info {
  text-align: center;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--card);
  color: var(--fg);
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.contact-link:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(122, 162, 247, 0.3);
}

.contact-icon {
  font-size: 18px;
}

/* スムーズスクロール */
html {
  scroll-behavior: smooth;
}


/* フィルタボタン */
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--card);
  color: var(--fg);
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
}

.filter-btn:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(122, 162, 247, 0.3);
}

.filter-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.filter-icon {
  font-size: 16px;
}

.filter-count {
  font-size: 12px;
  opacity: 0.8;
}

/* ギャラリーグリッド */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  transition: opacity 0.3s ease;
}

.gallery-item {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery-media {
  position: relative;
  cursor: pointer;
}

/* 個人作 / 合作バッジ */
.gallery-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  user-select: none;
}
.gallery-badge.badge-personal {
  background: linear-gradient(135deg, var(--accent), #9fb9ff);
}
.gallery-badge.badge-collab {
  background: linear-gradient(135deg, #ff6a3d, #ffb347);
}

.gallery-media img,
.gallery-media video {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-media:hover .gallery-overlay {
  opacity: 1;
}

.gallery-caption {
  font-weight: 500;
  font-size: 14px;
}

.external-link-icon {
  font-size: 18px;
  opacity: 0.9;
}

.no-items {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 40px;
  font-style: italic;
}

/* ライトボックス */
#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}

#lightbox-media {
  max-width: 100%;
  max-height: 80vh;
}

#lightbox-caption {
  color: white;
  margin-top: 16px;
  font-size: 16px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.9);
}

