/* 05 Best agent, highlights on scroll (4 Nov): the head beside its lead, then the three cards in a row,
   one in front with the next peeking at the right. The row holds in view while the page scrolls, and the scroll moves
   it along, so the cards change as the visitor scrolls; the card in front shows its words and plays its picture's
   moment (/_assets/design/5fffbbb541703d47/05-best-agent.js), and the dots and arrows scroll to a card. Reduced motion and ?static: no hold, the dots
   and arrows move the row a card at a time, the pictures at rest.

   The pictures (Jamie's set, 30 Oct): one brush, its crop moving across the three, with a blue, violet and pink filter
   (Figma's renders of each width's crop, as WebP); white 1.5 px lines; every word in the same frosted glass pill with
   an icon disc; one focal group per picture, as high as the dial (272, 228 and 144). The third shows the channels on
   its pink crop: the call in the middle with the first's voice bars, SMS, WhatsApp and web chat around it. Each
   picture's art sits in that width's Figma coordinates (620 x 456, 680 x 380, 326 x 240), centred in its card; where
   the card is narrower or lower, the art shrinks to fit (--fit), never grows. */

.best-agent {
  --best-agent-glass-shadow: 0 1px 2px rgb(var(--c-violet-deep-rgb) / 0.08), 0 28px 64px -30px rgb(var(--c-violet-deep-rgb) / 0.32),
    0 10px 24px -16px rgb(var(--c-violet-rgb) / 0.14);   /* Elevation/Glass with its -30 and -16 spreads, as Figma renders the pills */
  padding-block: var(--space-9);
  background: var(--surface-page);
}
.best-agent-inner { display: flex; flex-direction: column; gap: var(--space-7); }
.best-agent-head p { text-wrap: pretty; }
.best-agent-title { text-wrap: balance; }


/* The row holds in view (.best-agent-pin, sticky, centred under the nav) while the page scrolls through
   .best-agent-scroller, and the scroll moves it along: /_assets/design/5fffbbb541703d47/05-best-agent.js sets the row's --shift and each card's --d (how
   far it is from the front, 0 to 2), so a card's words and picture come up as it reaches the front and fade as it
   leaves. Only the card in front reads. Reduced motion and ?static (.best-agent--steps): the dots and arrows move it.
   The row is .best-agent-show > .best-agent-track: the dial's arc in the pictures is a .best-agent-track too. */
.best-agent--highlights { --ba-gap: var(--space-7); overflow-x: clip; }   /* --ba-gap: the head to the row */
.best-agent-scroller { position: relative; height: var(--scroller-h, auto); margin-top: var(--ba-gap); }
.best-agent-pin { position: sticky; top: var(--pin-top, 88px); }
/* A window with room for both (/_assets/design/5fffbbb541703d47/05-best-agent.js): the head holds above the row and lets go with it, its margin reaching
   the row's foot (--pin-h) and the scroller's taking it back, so the page's flow is as before */
.best-agent--hold-head .best-agent-inner { position: sticky; top: var(--head-top); margin-bottom: calc(var(--pin-h) + var(--ba-gap)); }
.best-agent--hold-head .best-agent-scroller { margin-top: calc(-1 * var(--pin-h)); }
.best-agent--highlights .best-agent-show { display: flex; flex-direction: column; gap: var(--space-6); }
.best-agent-show > .best-agent-track {
  --card-w: min(80%, 980px);
  --card-gap: var(--space-5);
  display: flex; gap: var(--card-gap);
  transform: translate3d(calc(var(--shift, 0) * -1px), 0, 0);
  will-change: transform;
}
.best-agent--steps .best-agent-show > .best-agent-track { transition: transform 700ms var(--ease-settle); }
.best-agent--highlights .best-agent-step {
  --d: 1;
  position: relative; flex: 0 0 var(--card-w); min-width: 0; display: block;
}
.best-agent--highlights .best-agent-step:first-child { --d: 0; }
/* --pic-h (/_assets/design/5fffbbb541703d47/05-best-agent.js) lowers the pictures where the held row would be taller than the window; the art shrinks with them (--fit) */
.best-agent--highlights .best-agent-pic { --pic: var(--pic-h, 500px);
  width: 100%; height: var(--pic);
  border-radius: var(--radius-lg); box-shadow: var(--elev-1); opacity: calc(1 - min(var(--d), 1) * 0.45); }
.best-agent--highlights .best-agent-text { display: flex; flex-direction: column; gap: var(--space-2); max-width: 720px;
  padding: var(--space-5) var(--space-1) 0; opacity: clamp(0, calc(1 - var(--d) * 1.8), 1); }
