/*==================================================
　5-17 パーティクルテキスト（ホーム）
===================================*/

#wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: calc(100vh - 68px);
  background:
    radial-gradient(ellipse 70% 50% at 50% 38%, var(--home-glow), transparent 70%),
    var(--home-bg);
  overflow: hidden;
  transition: background 0.45s ease;
}

/* ライト：紙吹雪が見えるようホーム背景は透明（5-8.css側でも指定） */
html:not([data-theme="dark"]) #wrapper {
  background: transparent;
}

/* ダーク：右側の月夜 */
[data-theme="dark"] #wrapper {
  background:
    radial-gradient(ellipse 50% 65% at 92% 36%, rgba(170, 190, 255, 0.22), transparent 60%),
    radial-gradient(ellipse 35% 45% at 82% 52%, rgba(120, 140, 220, 0.12), transparent 70%),
    radial-gradient(ellipse 70% 50% at 50% 38%, var(--home-glow), transparent 70%),
    linear-gradient(255deg, var(--home-bg) 0%, var(--home-bg) 55%, #0a1020 100%);
}

/* ---------- 朝日 / 月（左右対称） ---------- */

.sky-decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sky-sun,
.sky-moon {
  position: absolute;
  top: 14%;
  width: min(22vw, 168px);
  height: min(22vw, 168px);
  border-radius: 50%;
  will-change: transform, opacity;
  opacity: 0;
  transform: translateY(26vh) scale(0.85);
}

/* 朝日（ライトのみ・左）＝月と同サイズ・同高さ */
.sky-sun {
  left: clamp(12px, 4.5vw, 56px);
  right: auto;
  background:
    radial-gradient(circle at 35% 32%,
      #fffdf5 0%,
      #ffe9b5 28%,
      #f5c56a 62%,
      #e8a84a 100%);
  box-shadow:
    0 0 40px 14px rgba(255, 190, 100, 0.28),
    0 0 90px 36px rgba(255, 160, 70, 0.12),
    inset -10px -6px 22px rgba(200, 120, 40, 0.12);
  animation: sky-rise 2.8s cubic-bezier(0.22, 0.7, 0.25, 1) 0.2s forwards;
}

.sky-sun::before {
  content: "";
  position: absolute;
  width: 16%;
  height: 16%;
  left: 30%;
  top: 40%;
  border-radius: 50%;
  background: rgba(230, 170, 80, 0.22);
  box-shadow:
    26px -16px 0 -2px rgba(235, 175, 90, 0.18),
    40px 14px 0 -4px rgba(220, 150, 60, 0.16);
}

.sky-sun::after {
  display: none;
}

/* 月（ダークのみ・右） */
.sky-moon {
  right: clamp(12px, 4.5vw, 56px);
  left: auto;
  background:
    radial-gradient(circle at 32% 30%,
      #ffffff 0%,
      #eef2ff 28%,
      #c9d2ea 62%,
      #9aa6c4 100%);
  box-shadow:
    0 0 40px 14px rgba(190, 205, 255, 0.35),
    0 0 90px 36px rgba(140, 160, 230, 0.18),
    inset -14px -8px 28px rgba(60, 70, 110, 0.18);
  animation: none;
}

.sky-moon::before {
  content: "";
  position: absolute;
  width: 18%;
  height: 18%;
  left: 28%;
  top: 38%;
  border-radius: 50%;
  background: rgba(150, 160, 190, 0.28);
  box-shadow:
    28px -18px 0 -2px rgba(140, 150, 180, 0.22),
    42px 16px 0 -4px rgba(130, 140, 170, 0.2);
}

/* テーマ表示切替 */
html:not([data-theme="dark"]) .sky-sun,
html:not([data-theme="dark"]) .sky-moon,
html:not([data-theme="dark"]) .wave {
  display: none;
}

[data-theme="dark"] .sky-sun {
  display: none;
}

[data-theme="dark"] .sky-moon {
  display: block;
  animation: sky-rise 2.8s cubic-bezier(0.22, 0.7, 0.25, 1) 0.2s forwards;
}

@keyframes sky-rise {
  0% {
    opacity: 0;
    transform: translateY(26vh) scale(0.85);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sky-sun,
  .sky-moon {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

#particle {
  width: 100%;
  height: calc(100vh - 68px);
  vertical-align: bottom;
  position: relative;
  z-index: 1;
}

.home-caption {
  position: absolute;
  left: 50%;
  top: calc(50% + min(18vw, 120px));
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  padding: 0 20px;
  max-width: 90vw;
  text-align: center;
  font-family: "Noto Sans JP", sans-serif;
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  pointer-events: none;
}

#mode-home {
  padding: 0;
}

#mode-home .home-inner {
  margin: 0;
  max-width: none;
}

body.mode-home footer {
  display: none;
}

@media (max-width: 800px) {
  #wrapper {
    min-height: calc(100vh - 60px);
  }
  #particle {
    height: calc(100vh - 60px);
  }
  .home-caption {
    top: calc(50% + 72px);
    letter-spacing: 0.08em;
  }
  .sky-sun,
  .sky-moon {
    width: min(28vw, 120px);
    height: min(28vw, 120px);
    top: 18%;
  }
}
