/* 首屏區 */
.home-hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 60px 20px;
}

.home-hero h2 {
  font-size: 3rem;
  letter-spacing: 4px;
  background: linear-gradient(90deg, #A38AFF, #E2DCFF, #FFFFFF);
  background-size: 200%;
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: 0 0 25px rgba(200,180,255,0.3);
  animation: heroWelcome 2s ease forwards;
  opacity: 0;
  transition: background-position 0.8s ease-in-out, transform 0.3s;
}

.home-hero h2:hover {
  background-position: right;
  transform: scale(1.02);
}

@keyframes heroWelcome {
  0% { opacity: 0; filter: blur(10px); }
  100% { opacity: 1; filter: blur(0); }
}

.home-hero p {
  margin-top: 15px;
  font-size: 1.1rem;
  color: rgba(245,245,255,0.7);
  opacity: 0;
  animation: heroFade 2s ease 0.5s forwards;
}

@keyframes heroFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 呼吸箭頭 */
.home-hero p:last-of-type {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 20px;
  animation: arrowFloat 1.2s infinite ease-in-out;
}

@keyframes arrowFloat {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(5px); opacity: 1; }
}

/* ===== 左右膠囊模塊區段（置中 ＋ 光線流動） ===== */

.module {
  opacity: 0;
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center; /* 橢圓置中 */
  padding: 40px 0;
  transition: transform 0.8s ease-out, opacity 0.8s ease-out;
}

/* 只用來區分進場方向 左右滑入 */
.module-left-row {
  transform: translateX(-80px);
}
.module-right-row {
  transform: translateX(80px);
}

.module.visible {
  opacity: 1;
  transform: translateX(0);
}

/* 真正的橢圓方塊 */
.module-card {
  width: min(70%, 780px);
  padding: 32px 56px;
  border-radius: 999px;
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0.26) 0%,
    rgba(163,138,255,0.28) 25%,
    rgba(20,18,40,0.96) 60%,
    rgba(6,7,14,0.98) 100%
  );
  background-size: 200% 100%;           /* 給光線流動空間 */
  background-position: left center;      /* 預設左邊比較亮 */
  box-shadow:
    0 0 25px rgba(10,10,30,0.9),
    0 0 40px rgba(160,140,255,0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0 clamp(24px, 6vw, 80px);      /* 雙邊留空 不撞邊界 */
  transition:
    background-position 0.8s ease-in-out,
    box-shadow 0.4s ease,
    transform 0.3s ease;
}

/* 滑鼠滑上去 光線往右流動 變亮 */
.module-card:hover {
  background-position: right center;
  box-shadow:
    0 0 30px rgba(190,180,255,0.9),
    0 0 60px rgba(160,140,255,0.6);
  transform: translateY(-4px);
}

/* 文字置中 */
.module-card h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.module-card p {
  font-size: 1rem;
  opacity: 0.9;
}

/* 模塊按鈕 */
.module-btn {
  margin-top: 20px;
  padding: 10px 26px;
  background: rgba(200,180,255,0.15);
  border: 1px solid rgba(200,180,255,0.5);
  border-radius: 999px;
  color: #F5F5FF;
  cursor: pointer;
  transition: 0.25s ease;
}

.module-btn:hover {
  background: rgba(200,180,255,0.35);
  transform: translateY(-2px);
}

/* 星空淡入淡出 */
#space-bg {
  transition: opacity 1.5s ease-in-out;
  opacity: 0;
}

body:not(.scrolled) #space-bg {
  opacity: 1;
}

body.scrolled #space-bg {
  opacity: 0.5;
}

/* 手機調整 */
@media (max-width: 768px) {
  .module-card {
    width: calc(100% - 40px);
    padding: 26px 24px;
    margin: 0 20px;
  }
}