.best-agent--steps .best-agent-pic, .best-agent--steps .best-agent-text { transition: opacity 450ms var(--ease-settle); }
.best-agent--highlights .best-agent-title { font: var(--t-headline); letter-spacing: var(--t-headline-tracking); }
.best-agent--highlights .best-agent-body { font: var(--t-body); color: var(--ink-secondary); text-wrap: pretty; }

/* The controls: the dots on a pill (the card in front's a line) and the arrows; each scrolls to its card */
.best-agent-controls { display: flex; align-items: center; gap: var(--space-3); }
.best-agent-dots { display: flex; align-items: center; gap: 16px; height: 40px; padding: 0 16px; border-radius: var(--radius-full);
  background: var(--surface-sunken); }
.best-agent-dot { position: relative; width: 8px; height: 8px; padding: 0; border: 0; border-radius: var(--radius-full);
  background: var(--border-strong); cursor: pointer; transition: width 400ms var(--ease-settle), background-color 300ms var(--ease-settle); }
.best-agent-dot::before { content: ""; position: absolute; inset: -16px -8px; }   /* a 24 x 40 px target around the dot, 24 px from the next (WCAG 2.5.8) */
.best-agent-dot[aria-current] { width: 40px; background: var(--accent); }
.best-agent-dot i { display: none; }
.best-agent-arrows { display: flex; gap: var(--space-2); margin-left: auto; }
.best-agent-prev, .best-agent-next { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0;
  border-radius: var(--radius-full); background: var(--surface-card); box-shadow: inset 0 0 0 1px var(--border-strong);
  color: var(--ink-primary); cursor: pointer; transition: box-shadow var(--motion-hover) var(--ease-settle), opacity 300ms; }
.best-agent-prev:hover, .best-agent-next:hover { box-shadow: inset 0 0 0 1px var(--ink-primary); }
.best-agent-prev[aria-disabled="true"], .best-agent-next[aria-disabled="true"] { opacity: 0.35; cursor: default; box-shadow: inset 0 0 0 1px var(--border-strong); }
.best-agent-prev svg, .best-agent-next svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; }
:is(.best-agent-dot, .best-agent-prev, .best-agent-next):focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

@media (min-width: 900px) and (max-width: 1199px) {
  .best-agent--highlights .best-agent-pic { --pic: var(--pic-h, 440px); }
  .best-agent--highlights { --ba-gap: var(--space-6); }
}
@media (max-width: 899px) {
  .best-agent-show > .best-agent-track { --card-w: 86%; --card-gap: var(--space-4); }
  .best-agent--highlights .best-agent-pic { --pic: var(--pic-h, 380px); border-radius: var(--radius-md); }   /* the tablet art */
  .best-agent--highlights { --ba-gap: var(--space-6); }
}
@media (max-width: 599px) {
  .best-agent-show > .best-agent-track { --card-w: calc(100% - 36px); --card-gap: var(--space-3); }
  .best-agent--highlights .best-agent-pic { --pic: var(--pic-h, 240px); }   /* the phone art */
  .best-agent--highlights .best-agent-title { font-size: 20px; line-height: 28px; }   /* System/Phone/Headline */
  .best-agent--highlights .best-agent-body { font-size: 16px; line-height: 26px; }
  .best-agent-arrows { display: none; }
  .best-agent-dots { height: 44px; }
  /* Carousel's phone rule: the dots 16 px under the pictures and the words 16 px under the dots, so the dots stand where
     the eye leaves the picture and keep their place as the cards change; the room a shorter card leaves falls after its
     words. The controls are set from the row's top (the held row's while it holds) into the room the words keep over them */
  .best-agent--highlights .best-agent-show { position: relative; }
  .best-agent--highlights .best-agent-controls { position: absolute; top: calc(var(--pic-h, 240px) + var(--space-4)); left: 0; }
  .best-agent--highlights .best-agent-text { padding-top: calc(var(--control-target) + 2 * var(--space-4)); }
}
@media (prefers-reduced-motion: reduce) {
  .best-agent--steps .best-agent-show > .best-agent-track, .best-agent--steps .best-agent-pic, .best-agent--steps .best-agent-text { transition: none; }
}

