/* ═══════════════════════════════════════════════════════════════
   ZHEN AI — cross-cutting accessibility layer
   Shared by every page, whatever design system that page uses.

   Small on purpose. It carries only what assistive technology needs
   and no page should have to re-invent.
   ═══════════════════════════════════════════════════════════════ */

/* Skip link — off-screen until focused, then plainly visible.
   Keyboard and screen-reader users get past the navigation in one
   keystroke instead of tabbing through it on all 84 pages. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: .7rem 1.1rem;
  background: #111;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: .85rem;
  line-height: 1.2;
  text-decoration: none;
  border-radius: 0 0 3px 0;
}
.skip-link:focus {
  left: 0;
  outline: 3px solid #ffd34d;
  outline-offset: 2px;
}

/* A visible focus ring everywhere. Several design systems in this repo
   set `outline: none` on interactive elements for aesthetic reasons,
   which locks keyboard users out. This restores it, consistently. */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Available to screen readers, not to the eye. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Chinese runs inside English prose. Screen readers otherwise attempt
   them in an English voice, which is unintelligible. See render.py,
   which wraps every CJK run in <span lang="zh-Hans">. */
[lang="zh-Hans"],
[lang="zh"] {
  font-family: "Noto Serif SC", "Noto Serif CJK SC", "Songti SC", "SimSun", serif;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
