/* ==========================================================================
   reveal.css — 全站滚动入场动画（Scroll Reveal）
   --------------------------------------------------------------------------
   设计要点：
   1) 隐藏规则使用「静态选择器」，随首屏 CSS 一起生效，
      避免「内容先显示、再被 JS 隐藏」的闪烁（FOUC）。
   2) 隐藏仅在 <html class="js-rv"> 时生效。该类由页头内联脚本添加：
      禁用 JS 时不会添加 → 内容保持可见（渐进增强）。
   3) 用 :where() 承载长选择器（特异性为 0），
      使后面的 .ice-rv-done / .ice-rv-skip 能轻易覆盖隐藏状态。
   4) 动画结束后移除 animation 并声明 transform:none，
      避免常驻 transform 覆盖卡片 hover 等既有位移效果。
   5) 尊重系统「减弱动态效果」偏好。

   注意：下方目标选择器必须与 assets/js/reveal.js 中的 TARGET_SELECTOR
   保持一致，否则被 CSS 隐藏的元素可能永远不显示。
   （页头内联脚本带 2 秒兜底，极端情况下会移除本样式表保证内容可见）
   ========================================================================== */

/* ---------- 1. 初始隐藏 ----------
   覆盖页面主要内容区块：区块标题、网格/特性/时间线的子项、各类卡片、
   分类简介、首屏文案、图片、引言、表格，以及旧版手写的 .reveal。
   末行补充「section 容器内散落的内容元素」，但排除本身由子项动画的分组容器。 */
html.js-rv :where(
  .section-head,
  .grid > *,
  .features > *,
  .timeline > *,
  .cert-grid > *,
  .factory-grid > *,
  [class*="card"],
  .cat-intro,
  .about-intro p,
  .hero__content,
  .page-hero .container > *,
  figure,
  blockquote,
  table,
  .reveal:not(section):not(.section),
  .section > .container > *:not(.grid):not(.features):not(.timeline):not(.cert-grid):not(.factory-grid)
) {
  opacity: 0;
}

/* ---------- 2. 入场动画 ---------- */
html.js-rv .ice-rv-in {
  animation: iceRvUp var(--ice-rv-dur, 0.7s) cubic-bezier(0.22, 0.61, 0.36, 1) both;
  animation-delay: var(--ice-rv-delay, 0s);
}

@keyframes iceRvUp {
  from {
    opacity: 0;
    transform: translate3d(0, var(--ice-rv-y, 26px), 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* ---------- 3. 完成 / 跳过后恢复可见并清理 transform ---------- */
html.js-rv :is(.ice-rv-done, .ice-rv-skip) {
  opacity: 1;
  transform: none;
}

html.js-rv .ice-rv-in.ice-rv-done {
  animation: none;
}

/* ---------- 4. 无障碍：尊重系统「减弱动态效果」偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html.js-rv :where(
    .section-head,
    .grid > *,
    .features > *,
    .timeline > *,
    .cert-grid > *,
    .factory-grid > *,
    [class*="card"],
    .cat-intro,
    .about-intro p,
    .hero__content,
    .page-hero .container > *,
    figure,
    blockquote,
    table,
    .reveal:not(section):not(.section),
    .section > .container > *:not(.grid):not(.features):not(.timeline):not(.cert-grid):not(.factory-grid)
  ) {
    opacity: 1 !important;
    transform: none !important;
  }

  html.js-rv .ice-rv-in {
    animation: none !important;
  }
}
