/* ============================
   GLOBAL
============================ */

body {
  margin: 0;
  background: #000;
  color: #d1d1d1;
  font-family: "JetBrains Mono", monospace;
  padding: 40px 20px;
  overflow-x: hidden;
}

/* 紫ノイズ背景（静的） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center,
    rgba(120, 0, 255, 0.15),
    transparent 70%
  );
  mix-blend-mode: screen;
  pointer-events: none;
}

/* ============================
   HEADER / MENU
============================ */

.header {
  margin-bottom: 40px;
  border-bottom: 1px solid rgba(157, 78, 221, 0.4);
  padding-bottom: 12px;
}

.menu {
  display: flex;
  gap: 20px;
}

.cmd {
  color: #00ff00;
  text-decoration: none;
  font-size: 16px;
  transition: 0.2s;
}

.cmd:hover,
.cmd.active {
  color: #9d4edd;
  text-shadow: 0 0 8px #9d4edd;
}

/* ============================
   CARD
============================ */

.card {
  border: 1px solid rgba(157, 78, 221, 0.4);
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 12px rgba(157, 78, 221, 0.3);
  animation: flicker 4s infinite;
}

/* flicker アニメーション */
@keyframes flicker {
  0% { opacity: 1; }
  50% { opacity: 0.9; }
  100% { opacity: 1; }
}

/* ============================
   ノイズ（緑＋紫）
============================ */

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: url(noise.gif), url(p-noise.gif);
  background-size: cover;
  opacity: 0.12;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: noiseMove 0.6s steps(2) infinite;
}

@keyframes noiseMove {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-2px, 1px); }
  100% { transform: translate(0, 0); }
}

/* ============================
   強制グリッチ（中ページ用）
============================ */

.glitch-attack {
  animation: glitchAttack 0.25s steps(2) forwards;
}

@keyframes glitchAttack {
  0% { transform: translate(0, 0); filter: hue-rotate(0deg); }
  20% { transform: translate(-8px, 4px) skewX(10deg); filter: hue-rotate(40deg); }
  40% { transform: translate(6px, -6px) skewX(-8deg); filter: hue-rotate(-40deg); }
  60% { transform: translate(-4px, 2px) skewX(6deg); filter: hue-rotate(20deg); }
  80% { transform: translate(3px, -3px) skewX(-4deg); filter: hue-rotate(-20deg); }
  100% { transform: translate(0, 0); filter: hue-rotate(0deg); }
}

/* ============================
   ページ遷移グリッチ
============================ */

.glitch-out {
  animation: glitchOut 0.4s steps(3) forwards;
}

@keyframes glitchOut {
  0% { opacity: 1; transform: none; }
  30% { opacity: 0.3; transform: skewX(20deg) translateX(20px); }
  60% { opacity: 0.1; transform: skewX(-20deg) translateX(-20px); }
  100% { opacity: 0; transform: none; }
}

.screen-split {
  animation: screenSplit 0.35s steps(2) forwards;
}

@keyframes screenSplit {
  0% { clip-path: inset(0 0 0 0); transform: translate(0, 0); }
  40% { clip-path: inset(0 0 50% 0); transform: translate(-10px, -4px); }
  60% { clip-path: inset(50% 0 0 0); transform: translate(10px, 4px); }
  100% { clip-path: inset(0 0 0 0); transform: translate(0, 0); }
}

.text-melt {
  display: inline-block;
  animation: textMelt 0.4s forwards;
}

@keyframes textMelt {
  0% { transform: translateY(0); filter: blur(0); opacity: 1; }
  40% { transform: translateY(4px); filter: blur(2px); opacity: 0.7; }
  80% { transform: translateY(10px); filter: blur(4px); opacity: 0.2; }
  100% { transform: translateY(0); filter: blur(0); opacity: 1; }
}

.terminal-text {
  font-family: "JetBrains Mono", monospace;
  white-space: pre-wrap;
  color: #39ff14;
  line-height: 1.6;
  text-shadow: 0 0 4px rgba(57,255,20,0.5);
}