/* Picture, with the desktop sizes of its art */
.best-agent-pic {
  --art-w: 620px;
  --art-h: 456px;
  --fit: 1;
  --pill-h: 64px;
  --disc: 48px;
  --icon: 24px;
  --pill-in: var(--space-2);
  --pill-end: var(--space-5);
  --pill-gap: var(--space-3);
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  container-type: inline-size;
}
.best-agent-pic img { max-width: none; }
.best-agent-brush { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* The art is made smaller to fit its picture, never larger: --fit is /_assets/design/5fffbbb541703d47/05-best-agent.js's, the picture's width and height
   over the art's, at most 1. A ratio of two lengths written in CSS (tan(atan2())) comes out wrong in Safari, which drew
   the art as a dot or mirrored on a phone and a tablet, and Firefox drops it; without the script the art is at its own
   size, centred, and the picture cuts its sides */
.best-agent-art { position: absolute; top: 50%; left: 50%; width: var(--art-w); height: var(--art-h);
  translate: -50% -50%; scale: var(--fit, 1); }

/* Lines: white, with a soft glow; each width draws its own at its size (best-agent-art.py draws all three from one
   set of measures): the call's line across the picture, fading at its ends; voice bars on it,
   dense and shaped as speech; the dial's ticks (a major one every 25°), its track and the lit arc up to the reading,
   a tapered needle on a hub with the accent at its centre; the handover's branches, their junction and the call's
   two rings */
.best-agent-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
  fill: none; stroke: var(--c-white); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 5px rgb(var(--c-white-rgb) / 0.35)); }
.best-agent-at-768, .best-agent-at-390 { display: none; }
.best-agent-base { stroke-width: 1; }
.best-agent-wave { stroke-opacity: 0.92; }
.best-agent-tick { stroke-opacity: 0.95; }
.best-agent-tick-minor { stroke-opacity: 0.5; }
.best-agent-track { stroke-opacity: 0.22; }
.best-agent-needle, .best-agent-hub, .best-agent-node-dot { fill: var(--c-white); stroke: none; }
.best-agent-hub-dot { fill: var(--accent); stroke: none; }
.best-agent-ring-line { stroke-width: 1; stroke-opacity: 0.5; }
.best-agent-ring-line--far { stroke-opacity: 0.24; }

/* Dial: white glass, lit from the top left, with a white stroke and Figma's background blur 8 (CSS 4 px, here 6 px);
   base.css adds the glass edge light (.best-agent-glass-blur) just inside its stroke */
.best-agent-dial {
  position: absolute;
  top: 92px;
  left: 174px;
  width: 272px;
  height: 272px;
  border: 1px solid color-mix(in srgb, var(--c-white) 75%, transparent);
  border-radius: var(--radius-full);
  background: radial-gradient(120% 120% at 30% 18%, color-mix(in srgb, var(--c-white) 42%, transparent),
    color-mix(in srgb, var(--c-white) 12%, transparent) 60%, color-mix(in srgb, var(--c-white) 6%, transparent));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--c-white) 70%, transparent), inset 0 -24px 48px -24px rgb(var(--c-violet-rgb) / 0.22),
    0 30px 60px -30px rgb(var(--c-violet-deep-rgb) / 0.45);
  -webkit-backdrop-filter: blur(6px) saturate(1.15);
  backdrop-filter: blur(6px) saturate(1.15);
}

/* Pill: the file's glass (.glass: its blur and edge light) with Figma's frosted fill, white stroke and glass shadow */
.best-agent-pill {
  position: absolute;
  display: flex;
  align-items: center;
  gap: var(--pill-gap);
  height: var(--pill-h);
  padding: 0 var(--pill-end) 0 var(--pill-in);
  border: 1px solid color-mix(in srgb, var(--c-white) 92%, transparent);
  border-radius: var(--radius-full);
  background: linear-gradient(color-mix(in srgb, var(--c-white) 66%, transparent),
    color-mix(in srgb, var(--c-panel-deep) 62%, transparent));
  box-shadow: inset 0 1px 0 var(--c-white), inset 0 -10px 18px -12px rgb(var(--c-violet-rgb) / 0.2), var(--best-agent-glass-shadow);
  color: var(--ink-primary);
  white-space: nowrap;
}
.best-agent-unit { color: var(--ink-secondary); }
/* Body/Strong on desktop (not one of base.css's classes); System/Label L (.t-label-l) on tablet; System/Label on phone */
@media (min-width: 900px) { .best-agent-word { font-size: 18px; line-height: 26px; letter-spacing: -0.2px; } }
.best-agent-disc {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--disc);
  height: var(--disc);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  background: var(--surface-card);
  box-shadow: 0 1px 2px rgb(var(--c-violet-deep-rgb) / 0.1), 0 6px 14px -6px rgb(var(--c-violet-deep-rgb) / 0.28);
  color: var(--accent);
}
/* The call itself: the accent disc with a white icon */
.best-agent-disc--call { border-color: transparent; background: linear-gradient(160deg, var(--c-agent), var(--accent));
  color: var(--ink-on-dark); }
