/* ==========================================================================
   THE AGENTS, IN PERSON.
   Adriana, Luis and Chloe as characters rather than initials: one round
   avatar (.av) used everywhere an agent is named, and one portrait card
   (.cast-card) for the AI team section. Each agent carries an aura built
   from their own artwork plus a brand colour:
     Adriana  neon green + violet     (her jacket's piping, the brand primary)
     Luis     ice silver + sea green  (his uniform, the success green)
     Chloe    cyan + ice blue         (her circuitry glow)
   Every animation here is transform/opacity only, and all of it stops under
   prefers-reduced-motion (block at the bottom).
   ========================================================================== */

.agent-adriana { --a1: #7DFF4D; --a2: #9D6FFF; --a-rgb: 125, 255, 77; }
.agent-luis    { --a1: #E6EDF7; --a2: #00E676; --a-rgb: 230, 237, 247; }
.agent-chloe   { --a1: #38BDF8; --a2: #A5F3FC; --a-rgb: 56, 189, 248; }

/* --------------------------------------------------------------------------
   Round avatar
   <span class="av agent-adriana" style="--size:40px"><img …></span>
   -------------------------------------------------------------------------- */
.av {
  --size: 40px;
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  isolation: isolate;
  vertical-align: middle;
}
/* The ring: a conic gradient behind the photo, rotated as a whole. A circle
   rotating is still a circle, so this needs no @property support. */
.av::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(var(--a1), var(--a2), rgba(var(--a-rgb), 0) 45%, rgba(var(--a-rgb), 0) 60%, var(--a1));
  animation: av-spin 5s linear infinite;
  z-index: -1;
}
/* The aura: a soft glow that breathes. */
.av::after {
  content: "";
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--a-rgb), .42), rgba(var(--a-rgb), 0) 62%);
  animation: av-breathe 3.6s ease-in-out infinite;
  z-index: -2;
  pointer-events: none;
}
.av img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--void, #06060A);
  background: var(--surface, #121218);
}
/* Live status: a dot that sends out a ping. */
.av-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: max(8px, 26%);
  height: max(8px, 26%);
  border-radius: 50%;
  background: var(--a1);
  border: 2px solid var(--void, #06060A);
  z-index: 2;
}
.av-dot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--a1);
  animation: av-ping 2.4s cubic-bezier(0, 0, .2, 1) infinite;
}
/* Working: the ring spins faster, as if thinking. */
.av--busy::before { animation-duration: 1.4s; }
/* Still: ring but no motion, for small inline uses next to text. */
.av--still::before, .av--still::after { animation: none; }
.av--still::after { opacity: .5; }

@keyframes av-spin { to { transform: rotate(360deg); } }
@keyframes av-breathe {
  0%, 100% { opacity: .35; transform: scale(.92); }
  50%      { opacity: .8;  transform: scale(1.06); }
}
@keyframes av-ping {
  0%   { opacity: .9; transform: scale(1); }
  80%, 100% { opacity: 0; transform: scale(2.4); }
}

/* --------------------------------------------------------------------------
   Hero: the stacked trio
   -------------------------------------------------------------------------- */
.av-stack { display: flex; align-items: center; padding-left: 4px; }
.av-stack .av { --size: 40px; margin-left: -10px; transition: transform .35s var(--ease-spring, ease), z-index 0s; }
.av-stack .av:first-child { margin-left: 0; }
.av-stack .av:nth-child(1) { z-index: 3; }
.av-stack .av:nth-child(2) { z-index: 2; }
.av-stack .av:nth-child(3) { z-index: 1; }
.av-stack:hover .av { margin-left: -4px; }
.av-stack:hover .av:first-child { margin-left: 0; }
.av-stack .av:hover { transform: translateY(-4px) scale(1.08); z-index: 5; }
.av-stack .av:nth-child(2)::before { animation-delay: -1.6s; }
.av-stack .av:nth-child(3)::before { animation-delay: -3.2s; }
.av-stack .av:nth-child(2)::after  { animation-delay: -1.2s; }
.av-stack .av:nth-child(3)::after  { animation-delay: -2.4s; }

/* Sample-workspace rows: the photo replaces the letter disc. */
.mock-row .av { --size: 30px; }

