/* Live dashboard widgets. Each .dw holds a real piece of the MyForexFunds dashboard (markup and styles taken from the
   dashboard design, see src/dw/), laid out at its design size and scaled to the width it is given (--dw-k, set by js/dw.js).
   Put one in a page with {{dw:name}}; add classes with {{dw:name class="..."}}.
   When a widget scrolls into view its figures count up, its chart draws, its bars fill and its rows arrive one by one. */
@font-face { font-family: Poppins; font-weight: 300; font-display: swap; src: url(../assets/fonts/poppins-300-latin.ttf) format("truetype"); }
@font-face { font-family: Poppins; font-weight: 700; font-display: swap; src: url(../assets/fonts/poppins-700-latin.woff2) format("woff2"); }

.dw { --dw-k: 1; position: relative; display: block; width: 100%; aspect-ratio: var(--dw-w) / var(--dw-h); border-radius: calc(var(--dw-r, 12px) * var(--dw-k)); overflow: hidden; text-align: left; }
.dw.nat { width: calc(var(--dw-w) * 1px); max-width: 100%; }
.dw-in { position: absolute; left: 0; top: 0; width: calc(var(--dw-w) * 1px); height: calc(var(--dw-h) * 1px); transform-origin: 0 0; transform: scale(var(--dw-k)); color: #fff; font-family: Poppins, system-ui, sans-serif; font-size: 16px; font-weight: 400; line-height: 1.5; letter-spacing: 0; text-transform: none; text-shadow: none; white-space: normal; }
.dw-in, .dw-in *, .dw-in *::before, .dw-in *::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; }
.dw-in svg { display: block; }
.dw-in [data-a=num] { font-variant-numeric: tabular-nums; }
/* a long screen shown through a shorter window: --dw-view is the visible height in design pixels */
.dw.cut { aspect-ratio: var(--dw-w) / var(--dw-view, 800); }
/* depth for a widget that floats over the page or over another widget: solid behind its glass, so nothing shows through */
.dw.lift { background: #0a1832; box-shadow: 0 30px 60px -22px rgba(0,8,40,.85), 0 0 0 1px rgba(255,255,255,.14), 0 0 46px -10px rgba(var(--dw-glow, 0,168,232), .55); }
/* on glass: the widget's own dark panel becomes see-through so it sits in the page instead of on it */
.dw.glass { -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5); }

/* status lights breathe */
.dw-in [data-a=dot] { animation: dwDot 2.4s ease-in-out infinite; }
@keyframes dwDot { 50% { box-shadow: 0 0 0 4px rgba(120,255,200,.16); } }

/* before a widget is seen (only when the script is running) */
.dw-ready .dw:not(.in) [data-a=bar] { transform: scaleX(0); }
.dw-ready .dw:not(.in) [data-a=chart] { clip-path: inset(0 100% 0 0); }
.dw-ready .dw:not(.in) [data-a=row] { opacity: 0; transform: translateY(8px); }
.dw-in [data-a=bar] { transform-origin: 0 50%; transition: transform 1.1s cubic-bezier(.22,1,.36,1) .25s; }
.dw-in [data-a=chart] { clip-path: inset(0 0 0 0); transition: clip-path 1.5s cubic-bezier(.4,0,.2,1) .15s; }
.dw-in [data-a=row] { transition: opacity .5s, transform .5s cubic-bezier(.22,1,.36,1); transition-delay: calc(var(--i, 0) * 70ms + .15s); }
.dw.rst [data-a] { transition: none !important; }
/* a light passes over a widget now and then */
.dw.sheen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, rgba(255,255,255,0) 42%, rgba(255,255,255,.1) 50%, rgba(255,255,255,0) 58%); transform: translateX(-100%); animation: dwSheen 8s ease-in-out infinite; }
@keyframes dwSheen { 0%, 55% { transform: translateX(-100%); } 85%, 100% { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  .dw-in [data-a=dot], .dw.sheen::after { animation: none; }
  .dw-in [data-a=bar], .dw-in [data-a=chart], .dw-in [data-a=row] { transition: none; }
}
