/* 八重罗生官网 · 动效与装饰增量层（不改 site.css）
   依赖：site.css 之后加载；motion.js 给 <html> 加 .motion-on 后才启用隐藏态（fail-open）
   原则：仅动画 transform / opacity；尊重 prefers-reduced-motion；<=768px 关闭氛围层 */

@keyframes b-drift{from{transform:scale(1.02)}to{transform:scale(1.07)}}
@keyframes b-breathe{from{opacity:.86}to{opacity:1}}
@keyframes b-ember{0%{opacity:0;transform:translateY(14px)}35%{opacity:.6}100%{opacity:0;transform:translateY(-40px)}}
@keyframes b-in{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:translateY(0)}}
@keyframes b-flow{0%{opacity:0;transform:translateY(-12px)}40%{opacity:.9}100%{opacity:0;transform:translateY(22px)}}

/* ---- 补齐定位上下文（原有规则未声明，伪元素需要） ---- */
.content-card,.button,.recruit-visual,.down-line{position:relative}
.button{overflow:hidden}
.section-pad + .section-pad{position:relative}

/* ---- hero 氛围层 ---- */
html.motion-on .hero-bg{animation:b-drift 20s ease-in-out infinite alternate;will-change:transform}
html.motion-on .hero-vignette{animation:b-breathe 6s ease-in-out infinite alternate}
html.motion-on .hero-bg::before,
html.motion-on .hero-bg::after,
html.motion-on .hero-vignette::after{
  content:"";position:absolute;width:6px;height:6px;border-radius:50%;
  background:var(--cyan);opacity:0;pointer-events:none;
  animation:b-ember 9s linear infinite}
html.motion-on .hero-bg::before{left:18%;bottom:16%;animation-delay:0s}
html.motion-on .hero-bg::after{left:63%;bottom:26%;animation-delay:3.2s}
html.motion-on .hero-vignette::after{left:82%;bottom:12%;animation-delay:6.1s;animation-duration:12s}

html.motion-on .hero-copy > *{animation:b-in .7s both}
html.motion-on .hero-copy > *:nth-child(2){animation-delay:.09s}
html.motion-on .hero-copy > *:nth-child(3){animation-delay:.18s}
html.motion-on .hero-copy > *:nth-child(4){animation-delay:.27s}
html.motion-on .hero-copy > *:nth-child(5){animation-delay:.36s}
html.motion-on .hero-copy > *:nth-child(6){animation-delay:.45s}

html.motion-on .down-line::after{content:"";position:absolute;left:50%;top:0;
  width:1px;height:14px;background:var(--cyan);opacity:0;
  animation:b-flow 1.8s linear infinite}

/* ---- 滚动揭示（初始隐藏态只在 motion-on 下生效，JS 失效即全量显示） ---- */
html.motion-on [data-reveal]{opacity:0;transform:translateY(18px);
  transition:opacity .55s cubic-bezier(.2,.7,.2,1),
             transform .55s cubic-bezier(.2,.7,.2,1);
  transition-delay:var(--rd,0ms)}
html.motion-on [data-reveal].in{opacity:1;transform:none}

/* ---- 卡片 / 按钮微交互（叠加在既有 hover 之上，不覆盖） ---- */
.card-cover{transition:transform .3s}
.content-card:hover .card-cover,
.content-card:focus-visible .card-cover{transform:scale(1.05)}
.content-card::after{content:"";position:absolute;left:0;top:0;height:2px;width:100%;
  background:var(--cyan);transform:scaleX(0);transform-origin:left;
  transition:transform .4s;pointer-events:none;z-index:2}
.content-card:hover::after,
.content-card:focus-visible::after{transform:scaleX(1)}
.feature-no{transition:color .2s,transform .2s}
.feature:hover .feature-no{color:var(--cyan);transform:translateX(2px)}
.button::after{content:"";position:absolute;inset:0;
  background:rgba(255,255,255,.1);transform:translateX(-120%);
  transition:transform .5s;pointer-events:none}
.button:hover::after{transform:translateX(120%)}
.text-more span{display:inline-block;transition:transform .2s}
.text-more:hover span{transform:translateX(4px)}

/* ---- 装饰 ---- */
html.motion-on body{
  background-image:repeating-linear-gradient(135deg,
    rgba(229,179,103,.028) 0 1px,transparent 1px 14px)}
.section-pad + .section-pad::before{content:"";position:absolute;top:0;left:50%;
  transform:translateX(-50%);width:min(240px,40%);height:1px;
  background:linear-gradient(90deg,transparent,rgba(229,179,103,.42),transparent);
  pointer-events:none}
.section-pad + .section-pad::after{content:"";position:absolute;top:-4px;left:50%;
  width:8px;height:8px;border:1px solid rgba(229,179,103,.55);
  transform:translateX(-50%) rotate(45deg);pointer-events:none}
.section-kicker::before{content:"";display:inline-block;width:6px;height:6px;
  margin-right:9px;background:var(--red-light);
  transform:rotate(45deg);vertical-align:middle}
.section-heading h2::after{content:"";display:block;width:40px;height:2px;
  margin-top:14px;background:var(--red-light);opacity:.85}
.recruit-visual::before,.recruit-visual::after{content:"";position:absolute;
  width:22px;height:22px;border:1px solid rgba(229,179,103,.38);pointer-events:none}
.recruit-visual::before{left:12px;top:12px;border-right:0;border-bottom:0}
.recruit-visual::after{right:12px;bottom:12px;border-left:0;border-top:0}

/* ---- 移动端：关氛围层、去位移，省电并避免低端机掉帧 ---- */
@media(max-width:768px){
  html.motion-on .hero-bg{animation:none}
  html.motion-on .hero-vignette{animation:none}
  html.motion-on .hero-bg::before,
  html.motion-on .hero-bg::after,
  html.motion-on .hero-vignette::after{display:none}
  html.motion-on .down-line::after{display:none}
  html.motion-on [data-reveal]{transform:none}
  .section-pad + .section-pad::before{width:min(160px,50%)}
}

/* ---- 无障碍：与站点已有全局降级规则叠加，双重保险 ---- */
@media(prefers-reduced-motion:reduce){
  html.motion-on *,html.motion-on *::before,html.motion-on *::after{
    animation:none!important;transition:none!important}
  html.motion-on [data-reveal]{opacity:1!important;transform:none!important}
}
