/* Proxy Studio: the hero (agent tunnel), section#agents in index.html.
   It is the first section on the page; the "One dashboard" section (dsh.css) follows it. The section is tall and its stage pins to the screen.
   The hero has the same spotlight background as the final call to action (.spot, in index.html), running edge to edge
   and fading out at the bottom into the next section. A row of the five agent
   characters sits above the headline; scrolling lifts each one out of the row and grows it into its full card, which flies
   toward the viewer in front of the headline. The motion is in tun.js.
   The pinned stretch is the section height minus one screen: 180vh on wide screens, 120vh on phones. */

.tun{--t-ink:#F4F4F4;--t-dim:rgba(255,255,255,.62);--t-faint:rgba(255,255,255,.4);--t-mono:"Geist Mono",ui-monospace,Menlo,monospace;
  position:relative;margin-top:calc(-1*var(--nav-h,64px));height:280vh;background:#000;color:var(--t-ink);font-family:Geist,Figtree,system-ui,sans-serif;color-scheme:dark}
.tun-stage{position:sticky;top:0;height:100vh;height:100svh}
/* the background fills the whole first screen (it runs under the translucent nav; the copy is centred in the part below it).
   The flying cards are clipped by it, that is, by the screen. */
.tun .tun-panel{position:absolute;inset:0;padding-top:var(--nav-h,64px);display:flex;align-items:center;justify-content:center}
/* the spotlight and the grid lines fade out toward the bottom edge, into the colour of the next section, so there is no hard line */
.tun-panel::after{content:"";position:absolute;left:0;right:0;bottom:0;height:34%;z-index:-1;pointer-events:none;background:linear-gradient(rgba(4,4,4,0),#040404)}

/* centre copy: the cards pass in front of it */
.tun-title{position:relative;z-index:2;will-change:transform;display:flex;flex-direction:column;align-items:center;text-align:center;padding:0 24px;max-width:100%;pointer-events:none}
/* the agent row: one slot per agent, sized and spaced like the final call to action's row, the middle one larger.
   With motion on (.tun.fly), the slots only hold the places: the icons you see are the flying cards in .tun-space.
   The icons are the shared ones from agents.js, the same as in the final call to action. */
.tun-row{display:flex;justify-content:center;align-items:center;gap:clamp(12px,2vw,24px);margin-bottom:28px}
.tun-slot{position:relative;isolation:isolate;flex:none;width:clamp(44px,6vw,68px);aspect-ratio:1}
.tun-slot.big{width:clamp(60px,8.4vw,96px)}
.tun-slot::before{content:"";position:absolute;inset:-28%;z-index:-1;border-radius:50%;background:radial-gradient(closest-side,color-mix(in srgb,var(--c,#fff) 26%,transparent),transparent)}
.tun-slot svg{display:block;width:100%;height:100%;overflow:visible}
.tun.fly .tun-slot svg,.tun.fly .tun-slot::before{visibility:hidden}
.tun-title a{pointer-events:auto}
.tun h1{font-family:inherit;font-size:clamp(40px,6.6vw,104px);font-weight:600;letter-spacing:-.05em;line-height:1;text-wrap:balance;color:#fff}
/* each word carries the headline gradient (tun.js stretches it across the whole headline, so it fades over the last words) and can be revealed on its own */
.tun h1 .w{display:inline-block;padding-bottom:.1em;margin-bottom:-.1em;background:linear-gradient(to bottom right,#fff 40%,rgba(255,255,255,.45)) no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent}
/* subline 1: a second, darker headline line at 55% of the headline size (so it is never wider than the headline); subline 2: the sentence under it.
   Each word carries one grey gradient that tun.js stretches across the whole line, so the words can pop in on their own. */
.tun-tags{margin:10px 0 0;font-family:inherit;font-size:clamp(22px,3.63vw,57.2px);font-weight:600;letter-spacing:-.05em;line-height:1.05;text-wrap:balance;color:#6a6a6a}
.tun-tags span{display:inline-block;white-space:nowrap;padding-bottom:.1em;margin-bottom:-.1em;background:linear-gradient(90deg,#8a8a8a,#4a4a4a) no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent}
.tun-sub{margin:14px 0 0;max-width:55ch;font-size:clamp(15px,1.3vw,18px);color:var(--t-dim)}
.tun-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px 26px;margin-top:28px}
/* the hero's "Book a free call" is 40% bigger than the standard button (15px text, 13px × 20px padding) */
.tun .tun-cta{gap:14px;padding:18px 28px;font-size:21px}
.tun-actions.gone{visibility:hidden}

/* load sequence, about 1.6s in total: the agent row pops in one character at a time (60ms apart), then the headline word by word,
   subline 1 word by word, subline 2 fading up, the button, then the dashes and scroll prompt. */
@keyframes tun-fade{from{opacity:0}to{opacity:1}}
@keyframes tun-pop{from{opacity:0;transform:translateY(6px) scale(.9)}60%{opacity:1;transform:scale(1.04)}to{opacity:1;transform:none}}
@keyframes tun-up{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@keyframes tun-word{from{opacity:0;transform:translateY(.35em);filter:blur(8px)}to{opacity:1;transform:none;filter:blur(0)}}
@keyframes tun-in{from{opacity:0;transform:scale(.3)}to{opacity:1;transform:none}}
.tun-pop{animation:tun-in .4s cubic-bezier(.34,1.56,.64,1) calc(var(--i)*60ms) backwards}
.tun h1 .w{animation:tun-word .35s cubic-bezier(.2,.7,.2,1) calc(.35s + var(--i)*.045s) both}
.tun-tags span{animation:tun-pop .3s ease-out calc(.65s + var(--i)*.055s) both}
.tun-sub{animation:tun-up .35s ease-out 1.1s both}
.tun-actions{animation:tun-up .3s ease-out 1.25s backwards}
.tun-hud{animation:tun-fade .3s ease-out 1.3s backwards}

/* the space the cards fly through: the whole screen, in front of the copy. It gives the cards their perspective, but
   it is not a 3D-sorted scene: each card and chip is stacked by the z-index tun.js gives it, so one can never cut through another. */
.tun-space{position:absolute;inset:0;z-index:3;isolation:isolate;pointer-events:none;perspective:1200px}
.tun-card,.tun-chip{position:absolute;left:50%;top:50%;user-select:none;-webkit-user-select:none}
.tun-chip{opacity:0;will-change:transform,opacity}
/* One element per agent. At rest it is scaled down so that only its icon shows, sitting in the row; as it flies,
   the card frame fades in around the icon (.tun-frame), then the name and job line (.tun-text). tun.js drives the
   transform and the opacities; nothing else animates.
   The card is plain HTML: .tun-big holds it at 1.75 times its size and is scaled back down (tun.js sets both), and it is
   the layer the browser keeps, so the text and the icon are still sharp when the card is at its largest. Sizes inside
   are in cqw (hundredths of the card's width) or in px at that larger scale. */
.tun-card{aspect-ratio:248/376}
.tun-pop{position:absolute;inset:0;transition:opacity .25s}
/* an icon still waiting in the row, while a flying card is over it */
.tun-card.dim .tun-pop{opacity:.5}
.tun-big{position:absolute;left:0;top:0;transform-origin:0 0;will-change:transform;container-type:inline-size}
/* the dark card: its border and glow take the agent's colour */
.tun-frame{position:absolute;inset:0;opacity:0;border-radius:8.5%/5.6%;background:#0a0a0a;
  box-shadow:0 0 0 2px color-mix(in srgb,var(--c) 55%,rgba(255,255,255,.12)),0 52px 105px -35px #000,0 0 122px -18px var(--c);transition:box-shadow .4s}
.tun-card:hover .tun-frame{box-shadow:0 0 0 2.6px var(--c),0 52px 105px -35px #000,0 0 190px -10px var(--c)}
/* the badge slot at the top of the card */
.tun-frame::before{content:"";position:absolute;left:50%;top:3.7%;width:22%;height:2.7%;transform:translateX(-50%);border-radius:99px;background:#000;box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.09)}
/* name and job line: real text */
.tun-text{position:absolute;left:5%;right:5%;top:75.5%;opacity:0;text-align:center;color:#fff}
.tun-name{display:inline-block;font:900 var(--nf,12cqw)/1 Figtree,"Inter Tight",Inter,system-ui,sans-serif;letter-spacing:-.05em;white-space:nowrap}
.tun-role{display:block;margin-top:2.4cqw;font:400 5.6cqw/1.2 Geist,Figtree,system-ui,sans-serif;letter-spacing:-.01em;color:rgba(255,255,255,.86);white-space:nowrap}
/* the icon: floats gently and blinks now and then, like the row in the final call to action */
.tun-char{position:absolute;aspect-ratio:1;animation:tun-bob 3.2s ease-in-out infinite;animation-delay:var(--bd,0s)}
.tun-char svg{position:relative;display:block;width:100%;height:100%;overflow:visible}
/* the glow is the element before the icon, so it sits behind it without any z-index */
.tun-aura{position:absolute;inset:-28%;border-radius:50%;background:radial-gradient(closest-side,color-mix(in srgb,var(--c,#fff) 26%,transparent),transparent)}
.tun-char .eye,.tun-slot .eye{transform-box:fill-box;transform-origin:center;animation:tun-blink 4.6s infinite;animation-delay:var(--bd,0s)}
@keyframes tun-bob{50%{transform:translateY(var(--bob,0px))}}
@keyframes tun-blink{0%,92%,100%{transform:scaleY(1)}95%{transform:scaleY(.1)}}
.tun-chip{display:inline-flex;align-items:center;gap:8px;padding:9px 13px;border-radius:999px;border:1px solid rgba(255,255,255,.16);background:rgba(12,12,12,.85);font:500 12px/1 var(--t-mono);color:var(--t-dim);white-space:nowrap}
/* each chip's dot is its agent's colour */
.tun-chip::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--c,#fff);box-shadow:0 0 8px var(--c,#fff)}
@media (prefers-reduced-motion:reduce){.tun-pop,.tun h1 .w,.tun-tags span,.tun-sub,.tun-actions,.tun-hud,.tun-char,.tun-char .eye,.tun-slot .eye{animation:none}}

/* bottom: who you are looking at, progress dashes and the scroll prompt */
.tun-hud{position:absolute;left:0;right:0;bottom:clamp(20px,4vh,40px);z-index:20;display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;pointer-events:none;padding:0 20px}
.tun-now{min-height:1.4em;padding:7px 16px;border-radius:999px;background:rgba(0,0,0,.6);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);font-size:clamp(15px,1.4vw,18px);line-height:1.4;color:var(--t-ink);opacity:0;transition:opacity .3s}
.tun-now b{font-weight:600}
/* a dot in the colour of the agent in focus */
.tun-now b::before{content:"";display:inline-block;width:.46em;height:.46em;margin-right:.55em;border-radius:50%;background:var(--c,#fff);box-shadow:0 0 10px var(--c,#fff);vertical-align:.1em}
.tun-now span{color:var(--t-dim)}
.tun-pips{display:flex;gap:8px}
.tun-pips i{width:22px;height:3px;border-radius:3px;background:rgba(255,255,255,.16);transition:background .3s,box-shadow .3s}
.tun-pips i.seen{background:rgba(255,255,255,.5)}
.tun-pips i.on{background:var(--c,#fff);box-shadow:0 0 12px var(--c,#fff)}
.tun-prompt{display:flex;flex-direction:column;align-items:center;gap:8px;font:500 11px/1 var(--t-mono);letter-spacing:.3em;text-transform:uppercase;color:var(--t-faint)}
.tun-prompt::after{content:"";width:1px;height:22px;background:linear-gradient(#fff,transparent)}

/* no-motion fallback (reduced motion): no pinning. The copy with the static row fills the first screen,
   then comes a simple grid of the agent cards. */
.tun.static{height:auto}
.tun.static .tun-stage{position:static;height:auto}
.tun.static .tun-panel{position:relative;inset:auto;flex-direction:column;padding-bottom:72px}
.tun.static .tun-panel::after{height:160px}
.tun.static .tun-title{min-height:calc(100vh - var(--nav-h,64px));min-height:calc(100svh - var(--nav-h,64px));justify-content:center}
.tun.static .tun-space{position:static;width:100%;display:flex;flex-wrap:wrap;justify-content:center;gap:16px;padding:0 16px;perspective:none;scroll-margin-top:calc(var(--nav-h,64px) + 24px)}
.tun.static .tun-card{position:relative;left:auto;top:auto;width:min(200px,calc(50% - 8px))}
.tun.static .tun-frame,.tun.static .tun-text{opacity:1}
.tun.static .tun-aura,.tun.static .tun-chip,.tun.static .tun-hud{display:none}

/* phones: a shorter pin, about 120vh of scrolling */
@media (max-width:767px){.tun{height:220vh}.tun-panel{padding-bottom:44px}.tun-row{margin-bottom:20px}}
/* narrow phones: the longest caption ("Content Agent — Writes and schedules posts") stays on one line */
@media (max-width:430px){.tun-now{font-size:13.5px;white-space:nowrap}}
/* short screens (phones on their side): tighten the copy so the headline and button still fit */
@media (max-height:560px){.tun h1{font-size:clamp(26px,8vh,44px)}.tun-tags{font-size:clamp(16px,4.8vh,26px);margin-top:6px}.tun-sub{margin-top:10px}.tun-actions{margin-top:14px}.tun-prompt,.tun-pips{display:none}.tun-row{margin-bottom:10px}.tun-slot{width:34px}.tun-slot.big{width:46px}}
