/* ═══════════════════════════════════════════════════════════
   animations.css —— 关键帧 / 入场显现 / 光效
   ═══════════════════════════════════════════════════════════ */

@keyframes sealPulse{
  0%,100%{ transform:scale(1);    box-shadow:0 0 0 0 rgba(201,162,39,.55); }
  50%    { transform:scale(1.06); box-shadow:0 0 0 18px rgba(201,162,39,0); }
}
@keyframes recPulse{
  0%  { box-shadow:0 0 0 0 rgba(232,199,102,.85); }
  70% { box-shadow:0 0 0 9px rgba(232,199,102,0); }
  100%{ box-shadow:0 0 0 0 rgba(232,199,102,0); }
}
@keyframes spinSlow{ to{ transform:rotate(360deg); } }

@keyframes revealUp{
  from{ opacity:0; transform:translateY(26px); }
  to  { opacity:1; transform:none; }
}
@keyframes sweep{
  0%  { transform:translateX(-120%) skewX(-18deg); opacity:0; }
  40% { opacity:.85; }
  100%{ transform:translateX(220%) skewX(-18deg); opacity:0; }
}
@keyframes drawLine{ from{ stroke-dashoffset:var(--len,1000); } to{ stroke-dashoffset:0; } }
@keyframes nodePop{
  0%  { transform:scale(0); opacity:0; }
  70% { transform:scale(1.5); opacity:1; }
  100%{ transform:scale(1);   opacity:1; }
}
@keyframes floatY{
  0%,100%{ transform:translateY(0); }
  50%    { transform:translateY(-9px); }
}
@keyframes badgeIn{
  0%  { transform:scale(.4) rotate(-24deg); opacity:0; }
  62% { transform:scale(1.1) rotate(4deg);  opacity:1; }
  100%{ transform:scale(1) rotate(0); }
}
@keyframes flashGold{
  0%,100%{ box-shadow:0 0 0 8px rgba(201,162,39,.09), 0 0 54px rgba(201,162,39,.4); }
  50%    { box-shadow:0 0 0 14px rgba(201,162,39,.16), 0 0 82px rgba(201,162,39,.68); }
}

/* ── 滚动显现 ── */
.rv{ opacity:0; }
.rv.in{ animation:revealUp .72s var(--ease-out) both; }
.rv.in[data-d="1"]{ animation-delay:.08s; }
.rv.in[data-d="2"]{ animation-delay:.16s; }
.rv.in[data-d="3"]{ animation-delay:.24s; }
.rv.in[data-d="4"]{ animation-delay:.32s; }
.rv.in[data-d="5"]{ animation-delay:.40s; }
.rv.in[data-d="6"]{ animation-delay:.48s; }

/* ── 封面：斜向金色光带 ── */
.scene--cover::before{
  content:""; position:absolute; top:0; bottom:0; width:190px; z-index:1;
  background:linear-gradient(90deg,transparent,rgba(201,162,39,.16),rgba(255,246,220,.24),rgba(201,162,39,.16),transparent);
  filter:blur(10px); pointer-events:none;
  animation:sweep 7.5s var(--ease) infinite;
  animation-delay:1.1s;
}
/* 封面：星点 */
.scene--cover::after{
  content:""; position:absolute; inset:0; z-index:0; pointer-events:none; opacity:.5;
  background-image:
    radial-gradient(1.4px 1.4px at 14% 22%, rgba(255,246,220,.9), transparent),
    radial-gradient(1.2px 1.2px at 82% 18%, rgba(255,246,220,.75), transparent),
    radial-gradient(1.6px 1.6px at 66% 72%, rgba(201,162,39,.9), transparent),
    radial-gradient(1.2px 1.2px at 26% 78%, rgba(255,246,220,.7), transparent),
    radial-gradient(1.1px 1.1px at 48% 34%, rgba(255,246,220,.6), transparent),
    radial-gradient(1.3px 1.3px at 91% 58%, rgba(201,162,39,.8), transparent),
    radial-gradient(1.1px 1.1px at 8% 54%, rgba(255,246,220,.55), transparent);
  animation:floatY 9s ease-in-out infinite;
}
.cover-inner > *{ animation:revealUp .9s var(--ease-out) both; }
.cover-inner > *:nth-child(1){ animation-delay:.10s; }
.cover-inner > *:nth-child(2){ animation-delay:.22s; }
.cover-inner > *:nth-child(3){ animation-delay:.32s; }
.cover-inner > *:nth-child(4){ animation-delay:.42s; }
.cover-inner > *:nth-child(5){ animation-delay:.52s; }
.cover-inner > *:nth-child(6){ animation-delay:.62s; }
.cover-inner > *:nth-child(7){ animation-delay:.72s; }
.cover-inner > *:nth-child(8){ animation-delay:.82s; }

/* ── 世界连线图动画 ── */
.mapwrap .route{
  stroke-dasharray:var(--len,600);
  stroke-dashoffset:var(--len,600);
  animation:drawLine 2.2s var(--ease-out) forwards;
  animation-delay:calc(var(--i,0) * .22s + .3s);
}
.mapwrap .node{ transform-origin:center; transform-box:fill-box; animation:nodePop .5s var(--ease-out) both; animation-delay:calc(var(--i,0) * .22s + .3s); }
.mapwrap .pulse{ animation:nodePop .6s var(--ease-out) both; animation-delay:calc(var(--i,0) * .22s + .45s); }

/* ── 徽章合成 ── */
.merge-badge{ animation:badgeIn .9s var(--ease-out) both, flashGold 4.2s ease-in-out 1s infinite; }
.merge-keys .key{ animation:badgeIn .7s var(--ease-out) both; }
.merge-keys .key:nth-child(1){ animation-delay:.05s; }
.merge-keys .key:nth-child(2){ animation-delay:.15s; }
.merge-keys .key:nth-child(3){ animation-delay:.25s; }
.merge-keys .key:nth-child(4){ animation-delay:.35s; }
.merge-arrow{ align-self:center; color:var(--c-gold); font-size:22px; animation:floatY 2.4s ease-in-out infinite; }

/* 钥匙 hover 光泽 */
.key--rich:hover .key-ring::after{ border-color:var(--c-gold-light); }

@media (prefers-reduced-motion:reduce){
  .scene--cover::before,.scene--cover::after,
  .merge-badge,.key-ring::after,.nav-btn--speech .rec,.boot-seal{ animation:none !important; }
  .rv{ opacity:1 !important; }
  .mapwrap .route{ stroke-dashoffset:0; animation:none !important; }
}
