/* Services: who each service is for, as a table. A ruled row per service, a
   tick in each audience's column, a crimson line that sweeps along a row on
   hover, and ticks that draw themselves in as the section arrives. */

#services table {
  width: 100%;
  margin-top: clamp(1.75rem, 4vw, 3rem);
  border-collapse: collapse;
}

#services thead th {
  padding: 0 0 1rem;
  color: rgba(var(--charcoal-rgb), 0.55);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

#services thead th:first-child {
  text-align: left;
}

#services tbody tr {
  border-top: 1px solid rgba(var(--charcoal-rgb), 0.14);
  background: linear-gradient(var(--crimson), var(--crimson)) 0 100% / 0 2px no-repeat;
  transition:
    background-size 0.9s var(--ease-out),
    background-color var(--duration-normal) var(--ease-out);
}

#services tbody tr:last-child {
  border-bottom: 1px solid rgba(var(--charcoal-rgb), 0.14);
}

#services tbody tr:hover {
  background-color: rgba(var(--crimson-rgb), 0.04);
  background-size: 100% 2px;
}

#services tbody th {
  width: 46%;
  padding: clamp(1rem, 2vw, 1.5rem) 1rem clamp(1rem, 2vw, 1.5rem) 0;
  font-weight: inherit;
  text-align: left;
  transition: translate 0.6s var(--ease-out);
}

#services tbody tr:hover th {
  translate: 6px 0;
}

#services tbody th strong {
  display: block;
  font-size: clamp(1.0625rem, 1.5vw, 1.375rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

#services tbody th p {
  max-width: 40ch;
  margin-top: 0.25rem;
}

#services td {
  width: 18%;
  text-align: center;
}

#services td svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: var(--crimson);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: scale 0.5s var(--ease-out);
}

#services td svg circle {
  stroke-opacity: 0.35;
}

#services td svg path {
  stroke-dasharray: 20;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.7s var(--ease-out) calc(0.3s + var(--i) * 80ms);
}

#services tbody tr:hover td svg {
  scale: 1.15;
}

html.js #services:not(.is-revealed) td svg path {
  stroke-dashoffset: 20;
}

#services :is(a, button):focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 4px;
}

/* Narrow screens: each row becomes a block, and the audiences it serves are
   listed as labelled ticks under it. */
@media (max-width: 768px) {
  #services thead {
    display: none;
  }

  #services :is(tbody, tr, th, td) {
    display: block;
  }

  #services tbody th {
    width: auto;
    padding-bottom: 0.5rem;
  }

  #services tbody tr {
    padding-bottom: 1rem;
  }

  #services td {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: auto;
    margin-inline-end: 1.25rem;
  }

  #services td:empty {
    display: none;
  }

  #services td::after {
    content: attr(data-for);
    color: rgba(var(--charcoal-rgb), 0.55);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
}

@media (prefers-reduced-motion: reduce) {
  #services tbody tr,
  #services tbody th,
  #services td svg,
  #services td svg path {
    transition: none;
  }
}
