/* The heading feeds two equal branches, which reconnect above the case studies. */
#teams.team-story {
  --team-paper: var(--story-paper, #f5f5f7);
  --team-ink: var(--story-ink, #02021e);
  --team-blue: var(--story-blue, #1964d1);
  --team-line: #cbd9f3;
  --team-copy-gap: 1.5rem;
  position: relative;
  padding: 7rem max(2rem, var(--site-gutter, 2rem)) 0;
  background: var(--team-paper);
  color: var(--team-ink);
  isolation: isolate;
}

.team-story *,
.team-story *::before,
.team-story *::after { box-sizing: border-box; }

.team-story .team-story__inner {
  width: 100%;
  max-width: var(--about-content, 82rem);
  margin-inline: auto;
}

.team-story .team-story__glass-star {
  display: block;
}

.team-story .team-story__title {
  margin: 0;
  color: var(--team-ink);
  text-align: center;
  font: var(--story-section-weight, 600) var(--story-type-section, 3.5rem)/1.1 Suisse, Arial, sans-serif;
  letter-spacing: -.013em;
}

.team-story .team-story__accessible-description {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.team-story .team-story__diagram {
  --flow-exit-height: 4rem;
  position: relative;
  margin-top: 2rem;
}

.team-story .team-story__connections {
  display: block;
  width: 100%;
  overflow: visible;
  fill: none;
  pointer-events: none;
}

.team-story .team-story__connections--split { height: 6rem; }
.team-story .team-story__connections--join { height: 7rem; margin-top: 2.25rem; }
.team-story .team-story__connections--cases {
  height: var(--flow-exit-height);
  -webkit-mask-image: linear-gradient(to bottom, #000 25%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 25%, transparent 100%);
}

.team-story .team-story__line {
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.team-story .team-story__line { stroke: var(--team-line); stroke-width: 1; }

.team-story .team-story__light {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--flow-exit-height) * .75), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - var(--flow-exit-height) * .75), transparent 100%);
}

.team-story .team-story__teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-story .team-story__team {
  min-width: 0;
  padding-inline: 2rem;
  text-align: center;
}

.team-story .team-story__label,
.team-story .team-story__outcome {
  --flow-energy: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: max-content;
  max-width: 100%;
  min-height: 3rem;
  margin: 0 auto;
  padding: .375rem 1rem .375rem .375rem;
  border: 1px solid var(--team-line);
  border-color: color-mix(in srgb, var(--team-line), var(--team-blue) calc(var(--flow-energy) * 38%));
  border-radius: 2rem;
  background: var(--team-paper);
  color: var(--team-ink);
  box-shadow: 0 0 0 calc(var(--flow-energy) * .25rem) rgb(25 100 209 / 5%);
  font: 500 .875rem/1.4 Suisse, Arial, sans-serif;
}

.team-story .team-story__label { margin-bottom: var(--team-copy-gap); }

.team-story .team-story__symbol {
  flex: none;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  overflow: hidden;
}

.team-story .team-story__symbol img { display: block; width: 100%; height: 100%; }

#teams.team-story .team-story__promise {
  max-width: 36rem;
  min-height: 2.08em;
  margin: 0 auto var(--team-copy-gap);
  color: var(--team-ink);
  font: italic 400 3.4rem/1.04 "Instrument Serif", Instrument, Georgia, serif;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.team-story .team-story__body {
  max-width: 26rem;
  margin: 0 auto;
  color: var(--story-secondary, rgb(2 2 30 / 60%));
  font: 400 var(--story-body, 1rem)/1.6 Suisse, Arial, sans-serif;
  text-wrap: balance;
}

/* Shared rows keep both team promises and descriptions level when the copy
   wraps differently. Articles keep their semantic grouping and reading order. */
@supports (grid-template-rows: subgrid) {
  .team-story .team-story__teams {
    grid-template-rows: auto auto 1fr;
    row-gap: var(--team-copy-gap);
  }
  .team-story .team-story__team {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: 1 / span 3;
    align-items: start;
  }
  .team-story .team-story__team:first-child { grid-column: 1; }
  .team-story .team-story__team:last-child { grid-column: 2; }
  .team-story .team-story__label { margin-bottom: 0; }
  #teams.team-story .team-story__promise { min-height: 0; margin-bottom: 0; }
}

@media (max-width: 991px) {
  #teams.team-story {
    --team-copy-gap: 1.25rem;
    padding: 4rem var(--site-gutter, 1.5rem) 0;
  }
  .team-story .team-story__title { font-size: var(--story-type-section, 2.5rem); }
  .team-story .team-story__team { padding-inline: 1rem; }
  #teams.team-story .team-story__promise { font-size: 2.5rem; }
  .team-story .team-story__body { font-size: var(--story-body, .875rem); }
}

