/* ==========================================================================
   MOTION — 一个有作者感的焦点时刻 + 只为反馈/连续性的配角
   焦点：封面标题的一次裁切揭示 + 日落光晕的缓慢漂移（在屏才跑）
   配角：列表行首次进入的短促上移、顶部导航下划线（CSS）、阅读位置提示
   全部走 transform/opacity；reduced-motion 下只保留不透明度与颜色。
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  /* 焦点：标题从下方裁切揭示，一次，不重复 */
  .hero-name {
    opacity: 0;
    transform: translateY(18px);
    clip-path: inset(0 0 100% 0);
    animation: wyl-hero-rise 720ms cubic-bezier(0.16, 1, 0.3, 1) 80ms forwards;
  }

  .hero-eyebrow,
  .hero-tagline,
  .hero-scroll {
    opacity: 0;
    transform: translateY(10px);
    animation: wyl-hero-fade 620ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .hero-eyebrow { animation-delay: 40ms; }
  .hero-tagline { animation-delay: 260ms; }
  .hero-scroll  { animation-delay: 380ms; }

  /* 日落光晕缓慢漂移：transform only，在屏才跑，离屏暂停 */
  .hero::after {
    animation: wyl-sun-drift 26s ease-in-out infinite alternate;
    will-change: transform;
  }

  .hero[data-motion="off"]::after,
  .hero[data-motion="off"] .hero-name {
    animation-play-state: paused;
  }

  /* 列表：首次进入时短促上移，级联总延迟封顶 220ms */
  .post-list li {
    opacity: 0;
    transform: translateY(12px);
  }

  .post-list li.is-in {
    opacity: 1;
    transform: none;
    transition:
      opacity 420ms cubic-bezier(0.16, 1, 0.3, 1),
      transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--wyl-delay, 0ms);
  }
}

@keyframes wyl-hero-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
    clip-path: inset(0 0 100% 0);
  }
  to {
    opacity: 1;
    transform: none;
    clip-path: inset(0 0 -12% 0);
  }
}

@keyframes wyl-hero-fade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@keyframes wyl-sun-drift {
  from { transform: translate3d(-2%, 1.2%, 0) scale(1.015); }
  to   { transform: translate3d(2%, -1.4%, 0) scale(1.035); }
}

/* ---------- 继续阅读：一条位置提示，不是装饰 ---------- */
.wyl-resume {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  transition: border-color 0.22s var(--ease), color 0.22s var(--ease), background-color 0.22s var(--ease);
}

.wyl-resume:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.wyl-resume__bar {
  width: 54px;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.wyl-resume__bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
}

.wyl-resume__pct {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

/* 文章页顶部的那枚提示：不抢标题 */
.entry-header .wyl-resume {
  margin: 16px 0 0;
  font-size: 12.5px;
}

@media (prefers-reduced-motion: reduce) {
  .hero-name,
  .hero-eyebrow,
  .hero-tagline,
  .hero-scroll {
    opacity: 1;
    transform: none;
    clip-path: none;
    animation: none;
  }

  .post-list li {
    opacity: 1;
    transform: none;
  }

  .hero::after {
    animation: none;
  }
}

.wyl-resume__sep {
  opacity: 0.45;
}
/* ---------- polish：焦点可见、长标题截断、移动端省电 ---------- */
.wyl-resume:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wyl-resume > span:last-child {
  max-width: 22ch;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.topbar .nav a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 4px;
}

/* 小屏不跑光晕漂移：省电，也不制造无意义的晃动 */
@media (max-width: 780px) {
  .hero::after {
    animation: none !important;
  }
}