.section-title {
  color: #9d4edd;
  text-shadow: 0 0 6px rgba(157,78,221,0.6);
  margin-bottom: 10px;
}

/* ============================
   GATE 専用リンクカラー（シアン）
============================ */

.gate-link {
  color: #00eaff;
  text-shadow: 0 0 6px rgba(0,234,255,0.6);
  font-size: 18px;
  text-decoration: none;
  transition: 0.2s;
}

.gate-link:hover {
  color: #39ff14;
  text-shadow: 0 0 8px rgba(57,255,20,0.8);
}

/* ============================
   LOG
============================ */

.log-item {
  margin: 14px 0;
}

.log-date {
  color: #20c202;
  margin-right: 10px;
  text-shadow: 0 0 4px rgba(57,255,20,0.5);
}

.log-desc {
  margin-left: 20px;
  color: #d1d1d1;
  font-size: 14px;
  opacity: 0.8;
  line-height: 1.4;
}

.log-tag {
  color: #00eaff;
  margin-left: 10px;
  font-size: 14px;
  text-shadow: 0 0 6px rgba(0,234,255,0.6);
  opacity: 0.9;
}

/* ============================
   GATE LIST
============================ */

.gate-list {
  list-style: none;
  padding-left: 0;
  margin-top: 20px;
}

.gate-list li {
  margin: 8px 0;
}

.gate-list .cmd {
  color: #9d4edd;
  text-shadow: 0 0 6px rgba(157,78,221,0.6);
  font-size: 18px;
}

.gate-list .cmd:hover {
  color: #39ff14;
  text-shadow: 0 0 8px rgba(57,255,20,0.8);
}
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(157, 78, 221, 0.4);
}

.nav-btn {
  color: #39ff14;
  text-decoration: none;
  font-size: 18px;
  text-shadow: 0 0 6px rgba(57,255,20,0.6);
  transition: 0.2s;
}

.nav-btn:hover {
  color: #9d4edd;
  text-shadow: 0 0 8px rgba(157,78,221,0.8);
}
@keyframes glitchChar {
  0% { opacity: 1; transform: none; }
  30% { opacity: 0.3; transform: skewX(25deg) translateX(2px); }
  60% { opacity: 0.1; transform: skewX(-25deg) translateX(-2px); }
  100% { opacity: 1; transform: none; }
}

.glitch-burst {
  animation: glitchChar 0.45s steps(2) forwards;
  opacity: 0.6;
  filter: blur(1px);
}

/* ============================
   📱 スマホ最適化
============================ */
@media (max-width: 600px) {

  /* 余白調整（スマホは狭いので軽く） */
  body {
    padding: 20px 14px;
  }

  /* メニューのタップしやすさUP */
  .menu {
    gap: 14px;
  }

  .cmd {
    font-size: 15px;
    padding: 6px 0; /* タップ領域を縦に広げる */
  }

  /* タイトルのサイズ調整 */
  .section-title {
    font-size: 22px;
    margin-bottom: 12px;
  }

  /* カードの幅と余白調整 */
  .card {
    padding: 16px;
    margin: 0;
  }

  /* ログの文字サイズ調整 */
  .log-desc {
    font-size: 13px;
    line-height: 1.5;
  }

  /* GATE リストの文字サイズ */
  .gate-list .cmd {
    font-size: 16px;
  }

  /* 横スクロール完全排除（重要） */
  html, body {
    overflow-x: hidden;
  }

  /* グリッチで横ズレしてもスクロール出さない */
  .glitch-attack,
  .screen-split {
    overflow-x: hidden;
  }

  /* post ナビゲーションの調整 */
  .post-nav {
    padding-top: 16px;
    margin-top: 30px;
  }

  .nav-btn {
    font-size: 16px;
  }
}
.glitch-out {
  opacity: 0;
  transition: opacity 0.4s ease;
}

body:not(.glitch-out) {
  opacity: 1;
  transition: opacity 0s !important; /* ← 復元時は一瞬で戻す */
}