/* Lucide icons, 1.5 px at every size, as Figma draws them; in the accent */
.best-agent-icon { width: var(--icon); height: var(--icon); fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; }
.best-agent-icon path { vector-effect: non-scaling-stroke; }
.best-agent-icon--mark { fill: currentColor; stroke: none; color: var(--ink-primary); }   /* WhatsApp's own mark, in ink */

/* Latency: the dial with the reading under its needle */
.best-agent-pill--reading { top: 264px; left: 50%; padding-inline: var(--pill-end); translate: -50% 0; }

/* Handover: a call branching to three pills of one width */
.best-agent-pill--caller { top: 196px; left: 155px; justify-content: center; width: var(--pill-h); padding: 0; }
.best-agent-pill--branch { left: 267px; width: 198px; }
.best-agent-pill--interrupt { top: 92px; }
.best-agent-pill--language { top: 196px; }
.best-agent-pill--human { top: 300px; }

/* Channels: four pills of one width; the call in the middle (its bars on the stage's centre line), web chat above
   it, SMS and WhatsApp below, either side of the centre */
.best-agent-pill--channel { width: 184px; }
.best-agent-pill--webchat, .best-agent-pill--phone { left: 50%; translate: -50% 0; }
.best-agent-pill--webchat { top: 92px; }
.best-agent-pill--phone { top: 196px; }
.best-agent-pill--sms, .best-agent-pill--whatsapp { --pair-gap: 12px; top: 300px; }
.best-agent-pill--sms { right: calc(50% + var(--pair-gap)); }
.best-agent-pill--whatsapp { left: calc(50% + var(--pair-gap)); }

/* Moments (/_assets/design/5fffbbb541703d47/05-best-agent.js): the voice bars grow from their centre line, the needle turns about the dial's centre,
   and a ring leaves the pill that takes the call */
.best-agent-bar { transform-box: fill-box; transform-origin: center; }
.best-agent-at-1440 .best-agent-needle { transform-origin: 310px 228px; }
.best-agent-at-768 .best-agent-needle { transform-origin: 340px 190px; }
.best-agent-at-390 .best-agent-needle { transform-origin: 163px 120px; }
.best-agent-ring { position: absolute; inset: -1px; border: 2px solid var(--c-white); border-radius: inherit;
  opacity: 0; pointer-events: none; }


@media (max-width: 1199px) {
  .best-agent { padding-block: var(--space-8); }
  .best-agent-inner { gap: var(--space-6); }
}

/* Tablet (768 frame): the art's tablet sizes and places */
@media (max-width: 899px) {
  .best-agent-pic {
    --art-w: 680px;
    --art-h: 380px;
    --pill-h: 56px;
    --disc: 40px;
    --icon: 20px;
  }

  .best-agent-at-1440 { display: none; }
  .best-agent-at-768 { display: inline; }
  .best-agent-dial { top: 76px; left: 226px; width: 228px; height: 228px; }
  .best-agent-pill--reading { top: 219px; }
  .best-agent-pill--caller { top: 162px; left: 201px; }
  .best-agent-pill--branch { left: 299px; width: 179px; }
  .best-agent-pill--interrupt { top: 76px; }
  .best-agent-pill--language { top: 162px; }
  .best-agent-pill--human { top: 248px; }
  .best-agent-pill--channel { width: 168px; }
  .best-agent-pill--webchat { top: 76px; }
  .best-agent-pill--phone { top: 162px; }
  .best-agent-pill--sms, .best-agent-pill--whatsapp { --pair-gap: 10px; top: 248px; }
}

/* Phone (390 frame): the art's phone sizes and places */
@media (max-width: 599px) {
  .best-agent-pic {
    --art-w: 326px;
    --art-h: 240px;
    --pill-h: 40px;
    --disc: 32px;
    --icon: 16px;
    --pill-in: var(--space-1);
    --pill-end: var(--space-4);
    --pill-gap: var(--space-2);
  }
  .best-agent-word { font-size: 14px; line-height: 20px; letter-spacing: 0; }   /* System/Label */

  .best-agent-at-768 { display: none; }
  .best-agent-at-390 { display: inline; }
  .best-agent-dial { top: 48px; left: 91px; width: 144px; height: 144px; }
  .best-agent-pill--reading { top: 136px; }
  .best-agent-pill--caller { top: 100px; left: 56px; }
  .best-agent-pill--branch { left: 126px; width: 144px; }
  .best-agent-pill--interrupt { top: 48px; }
  .best-agent-pill--language { top: 100px; }
  .best-agent-pill--human { top: 152px; }
  .best-agent-pill--channel { width: 132px; }
  .best-agent-pill--webchat { top: 48px; }
  .best-agent-pill--phone { top: 100px; }
  .best-agent-pill--sms, .best-agent-pill--whatsapp { --pair-gap: 6px; top: 152px; }
}
