/* ============================================
   PROJECTS — 映像・Web・アプリの制作実績（明るく・コンパクト・スタイリッシュ）
   ============================================ */
#projects.pj {
  --pj-ink: #0f1222;
  --pj-sub: #5b6075;
  --pj-line: rgba(15, 18, 34, .08);
  --pj-grad: linear-gradient(100deg, #ff2d92 0%, #8b5cf6 52%, #22c3ee 100%);
  --pj-video: #ff2d92;
  --pj-web: #3b82f6;
  --pj-app: #10b981;
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 10vw, 128px) 0;
  color: var(--pj-ink);
  background:
    radial-gradient(42% 38% at 92% 6%, rgba(139, 92, 246, .12), transparent 70%),
    radial-gradient(40% 36% at 4% 96%, rgba(34, 195, 238, .12), transparent 70%),
    #f7f8fc;
}

/* --- 見出し＋絞り込み --- */
.pj-top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.pj-head { max-width: 600px; }
.pj-tag {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 12px/1 var(--font-en-display, sans-serif); letter-spacing: .28em; color: var(--pj-sub);
}
.pj-tag i { width: 28px; height: 2px; border-radius: 2px; background: var(--pj-grad); }
.pj-title {
  margin: 16px 0 14px; font-family: var(--font-jp-display, sans-serif); font-weight: 900;
  font-size: clamp(30px, 4.4vw, 50px); line-height: 1.2; letter-spacing: -.01em; color: var(--pj-ink);
}
.pj-grad { background: var(--pj-grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.pj-desc { font-size: clamp(14px, 1.5vw, 15.5px); line-height: 1.9; color: var(--pj-sub); font-weight: 500; }

.pj-side { display: flex; flex-direction: column; align-items: flex-end; gap: 16px; flex: none; }
.pj-total { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.pj-total b {
  font: 700 clamp(48px, 6vw, 72px)/.9 var(--font-en-display, sans-serif); letter-spacing: -.04em;
  background: var(--pj-grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.pj-total span { font: 700 12px/1 var(--font-en-display, sans-serif); letter-spacing: .28em; color: var(--pj-sub); }

.pj-filters {
  display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px;
  background: rgba(255, 255, 255, .85); border: 1px solid var(--pj-line);
  box-shadow: 0 6px 24px -14px rgba(15, 18, 34, .3);
}
.pj-filter {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; border: 0; background: transparent;
  font: 700 14px/1 var(--font-jp-display, sans-serif); color: var(--pj-sub);
  padding: 10px 16px; border-radius: 999px; transition: background .25s, color .25s;
}
.pj-filter:hover { color: var(--pj-ink); }
.pj-filter .pj-count { font: 700 11px/1 var(--font-en-display, sans-serif); opacity: .55; }
.pj-filter[aria-pressed="true"] { background: var(--pj-ink); color: #fff; }
.pj-filter[aria-pressed="true"] .pj-count { opacity: .75; }

/* --- タイル（すべて同じ大きさ） --- */
.pj-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.5vw, 18px); }
.pj-card {
  --pj-c: var(--pj-video);
  position: relative; overflow: hidden; aspect-ratio: 16 / 11; border-radius: 16px; background: #e9ebf3; isolation: isolate;
  box-shadow: 0 1px 2px rgba(15, 18, 34, .06), 0 14px 30px -20px rgba(15, 18, 34, .45);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s;
}
.pj-card[data-kind="web"] { --pj-c: var(--pj-web); }
.pj-card[data-kind="app"] { --pj-c: var(--pj-app); }
.pj-card[hidden] { display: none; }
.pj-card:hover, .pj-card:focus-within { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(15, 18, 34, .06), 0 24px 44px -22px rgba(15, 18, 34, .55); }

.pj-thumb {
  position: absolute; inset: 0; display: block; padding: 0; margin: 0; border: 0; background: none;
  cursor: pointer; color: inherit; z-index: 0;
}
div.pj-thumb { cursor: default; }
.pj-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.pj-card[data-kind="video"] .pj-thumb img { object-position: center; }
.pj-card:hover .pj-thumb img { transform: scale(1.06); }
/* 文字を読ませるための下からのグラデーション */
.pj-thumb::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 12, 26, 0) 42%, rgba(10, 12, 26, .55) 72%, rgba(10, 12, 26, .9) 100%);
}
.pj-thumb:focus-visible { outline: 3px solid #8b5cf6; outline-offset: -3px; border-radius: 16px; }

.pj-play, .pj-go {
  position: absolute; z-index: 2; right: 12px; top: 12px; width: 38px; height: 38px;
  display: grid; place-items: center; border-radius: 50%; color: #fff;
  background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .5);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), background .3s, color .3s;
}
.pj-play::before { content: ""; margin-left: 3px; border-left: 11px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.pj-go { font: 600 16px/1 sans-serif; }
.pj-card:hover .pj-play, .pj-card:hover .pj-go { background: #fff; color: var(--pj-c); }
.pj-card:hover .pj-play { transform: scale(1.1); }
.pj-card:hover .pj-go { transform: rotate(45deg); }
.pj-badge {
  position: absolute; left: 12px; top: 12px; z-index: 2; font: 700 10.5px/1 var(--font-jp-display, sans-serif); letter-spacing: .06em;
  color: #fff; background: rgba(15, 18, 34, .55); border: 1px solid rgba(255, 255, 255, .35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 999px; padding: 6px 10px;
}

.pj-body {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; pointer-events: none;
  padding: 14px 14px 13px; color: #fff; transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}
.pj-card:hover .pj-body { transform: translateY(-3px); }
.pj-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.pj-label {
  display: inline-flex; align-items: center; gap: 6px; font: 700 10.5px/1 var(--font-en-display, sans-serif); letter-spacing: .08em;
  color: #fff; padding: 5px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pj-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pj-c); box-shadow: 0 0 8px var(--pj-c); }
.pj-cat { font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, .78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-card h3 {
  margin: 0; font-family: var(--font-jp-display, sans-serif); font-weight: 800; font-size: 14px; line-height: 1.45; color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .25);
}
.pj-card p { display: none; }

/* --- もっと見る --- */
.pj-more-wrap { text-align: center; margin-top: clamp(32px, 4vw, 48px); }
.pj-more {
  cursor: pointer; display: inline-flex; align-items: center; gap: 10px;
  font: 700 14.5px/1 var(--font-jp-display, sans-serif); color: #fff; background: var(--pj-ink);
  border: 0; border-radius: 999px; padding: 16px 30px; box-shadow: 0 16px 34px -18px rgba(15, 18, 34, .7);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
}
.pj-more:hover { transform: translateY(-2px); box-shadow: 0 22px 40px -18px rgba(139, 92, 246, .8); }
.pj-more[hidden] { display: none; }

/* --- 動画モーダル --- */
.pj-modal {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 10, 22, .8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pj-modal[hidden] { display: none; }
.pj-modal-box { width: min(1000px, 100%); border-radius: 18px; overflow: hidden; background: #0f1222; box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .8); }
.pj-modal-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.pj-modal-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pj-modal-foot { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.pj-modal-title { flex: 1; margin: 0; font: 700 15px/1.5 var(--font-jp-display, sans-serif); color: #fff; }
.pj-modal-close {
  cursor: pointer; width: 42px; height: 42px; flex: none; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .1); color: #fff; font: 400 22px/1 sans-serif;
}
.pj-modal-close:hover { background: #fff; color: #0f1222; }

@media (max-width: 1024px) {
  .pj-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pj-top { flex-direction: column; align-items: flex-start; }
  .pj-side { align-items: flex-start; }
  .pj-total { display: none; }
}
@media (max-width: 720px) {
  .pj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pj-card { border-radius: 12px; aspect-ratio: 4 / 3.4; }
  .pj-body { padding: 10px 10px 9px; }
  .pj-card h3 { font-size: 12.5px; }
  .pj-cat { display: none; }
  .pj-label { padding: 4px 7px; font-size: 9.5px; }
  .pj-play, .pj-go { width: 30px; height: 30px; right: 8px; top: 8px; }
  .pj-play::before { border-left-width: 9px; border-top-width: 6px; border-bottom-width: 6px; margin-left: 2px; }
  .pj-go { font-size: 13px; }
  .pj-badge { left: 8px; top: 8px; padding: 5px 8px; font-size: 9.5px; }
  .pj-filters { width: 100%; justify-content: space-between; }
  .pj-filter { padding: 10px 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .pj-card, .pj-thumb img, .pj-body, .pj-play, .pj-go, .pj-more { transition: none; }
  .pj-card:hover .pj-thumb img { transform: none; }
}
