/* ==========================================================================
   微扰动力官网 · 首页入场动画（墨与纸）
   --------------------------------------------------------------------------
   最小侵入：仅在 html.pd-intro-active / html.pd-intro-done 状态下生效。
   不改动 landing.html 的任何原有 DOM、文案与样式。
   动画结束后由 intro-animation.js 移除所有类名与标记，页面恢复原状。

   配色严格取自原站：冷白 #fbfbfd / 碳黑 #1d1d1f / 柔灰 #6e6e73 / 蓝 #0071e3
   ========================================================================== */

html.pd-intro-active body { overflow: hidden; }

/* ---------- 开场层 ---------- */
.pd-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: #fbfbfd;
  filter: blur(0);
  opacity: 1;
  transition: opacity 900ms cubic-bezier(.19, 1, .22, 1),
              filter 900ms cubic-bezier(.19, 1, .22, 1);
}
.pd-intro-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}
.pd-intro-overlay.is-out { opacity: 0; filter: blur(24px); pointer-events: none; }

.pd-intro-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: min(90vw, 560px);
  text-align: center;
}
.pd-intro-ink {
  position: absolute;
  z-index: 0;
  width: min(80vw, 330px);
  height: auto;
  overflow: visible;
  transform-origin: center;
  transform: scale(.04);
  opacity: 0;
  pointer-events: none;
}
html.pd-intro-active .pd-intro-ink {
  animation: pdInkBloom 1400ms cubic-bezier(.19, 1, .22, 1) 250ms both;
}
.pd-intro-word {
  position: relative;
  z-index: 1;
  font-family: "Songti SC", "Noto Serif SC", "STSong", Georgia, serif;
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .48em;
  text-indent: .48em;
  color: #1d1d1f;
  opacity: 0;
  filter: blur(16px);
}
html.pd-intro-active .pd-intro-word {
  animation: pdWordEmerge 1000ms cubic-bezier(.19, 1, .22, 1) 850ms both;
}
.pd-intro-en {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  font-family: "Songti SC", "Noto Serif SC", "STSong", Georgia, serif;
  font-size: 11px;
  letter-spacing: .3em;
  text-indent: .3em;
  color: #6e6e73;
  opacity: 0;
}
html.pd-intro-active .pd-intro-en {
  animation: pdFadeIn 600ms cubic-bezier(.22, 1, .36, 1) 1300ms both;
}
.pd-intro-rule {
  width: 0;
  height: 1px;
  margin: 32px auto 0;
  background: rgba(0, 113, 227, .32);
}
html.pd-intro-active .pd-intro-rule {
  animation: pdRuleGrow 700ms cubic-bezier(.19, 1, .22, 1) 1500ms both;
}
.pd-intro-poem {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  font-family: "Songti SC", "Noto Serif SC", "STSong", Georgia, serif;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  line-height: 2;
  letter-spacing: .14em;
  color: #6e6e73;
  opacity: 0;
  transform: translateY(7px);
}
html.pd-intro-active .pd-intro-poem {
  animation: pdSoftRise 800ms cubic-bezier(.22, 1, .36, 1) 2000ms both;
}
.pd-intro-skip {
  position: absolute;
  right: clamp(18px, 4vw, 38px);
  bottom: clamp(18px, 4vw, 32px);
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 6px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: .16em;
  color: #6e6e73;
  cursor: pointer;
  transition: color 200ms, border-color 200ms;
}
.pd-intro-skip:hover { color: #1d1d1f; border-color: rgba(0, 0, 0, .22); }

/* ---------- 原页面首屏的分层显影 ---------- */
html.pd-intro-active [data-pd-item],
html.pd-intro-done [data-pd-item] {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(7px);
}
html.pd-intro-done [data-pd-item] {
  animation: pdSettle 1500ms cubic-bezier(.19, 1, .22, 1) forwards;
  animation-delay: calc(var(--pd-i, 0) * 140ms + 360ms);
}
html.pd-intro-done [data-pd-title] {
  animation-name: pdTitleSettle;
  animation-duration: 1750ms;
  animation-delay: 440ms;
}

/* ---------- 移动端：缩短分层间隔、放大触控目标 ---------- */
@media (max-width: 767px) {
  html.pd-intro-done [data-pd-item] {
    animation-delay: calc(var(--pd-i, 0) * 90ms + 320ms);
  }
  html.pd-intro-done [data-pd-title] { animation-delay: 400ms; }
  .pd-intro-skip {
    right: 16px;
    bottom: 12px;
    padding: 14px 0;
    font-size: 11px;
  }
  .pd-intro-poem { padding: 0 10px; }
}

/* ---------- keyframes ---------- */
@keyframes pdInkBloom {
  0%   { transform: scale(.04); opacity: 0; filter: blur(7px); }
  38%  { opacity: .9; }
  100% { transform: scale(1); opacity: .13; filter: blur(.5px); }
}
@keyframes pdWordEmerge {
  from { opacity: 0; filter: blur(16px); letter-spacing: .48em; }
  to   { opacity: 1; filter: blur(0); letter-spacing: .2em; }
}
@keyframes pdFadeIn { to { opacity: 1; } }
@keyframes pdRuleGrow {
  from { width: 0; opacity: 0; }
  to   { width: 96px; opacity: 1; }
}
@keyframes pdSoftRise { to { opacity: 1; transform: none; } }
@keyframes pdSettle { to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes pdTitleSettle { to { opacity: 1; filter: blur(0); letter-spacing: -.025em; } }

@media (prefers-reduced-motion: reduce) {
  .pd-intro-overlay { display: none; }
  html.pd-intro-active body { overflow: auto; }
  html.pd-intro-active [data-pd-item],
  html.pd-intro-done [data-pd-item] { opacity: 1; transform: none; filter: none; }
}
