/* Slide 08 (customers and B2B partners) visual reconstruction: four business roles as the central model,
   five segments in a compact row, the who-pays matrix as secondary content. Entrance motion runs while
   #customers.customers-run is present (set by customers-visual.js). Opacity and transform only. */

/* Desktop */
@media (min-width: 801px) {
  /* One column: headline, the four roles, the five segments, then the matrix. Overrides the older two-column grid. */
  #customers.customers-section {
    display: block;
    column-gap: 0;
  }

  /* The section kicker sits where it does on the other slides (the old grid pinned it to the far left). */
  #customers > .section-kicker {
    position: absolute;
    left: 5vw;
    top: 110px;
  }

  #customers .ar-head { max-width: 1100px; }

  /* Compact headline and matrix so the whole slide reads as one composition on a 900 px screen. */
  #customers .ar-head h2 { font-size: clamp(2rem, 3.4vw, 3.4rem) !important; margin-bottom: 0; }

  #customers .cust-pay-wrap { margin: 0; }
  #customers .cust-pay th,
  #customers .cust-pay td {
    padding: 5px 8px;
    font-size: 11px;
    line-height: 1.35;
  }
  #customers .cust-pay caption { font-size: 10px; margin-bottom: 6px; }

  /* The four roles are connected by neutral, directionless separators (the row's top rule and the
     thin vertical dividers). They do not imply an order of steps in a transaction. */

  #customers .ar-intro {
    max-width: 680px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
  }

  #customers .ar-roles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(142, 219, 200, 0.3);
  }

  #customers .ar-role {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 20px 20px 18px 0;
  }

  #customers .ar-role + .ar-role {
    padding-left: 20px;
    border-left: 1px solid rgba(142, 219, 200, 0.12);
  }

  #customers .ar-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 6px;
    color: var(--mint);
  }

  #customers .ar-num {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--mint);
  }

  #customers .ar-role h3 {
    margin: 0;
    font-size: 19px;
    line-height: 1.2;
  }

  #customers .ar-role p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
  }

  #customers .ar-roles-note {
    margin: 12px 0 0;
    color: #8ea5b0;
    font-size: 12px;
    line-height: 1.4;
  }

  #customers .ar-segments {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(142, 219, 200, 0.14);
  }

  #customers .ar-seg {
    display: flex;
    gap: 10px;
    min-width: 0;
    padding: 14px 14px 0 0;
  }

  #customers .ar-seg + .ar-seg {
    padding-left: 14px;
    border-left: 1px solid rgba(142, 219, 200, 0.1);
  }

  #customers .ar-seg-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    color: var(--mint);
  }

  #customers .ar-seg > div { min-width: 0; }

  #customers .ar-seg h3 {
    margin: 6px 0 4px;
    font-size: 14px;
    line-height: 1.3;
  }

  #customers .ar-seg p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
  }

  #customers .ar-foot {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    margin-top: 22px;
  }

  #customers .ar-fineprint {
    margin: 0;
    color: #8ea5b0;
    font-size: 11px;
    line-height: 1.5;
  }
}

/* Phones */
@media (max-width: 800px) {
  #customers .ar-intro {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
  }

  #customers .ar-roles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(142, 219, 200, 0.3);
  }

  #customers .ar-role {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 12px 0 10px;
    border-bottom: 1px solid rgba(142, 219, 200, 0.1);
  }

  #customers .ar-icon { width: 22px; height: 22px; margin-bottom: 3px; color: var(--mint); }
  #customers .ar-num { font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em; color: var(--mint); }
  #customers .ar-role h3 { margin: 0; font-size: 14px; line-height: 1.25; }
  #customers .ar-role p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.4; }

  #customers .ar-roles-note {
    margin: 8px 0 0;
    color: #8ea5b0;
    font-size: 10.5px;
    line-height: 1.4;
  }

  #customers .ar-segments {
    display: grid;
    grid-template-columns: 1fr;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
  }

  #customers .ar-seg {
    display: flex;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(142, 219, 200, 0.1);
  }

  #customers .ar-seg-icon { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; color: var(--mint); }
  #customers .ar-seg > div { min-width: 0; }
  #customers .ar-seg h3 { margin: 3px 0 2px; font-size: 13px; line-height: 1.3; }
  #customers .ar-seg p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.4; }

  #customers .ar-foot { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 14px; }
  #customers .ar-fineprint { margin: 0; color: #8ea5b0; font-size: 10.5px; line-height: 1.45; }
}

/* Entrance motion (gated by customers-run). */
@keyframes ar-title-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ar-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ar-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* The who-pays matrix keeps its own collapse behaviour; only its entrance is handled here. */
#customers .cust-pay-details.reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

#customers.customers-run .ar-head h2 {
  animation: ar-title-in 0.6s cubic-bezier(0.22, 0.8, 0.26, 1) both;
}

#customers.customers-run .ar-intro {
  animation: ar-fade 0.5s ease-out 0.3s both;
}

#customers.customers-run .ar-role {
  animation: ar-rise 0.42s ease-out both;
}
#customers.customers-run .ar-role:nth-child(1) { animation-delay: 0.45s; }
#customers.customers-run .ar-role:nth-child(2) { animation-delay: 0.56s; }
#customers.customers-run .ar-role:nth-child(3) { animation-delay: 0.67s; }
#customers.customers-run .ar-role:nth-child(4) { animation-delay: 0.78s; }

#customers.customers-run .ar-roles-note {
  animation: ar-fade 0.5s ease-out 1s both;
}

#customers.customers-run .ar-seg {
  animation: ar-rise 0.42s ease-out both;
}
#customers.customers-run .ar-seg:nth-child(1) { animation-delay: 1.1s; }
#customers.customers-run .ar-seg:nth-child(2) { animation-delay: 1.2s; }
#customers.customers-run .ar-seg:nth-child(3) { animation-delay: 1.3s; }
#customers.customers-run .ar-seg:nth-child(4) { animation-delay: 1.4s; }
#customers.customers-run .ar-seg:nth-child(5) { animation-delay: 1.5s; }

#customers.customers-run .ar-foot {
  animation: ar-fade 0.6s ease-out 1.75s both;
}

@media (prefers-reduced-motion: reduce) {
  #customers.customers-run,
  #customers.customers-run * {
    animation: none !important;
  }
}
