/* polish.css — the site-wide finish (scripts/polish). Ours, not the export's.
 *
 * The page-by-page values (type scale, section space, surfaces, control sizes) are rewritten
 * in design-source/ by `npm run polish:build` (scripts/polish/rules.mjs has the standard).
 * This sheet holds only what applies to every page at once. Inline styles on the pages win
 * over everything here, so a rule below only reaches elements that do not set the property.
 */

/* Type rendering: kerning and ligatures on for display sizes, and numbers that do not
   shift width while they count. */
h1, h2, h3 { text-rendering: optimizeLegibility; font-kerning: normal; }
li, dd, figcaption, blockquote { text-wrap: pretty; }

/* Text links that had no transition of their own ease like every other control. */
a { transition: color var(--motion-hover), text-decoration-color var(--motion-hover); }

/* Video carousel (desktop): the card that peeks past the container fades out instead of
   being cut mid-word, and the fade follows the scroll position (left edge once scrolled,
   none at the end). Without scroll-driven animation support the row is as before. */
@media (min-width: 1024px) {
  @supports (animation-timeline: scroll()) {
    @property --vr-fade-l { syntax: "<length>"; inherits: false; initial-value: 0px; }
    @property --vr-fade-r { syntax: "<length>"; inherits: false; initial-value: 96px; }
    .vr-row {
      -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--vr-fade-l), #000 calc(100% - var(--vr-fade-r)), transparent);
      mask-image: linear-gradient(90deg, transparent, #000 var(--vr-fade-l), #000 calc(100% - var(--vr-fade-r)), transparent);
      animation: vr-edge-fade linear both;
      animation-timeline: scroll(self inline);
    }
    @keyframes vr-edge-fade {
      0% { --vr-fade-l: 0px; --vr-fade-r: 96px; }
      6% { --vr-fade-l: 96px; --vr-fade-r: 96px; }
      94% { --vr-fade-l: 96px; --vr-fade-r: 96px; }
      100% { --vr-fade-l: 96px; --vr-fade-r: 0px; }
    }
  }
}
