/* ============================================================
   motion.css — 逆向自 tasteskill.dev 的动效系统
   提取日期 2026-12-05
   用法：在 system.css 之后引入
   ============================================================ */

:root{
  /* 缓动曲线（原站四条，全部保留） */
  --ease-out-expo:  cubic-bezier(.16, 1, .3, 1);
  --ease-out-quart: cubic-bezier(.25, 1, .5, 1);
  --ease-in-out:    cubic-bezier(.65, 0, .35, 1);
  --ease:           cubic-bezier(.2, .8, .2, 1);

  /* 时长 */
  --t-out: .2s;

  /* 入场时序（原站 100ms 间隔，这里压到 60ms 让内容更快到位） */
  --d-1: 0ms;
  --d-2: 60ms;
  --d-3: 120ms;
  --d-4: 180ms;
  --d-5: 240ms;
}

/* ------------------------------------------------------------
   入场：背景日出
   原站 1.4s，从 78% 缩放 + 下方 38% + 20% 透明度升起
   ------------------------------------------------------------ */
@keyframes hero-sunrise{
  0%{ opacity:.2; translate:0 38%; scale:.78 }
}
.anim-sunrise{
  animation: hero-sunrise 1.4s var(--ease-out-expo) backwards;
}

/* ------------------------------------------------------------
   入场：标题滑入
   从 112% 下方（完全在容器外）+ 7 度旋转
   7 度是刻意的——纯上滑会显得机械
   ------------------------------------------------------------ */
@keyframes hero-word{
  0%{ translate:0 112%; rotate:7deg }
}
.anim-word{
  animation: hero-word .95s var(--ease-out-expo) backwards;
}

/* ------------------------------------------------------------
   入场：内容上浮
   只有 18px 位移，很克制
   ------------------------------------------------------------ */
@keyframes hero-rise{
  0%{ opacity:0; translate:0 18px }
}
.anim-rise{
  animation: hero-rise .8s var(--ease-out-expo) backwards;
}
.anim-rise-1{ animation-delay: var(--d-2) }
.anim-rise-2{ animation-delay: var(--d-3) }
.anim-rise-3{ animation-delay: var(--d-4) }

/* ------------------------------------------------------------
   循环：呼吸
   16 秒往返，背景的"呼吸感"
   ------------------------------------------------------------ */
@keyframes hero-breathe{
  to{ opacity:.86; translate:2.5% -4%; scale:1.08 }
}
.anim-breathe{
  animation: hero-breathe 16s ease-in-out 1.4s infinite alternate;
}

/* ------------------------------------------------------------
   循环：余烬漂移
   22 秒三关键帧，左右漂移 + 缩放
   与 breathe 周期不同（16 vs 22），永远不会同步
   ------------------------------------------------------------ */
@keyframes hero-ember{
  50%{ translate:-14% -8%; scale:1.12 }
  to{ translate:14% 2%;  scale:.94 }
}
.anim-ember{
  animation: hero-ember 22s ease-in-out 1.4s infinite alternate;
}

/* ------------------------------------------------------------
   球体：改用 ember 的漂移逻辑（原站是纯上下浮动，太机械）
   ------------------------------------------------------------ */
@keyframes orb-drift{
  0%  { transform: translate(-50%,-50%) translate(0,0)      scale(1)    }
  50% { transform: translate(-50%,-50%) translate(-6px,-9px) scale(1.012) }
  100%{ transform: translate(-50%,-50%) translate(5px,-3px)  scale(.995) }
}
.orb-drift{
  animation: orb-drift 18s ease-in-out infinite alternate;
}

/* ------------------------------------------------------------
   转场：擦除 / 落定 / 退后（案例切换用）
   ------------------------------------------------------------ */
@keyframes shot-wipe{
  0%{ clip-path: inset(0 100% 0 0) }
  100%{ clip-path: inset(0 0 0 0) }
}
@keyframes shot-settle{
  0%{ opacity:0; scale:1.04 }
  100%{ opacity:1; scale:1 }
}
@keyframes shot-recede{
  0%{ opacity:1; scale:1 }
  100%{ opacity:0; scale:.97 }
}
.anim-wipe  { animation: shot-wipe   .82s var(--ease-in-out) backwards }
.anim-settle{ animation: shot-settle .82s var(--ease-in-out) backwards }
.anim-recede{ animation: shot-recede .82s var(--ease-in-out) backwards }

/* ------------------------------------------------------------
   滚动入场：进入视口时触发
   [data-reveal] 起初隐藏，加 .is-in 后播放
   兜底：JS 失败时 .no-js 让内容默认可见
   ------------------------------------------------------------ */
[data-reveal]{
  opacity:0;
  translate:0 18px;
  transition:
    opacity .7s var(--ease-out-expo),
    translate .7s var(--ease-out-expo);
}
[data-reveal].is-in{
  opacity:1;
  translate:0 0;
}
/* 错开延迟 */
[data-reveal][data-delay="1"]{ transition-delay:60ms }
[data-reveal][data-delay="2"]{ transition-delay:120ms }
[data-reveal][data-delay="3"]{ transition-delay:180ms }
[data-reveal][data-delay="4"]{ transition-delay:240ms }

/* 图片：从 96% 缩放淡入 */
[data-reveal="img"]{
  opacity:0;
  scale:.96;
  transition:
    opacity .8s var(--ease-out-expo),
    scale .8s var(--ease-out-expo);
}
[data-reveal="img"].is-in{
  opacity:1;
  scale:1;
}

/* ------------------------------------------------------------
   交互
   ------------------------------------------------------------ */
.hover-lift{
  transition: transform 90ms var(--ease), box-shadow .2s var(--ease);
}
.hover-lift:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -28px #501e0540;
}

/* ------------------------------------------------------------
   无障碍与降级
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  [data-reveal], [data-reveal="img"]{
    opacity:1 !important;
    translate:none !important;
    scale:1 !important;
  }
}

/* 手机：关掉无限循环动画省电 */
@media (max-width: 639px){
  .anim-breathe, .anim-ember, .orb-drift{
    animation: none !important;
  }
}