/* Mobile is an editorial reading surface inside two independent routes.
   Bounded component sizes avoid the shared root's 480px scaling discontinuity. */
.team-story .team-story__connections--mobile { display: none; }
@media (max-width: 767px) {
  #teams.team-story {
    --team-copy-gap: 16px;
    /* Reclaim 8px from the outside gutter for the frame interior. Copy keeps
       its existing 50px screen inset and therefore the same usable width. */
    padding-inline: 12px;
  }
  #teams.team-story .team-story__title {
    font-size: clamp(27px, 7.2vw, 34px);
    font-weight: var(--story-section-weight, 500);
  }
  #teams.team-story .team-story__diagram {
    --flow-exit-height: 48px;
    max-width: 556px;
    margin: 32px auto 0;
  }
  #teams.team-story .team-story__connections--split { height: 56px; visibility: hidden; }
  #teams.team-story .team-story__connections--join { height: 66px; margin-top: 0; visibility: hidden; }
  #teams.team-story .team-story__connections--mobile {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 0;
  }
  #teams.team-story .is-mobile-measured > .team-story__connections--mobile { display: block; }
  #teams.team-story .team-story__teams {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 52px;
  }
  #teams.team-story .team-story__team:nth-child(n) {
    display: block;
    grid-column: 1;
    grid-row: auto;
    /* The measured rails sit 6px inside the diagram: 38 - 6 = 32px clear. */
    padding-inline: 38px;
    text-align: left;
  }
  #teams.team-story .team-story__team + .team-story__team {
    padding-top: 0;
    border: 0;
  }
  #teams.team-story .team-story__label,
  #teams.team-story .team-story__outcome {
    position: relative;
    z-index: 1;
    min-height: 34px;
    gap: 7px;
    padding: 4px 11px 4px 4px;
    border-radius: 24px;
    font-size: 14px;
    line-height: 1.4;
  }
  #teams.team-story .team-story__label { margin: 0 0 16px; }
  #teams.team-story .team-story__symbol { width: 24px; height: 24px; }
  #teams.team-story .team-story__promise {
    max-width: 100%;
    min-height: 0;
    margin: 0 0 16px;
    font-size: clamp(30px, 7.8vw, 34px);
    line-height: 1.08;
    letter-spacing: -.018em;
    text-wrap: balance;
  }
  #teams.team-story .team-story__desktop-break { display: none; }
  #teams.team-story .team-story__body {
    max-width: 100%;
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    text-wrap: pretty;
  }
  /* Without JS the single paired frame and central stems retain the common
     source/outcome. The measured SVG replaces it when animation initializes. */
  #teams.team-story .team-story__diagram:not(.is-mobile-measured)::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    height: 26px;
    border-left: 1px solid var(--team-line);
  }
  #teams.team-story .team-story__diagram:not(.is-mobile-measured) .team-story__teams::before {
    content: "";
    position: absolute;
    inset: -32px 6px -32px;
    border: 1px solid var(--team-line);
    border-radius: 20px;
    pointer-events: none;
  }
  #teams.team-story .team-story__diagram:not(.is-mobile-measured) .team-story__outcome::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 100%;
    height: 34px;
    border-left: 1px solid var(--team-line);
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-story .team-story__light { display: none; }
  .team-story .team-story__label,
  .team-story .team-story__outcome { box-shadow: none; }
}
