/* AI Buddy · the numbers band (60% cheaper, 85% sooner) and the row of client and partner logos under it.
   It sits inside #diff, directly after the comparison scene (.dif), so it is a block, not a section:
   .nm carries data-sec="numbers" (motion off rule) and data-scene (entrance), and sets its own spacing.

   Layout   .nm           the block: the band, then the logos
            .nm-band      full bleed violet band; on a wide page no taller than about 85% of the window
            .nm-card      one figure with its caption; card A has the figure on the left, card B on the right,
                          so the two figures keep the old diagonal but are on screen together
            .nm-fig       the big number; the digits are plain text in the HTML (.nm-d), so it reads right with no script
            .nm-cap       label (.nm-k), title (.nm-t) and two comparison bars (.nm-vs)
            .nm-mq        the client and partner logos. Without script, or with motion off, a still centred row that wraps.
                          With motion on (.is-live) one endless row that glides to the left and slows to a stop under the pointer:
                          .nm-mq-t the track (the glide), .nm-mq-i the same row again (only the slowing), .nm-mq-s one set of logos
                          (the script appends copies of the set), .nm-lg one logo
   Sizes    the figure follows the window height as well as the width (--fig), so both rows fit one window
   States   .is-armed on .nm   the script is running and parts wait for their entrance
            .is-in on a card   that card has entered: its digits roll once onto the real value and its bars fill once
            Without .is-armed (no script, motion off) everything shows its final state.
            .is-live on .nm-mq the script has made the row endless; .is-off: the row is off screen and waits
   Script   assets/sec-numbers.js builds the digit reels while the scene is armed and removes them on unmount;
            for the logos it copies the set and sets the distance of one set (--mq-x) and the time it takes (--mq-d).
            The glide itself is a CSS animation of transform, so it does not depend on the script's frame rate. */

.s5 .nm{
  --fig:clamp(120px,min(19cqw,calc(var(--dvh) * .34)),340px);
  --band-y:clamp(48px,calc(var(--dvh) * .075),96px);
  --ink-on:#fff;
  margin:0;color:var(--ink-on);
}

/* the block is the last thing in #diff: the section adds no space under it, the next section's --sec-y is the gap */
.s5 .after>.sec.diff,.s5 .after>.sec.diff>.wrap,html.mob .s5 .after>section.sec.diff{padding-bottom:0}

