@layer fx {

/* Images render in full colour everywhere (grayscale-on-default removed by request). */

body.public-body a {
  position: relative;
  text-decoration: none;
}

/* One-shot text reveal.
   Each paragraph fades softly into focus exactly ONCE, the first time it enters
   the viewport, then stays sharp forever. The reveal is triggered by fx.js
   adding `.reveal-in` (an IntersectionObserver) — it is NOT coupled to scroll
   position, so paragraphs never get stuck blurred or re-blur as you scroll.

   The hidden start state only applies under `html.js-reveal`, a class fx.js's
   head guard adds when (and only when) JS will reveal the text — so no-JS,
   reduced-motion and low-end users always see the text immediately.
   Comment threads and anything tagged .no-reveal are excluded outright. */
/* The exclusions are wrapped in :where() so they add NO specificity. Written as
   bare :not(.craft-comments p):not(.no-reveal) this rule scored (0,5,4) and beat
   the .reveal-in rule below at (0,4,3) — which is why every revealed paragraph
   used to need `!important` just to become visible (see BUG-REPORT #22, where a
   missing !important made all body text invisible). Zeroing the guards fixes the
   cause: the hidden state is now (0,3,3) and .reveal-in wins on its own. */
/* 2026-08-21：加了 `[data-reveal]` 这一支。原本只有 <p> 会渐进显示，于是列表页
   （文稿全集的行、相册卡片、照片网格、印样）是「一次全渲染好」的，只有零星几段
   说明文字在淡入 —— 往下滑没有「慢慢出现」的感觉。视图给块级条目标上
   `data-reveal`，它们就走同一套观察器、同一条过渡曲线、同一份 0.06s 级联。
   两条选择器权重相同（都是 0,3,3），后写的这条不会覆盖上面那条。 */
html.js-reveal body.public-body .main-manju [data-reveal]:not(:where(.craft-comments [data-reveal], .no-reveal, .no-reveal [data-reveal])),
html.js-reveal body.public-body .main-manju p:not(:where(.craft-comments p, .no-reveal, .no-reveal p)) {
  opacity: 0;
  transform: translateY(12px);
  filter: blur(5px);
}

/* 出场用 **@keyframes 动画**，不是 transition。
   2026-08-23 抓到的：**首屏那一批一直是「跳」出来的，不是淡入的。**
   transition 要求元素先有一帧旧的计算值才会插值，而观察器在**首绘之前**就把
   `.reveal-in` 加上了（实测 /articles 第 57ms 加类、首绘在那之后），
   浏览器从头到尾只见过最终态 —— 0.7s 的曲线一次都没跑。
   逐帧采样：opacity 从 0 直接跳到 1，中间一个台阶都没有；三个页面都一样。
   往下滚之后进来的那些是好的（那时候早画过了），所以这毛病只出现在**第一屏**，
   看着就是「偶尔不淡入」。
   动画没有这个前提：规则一应用就一定从 from 播到 to。

   ⚠️ **fill-mode 必须是 backwards，不能省、也不能写 both。**
   级联延迟是靠 animation-delay 做的（fx.js 逐条加 0.06s）：
   · 不写 fill —— 延迟这段时间里元素落在下面 `.reveal-in` 的静态值上，
     也就是**先整块出现、再倒回去播一遍**；
   · 写 both —— 动画结束后最终帧被钉死，后面任何想改 transform / filter 的
     规则（hover、浮层）都推不动它。
   backwards 正好：延迟期间按 from 那一帧显示，播完落回静态值。 */
html.js-reveal body.public-body .main-manju [data-reveal].reveal-in,
html.js-reveal body.public-body .main-manju p.reveal-in {
  opacity: 1;
  transform: none;
  filter: none;
  animation: fx-reveal-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes fx-reveal-in {
  from { opacity: 0; transform: translateY(12px); filter: blur(5px); }
  to   { opacity: 1; transform: none; filter: none; }
}
/* Comment threads and dynamic UI must never sit in the hidden reveal state.
   2026-08-20：选择器从 `.gb-container`（旧留言板容器）换成 `.craft-comments`
   —— 文章页和留言板现在是同一个评论组件，容器类名也统一了。
   **不换的话评论正文会跟着淡入**：评论体是 renderMarkdown 出来的 <p>，
   而它们同样落在 .main-manju 里面。 */
html.js-reveal body.public-body .craft-comments,
html.js-reveal body.public-body .craft-comments p,
html.js-reveal body.public-body .craft-comments [data-reveal],
html.js-reveal body.public-body .no-reveal,
html.js-reveal body.public-body .no-reveal p,
html.js-reveal body.public-body .no-reveal [data-reveal] {
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
}

/* Cursor Trail Canvas */
#cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
}

/* Custom crosshair for CS2 */
.cs2-crosshair {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path d="M16 2 L16 12 M16 20 L16 30 M2 16 L12 16 M20 16 L30 16" stroke="%2300ff00" stroke-width="2"/></svg>') 16 16, crosshair !important;
}

@keyframes pulse-dots {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Social Buttons */

/* Nav Detach & Blur on scroll */

/* ══ Task #37: Copyright Hover to Infinity ══ */
.footer-copyright {
  position: relative;
  cursor: default;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.55em;
  line-height: 1;
}

/* The single-line lockup is a DESKTOP-only look. This rule used to be
   unconditional, and because `fx` is the last-but-one layer it beat the mobile
   wrapping rules in 005/006 — so on a phone the copyright ran off the right
   edge ("…ALL RIGHTS RES") and dragged the footer wider than the viewport.
   Keep nowrap where there is room; let it wrap where there isn't. */
@media (min-width: 769px) {
  .footer-copyright {
    flex-wrap: nowrap;
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  .footer-copyright {
    flex-wrap: wrap;
    white-space: normal;
  }
}
.footer-copyright-year {
  display: inline-block;
  transform-origin: 50% 70%;
  transition: opacity 0.24s ease, transform 0.34s cubic-bezier(0.16, 1, 0.3, 1), filter 0.34s ease;
}
.footer-copyright:hover .footer-copyright-year {
  opacity: 1;
  transform: none;
  filter: none;
}
.footer-copyright-label,
.footer-copyright-range,
.footer-copyright-dot,
.footer-copyright-tail,
.footer-copyright a {
  display: inline-block;
}

/* ══ Task #31: Site Pulse stagger entrance ══ */

.footer-live-readers strong {
  display: inline-block;
  min-width: 1.4ch;
  text-align: center;
}

}
