/* The partners page: the drawn hand off in the hero, the matcher (six panels that become
   tabs), and the two ways to partner.
   Values come from tokens.css; shared parts (page hero, facts, steps, FAQ, ask) from styles.css. */

/* ---------- Hero art: you, your client, and us, in a line ---------- */

/* Only where there is room beside the copy. Below 900px the lead already says it. */
.partner-art {
  display: none;
}

.chain {
  display: grid;
  justify-items: start;
  color: var(--fg-soft);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-mono);
}

.chain-node {
  padding: var(--space-3) var(--space-6);
  border: var(--hair) solid var(--fg-soft);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--display-weight);
  font-stretch: var(--heading-stretch);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
}

.chain-node--snc {
  border-color: var(--brass);
  background: var(--brass);
  color: var(--ink);
}

/* The dashed line between two of them, with what it carries written beside it. */
.chain-link {
  display: flex;
  align-items: center;
  min-height: calc(var(--space-8) + var(--space-4));
  margin-inline-start: var(--space-7);
  padding-inline-start: var(--space-5);
  border-inline-start: var(--hair-strong) dashed var(--rule);
}

@media (min-width: 900px) {
  .partner-art {
    display: block;
  }
}

/* ---------- The matcher ----------
   Six panels, one per kind of partner. Without the script they read one after another.
   With it, a list of tabs picks one: chips on a phone, a column of rows from 900px. */

.match {
  display: grid;
  gap: var(--space-5);
}

.match-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.match-tab {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h-sm);
  padding: 0 var(--space-4);
  border: var(--hair) solid var(--fg-soft);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--fg);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: var(--leading-snug);
  text-align: start;
  cursor: pointer;
  transition:
    background-color var(--fast) var(--ease),
    border-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

.match-tab:hover {
  border-color: var(--fg);
}

.match-tab[aria-selected="true"] {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--on-navy);
  font-weight: 600;
}

.match-panels {
  display: grid;
  gap: var(--space-5);
  min-width: 0;
}

/* Each panel carries the short bar on its top edge, the same shape as the brass bar in the mark. */
.match-panel {
  position: relative;
  display: grid;
  gap: var(--space-5);
  align-content: start;
  padding: var(--space-6) var(--space-5) var(--space-5);
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.match-panel::before {
  content: "";
  position: absolute;
  inset-block-start: calc(var(--hair) * -1);
  inset-inline-start: var(--space-5);
  inline-size: var(--space-8);
  block-size: calc(var(--space-1) + var(--hair-strong));
  background: var(--brass);
}

.match-panel h3 {
  color: var(--fg-soft);
  font-size: var(--text-base);
}

/* The one line a partner would repeat to a client. It is the largest thing in the panel. */
.match-short {
  max-inline-size: 22ch;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--display-weight);
  font-stretch: var(--heading-stretch);
  line-height: 1.05;
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

.match-label,
.match-detail dt {
  display: block;
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  font-stretch: 100%;
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-mono);
}

.match-label {
  margin-block-end: var(--space-2);
}

.match-detail {
  display: grid;
  gap: var(--space-5);
  padding-block-start: var(--space-5);
  border-top: var(--hair) solid var(--rule);
}

.match-detail dt {
  margin-block-end: var(--space-1);
}

.match-detail dd {
  max-width: var(--measure);
  color: var(--fg-soft);
}

@media (min-width: 640px) {
  .match-panel {
    padding: var(--space-7) var(--space-6) var(--space-6);
  }

  .match-panel::before {
    inset-inline-start: var(--space-6);
  }

  .match-detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-6);
  }
}

@media (min-width: 900px) {
  .match[data-enhanced] {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--space-5);
    align-items: start;
  }

  /* The tabs become a column of rows, ruled like the services list on the home page. */
  .match-tabs {
    grid-column: 1 / span 4;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    border-top: var(--hair) solid var(--fg);
  }

  .match-tab {
    gap: var(--space-3);
    min-height: calc(var(--control-h) + var(--space-3));
    padding: 0;
    border: 0;
    border-bottom: var(--hair) solid var(--rule);
    border-radius: 0;
    background: transparent;
    color: var(--fg-soft);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--heading-weight);
    font-stretch: var(--heading-stretch);
    letter-spacing: var(--tracking-heading);
  }

  /* The brass bar marks the row that is open. Until then it has no width, and a negative
     margin cancels the gap after it, so the other rows start flush with the rule. */
  .match-tab::before {
    content: "";
    flex: none;
    inline-size: 0;
    block-size: calc(var(--space-1) + var(--hair-strong));
    margin-inline-end: calc(var(--space-3) * -1);
    background: var(--brass);
    transition:
      inline-size var(--medium) var(--ease),
      margin var(--medium) var(--ease);
  }

  .match-tab:hover {
    color: var(--fg);
  }

  .match-tab[aria-selected="true"] {
    border-color: var(--rule);
    background: transparent;
    color: var(--fg);
    font-weight: var(--heading-weight);
  }

  .match-tab[aria-selected="true"]::before {
    inline-size: var(--space-5);
    margin-inline-end: 0;
  }

  .match[data-enhanced] .match-panels {
    grid-column: 6 / -1;
  }

  /* Tall enough for the longest panel, so the page below does not jump between tabs. */
  .match[data-enhanced] .match-panel {
    min-height: calc(var(--space-10) * 3.5);
  }

  /* Without the script the six panels sit two to a row. */
  .match:not([data-enhanced]) .match-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match:not([data-enhanced]) .match-detail {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Two ways to partner ---------- */

.ways {
  display: grid;
  gap: var(--space-5);
}

.way {
  display: grid;
  gap: var(--space-4);
  align-content: start;
  padding: var(--space-6) var(--space-5);
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.way-num {
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: 500;
}

.way h3 {
  font-size: var(--text-xl);
  font-weight: var(--display-weight);
  line-height: 1.1;
  letter-spacing: var(--tracking-display);
}

.way > p:not(.way-num) {
  max-width: var(--measure);
  color: var(--fg-soft);
  font-size: var(--text-lg);
  line-height: var(--leading-lead);
}

.way-points {
  display: grid;
  gap: var(--space-3);
  margin-block-start: var(--space-2);
  padding-block-start: var(--space-5);
  border-top: var(--hair) solid var(--rule);
}

.way-points li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

/* The brass bar again, as the bullet. */
.way-points li::before {
  content: "";
  flex: none;
  inline-size: var(--space-4);
  block-size: calc(var(--space-1) + var(--hair-strong));
  margin-block-start: calc(var(--space-3) - var(--hair-strong));
  background: var(--brass);
}

@media (min-width: 900px) {
  .ways {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .way {
    padding: var(--space-7) var(--space-6);
  }
}

/* ---------- How a hand off works: five steps in one row where they fit ---------- */

.steps--five {
  --steps: 5;
}
