/* Story: the AI team (#team) and how it works (#how).
   Every selector is scoped to .team or .how. */

/* =====================================================================
   TEAM: Enzo, the Chief of Staff, leads on an ink card;
   six specialists sit below him, all on a warm rounded panel
   ===================================================================== */
.team { padding: 0 var(--gutter) var(--section-y); }
.team .team-panel {
  max-width: 1600px;
  margin-inline: auto;
  padding: clamp(44px, 6.5vw, 100px) clamp(16px, 4vw, 64px) clamp(36px, 5vw, 72px);
  background: var(--paper-2);
  border-radius: var(--radius-lg);
}
/* inner width matches the .wrap content box so the left edges line up with #how */
.team .team-panel > * { max-width: calc(var(--wrap) - 2 * var(--gutter)); margin-inline: auto; }
.team .team-head {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: end;
  gap: 18px clamp(32px, 6vw, 96px);
}
.team .team-head h2 { margin-top: 14px; }
.team .team-head .lede { padding-bottom: 6px; }

/* ---------- Shared agent parts: brand tile, on duty, role line, AI tag, duties ---------- */
/* Brand tile avatar: initial plus a small job icon. Never a face. */
.team .agent-tile {
  position: relative;
  flex: none;
  width: 60px; height: 60px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.04em;
  font-variation-settings: "opsz" 96;
}
.team .tile-cobalt { background: var(--cobalt); color: #fff; }
.team .tile-sun { background: var(--sun); color: var(--ink); }
.team .tile-ink { background: var(--ink); color: var(--paper); }
.team .agent-ico {
  position: absolute;
  right: -8px; bottom: -8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 0 0 3px #fff, 0 4px 10px -4px rgba(20, 18, 14, .35);
}

.team .duty {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 10px 0 9px;
  border-radius: 999px;
  background: rgba(27, 158, 75, .08);
  color: #17733A;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.team .duty-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.team .duty-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--success);
  opacity: 0;
  animation: team-duty 2.6s ease-out infinite;
}
@keyframes team-duty {
  0% { transform: scale(.6); opacity: .7; }
  70%, 100% { transform: scale(1.5); opacity: 0; }
}

.team .agent-role {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 8px;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 15px;
}
.team .ai-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(20, 18, 14, .14);
  color: var(--ink-2);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.team .agent-duties {
  list-style: none;
  margin: 18px 0 22px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.team .agent-duties li { display: flex; align-items: flex-start; gap: 9px; font-size: 14.5px; font-weight: 500; line-height: 1.35; }
.team .agent-duties svg { flex: none; margin-top: 1px; color: var(--cobalt); }

/* ---------- Enzo, the Chief of Staff: full width, ink, the lead ---------- */
.team .chief {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: clamp(32px, 4.5vw, 60px);
  padding: clamp(24px, 3vw, 40px) clamp(20px, 3.4vw, 48px) clamp(24px, 3.2vw, 44px);
  background: var(--ink);
  color: var(--paper);
  border-radius: 30px;
  box-shadow: 0 2px 4px rgba(20, 18, 14, .08), 0 44px 80px -44px rgba(20, 18, 14, .75);
}
/* A soft sunshine glow in the far corner and a thin line of light along the top edge */
.team .chief::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(55% 85% at 100% 0%, rgba(255, 201, 49, .15), rgba(255, 201, 49, 0) 72%);
}
.team .chief::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 253, 246, .12);
}
.team .chief :focus-visible { outline-color: var(--sun); }

