:root {
  /* サイト全体で使う色 */
  color-scheme: dark;
  --background: #191e27;
  --text: #ffffff;
  --muted: #ffffff;
  --border: rgba(255, 255, 255, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.7;
}

#particle-canvas {
  /* 粒子アニメーションを画面全体の背景として固定 */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  background: #191e27;
}

.site-header {
  /* 背景canvasより前面に表示 */
  position: relative;
  z-index: 1;
  width: min(100% - 40px, 1180px);
  margin: 0 auto;
  padding: 28px 0 36px;
}

.portfolio {
  /* 背景canvasより前面に表示 */
  position: relative;
  z-index: 1;
  width: min(100% - 40px, 1180px);
  margin: 0 auto;
  padding: 0;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 44px 28px;
}

h1 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.is-glitching {
  /* タイトルのスクランブル演出中だけ適用 */
  animation: glitch 0.4s ease-in-out infinite;
}

@keyframes glitch {
  0% {
    text-shadow:
      2px -2px 0 #ff00c1,
      -2px 2px 0 #00fff0;
  }

  25% {
    text-shadow:
      -2px 2px 0 #ff00c1,
      2px -2px 0 #00fff0;
  }

  50% {
    text-shadow:
      2px 2px 0 #ff00c1,
      -2px -2px 0 #00fff0;
  }

  100% {
    text-shadow: none;
  }
}

.work {
  /* ホバー時に枠線が出てもレイアウトが動かないようにする */
  min-width: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  transition:
    transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
    border-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
    box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.work:hover {
  /* 作品ごとのネオンカラーはscript.jsから--neon-colorで受け取る */
  transform: translateY(-5px);
  border-color: var(--neon-color);
  box-shadow:
    inset 0 0 10px var(--neon-color),
    0 0 15px var(--neon-color),
    0 0 30px rgba(0, 0, 0, 0.5);
}

.video-frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0;
  background: #111;
}

.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.description {
  padding: 14px 14px 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.description h2 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  transition:
    color 0.4s ease,
    text-shadow 0.4s ease;
}

.work:hover .description h2 {
  color: #ffffff;
  text-shadow:
    0 0 5px #ffffff,
    0 0 10px var(--neon-color);
}

.description p {
  margin: 0;
  /* JS側の説明文に含めた改行を表示に反映 */
  white-space: pre-line;
}

@media (max-width: 720px) {
  .portfolio {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    width: min(100% - 28px, 1180px);
    padding: 22px 0 28px;
  }

  .works-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }
}