/* --------------------------------------------------------------------------
   Team banner
   -------------------------------------------------------------------------- */
.team-banner {
  position: relative;
  margin: 0 auto 1.5rem;
  max-width: 980px;
  border-radius: var(--radius-lg, 26px);
  padding: 2px;
  isolation: isolate;
}
/* Glowing edge: a gradient frame with the brand colours drifting round it. */
.team-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, #7DFF4D, #9D6FFF 30%, #E6EDF7 50%, #38BDF8 70%, #7DFF4D);
  background-size: 300% 100%;
  animation: banner-drift 9s linear infinite;
  z-index: -1;
}
.team-banner::after {
  content: "";
  position: absolute;
  inset: 8% 4% -6%;
  border-radius: inherit;
  background: radial-gradient(60% 70% at 20% 60%, rgba(125,255,77,.28), transparent 70%),
              radial-gradient(60% 70% at 80% 60%, rgba(56,189,248,.28), transparent 70%),
              radial-gradient(50% 60% at 50% 30%, rgba(157,111,255,.3), transparent 70%);
  filter: blur(28px);
  z-index: -2;
  animation: av-breathe 6s ease-in-out infinite;
}
.team-banner-inner {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius-lg, 26px) - 2px);
  background: var(--void, #06060A);
  aspect-ratio: 16 / 9;
  cursor: pointer;
  outline: none;
}
.team-banner-inner:focus-visible { box-shadow: 0 0 0 3px var(--void, #06060A), 0 0 0 5px var(--accent, #7DFF4D); }
/* Cover and film share one frame; the film's first frame IS the cover, so
   the crossfade between them is invisible apart from the motion starting. */
.team-banner img,
.team-banner video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* No zoom on the cover: it must sit exactly where the film will play, so
   the hand-off from picture to motion has no jump in scale. */
.team-banner img {
  transform: none;
  transition: opacity .7s var(--ease-out, ease), filter .7s ease;
}
.team-banner video {
  opacity: 0;
  transition: opacity .7s var(--ease-out, ease);
}
.team-banner.is-playing video { opacity: 1 !important; }
.team-banner.is-playing img { opacity: 0 !important; animation-play-state: paused; }
/* Waiting on the first frames: the cover dims a touch so the hover registers. */
.team-banner.is-loading img { filter: brightness(.82) saturate(1.1); }
.team-banner:hover::after,
.team-banner.is-active::after { opacity: 1; filter: blur(34px); }
.team-banner { transition: transform .6s var(--ease-spring, ease); }
.team-banner:hover { transform: translateY(-3px); }

/* "Hover to watch" pill. Shown only once the script is ready, so a visitor
   without JavaScript is never promised a film that will not play. */
.tb-hint {
  position: absolute;
  left: .85rem;
  top: .85rem;
  z-index: 3;
  display: none;
  align-items: center;
  gap: .45rem;
  padding: .3rem .75rem .3rem .3rem;
  border-radius: 999px;
  font-size: .72rem;
  letter-spacing: .01em;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  background: rgba(6,6,10,.58);
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity .45s ease, transform .45s var(--ease-spring, ease);
}
.tb-ready .tb-hint { display: inline-flex; }
.team-banner.is-active .tb-hint { opacity: 0; transform: translateY(-6px); }
.tb-play {
  position: relative;
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  color: #06060A;
  background: linear-gradient(135deg, #B7FF63, #7DFF4D);
  padding-left: 2px;
}
.tb-play::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(125,255,77,.6);
  animation: av-ping 2.2s cubic-bezier(0, 0, .2, 1) infinite;
}

.tb-sound {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  color: #fff;
  background: rgba(6,6,10,.55);
  border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform: scale(.85);
  transition: opacity .35s ease, transform .35s var(--ease-spring, ease), border-color .2s ease;
}
.tb-sound[hidden] { display: none; }
.team-banner.is-active .tb-sound { opacity: 1; transform: scale(1); }
.tb-sound:hover { border-color: var(--accent, #7DFF4D); }
.tb-sound:focus-visible { outline: 2px solid var(--accent, #7DFF4D); outline-offset: 2px; opacity: 1; }
.tb-sound .tb-ic-on { display: none; }
.tb-sound[aria-pressed="true"] .tb-ic-on { display: block; }
.tb-sound[aria-pressed="true"] .tb-ic-off { display: none; }
@media (max-width: 600px) { .tb-hint { font-size: .66rem; top: .55rem; left: .55rem; } }

/* A band of light that crosses the banner every few seconds. */
/* Paused while the film plays, so the light never crosses the footage. */
.team-banner.is-playing .team-banner-inner::after { animation-play-state: paused; opacity: 0; }
.team-banner-inner::after {
  content: "";
  z-index: 2;
  position: absolute;
  inset: -20% auto -20% -40%;
  width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.14), transparent);
  transform: skewX(-18deg);
  animation: sweep 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes banner-drift { to { background-position: 300% 0; } }
@keyframes banner-zoom { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes sweep {
  0%, 55% { transform: translateX(0) skewX(-18deg); }
  100%    { transform: translateX(560%) skewX(-18deg); }
}

/* --------------------------------------------------------------------------
   Cast cards: one per agent
   -------------------------------------------------------------------------- */
.cast-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}
@media (max-width: 900px) { .cast-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; } }

.cast-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md, 18px);
  padding: 1rem 1rem 1.5rem;
  transition: transform .45s var(--ease-spring, ease), box-shadow .45s var(--ease-spring, ease), border-color .3s ease;
}
.cast-card:hover {
  transform: translateY(-6px);
  border-color: rgba(var(--a-rgb), .45);
  box-shadow: 0 24px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(var(--a-rgb), .2), 0 10px 40px rgba(var(--a-rgb), .18);
}

.cast-portrait {
  position: relative;
  border-radius: calc(var(--radius-md, 18px) - 4px);
  padding: 2px;
  overflow: hidden;
  isolation: isolate;
}
/* Neon frame: a spinning conic gradient, oversized and centred, shows only
   as the 2px band between the card's edge and the photo. */
.cast-portrait::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 160%;
  aspect-ratio: 1;
  background: conic-gradient(var(--a1), var(--a2), rgba(var(--a-rgb), 0) 30%, rgba(var(--a-rgb), 0) 50%, var(--a2), var(--a1) 80%, rgba(var(--a-rgb), 0) 90%, var(--a1));
  transform: translate(-50%, -50%) rotate(0deg);
  animation: frame-spin 6s linear infinite;
  z-index: -1;
}
.cast-photo {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius-md, 18px) - 6px);
  background: var(--void, #06060A);
  aspect-ratio: 1 / 1;
}
.cast-photo img,
.cast-photo video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  transform: scale(1.02);
  transition: transform .8s var(--ease-spring, ease);
  animation: cast-float 7s ease-in-out infinite;
}
.cast-card:hover .cast-photo img,
.cast-card:hover .cast-photo video { transform: scale(1.08); }
/* The blink-and-smirk clip sits exactly over the portrait (its size and
   crop are also inline) and fades in once it is actually playing. */