.team .chief-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}
.team .chief-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: var(--fs-label);
  letter-spacing: .14em;
  color: var(--sun);
}
.team .chief-label::before {
  content: "";
  flex: none;
  width: 9px; height: 9px;
  border-radius: 3px;
  background: var(--sun);
  transform: rotate(45deg);
  box-shadow: 0 0 0 3px rgba(255, 201, 49, .22);
  margin-top: .38em; /* sits on the first line when the label wraps on a small phone */
}
.team .chief .duty { background: rgba(27, 158, 75, .2); color: #7FE0A3; }

.team .chief-body {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  align-items: center;
  gap: 28px clamp(32px, 5vw, 80px);
  margin-top: clamp(26px, 3.2vw, 44px);
}
.team .chief-who { display: flex; align-items: center; gap: clamp(22px, 2.4vw, 30px); }
/* Ink on ink: a hairline shows the tile's edge, then a sunshine ring marks the lead */
.team .chief .agent-tile {
  width: clamp(76px, 6.6vw, 92px); height: clamp(76px, 6.6vw, 92px);
  border-radius: 26px;
  font-size: clamp(38px, 3.3vw, 46px);
  box-shadow: 0 0 0 1px rgba(255, 253, 246, .2), 0 0 0 6px var(--ink), 0 0 0 8px var(--sun);
}
.team .chief .agent-ico {
  right: -11px; bottom: -11px;
  width: 34px; height: 34px;
  box-shadow: 0 0 0 4px var(--ink);
}
.team .chief .agent-ico svg { width: 16px; height: 16px; }
.team .chief-name {
  font-size: clamp(46px, 5vw, 72px);
  font-weight: 800;
  line-height: .9;
  letter-spacing: -.045em;
  color: var(--paper);
}
.team .chief .agent-role { margin-top: 10px; color: rgba(255, 253, 246, .84); font-size: 16px; }
.team .chief .ai-tag { border-color: rgba(255, 253, 246, .28); color: rgba(255, 253, 246, .88); }
/* Enzo speaks in the display face, a touch larger than the specialists */
.team .chief-bio {
  margin-top: clamp(24px, 2.8vw, 34px);
  max-width: 29em;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(19px, 1.6vw, 23px);
  line-height: 1.38;
  letter-spacing: -.012em;
  color: rgba(255, 253, 246, .92);
  font-variation-settings: "opsz" 36;
}
.team .chief-work { display: flex; flex-direction: column; gap: 16px; }
.team .chief-duties {
  margin: 0;
  padding: 2px 20px;
  gap: 0;
  border: 1px solid rgba(255, 253, 246, .12);
  border-radius: 20px;
  background: rgba(255, 253, 246, .045);
}
.team .chief-duties li { gap: 12px; padding: 14px 0; font-size: 16px; color: var(--paper); }
.team .chief-duties li + li { border-top: 1px solid rgba(255, 253, 246, .1); }
.team .chief-duties svg { color: var(--sun); }
.team .chief-hire { --h: 54px; width: 100%; font-size: 16px; }
.team .chief-hire svg { transition: transform .3s var(--ease); }
.team .chief-hire:hover svg { transform: translate(2px, -2px); }

/* ---------- The specialists ---------- */
.team .team-sub {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: clamp(40px, 5vw, 64px);
  font-size: clamp(22px, 1.9vw, 28px);
  letter-spacing: -.025em;
}
.team .team-sub::after { content: ""; flex: 1; height: 1px; background: rgba(20, 18, 14, .12); }

.team .agents {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.3vw, 18px);
  margin-top: clamp(18px, 2vw, 26px);
}
.team .agent {
  display: flex;
  flex-direction: column;
  padding: 22px 20px 20px;
  background: #fff;
  border: 1px solid rgba(20, 18, 14, .06);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(20, 18, 14, .04), 0 22px 48px -34px rgba(20, 18, 14, .45);
}
.team .agent:nth-child(3n + 2) { --rv-delay: .08s; }
.team .agent:nth-child(3n) { --rv-delay: .16s; }
.team .agent-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.team .agent:nth-child(2) .duty-dot::after { animation-delay: .45s; }
.team .agent:nth-child(3) .duty-dot::after { animation-delay: .9s; }
.team .agent:nth-child(4) .duty-dot::after { animation-delay: 1.35s; }
.team .agent:nth-child(5) .duty-dot::after { animation-delay: 1.8s; }
.team .agent:nth-child(6) .duty-dot::after { animation-delay: 2.25s; }

