/* Snug: text that does not fit its place rolls. The styles of assets/site/roll.js (Snug.marquee), which says what
   rolls, when, and what happens at an edge of glass. One file for the blogs, the Dashboard, the console and the
   service's own site; nothing here applies until the script has marked something (.roll-long, .roll-tick), so a
   page without scripts, and one with "reduce motion", keeps its ellipses.

   --roll-p is how far along a label is, 0 to 1: one animated number that moves the text (text-indent, so nothing is
   added to the page) and, off glass, tells each end how softly to cut it: an end with more text beyond it is cut
   softly, an end the text has reached is not. The script gives --roll-far (how far there is to go), --roll-t (how
   long, so every label keeps one pace) and --roll-ease (the rests at each end). */
@property --roll-p{syntax:"<number>";inherits:false;initial-value:0}

@media (prefers-reduced-motion:no-preference){
  .roll-long{--roll-s:calc(var(--roll-p)*var(--roll-far,0px));--roll-a:min(var(--roll-fs,14px),var(--roll-s));--roll-b:min(var(--roll-fe,14px),calc(var(--roll-far,0px) - var(--roll-s)));
    text-overflow:clip!important;text-indent:calc(-1*var(--roll-s))!important;transition:--roll-p .45s ease;
    -webkit-mask-image:linear-gradient(var(--roll-to,90deg),transparent,#000 var(--roll-a),#000 calc(100% - var(--roll-b)),transparent);mask-image:linear-gradient(var(--roll-to,90deg),transparent,#000 var(--roll-a),#000 calc(100% - var(--roll-b)),transparent)}
  .roll-long > *{text-indent:0}
  .roll-long.roll-rtl{--roll-to:270deg}
  .roll-long.roll-go{animation:roll-p var(--roll-t,8s) var(--roll-ease,linear) var(--roll-d,1.1s) infinite alternate}

  /* on glass: the end at the pane's edge is not cut softly; the letters are seen through the bevel (the lens, where
     the browser can draw it), and end where the pane does. .roll-pad: the text's box reaches the plate's edge
     (--roll-pl, --roll-pr, measured by the script), and takes no room by it. */
  .roll-g2,.roll-gl{--roll-fs:0px}
  .roll-g2,.roll-gr{--roll-fe:0px}
  .roll-rtl.roll-gl{--roll-fs:14px;--roll-fe:0px}
  .roll-rtl.roll-gr{--roll-fe:14px;--roll-fs:0px}
  .roll-pad{padding-left:var(--roll-pl,0px)!important;padding-right:var(--roll-pr,0px)!important;margin-left:calc(-1*var(--roll-pl,0px))!important;margin-right:calc(-1*var(--roll-pr,0px))!important}
  .roll-in.roll-g2{filter:var(--roll-lens)}
  .roll-in.roll-gl{filter:var(--roll-lens-l)}
  .roll-in.roll-gr{filter:var(--roll-lens-r)}

  /* a ticker: the line and a second copy of it, going round from right to left; it waits under the pointer and the focus */
  .roll-tick{overflow:hidden!important;white-space:nowrap;text-overflow:clip!important;
    -webkit-mask-image:linear-gradient(90deg,transparent,#000 26px,#000 calc(100% - 26px),transparent);mask-image:linear-gradient(90deg,transparent,#000 26px,#000 calc(100% - 26px),transparent)}
  .roll-tick > .roll-track{display:inline-flex;vertical-align:top;will-change:transform;animation:roll-tick var(--roll-t,40s) linear infinite paused}
  .roll-tick.roll-in > .roll-track{animation-play-state:running}
  .roll-tick:hover > .roll-track,.roll-tick:focus-within > .roll-track{animation-play-state:paused}
  .roll-tick .roll-set{flex:none;padding-inline-end:var(--roll-gap,3.5em)}
  .roll-tick.roll-rtl > .roll-track{--roll-way:1}
}
@keyframes roll-p{to{--roll-p:1}}
@keyframes roll-tick{to{transform:translateX(calc(var(--roll-way,-1)*var(--roll-far,0px)))}}

/* the words of a button that lays out its own children, in a box they can roll in */
.roll-w{flex:0 1 auto;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}

@media (prefers-reduced-transparency:reduce),(prefers-contrast:more){
  .roll-long{filter:none!important}
}