.cast-photo video.cast-anim { position: absolute; inset: 0; transition: opacity .35s ease, transform .8s var(--ease-spring, ease); }

/* Colour wash from the bottom so the name sits on the agent's own light. */
.cast-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(var(--a-rgb), .16) 85%, rgba(6,6,10,.75));
  pointer-events: none;
}
/* Light sweep across the photo on hover. */
.cast-photo::before {
  content: "";
  position: absolute;
  inset: -10% auto -10% -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.22), transparent);
  transform: skewX(-18deg);
  z-index: 2;
  pointer-events: none;
  opacity: 0;
}
.cast-card:hover .cast-photo::before { animation: sweep 1.1s ease-out; opacity: 1; }

/* Sparks rising off the portrait, in the agent's colour. */
.cast-sparks { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; border-radius: inherit; }
.cast-sparks i {
  position: absolute;
  bottom: -6px;
  left: var(--x);
  width: var(--s, 4px);
  height: var(--s, 4px);
  border-radius: 50%;
  background: var(--a1);
  box-shadow: 0 0 8px var(--a1), 0 0 2px #fff;
  opacity: 0;
  animation: spark-rise var(--d, 5s) linear infinite;
  animation-delay: var(--t, 0s);
}
@keyframes spark-rise {
  0%   { opacity: 0; transform: translate(0, 0) scale(.6); }
  12%  { opacity: 1; }
  70%  { opacity: .8; }
  100% { opacity: 0; transform: translate(var(--dx, 10px), -260px) scale(1.1); }
}