/* Specialist names are h4 under "Your specialists", so they carry the display face themselves */
.team .agent-name {
  margin-top: 22px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.035em;
  color: var(--ink);
  font-variation-settings: "opsz" 96;
}
.team .agent-bio { flex: 1 0 auto; margin-top: 14px; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.team .agent-hire {
  margin-top: auto;
  width: 100%;
  border-color: rgba(20, 18, 14, .16);
  background: #fff;
}
.team .agent-hire svg { transition: transform .3s var(--ease); }
.team .agent:hover .agent-hire { border-color: var(--ink); }
.team .agent-hire:hover { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.team .agent-hire:hover svg { transform: translate(2px, -2px); }

.team .team-note {
  margin-top: clamp(28px, 3.5vw, 44px);
  text-align: center;
  color: var(--ink-2);
  font-size: 15.5px;
  text-wrap: balance;
}

/* =====================================================================
   HOW: four steps that climb, one agent at a time
   ===================================================================== */
.how { padding-block: 0 var(--section-y); }
.how .how-head { max-width: 60em; }
.how .how-head h2 { margin-top: 14px; }
.how .how-steps {
  --rise: clamp(24px, 3.4vw, 50px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: clamp(12px, 1.3vw, 18px);
  margin-top: clamp(36px, 5vw, 64px);
}
.how .step {
  --n: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-height: calc(clamp(230px, 18vw, 260px) + var(--rise) * var(--n));
  padding: 22px 22px 24px;
  background: #fff;
  border: 1px solid rgba(20, 18, 14, .07);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(20, 18, 14, .04), 0 22px 48px -36px rgba(20, 18, 14, .4);
}
.how .step:nth-child(2) { --n: 1; --rv-delay: .08s; }
.how .step:nth-child(3) { --n: 2; --rv-delay: .16s; }
.how .step:nth-child(4) {
  --n: 3;
  --rv-delay: .24s;
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.how .how-num {
  position: relative;
  isolation: isolate;
  align-self: flex-start;
  font-family: var(--display);
  font-weight: 800;
  font-size: 56px;
  line-height: .9;
  letter-spacing: -.05em;
  color: var(--ink);
  font-variation-settings: "opsz" 96;
}
.how .how-num::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -.12em; right: -.14em; bottom: .02em;
  height: .36em;
  border-radius: .14em .34em .2em .4em;
  background: var(--sun);
  transform: rotate(-2deg);
}
.how .step:nth-child(4) .how-num { color: var(--sun); }
.how .step:nth-child(4) .how-num::after { display: none; }
.how .step h3 { font-size: clamp(20px, 1.6vw, 24px); }
.how .step p { margin-top: 10px; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.how .step:nth-child(4) h3 { color: var(--paper); }
.how .step:nth-child(4) p { color: rgba(255, 253, 246, .78); }


/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1099px) {
  .how .how-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .how .step { min-height: 0; }
}
@media (max-width: 899px) {
  .team .team-head { grid-template-columns: 1fr; }
  .team .chief-body { grid-template-columns: 1fr; align-items: start; }
  .team .agents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team .agent:nth-child(n) { --rv-delay: 0s; }
  .team .agent:nth-child(even) { --rv-delay: .08s; }
}
@media (max-width: 639px) {
  .team { padding-inline: 8px; }
  .team .team-panel { padding: 48px 8px 32px; border-radius: 28px; }
  .team .team-head { padding-inline: 0; }
  .team .chief { padding: 22px 18px 20px; border-radius: 26px; }
  .team .chief-top { flex-direction: column; align-items: flex-start; gap: 12px; }
  .team .chief-label { font-size: 10.5px; letter-spacing: .1em; line-height: 1.5; }
  .team .chief-body { gap: 24px; margin-top: 26px; }
  .team .chief-who { gap: 22px; }
  .team .chief .agent-tile { width: 68px; height: 68px; border-radius: 22px; font-size: 34px; }
  .team .chief .agent-ico { right: -9px; bottom: -9px; width: 30px; height: 30px; }
  .team .chief .agent-ico svg { width: 14px; height: 14px; }
  .team .chief-name { font-size: 46px; }
  .team .chief .agent-role { font-size: 15px; }
  .team .chief-bio { margin-top: 22px; font-size: 19px; }
  .team .chief-duties { padding: 2px 16px; border-radius: 18px; }
  .team .chief-duties li { padding: 12px 0; font-size: 15.5px; }
  .team .team-sub { margin-top: 36px; }
  .team .agents { grid-template-columns: 1fr; gap: 12px; }
  .team .agent:nth-child(n) { --rv-delay: 0s; }
  .team .agent { padding: 20px 18px 18px; }
  .team .team-note { text-align: left; text-wrap: pretty; }

  /* Steps become a numbered column joined by a thin line */
  .how .how-steps { grid-template-columns: 1fr; gap: 0; }
  .how .step,
  .how .step:nth-child(4) {
    flex-direction: row;
    justify-content: flex-start;
    gap: 16px;
    padding: 0 0 26px;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: var(--ink);
  }
  .how .step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 21px;
    top: 50px;
    bottom: 6px;
    width: 2px;
    border-radius: 2px;
    background: var(--line);
  }
  .how .how-num,
  .how .step:nth-child(4) .how-num {
    flex: none;
    width: 44px; height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--paper-2);
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
    letter-spacing: -.03em;
  }
  .how .how-num::after { display: none; }
  .how .step:nth-child(4) .how-num { background: var(--ink); color: var(--sun); }
  .how .how-copy { padding-top: 9px; }
  .how .step:nth-child(4) h3 { color: var(--ink); }
  .how .step:nth-child(4) p { color: var(--ink-2); }
}
