/* motion/scroll.css — 滚动入场增强：stagger 错峰、workflow 连线、对比板块、表单方向变体。 */

/* -------------------------------------------------------------------------- */
/* A. 通用 stagger                                                            */
/* 初始隐藏必须挂在 html.has-motion 下：无 JS 时没有该类，内容保持可见。     */
/* html.has-motion [data-stagger] > * 特异性 0,2,1，压过 .reveal.is-visible   */
/* (0,2,0)；本文件在 styles.css 之后加载，形成容器内 --si 错峰入场。         */
/* -------------------------------------------------------------------------- */

html.has-motion [data-stagger] > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

html.has-motion:not(.motion-reduced) [data-stagger] > * {
  transition-delay: calc(var(--si, 0) * 80ms);
}

html.has-motion [data-stagger].stagger-in > *,
html.has-motion.motion-reduced [data-stagger] > * {
  opacity: 1;
  transform: none;
}

/* -------------------------------------------------------------------------- */
/* B. workflow 连线：叠在编号列既有 border-right 上，scaleY 自上而下生长。    */
/* 编号色从 muted 过渡到 mint；纯 CSS，跟随容器 .stagger-in / reduced 终态。 */
/* -------------------------------------------------------------------------- */

html.has-motion [data-workflow] > li > span {
  position: relative;
  color: var(--muted);
  transition: color 0.5s ease;
}

html.has-motion [data-workflow] > li > span::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 100%;
  background: var(--mint);
  pointer-events: none;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.5s ease;
}

html.has-motion:not(.motion-reduced) [data-workflow] > li > span,
html.has-motion:not(.motion-reduced) [data-workflow] > li > span::after {
  transition-delay: calc(var(--si, 0) * 80ms);
}

html.has-motion [data-workflow].stagger-in > li > span,
html.has-motion.motion-reduced [data-workflow] > li > span {
  color: var(--mint);
}

html.has-motion [data-workflow].stagger-in > li > span::after,
html.has-motion.motion-reduced [data-workflow] > li > span::after {
  transform: scaleY(1);
}

/* -------------------------------------------------------------------------- */
/* C. 对比板块：编辑风三列网格（与 .proof-grid / .boundary-list 同一套细线）。 */
/* 入场由通用 stagger 覆盖 .compare-table[data-stagger] 的行级错峰。         */
/* -------------------------------------------------------------------------- */

.compare-section {
  background: var(--bg);
}

.compare-table {
  border-top: 1px solid var(--line);
}

.compare-row {
  display: grid;
  grid-template-columns: 0.7fr 1.15fr 1.15fr;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.2s ease;
}

.compare-row > * {
  min-width: 0;
  padding: 22px 26px;
  font-size: 14px;
  line-height: 1.65;
}

.compare-row > * + * {
  border-left: 1px solid var(--line);
}

.compare-head > * {
  color: var(--muted);
  font: 700 10px / 1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.compare-row:not(.compare-head) > :first-child {
  color: var(--text);
  font-weight: 700;
}

.compare-row:not(.compare-head) > :nth-child(2) {
  color: var(--muted);
}

.compare-row:not(.compare-head) > :nth-child(3) {
  color: #e8f4ee;
}

.compare-row:not(.compare-head) > :nth-child(3)::before {
  content: "✓ ";
  color: var(--mint);
  font-weight: 700;
}

@media (hover: hover) {
  .compare-row:hover {
    background-color: rgba(185, 248, 211, 0.02);
  }
}

@media (max-width: 760px) {
  .compare-head {
    display: none;
  }

  .compare-row {
    grid-template-columns: 1fr;
    padding: 22px 0;
  }

  .compare-row > * {
    padding: 8px 0;
    border-left: 0;
  }

  .compare-row:not(.compare-head) > :first-child {
    padding-top: 0;
    padding-bottom: 12px;
    font-size: 15px;
  }

  .compare-row:not(.compare-head) > :nth-child(2) {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
  }

  .compare-row:not(.compare-head) > :nth-child(3) {
    padding-top: 14px;
    padding-bottom: 0;
  }

  .compare-row:not(.compare-head) > :nth-child(2)::before,
  .compare-row:not(.compare-head) > :nth-child(3)::before {
    display: block;
    margin-bottom: 4px;
    font: 700 9px / 1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .compare-row:not(.compare-head) > :nth-child(2)::before {
    content: "各自为战";
    color: #7d9188;
  }

  .compare-row:not(.compare-head) > :nth-child(3)::before {
    content: "控制中心";
    color: var(--mint);
  }
}

/* -------------------------------------------------------------------------- */
/* D. 方向变体：咨询区右侧表单从右侧滑入。只改 transform，opacity 仍由 .reveal */
/* 承担；必须压过 .reveal 的 translateY，并在 reduced / 无 JS 时不生效。     */
/* -------------------------------------------------------------------------- */

html.has-motion:not(.motion-reduced) .access-grid > .lead-form.reveal {
  transform: translateX(24px);
}

html.has-motion:not(.motion-reduced) .access-grid > .lead-form.reveal.is-visible {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html.has-motion [data-stagger] > *,
  html.has-motion [data-workflow] > li > span,
  html.has-motion [data-workflow].stagger-in > li > span {
    opacity: 1;
    transform: none;
    transition-delay: 0s;
    color: var(--mint);
  }

  html.has-motion [data-workflow] > li > span::after {
    transform: scaleY(1);
    transition-delay: 0s;
  }

  html.has-motion .access-grid > .lead-form.reveal {
    transform: none;
  }
}
