/* Hero 入场时间表：delay 为相对 Hero 开始，duration 为每项入场用时。 */
:root {
  /* PC 时间表。delay = 开始时间，duration = 播放多久；单位 s 或 ms。
     各项可交叠；整组会自动等所有首页入场动画结束，无需手动计算收尾时间。 */
  --hero-intro-duration: 1.35s;    /* I’m */
  --hero-richelle-duration: 1.35s; /* Richelle */
  --hero-yao-duration: 1.35s;      /* Yao */
  --hero-photo-duration: 2.0s;    /* 照片 */
  --hero-left-duration: 1.35s;     /* About Me 1 */
  --hero-right-duration: 1.35s;    /* About Me 2（手机端滚动触发也使用它） */
  --hero-enter-ease: cubic-bezier(.16,.85,.25,1); /* 起步快，后段逐渐减速到停稳 */
  --hero-intro-delay: 0s; /* I’m */
  --hero-richelle-delay: .5s;
  --hero-yao-delay: .75s;
  --hero-photo-delay: 0.95s;
  --hero-about-delay: 1.6s; /* PC 两段 About Me 同时开始，只调这一项 */
  --hero-left-delay: var(--hero-about-delay);
  --hero-right-delay: var(--hero-about-delay);
  --hero-links-delay: 2.3s; /* 四个链接原位渐显 */
  --hero-link-ai-duration:.85s;      /* AI Project 按钮 */
  --hero-link-trading-duration:.85s; /* Option Trading 按钮 */
  --hero-link-welfare-duration:.85s; /* Public Welfare 按钮 */
  --hero-link-music-duration:.85s;   /* Music 按钮 */
  --hero-enter-distance: 22px;

  /* PC 红框 + 白字：delay 从对应文段开始淡入时计时（不是淡入完成后）。
     黑字保持原位；红框和白字作为两层同步从左滑入。 */
  --hero-left-emphasis-delay: .5s;
  --hero-left-emphasis-duration: .65s;
  --hero-right-emphasis-delay: 0.70s;
  --hero-right-emphasis-duration: .65s;
  --hero-emphasis-distance: 32px;
  --hero-emphasis-ease: cubic-bezier(.16,.85,.25,1);
}
.hero-stage .intro { --hero-delay: var(--hero-intro-delay); --hero-duration: var(--hero-intro-duration); }
.hero-stage .first-name { --hero-delay: var(--hero-richelle-delay); --hero-duration: var(--hero-richelle-duration); }
.hero-stage .last-name { --hero-delay: var(--hero-yao-delay); --hero-duration: var(--hero-yao-duration); }
.hero-stage .portrait { --hero-delay: var(--hero-photo-delay); --hero-duration: var(--hero-photo-duration); }
.hero-stage .bio-left { --hero-delay: var(--hero-left-delay); --hero-duration: var(--hero-left-duration); }
.hero-stage .bio-right { --hero-delay: var(--hero-right-delay); --hero-duration: var(--hero-right-duration); }
.hero-stage .hero-link { --hero-delay: var(--hero-links-delay); }
.hero-stage .link-ai { --hero-duration: var(--hero-link-ai-duration); }
.hero-stage .link-trading { --hero-duration: var(--hero-link-trading-duration); }
.hero-stage .link-welfare { --hero-duration: var(--hero-link-welfare-duration); }
.hero-stage .link-music { --hero-duration: var(--hero-link-music-duration); }
html.hero-pending .hero-stage :is(.intro,.first-name,.last-name,.portrait,.bio,.hero-link) { opacity: 0; }
html.hero-entering .hero-stage :is(.intro,.first-name,.last-name,.portrait,.bio) {
  animation: hero-rise var(--hero-duration) var(--hero-enter-ease) var(--hero-delay) both;
}
html.hero-entering .hero-stage .hero-link {
  animation: hero-appear var(--hero-duration) ease-out var(--hero-delay) both;
}
@keyframes hero-rise { from { opacity:0; translate:0 var(--hero-enter-distance); } to { opacity:1; translate:0 0; } }
@keyframes hero-appear { from { opacity:0; } to { opacity:1; } }
/* 手机独立时间表：下面的数值只影响手机，不会跟随 PC 时间修改。
   第一段 About Me 跟在照片后面；第二段等第一段完成且滚入视野后开始。
   手机第二段不使用 --hero-right-delay；其红框延迟同样从该段开始淡入时计时。 */
@media(max-width:767px) {
  :root {
    --hero-intro-delay: 0s;
    --hero-richelle-delay: .5s;
    --hero-yao-delay: .75s;
    --hero-photo-delay: .95s;
    --hero-left-delay: 1.35s;
    --hero-right-delay: 0s;
    --hero-enter-ease: cubic-bezier(.16,.85,.25,1);
    --hero-left-emphasis-delay: .5s;
    --hero-left-emphasis-duration: .65s;
    --hero-right-emphasis-delay: .5s;
    --hero-right-emphasis-duration: .65s;
    --hero-emphasis-distance: 24px;
    --hero-emphasis-ease: cubic-bezier(.16,.85,.25,1);
    --hero-intro-duration: 1.35s;
    --hero-richelle-duration: 1.35s;
    --hero-yao-duration: 1.35s;
    --hero-photo-duration: 2.0s;
    --hero-left-duration: 1.35s;
    --hero-right-duration: 1.35s;
    --hero-enter-distance: 14px;
  }
}
@media(prefers-reduced-motion:reduce) {
  html.hero-pending .hero-stage :is(.intro,.first-name,.last-name,.portrait,.bio,.hero-link) { opacity:1; }
  html.hero-entering .hero-stage :is(.intro,.first-name,.last-name,.portrait,.bio,.hero-link) { animation:none; }
}

/* Animate the colored layers only, preserving the existing black/white offset. */
.hero-stage .bio-left { --emphasis-delay:var(--hero-left-emphasis-delay); --emphasis-duration:var(--hero-left-emphasis-duration); }
.hero-stage .bio-right { --emphasis-delay:var(--hero-right-emphasis-delay); --emphasis-duration:var(--hero-right-emphasis-duration); }
.hero-stage .emphasis-waiting .layered-emphasis::before,
.hero-stage .emphasis-waiting .emphasis-overlay { opacity:0; }
.hero-stage .emphasis-entering .layered-emphasis::before,
.hero-stage .emphasis-entering .emphasis-overlay {
  animation:hero-emphasis-slide var(--emphasis-duration) var(--hero-emphasis-ease) var(--emphasis-delay) both;
}
@keyframes hero-emphasis-slide {
  from { opacity:0; translate:calc(-1 * var(--hero-emphasis-distance)) 0; }
  to { opacity:1; translate:0 0; }
}
@media(prefers-reduced-motion:reduce) {
  .hero-stage .emphasis-waiting .layered-emphasis::before,
  .hero-stage .emphasis-waiting .emphasis-overlay { opacity:1; }
  .hero-stage .emphasis-entering .layered-emphasis::before,
  .hero-stage .emphasis-entering .emphasis-overlay { animation:none; }
}
