/* ============================================================
   Our-World 官网 - effects.css（全部动效集中在此）
   ============================================================ */

/* ---------- 分行文字入场：先上后下 ---------- */
[data-reveal] .line{opacity:0}
[data-reveal] .line:nth-child(1){transform:translateY(-32px)}
[data-reveal] .line:nth-child(n+2){transform:translateY(32px)}

[data-reveal].in .line{
  animation-duration:.78s;
  animation-timing-function:cubic-bezier(.22,.82,.28,1);
  animation-fill-mode:forwards;
}
[data-reveal].in .line:nth-child(1){animation-name:lineFromTop;animation-delay:.08s}
[data-reveal].in .line:nth-child(2){animation-name:lineFromBottom;animation-delay:.32s}
[data-reveal].in .line:nth-child(3){animation-name:lineFromBottom;animation-delay:.56s}
[data-reveal].in .line:nth-child(n+4){animation-name:lineFromBottom;animation-delay:.8s}

@keyframes lineFromTop{
  from{opacity:0;transform:translateY(-32px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes lineFromBottom{
  from{opacity:0;transform:translateY(32px)}
  to{opacity:1;transform:translateY(0)}
}

/* ---------- 通用上升淡入 ---------- */
[data-reveal] .rise{opacity:0;transform:translateY(26px)}
[data-reveal].in .rise{
  animation:riseIn .82s cubic-bezier(.22,.82,.28,1) var(--d,0s) forwards;
}
@keyframes riseIn{
  from{opacity:0;transform:translateY(26px)}
  to{opacity:1;transform:translateY(0)}
}

/* ---------- 页头入场（用 top，禁用 transform，避免劫持内部 fixed） ---------- */
.site-header{animation:headerIn .7s cubic-bezier(.22,.82,.28,1) both}
@keyframes headerIn{
  from{opacity:0;top:-80px}
  to{opacity:1;top:0}
}

/* 导航入场（仅电脑端；nth-of-type 只统计 <a>，不受 nav-close 影响） */
@media (min-width:1081px){
  .site-nav a{animation:navIn .55s ease both}
  .site-nav a:nth-of-type(1){animation-delay:.25s}
  .site-nav a:nth-of-type(2){animation-delay:.33s}
  .site-nav a:nth-of-type(3){animation-delay:.41s}
  .site-nav a:nth-of-type(4){animation-delay:.49s}
  .site-nav a:nth-of-type(5){animation-delay:.57s}
  .site-nav a:nth-of-type(6){animation-delay:.65s}
  .site-nav a:nth-of-type(7){animation-delay:.73s}
  .site-nav a:nth-of-type(8){animation-delay:.81s}
}
@keyframes navIn{
  from{opacity:0;transform:translateY(-10px)}
  to{opacity:1;transform:translateY(0)}
}

/* ---------- 全屏菜单 X 入场 ---------- */
@keyframes closeIn{
  from{opacity:0;transform:scale(.5) rotate(-90deg)}
  to{opacity:1;transform:scale(1) rotate(0)}
}
.site-nav.is-open .nav-close{
  animation:closeIn .4s cubic-bezier(.22,.82,.28,1) .18s both;
}

/* ---------- 贡献者卡片（位移由 script.js 驱动，禁止写 animation/transform） ---------- */
.contrib-viewport{
  cursor:grab;
  touch-action:pan-y;
  user-select:none;
  -webkit-user-select:none;
}
.contrib-viewport.is-dragging{cursor:grabbing}
.contrib-track{display:flex;gap:26px;width:max-content}

.contrib-card{
  flex:0 0 auto;
  width:252px;
  height:378px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border-radius:var(--radius);
  background:var(--glass-bg);
  border:1px solid var(--glass-border);
  backdrop-filter:var(--glass-blur);
  -webkit-backdrop-filter:var(--glass-blur);
  box-shadow:0 12px 30px rgba(11,61,145,.16);
  transition:box-shadow .3s ease;
}
.contrib-card:hover{box-shadow:0 20px 44px rgba(11,61,145,.24)}

.contrib-avatar{flex:0 0 66%;overflow:hidden;background:rgba(255,255,255,.45)}
.contrib-avatar img{
  width:100%;height:100%;object-fit:cover;
  pointer-events:none;-webkit-user-drag:none;
}
.contrib-info{
  flex:1;
  display:flex;flex-direction:column;
  align-items:center;justify-content:center;
  text-align:center;
  padding:10px 14px;
}
.contrib-name{font-size:1.1rem;font-weight:800;color:var(--ink)}
.contrib-role{font-size:.82rem;font-weight:500;color:var(--ink-soft);margin-top:6px}

/* ---------- 页脚入场 ---------- */
.site-footer{animation:footIn .8s ease both}
@keyframes footIn{from{opacity:0}to{opacity:1}}

/* 兜底：若 JS 未执行/观察失败，1.6 秒后强制显示，避免白屏 */
.no-anim-fallback [data-reveal] .line,
.no-anim-fallback [data-reveal] .rise{opacity:1 !important;transform:none !important;animation:none !important}

/* ---------- 减少动态 ---------- */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto;scroll-snap-type:none}
  [data-reveal] .line,[data-reveal] .rise{opacity:1;transform:none;animation:none !important}
  .site-header,.site-nav a,.site-footer,.site-nav.is-open .nav-close{animation:none}
}