/* Services infographic: six services side by side, their lines meeting at one team label.
   Section padding and the heading margin come from site-refinements.css. */
#refresh-services-root { --sf-line: #ffffff59; --sf-soft: #d7dff3; min-width: 0; }

.sf-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 8px 0 0; padding: 0; list-style: none; }
.sf-service { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; height: 100%; padding: 10px 10px 6px; border-radius: 12px; color: var(--paper); text-align: center; }
.sf-service:focus-visible { outline-offset: 2px; }
.sf-icon { position: relative; display: grid; flex: none; place-items: center; width: 68px; height: 68px; border: 1px solid var(--sf-line); border-radius: 50%; transition: background-color .25s, border-color .25s, color .25s; }
.sf-icon .service-icon { width: 28px; height: 28px; }
.sf-word { font-size: 19px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.sf-mark { display: block; width: 54px; height: 54px; background: currentColor; -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }
/* Only the highlighted service has a mark: the KALE Riders leaf on the circle's right shoulder
   (assets/kale-leaf-128.png, cut from the favicon). It pops in with the highlight and leaves with it. */
.sf-leaf { position: absolute; top: -16px; right: -15px; width: 40px; height: 40px; background: url('assets/kale-leaf-128.png') center / contain no-repeat; filter: drop-shadow(0 2px 5px #0b183059); rotate: -6deg; opacity: 0; transform: scale(.5); transform-origin: left bottom; transition: transform .3s cubic-bezier(.3, 1.4, .5, 1), opacity .2s; pointer-events: none; }
.sf-service.is-shown .sf-leaf { opacity: 1; transform: scale(1); }
.sf-text { display: grid; justify-items: center; gap: 4px; }
.sf-name { font-size: 18px; font-weight: 500; line-height: 1.35; letter-spacing: -.03em; }
html[lang="en"] .sf-name { letter-spacing: -.01em; }
.sf-line { max-width: 18em; color: var(--sf-soft); font-size: 14px; line-height: 1.55; }
/* The highlighted service (cycling, or held after pointing or pressing): lime icon and name. */
.sf-service.is-shown .sf-icon { border-color: var(--lime); background: var(--lime); color: var(--ink); }
.sf-service.is-shown .sf-name { color: var(--lime); }
.sf-name { transition: color .25s; }

.sf-fan { display: block; width: 100%; height: 88px; margin-top: 6px; overflow: visible; }
/* The drawing stretches with the width while the stroke stays 1.5px, so dashes are measured on
   screen; 1400px is longer than any line at the widest layout. */
.sf-fan path { fill: none; stroke: var(--sf-line); stroke-width: 1.5; stroke-dasharray: 1400; stroke-dashoffset: 1400; vector-effect: non-scaling-stroke; transition: stroke-dashoffset .9s cubic-bezier(.4, 0, .2, 1) var(--sf-delay, 0s), stroke .25s, stroke-width .25s; }
.sf-fan path.is-shown { stroke: var(--lime); stroke-width: 2.5; }
.sf-team { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; width: fit-content; max-width: 100%; min-height: 50px; margin: 0 auto; padding: 12px 24px; border-radius: 999px; background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.6; text-align: center; }
.sf-team-state { display: none; }
.sf-team-state.is-active { display: contents; }
.sf-team strong { font-weight: 600; }

/* Drawn once when the graphic first appears: lines from left to right.
   Only the drawing is staggered; highlight colours change at once. */
.sf.is-drawn .sf-fan path { stroke-dashoffset: 0; }
:is(.sf-fan path, .sf-item):nth-child(2) { --sf-delay: .12s; }
:is(.sf-fan path, .sf-item):nth-child(3) { --sf-delay: .24s; }
:is(.sf-fan path, .sf-item):nth-child(4) { --sf-delay: .36s; }
:is(.sf-fan path, .sf-item):nth-child(5) { --sf-delay: .48s; }
:is(.sf-fan path, .sf-item):nth-child(6) { --sf-delay: .6s; }

/* Below 900px the services stack, joined by one rail down to the team label. */
@media (max-width: 900px) {
  .sf { position: relative; }
  .sf-list { position: relative; grid-template-columns: minmax(0, 1fr); margin-top: 0; }
  .sf-list::before { content: ''; position: absolute; left: 27px; top: 34px; bottom: -30px; border-left: 1.5px solid var(--sf-line); transform: scaleY(0); transform-origin: top; transition: transform .9s cubic-bezier(.4, 0, .2, 1); }
  .sf.is-drawn .sf-list::before { transform: none; }
  .sf-item { position: relative; }
  .sf-service { flex-direction: row; align-items: center; gap: 16px; padding: 10px 0; text-align: left; }
  .sf-icon { width: 56px; height: 56px; background: var(--deep); }
  .sf-icon .service-icon { width: 24px; height: 24px; }
  .sf-word { font-size: 16px; }
  .sf-mark { width: 44px; height: 44px; }
  .sf-text { justify-items: start; gap: 2px; }
  .sf-name { font-size: 18px; }
  .sf-line { max-width: none; }
  .sf-fan { display: none; }
  .sf-team { position: relative; display: grid; width: 100%; margin-top: 18px; padding: 14px 18px; border-radius: 14px; text-align: left; }
  .sf-team-state, .sf-team-state.is-active { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 2px 10px; grid-area: 1 / 1; }
  .sf-team-state:not(.is-active) { visibility: hidden; }
}
@media (max-width: 400px) {
  .sf-service { gap: 12px; }
  .sf-icon { width: 50px; height: 50px; }
  .sf-list::before { left: 24px; }
  .sf-name { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .sf-fan path, .sf-leaf, .sf-icon, .sf-list::before { transition: none; }
}
html.motion-paused :is(.sf-fan path, .sf-leaf, .sf-list::before) { transition: none; }

/* The partner projects' symbols as an overlapping row beside the shown service. */
.sf-logos { display: inline-flex; flex: none; align-items: center; margin-right: 4px; }
.sf-logo { display: block; flex: none; width: 26px; height: 26px; margin-left: -7px; overflow: hidden; border: 2px solid var(--paper); border-radius: 50%; background: #fff; }
.sf-logo:first-child { margin-left: 0; }
.sf-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* A mark on a clear ground sits inside the circle; a wordmark file shows the symbol at its left. */
.sf-logo[data-fit="mark"] img { padding: 4px; object-position: left center; }
/* The KGeN mark is a square that fills its file, so a round crop cut its corners: it is drawn
   smaller on its own charcoal ground. */
.sf-logo[title='KGeN'] { background: #172629; }
.sf-logo[title='KGeN'] img { transform: scale(.82); }
.sf-logo.sf-logo-more { display: grid; place-items: center; width: auto; min-width: 26px; padding: 0 6px; border-radius: 999px; background: #e4e8f2; color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1; }
.sf-team-state { align-items: center; }
@media (max-width: 900px) { .sf-logos { flex: 0 0 100%; margin: 0 0 6px; } }
/* Just above the stacked layout the longest state wraps to two lines. Every state shares one cell
   there too, so the label keeps the size of the longest and the cycle never moves the page. */
@media (min-width: 901px) and (max-width: 1040px) {
  .sf-team { display: grid; }
  .sf-team-state, .sf-team-state.is-active { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 10px; grid-area: 1 / 1; }
  .sf-team-state:not(.is-active) { visibility: hidden; }
}
/* On the vertical list the leaf is smaller, so it stays clear of the service name. */
@media (max-width: 900px) { .sf-leaf { top: -10px; right: -9px; width: 27px; height: 27px; } }
