/* 首頁主視覺：僅替「幻影鴿王」標題加入展開與字內掃光。 */
.hero .hero-headline-reveal {
  z-index: 1;
  opacity: 0;
  -webkit-clip-path: inset(0 50% 0 50%);
  clip-path: inset(0 50% 0 50%);
  transform: translateX(-50%) scaleX(.84);
  filter: drop-shadow(0 0 0 rgba(82, 142, 255, 0));
  animation: home-headline-reveal 1.15s cubic-bezier(.16, .82, .25, 1) 1.2s both;
}

.hero .hero-headline-light {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 50%;
  width: calc(100% - 60px);
  height: clamp(30vh, calc(24.688vw - 14.813px), 420px);
  min-height: 30vh;
  max-height: 420px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 39%, rgba(219, 237, 255, .05) 44%, rgba(232, 244, 255, .9) 50%, rgba(174, 208, 255, .08) 56%, transparent 61%) 130% 50% / 42% 100% no-repeat;
  -webkit-mask: url('../img/headline2.svg') center / 100% 100% no-repeat;
  mask: url('../img/headline2.svg') center / 100% 100% no-repeat;
  transform: translateX(-50%);
  animation: home-headline-sweep .95s ease-out 1.42s both;
}

.hero .hero-headline-light.for_mb {
  display: none;
}

.hero .hero-character-reveal {
  position: relative;
  z-index: 3;
}

/* 保留原本置中的揭開序幕構圖，並確保它位於人物前方。 */
.hero > a[href="#Intro"] {
  z-index: 4;
}

@keyframes home-headline-reveal {
  0% {
    opacity: 0;
    -webkit-clip-path: inset(0 50% 0 50%);
    clip-path: inset(0 50% 0 50%);
    transform: translateX(-50%) scaleX(.84);
  }

  35% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    -webkit-clip-path: inset(0 0 0 0);
    clip-path: inset(0 0 0 0);
    transform: translateX(-50%) scaleX(1);
    filter: drop-shadow(0 0 18px rgba(82, 142, 255, .28));
  }
}

@keyframes home-headline-sweep {
  0% {
    opacity: 0;
    background-position: 130% 50%;
  }

  12%,
  86% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    background-position: -30% 50%;
  }
}

@media (max-width: 767.98px) {
  /* AOS 在手機會被停用；僅補回首頁人物的原本 3 秒進場。 */
  .hero .character_wrap[data-aos] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero .hero-character-reveal {
    opacity: 0;
    transform: scale(.56);
    transform-origin: 50% 100%;
    animation: home-mobile-character-reveal 3s cubic-bezier(.16, .82, .25, 1) both;
  }

  .hero .hero-headline-light.for_dt {
    display: none;
  }

  .hero .hero-headline-light.for_mb {
    display: block;
    top: -6rem;
    width: calc(100% - 2rem);
    height: clamp(30vh, calc(89.3vw - 28.6px), 55vh);
    min-height: 30vh;
    max-height: 55vh;
    -webkit-mask-image: url('../img/headline_mob2.svg');
    mask-image: url('../img/headline_mob2.svg');
  }

  /* 維持原本置中的 CTA，避免在窄螢幕被推到人物右側。 */
  .hero > a[href="#Intro"] {
    right: auto;
    bottom: 2rem;
    left: 50%;
    animation: scroll 2s infinite;
    transform: translate(-50%, 0);
  }
}

@keyframes home-mobile-character-reveal {
  from {
    opacity: 0;
    transform: scale(.56);
  }

  to {
    opacity: 1;
    transform: scale(.94);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero .hero-character-reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .hero .hero-headline-reveal {
    opacity: 1;
    -webkit-clip-path: none;
    clip-path: none;
    transform: translateX(-50%);
    filter: none;
    animation: none;
  }

  .hero .hero-headline-light {
    display: none;
  }

  .hero > a[href="#Intro"] {
    animation: none;
  }
}