/* the band: full bleed from inside the page column (cqw is the section's width) */
.nm-band{
  display:grid;gap:clamp(20px,calc(var(--dvh) * .035),48px);
  margin-inline:calc(50% - 50cqw);padding:var(--band-y) calc(50cqw - 50%);
  background:radial-gradient(70% 110% at 10% 0%,#a46bff,#8b3dff 45%,#6a24d6);
}

/* one figure with its caption */
.nm-card{display:flex;align-items:flex-end;gap:clamp(28px,3.4cqw,56px)}
.nm-card.b{justify-content:flex-end}

.nm-fig{
  display:flex;align-items:flex-start;flex:none;margin:-.11em 0 -.1em;
  font-family:var(--serif);font-size:var(--fig);font-weight:200;line-height:1;letter-spacing:-.07em;
  font-variant-numeric:tabular-nums;color:var(--ink-on);
}
/* a digit's box is narrower than its glyph (the figure is tracked tight), so the box clips top and bottom only:
   the rolling reel stays hidden above and below while the glyph keeps its full width */
.nm-d{display:inline-block;height:1em;overflow-x:visible;overflow-y:clip;clip-path:inset(0 -.3em)}
.nm-rl{display:flex;flex-direction:column}
.nm-rl>span{display:block;height:1em}
.nm-pc{font-size:.22em;font-weight:300;line-height:1;letter-spacing:0;margin:.32em 0 0 .16em;opacity:.75}

.nm-cap{flex:0 1 28em;min-width:0;padding-bottom:.4em}
.nm-k{display:inline-flex;align-items:center;gap:11px;font-size:10.5px;font-weight:500;letter-spacing:.32em;text-transform:uppercase}
.nm-k::before{content:"";flex:none;width:5px;height:5px;border-radius:1px;transform:rotate(45deg);background:#fff;box-shadow:0 0 10px 2px rgba(255,255,255,.6)}
.nm-t{margin:clamp(10px,calc(var(--dvh) * .016),18px) 0 0;font-size:clamp(20px,calc(var(--u) * 1.7),32px);font-weight:400;line-height:1.2;letter-spacing:-.028em}

/* the two bars: agency against AI Buddy */
.nm-vs{display:grid;gap:12px;margin-top:clamp(14px,calc(var(--dvh) * .022),22px);width:min(30em,100%)}
.nm-vs>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;align-items:center;font-size:14px;color:rgba(255,255,255,.9)}
.nm-vs b{font-weight:500;color:#fff}
.nm-vs i{position:relative;display:block;height:2px;background:rgba(255,255,255,.22)}
.nm-vs i::before{content:"";position:absolute;inset:0 auto 0 0;width:var(--w);background:rgba(255,255,255,.5);transform-origin:0 50%}
.nm-vs i.u::before{background:#fff}

/* the client and partner logos (white versions of the files on aibud.ca; media/logo-*).
   --lh is the height of a plain wordmark; a logo with small lettering inside a taller shape sets --k to stand a little taller. */
.nm-mq{
  --lh:clamp(25px,2.1cqw,34px);
  --gap:clamp(28px,3.4cqw,60px);              /* the still row: close enough that the six fit one line on a wide page */
  margin:clamp(40px,calc(var(--dvh) * .08),96px) 0 0;padding:30px 0;
  border-block:1px solid rgba(255,255,255,.08);
}
.nm-mq-s{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;row-gap:24px;margin:0;padding:0;list-style:none}
.nm-lg{display:flex;align-items:center;flex:none;padding-inline:calc(var(--gap) / 2);opacity:.55;transition:opacity .4s}
.nm-lg img{display:block;flex:none;height:calc(var(--lh) * var(--k,1));width:auto}
.nm-lg.ma{gap:.42em;font-size:calc(var(--lh) * .7);font-weight:600;line-height:1;letter-spacing:-.03em;color:#fff;white-space:nowrap}
.nm-lg.ma img{height:1.3em}

/* motion on: one endless row. The track moves left by exactly one set (--mq-x) in --mq-d and starts again, which cannot be seen
   because the next copy of the set is then where the first one was. Under the pointer the track stops and, in the same moment,
   the inner row eases forward by the distance the row needed to slow down from its speed (38px a second, half a second: 9.5px);
   when the pointer leaves, the track runs again and the inner row eases back, so the row picks up speed instead of jumping. */
.nm-mq.is-live{--gap:clamp(44px,5.6cqw,100px);overflow:hidden;-webkit-mask-image:linear-gradient(90deg,transparent,#000 14%,#000 86%,transparent);mask-image:linear-gradient(90deg,transparent,#000 14%,#000 86%,transparent)}
.nm-mq.is-live .nm-mq-t{width:max-content;animation:nm-mq var(--mq-d,60s) linear infinite;will-change:transform}
.nm-mq.is-live .nm-mq-i{display:flex;will-change:transform;transition:transform .5s cubic-bezier(.25,.5,.5,1)}
.nm-mq.is-live .nm-mq-s{flex:none;flex-wrap:nowrap}
.nm-mq.is-live.is-off .nm-mq-t{animation-play-state:paused}
@media (hover:hover){
  .nm-lg:hover{opacity:1}
  .nm-mq.is-live:hover .nm-mq-t{animation-play-state:paused}
  .nm-mq.is-live:hover .nm-mq-i{transform:translate3d(-9.5px,0,0)}
}
@keyframes nm-mq{to{transform:translate3d(var(--mq-x,-50%),0,0)}}

/* narrow page (phones, and the phone preview): one column, figure above its caption */
@container (max-width:900px){
  .s5 .nm{--fig:132px;--band-y:56px}
  .nm-band{gap:48px}
  .nm-card,.nm-card.b{flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:8px}
  .nm-card.b .nm-fig{order:-1}
  .nm-cap{flex:none;width:100%;padding-bottom:0}
  .nm-t{font-size:22px}
  .nm-vs>div{font-size:13px}
  .nm-mq{margin-top:44px;padding:24px 0}   /* the same room above the logos as under them */
}

/* entrance: plays once per card, only while the script has armed the block.
   The reel starts on 0 and rolls once onto the real digit; the bars grow from the left. */
.nm.is-armed .nm-rl{transform:translate3d(0,0,0)}
.nm.is-armed .nm-card.is-in .nm-rl{transform:translate3d(0,calc(var(--n) * -1em),0);transition:transform 1.05s cubic-bezier(.2,.75,.2,1) .1s}
.nm.is-armed .nm-card.is-in .nm-d+.nm-d .nm-rl{transition-delay:.18s}
.nm.is-armed .nm-vs i::before{transform:scaleX(0)}
.nm.is-armed .nm-card.is-in .nm-vs i::before{transform:none;transition:transform 1s var(--ease) .35s}
.nm.is-armed .nm-card.is-in .nm-vs div+div i::before{transition-delay:.5s}

/* forced colours drop backgrounds: give the band and the bars an outline instead */
@media (forced-colors:active){.nm-band{border-block:1px solid CanvasText}.nm-vs i::before{background:CanvasText}}
/* the logos are white pictures: on a light forced background show them dark */
@media (forced-colors:active) and (prefers-color-scheme:light){.nm-lg img{filter:invert(1)}}

/* motion off: the script leaves the row still (no .is-live); this only covers the moment before it has restarted */
html.calm .nm-mq-t{animation:none !important}
html.calm .nm-mq-i{transition:none !important;transform:none !important}
