/* AI Buddy · the team section ("AI agents build your app. Our highly skilled developers and product analysts answer for the result.")
   One window on a wide page: headline, then the role dial beside the panel of AI agents; the three facts follow below.
   Nothing here depends on scroll position and nothing takes a swipe. assets/sec-team.js lets the visitor
   choose a role (click, tap, arrow keys, the wheel over the dial) and cycles the roles while the section is on screen.

   Layout   .team-h        the headline (shared .s-h size)
            .team-g        two columns: .team-dial (the roles) and .team-panel (the agents the chosen role guides)
            .team-roles    a radio group; every role sits on an arc around a hidden centre to the left of the hand.
                           A role's place on the arc is --team-k: its distance from the hand (0 is at the hand,
                           -4 to 4 around it). --team-s is its size and --team-o its brightness. These three are the
                           dial without script: the first role chosen. With script, assets/sec-team.js writes the same
                           formula as transform and opacity straight onto each role, every frame while the dial turns
                           (there is no CSS transition on the turn).
            .team-facts    three numbered facts in a row
   Sizes    --dial-h is the height of the dial and the panel; --R the arc radius (--rk of the dial's height);
            --st the angle between two roles. The script reads --rk and --st, so they are changed here only.
            The panel reserves room for the longest list (five agents), so choosing a role never changes the height.
   States   [aria-checked="true"]  the chosen role (at the hand, full size, white)
            [data-d="1".."4"]      how far a role is from the chosen one (smaller and dimmer, still 5 to 1)
            .is-turning on the dial  the dial is moving: roles and ticks sit on their own layers, only for that time
            .is-wheel on the dial  the dial has taken the wheel (the pointer moved onto it on purpose); the cursor says so
            .is-swap on the panel  the old list is fading out; the new one fades in when the class goes
            .is-armed / .is-in     the entrance (assets/kit.js); the facts follow the panel's entrance.
                                   Without script, or with motion off, the final state shows
   Narrow   (container under 900 px) the roles are a wrapping row of chips above the panel; no dial. */

@property --team-k{syntax:'<number>';inherits:false;initial-value:0}
@property --team-s{syntax:'<number>';inherits:false;initial-value:.6}
@property --team-o{syntax:'<number>';inherits:false;initial-value:1}

.team{
  --dial-h:clamp(300px,calc(var(--dvh) * .42),430px);
  --rk:.62;
  --R:calc(var(--dial-h) * var(--rk));
  --st:11deg;
  --hx:62%;                                   /* the hand: where the chosen role ends, from the left of the dial */
  --ag-h:clamp(40px,calc(var(--u) * 2.8),50px);
  --fs-role:clamp(24px,calc(var(--u) * 1.8),32px);
}

/* headline */
.team-h{max-width:17em}

/* dial and panel */
.team-g{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:clamp(40px,6cqw,120px);align-items:center;margin-top:clamp(24px,calc(var(--dvh) * .045),56px)}

