/* Home page only: art lettering for the display level (elements with .art),
   and the flowing light (流光) on the hero h1 and the closing headline.
   Face: ZCOOL XiaoWei (SIL OFL 1.1), subset by tools/build_fonts.py. */

@font-face { font-family: "RDMS Art XiaoWei"; src: url("../assets/fonts/art-xiaowei.woff2") format("woff2"); font-display: swap; }

/* Size-adjusted fallbacks: the system face scaled to the art face's advance
   width and line metrics, so nothing jumps when the subset arrives, and a
   glyph missing from the subset sits in line. */
@font-face { font-family: "RDMS Fallback XiaoWei"; src: local("PingFang SC"), local("PingFangSC-Regular"), local("Microsoft YaHei"), local("Noto Sans SC"); size-adjust: 102.4%; ascent-override: 86%; descent-override: 12%; line-gap-override: 0%; }

:root { --art: "RDMS Art XiaoWei", "RDMS Fallback XiaoWei", var(--font-cjk); --art-scale: 1.06; --art-track: .02em; --art-weight: 400; }

/* The display level: art face, the colour of ink, a still, barely-there
   gradient (ink to the deep end of the sky). No movement below the hero. */
.art { font-family: var(--art); font-weight: var(--art-weight); letter-spacing: var(--art-track); font-synthesis: none; }
.h2.art { font-size: calc(clamp(30px, 3.6vw, 48px) * var(--art-scale)); line-height: 1.22; }
.h3.art { font-size: calc(clamp(22px, 2.2vw, 28px) * var(--art-scale)); line-height: 1.3; }
.problems .art li { font-size: calc(clamp(24px, 3.4vw, 46px) * var(--art-scale)); font-weight: var(--art-weight); }
.section .h2.art:not(.art-flow), .line .h3.art, .problems .art li:last-child {
  background: linear-gradient(100deg, var(--ink) 0%, var(--ink) 45%, var(--sky-night) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.problems .art li:not(:last-child) { color: rgba(12, 35, 48, .40); }
.art::selection, .art *::selection { color: var(--white); background: var(--sky-deep); -webkit-text-fill-color: var(--white); }

/* 流光: glyphs filled with light (white, pale sky, a pale pink-coral glint,
   white) and a soft highlight band crossing them every 7 s. Every colour in
   the fill is a light tint, so the text keeps its contrast at every moment. */
.art-flow {
  --flow-base: linear-gradient(100deg, #F8FDFE 0%, #E8F8FD 24%, #F4FBFE 40%, #FFEFF6 55%, #FFF1EB 63%, #F6FCFE 78%, #E8F8FD 100%);
  --flow-band: linear-gradient(100deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, .85) 47%, #FFFFFF 50%, rgba(255, 255, 255, .85) 53%, rgba(255, 255, 255, 0) 60%);
  background-image: var(--flow-band), var(--flow-base);
  background-size: 250% 100%, 100% 100%;
  background-position: 120% 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  /* a faint glow, like light caught in the glass, and a soft shade beneath */
  filter: drop-shadow(0 1px 1px rgba(4, 30, 48, .28)) drop-shadow(0 0 18px rgba(176, 228, 255, .30));
  text-shadow: none;
}
.hero h1.art { font-size: calc(clamp(40px, 5.4vw, 80px) * var(--art-scale)); line-height: 1.14; }
.closing .h2.art { font-size: calc(clamp(30px, 4.4vw, 60px) * var(--art-scale)); }

@media (prefers-reduced-motion: no-preference) {
  .art-flow { animation: flow 7s cubic-bezier(.45, 0, .25, 1) infinite; }
  .closing .art-flow { animation-delay: -3.5s; }
}
@keyframes flow {
  0% { background-position: 120% 0, 0 0; }
  70%, 100% { background-position: -20% 0, 0 0; }
}
/* the clip-to-text fill lives on the h1, so the load animation moves the h1
   as a whole instead of its two lines */
@media (prefers-reduced-motion: no-preference) {
  .js .hero h1.art-flow { animation: settle-art 1.1s var(--ease) both, flow 7s cubic-bezier(.45, 0, .25, 1) 1.1s infinite; }
  .js .hero h1.art-flow span { animation: none; }
}
@media (max-width: 420px) { .hero h1.art { font-size: calc(32px * var(--art-scale)); } }
@keyframes settle-art { from { opacity: 0; transform: translateY(18px); } }

@media (forced-colors: active) {
  .art, .art-flow, .art li { background: none !important; color: CanvasText !important; -webkit-text-fill-color: CanvasText !important; filter: none; }
}