.cast-badge {
  position: absolute;
  top: .75rem;
  left: .75rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .6rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(6,6,10,.62);
  border: 1px solid rgba(var(--a-rgb), .4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cast-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--a1);
  box-shadow: 0 0 0 0 rgba(var(--a-rgb), .7);
  animation: badge-pulse 2s ease-out infinite;
}
@keyframes badge-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--a-rgb), .7); }
  100% { box-shadow: 0 0 0 8px rgba(var(--a-rgb), 0); }
}

.cast-body { padding: .9rem .4rem 0; }
.cast-role {
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--a1);
  text-shadow: 0 0 18px rgba(var(--a-rgb), .55);
}
.cast-body h3 {
  margin: .15rem 0 .7rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -.01em;
}
.cast-body .check-list li::before { background: rgba(var(--a-rgb), .14); }
.cast-body .check-list li::after { color: var(--a1); }

@keyframes frame-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes cast-float {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -6px; }
}

/* Hand-off arrows between the cards on wide screens: a pulse travelling
   from one agent to the next, so the trio reads as one relay. */
.cast-grid { position: relative; }
.cast-relay {
  position: absolute;
  top: 34%;
  width: 1.4rem;
  height: 2px;
  z-index: 5;
  background: rgba(255,255,255,.12);
  overflow: hidden;
  border-radius: 2px;
}
.cast-relay::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 50%;
  background: linear-gradient(90deg, transparent, var(--accent, #7DFF4D), transparent);
  animation: relay 2.2s ease-in-out infinite;
}
.cast-relay--1 { left: calc(33.333% - .7rem); }
.cast-relay--2 { left: calc(66.666% - .7rem); }
.cast-relay--2::after { animation-delay: 1.1s; }
@keyframes relay { from { transform: translateX(-100%); } to { transform: translateX(200%); } }
@media (max-width: 900px) { .cast-relay { display: none; } }

/* --------------------------------------------------------------------------
   Workflow: avatars on the agent steps, and a pulse travelling down the line
   -------------------------------------------------------------------------- */
.flow-vertical.flow-live { position: relative; }
.flow-vertical.flow-live::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(157,111,255,.25), rgba(125,255,77,.25));
  z-index: 0;
}
.flow-vertical.flow-live::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--accent, #7DFF4D);
  box-shadow: 0 0 12px 3px rgba(125,255,77,.7);
  animation: flow-travel 5s cubic-bezier(.45, 0, .55, 1) infinite;
  z-index: 0;
}
.flow-vertical.flow-live > span { position: relative; z-index: 1; background: var(--surface, #121218); }
.flow-step-agent {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  color: var(--text, #fff) !important;
  border: 1px solid rgba(var(--a-rgb), .28);
  box-shadow: inset 0 0 18px rgba(var(--a-rgb), .07);
}
.flow-step-agent .av { --size: 24px; }
@keyframes flow-travel {
  0%   { top: 0; opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { top: calc(100% - 8px); opacity: 0; }
}

/* Pricing group headings: a small portrait in place of the icon. */
.price-group .av { --size: 22px; margin-right: .15rem; }

/* --------------------------------------------------------------------------
   Reduced motion: keep the look, drop the movement.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .av::before, .av::after, .av-dot::after,
  .team-banner::before, .team-banner::after, .team-banner img, .team-banner-inner::after,
  .cast-portrait::before, .cast-photo img, .cast-sparks i, .cast-badge::before,
  .cast-relay::after, .flow-vertical.flow-live::after, .tb-play::after {
    animation: none !important;
  }
  .cast-sparks, .flow-vertical.flow-live::after, .team-banner-inner::after { display: none; }
  .cast-card, .cast-photo img, .av-stack .av, .team-banner { transition: none; }
  .team-banner:hover { transform: none; }
}