.team-dial{position:relative;height:var(--dial-h)}
/* the arc: ring and ticks around the same centre as the roles, cut to the right half and faded at both ends */
.team-arc{position:absolute;inset:-24px 0;pointer-events:none;-webkit-mask-image:linear-gradient(transparent,#000 18%,#000 82%,transparent);mask-image:linear-gradient(transparent,#000 18%,#000 82%,transparent);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}
.team-ring,.team-ticks{position:absolute;left:calc(var(--hx) - 2 * var(--R) - 26px);top:calc(50% - var(--R) - 26px);width:calc(2 * var(--R) + 52px);height:calc(2 * var(--R) + 52px);border-radius:50%;clip-path:inset(0 0 0 50%)}
.team-ring{border:1px solid rgba(255,255,255,.16)}
.team-ticks{
  background:repeating-conic-gradient(from calc(90deg - 16 * var(--st)),rgba(255,255,255,.62) 0deg .4deg,transparent .4deg var(--st)),repeating-conic-gradient(from calc(90deg - 16 * var(--st)),rgba(255,255,255,.2) 0deg .25deg,transparent .25deg calc(var(--st) / 4));
  -webkit-mask:radial-gradient(circle closest-side,transparent calc(100% - 12px),#000 calc(100% - 11px),#000 calc(100% - 3px),transparent calc(100% - 2px));
  mask:radial-gradient(circle closest-side,transparent calc(100% - 12px),#000 calc(100% - 11px),#000 calc(100% - 3px),transparent calc(100% - 2px));
  }
.team-hand{position:absolute;left:0;top:50%;width:calc(var(--hx) + 26px);height:1px;background:linear-gradient(90deg,rgba(168,117,255,0) 80%,rgba(168,117,255,.9));pointer-events:none}
.team-hand::after{content:"";position:absolute;right:-3px;top:-3px;width:7px;height:7px;border-radius:50%;background:#fff;box-shadow:0 0 0 4px rgba(139,61,255,.25),0 0 16px var(--v2)}

.team-dial.is-wheel{cursor:ns-resize}
.team-roles{position:absolute;inset:0}
.team-role{
  --team-k:0;--team-s:.6;--team-o:.51;
  position:absolute;right:calc(100% - var(--hx));top:50%;
  margin:0;padding:6px 0;border:0;background:none;font:inherit;text-align:right;white-space:nowrap;cursor:pointer;
  color:#fff;opacity:var(--team-o);transform-origin:100% 50%;
  transform:translate(calc((cos(calc(var(--team-k) * var(--st))) - 1) * var(--R)),calc(sin(calc(var(--team-k) * var(--st))) * var(--R) - 50%)) scale(var(--team-s));
  -webkit-tap-highlight-color:transparent;
}
.team-ti{display:none}
.team-tn{display:block;font-family:var(--serif);font-size:var(--fs-role);font-weight:300;line-height:1.2;letter-spacing:-.015em}
.team-role[aria-checked="true"]{--team-s:1;--team-o:1}
.team-role[data-d="1"]{--team-o:.75}
.team-role[data-d="2"]{--team-o:.62}
.team-role[data-d="3"]{--team-o:.55}
/* at rest a role under the pointer brightens; while the dial turns the script owns the brightness, on layers of their own */
.team-dial:not(.is-turning) .team-role{transition:opacity .25s ease}
.team-dial:not(.is-turning) .team-role:not([aria-checked="true"]):hover{opacity:.89 !important}
.team-dial.is-turning .team-role{will-change:transform,opacity}
.team-dial.is-turning .team-ticks{will-change:transform}
.team-role:focus-visible{outline:2px solid var(--v2);outline-offset:6px;border-radius:4px}
/* the arc without script: the first role chosen, the others around it */
.team-role:nth-child(2){--team-k:1}
.team-role:nth-child(3){--team-k:2}
.team-role:nth-child(4){--team-k:3}
.team-role:nth-child(5){--team-k:4}
.team-role:nth-child(6){--team-k:-4}
.team-role:nth-child(7){--team-k:-3}
.team-role:nth-child(8){--team-k:-2}
.team-role:nth-child(9){--team-k:-1}

/* panel: label, the role's name, the agents (room for five), the closing line */
.team-panel{display:flex;flex-direction:column}
.team-k{font-family:'Inter Tight','Helvetica Neue',Arial,sans-serif;font-size:11px;line-height:1.4;letter-spacing:.42em;text-transform:uppercase;color:var(--ink-low)}
.team-name{margin:clamp(10px,calc(var(--u) * .9),16px) 0 0;font-family:var(--serif);font-size:clamp(26px,calc(var(--u) * 2.3),44px);font-weight:300;line-height:1.05;letter-spacing:-.035em;color:var(--ink-hi);white-space:nowrap}
.team-name em{font-style:normal;color:var(--v2)}
.team-ags{display:grid;grid-auto-rows:var(--ag-h);align-content:start;height:calc(5 * var(--ag-h));margin:clamp(12px,calc(var(--u) * 1.2),24px) 0 0;padding:0;list-style:none}
.team-ag{display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--line);font-family:'Inter Tight','Helvetica Neue',Arial,sans-serif;font-size:clamp(15px,calc(var(--u) * 1.02),18px);color:#d8d8de}
.team-ag b{font-weight:500;font-size:10px;letter-spacing:.28em;color:var(--v2)}
.team-all{margin:clamp(12px,calc(var(--u) * 1.1),22px) 0 0;font-family:'Inter Tight','Helvetica Neue',Arial,sans-serif;font-size:13px;line-height:1.5;color:var(--ink-low)}

/* the swap: the old name and list fade out, the new ones fade in, one agent after another */
.team-name,.team-ag{transition:opacity .3s ease,transform .45s var(--ease)}
.team-ag{transition-delay:calc(var(--i,0) * 50ms)}
.team-panel.is-swap .team-name,.team-panel.is-swap .team-ag{opacity:0;transform:translate3d(0,6px,0);transition:opacity .16s ease,transform .16s ease;transition-delay:0s}

/* facts */
.team-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:30px;margin-top:clamp(48px,calc(var(--dvh) * .08),96px)}
.team-facts p{margin:0;padding-top:22px;border-top:1px solid var(--line);font-family:'Inter Tight','Helvetica Neue',Arial,sans-serif;font-size:15px;line-height:1.55;color:#c4c4cc}
.team-facts span{display:block;margin-bottom:10px;font-size:10px;letter-spacing:.3em;color:var(--v2)}
/* the facts are not parts of their own: they rise one after another when the panel enters, so they are complete
   even when they sit below the window at that moment */
.team.is-armed .team-facts p{opacity:0;transform:translate3d(0,14px,0)}
.team.is-armed:has(.team-panel.is-in) .team-facts p{opacity:1;transform:none;transition:opacity .6s var(--ease),transform .8s var(--ease)}
.team.is-armed:has(.team-panel.is-in) .team-facts p:nth-child(2){transition-delay:.11s}
.team.is-armed:has(.team-panel.is-in) .team-facts p:nth-child(3){transition-delay:.22s}

/* narrow page (phones, and the phone preview): a row of chips above the panel */
@container (max-width:900px){
  .team{--ag-h:56px}
  .team-h{font-size:clamp(30px,8.8cqw,44px);max-width:none}
  .team-g{grid-template-columns:minmax(0,1fr);row-gap:28px;margin-top:32px}
  .team-dial{height:auto}
  .team-arc,.team-hand{display:none}
  .team-roles{position:static;display:flex;flex-wrap:wrap;gap:8px}
  .team-roles .team-role{position:static;transform:none !important;opacity:1 !important;will-change:auto;padding:9px 14px;border:1px solid var(--line);border-radius:999px;color:#c4c4cc;transition:color .3s ease,background-color .3s ease,border-color .3s ease}
  .team-roles .team-role[aria-checked="true"]{color:#fff;background:rgba(139,61,255,.28);border-color:var(--v2)}
  .team-tn{font-family:'Inter Tight','Helvetica Neue',Arial,sans-serif;font-size:14px;font-weight:400;letter-spacing:0;line-height:1.3}
  .team-name{display:none}
  .team-k{font-size:10px;letter-spacing:.3em}
  .team-ags{margin-top:8px}
  .team-ag{flex-direction:column;align-items:flex-start;justify-content:center;gap:4px;font-size:14px}
  .team-ag b{font-size:10px;letter-spacing:.24em}
  .team-all{font-size:12px}
  .team-facts{grid-template-columns:minmax(0,1fr);gap:22px;margin-top:44px}
}

/* motion off (the page's own switch, or the system setting): roles and panel change at once */
html.calm .team-role{transition:none !important}
@media (prefers-reduced-motion:reduce){.team-role{transition:none !important}}
