﻿/* The flow of work of a service line (Views/Shared/_ServiceFlow.cshtml): four steps zigzag down a dotted board, joined by
   dashed wires a spark runs along. On the line's card on the services page and in the banner of the line's own page. */
.svc-flow {
  --svc-navy: #0e2a38;
  --svc-teal: #0e2a38;
  --svc-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
.svc-flow {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4.6rem;
  margin: 0;
  padding: 3.4rem 3rem;
  border: 1px solid #e3eef0;
  border-radius: 2.4rem;
  background-color: #f4fbfc;
  background-image: radial-gradient(rgba(0, 194, 203, 0.16) 1px, transparent 1.4px);
  background-size: 22px 22px;
  list-style: none;
}
.svc-flow__node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  min-height: 6.4rem;
  padding: 1.2rem 1.6rem;
  border: 1px solid #cdeff1;
  border-radius: 1.6rem;
  background: #ffffff;
  box-shadow: 0 1.4rem 2.8rem -2.2rem rgba(14, 42, 56, 0.4);
  line-height: 1.55;
  flex-wrap: wrap;
  row-gap: 0.8rem;
}
.svc-flow__node:nth-child(odd) {
  margin-right: 5.4rem;
}
.svc-flow__node:nth-child(even) {
  margin-left: 5.4rem;
}
/* Each step's icon, as the services page's tiles: white on the brand's cyan */
.svc-flow__icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 1.1rem;
  background: #00c2cb;
  box-shadow: 0 1rem 2rem -1.2rem rgba(0, 194, 203, 0.8);
  color: #ffffff;
}
/* The label stays on one line beside its icon; the tags wrap under them when the line is full */
.svc-flow__label {
  flex: 1 0 auto;
  white-space: nowrap;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--svc-navy);
}
.svc-flow__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-left: auto;
}
.svc-flow__tags span {
  padding: 0.4rem 1rem;
  border: 1px solid #cdeff1;
  border-radius: 999px;
  background: #f0fbfc;
  font-family: var(--svc-mono);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--svc-teal);
}
/* Each wire leaves its step half a zigzag off centre, so all wires line up in the middle of the board */
.svc-flow__wire {
  position: absolute;
  top: 100%;
  left: calc(50% + 2.7rem);
  width: 2px;
  height: 4.6rem;
  background-image: linear-gradient(180deg, rgba(0, 194, 203, 0.55) 50%, transparent 50%);
  background-size: 100% 7px;
}
.svc-flow__node:nth-child(even) .svc-flow__wire {
  left: calc(50% - 2.7rem);
}
.svc-flow__spark {
  position: absolute;
  left: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00c2cb;
  box-shadow: 0 0 8px 2px rgba(0, 194, 203, 0.7);
  animation: svc-spark 1.8s ease-in-out infinite;
}
.svc-flow__node:nth-child(2) .svc-flow__spark {
  background: #fedd59;
  box-shadow: 0 0 8px 2px rgba(254, 221, 89, 0.7);
  animation-delay: 0.45s;
}
.svc-flow__node:nth-child(3) .svc-flow__spark {
  animation-delay: 0.9s;
}
@keyframes svc-spark {
  0% {
    top: -6px;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    top: calc(100% - 6px);
    opacity: 0;
  }
}

/* Phones only: the four steps as a staircase climbing from the bottom up (step 1 at the foot, flush left; each next step
   one shift higher and further right), straight on the banner (no board, to leave the cards their width). A curved arrow leaves each step's right side and swings
   up into the underside of the step above it. Each arrow is drawn from its own step's height, so it fits in any language. */
.svc-climb {
  --climb-shift: 2.4rem;
  --climb-gap: 1.8rem;
  --climb-reach: 1.6rem;
  display: none;
  flex-direction: column-reverse;
  gap: var(--climb-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.svc-climb__step {
  --climb-i: 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  width: calc(100% - 3 * var(--climb-shift));
  min-height: var(--climb-h, 7.2rem);
  margin-left: calc(var(--climb-i) * var(--climb-shift));
  padding: 1.2rem 1.4rem;
  border: 1px solid #cdeff1;
  border-radius: 1.6rem;
  background: #ffffff;
  box-shadow: 0 1.6rem 3rem -2.2rem rgba(14, 42, 56, 0.45);
}
.svc-climb__step:nth-child(2) {
  --climb-i: 1;
}
.svc-climb__step:nth-child(3) {
  --climb-i: 2;
}
.svc-climb__step:nth-child(4) {
  --climb-i: 3;
}
/* The arrow up to the next step: a quarter curve from this step's right side into the next one's underside */
.svc-climb__step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(-1 * var(--climb-gap));
  left: 100%;
  width: var(--climb-reach);
  height: calc(50% + var(--climb-gap));
  border-right: 2px solid #00c2cb;
  border-bottom: 2px solid #00c2cb;
  border-bottom-right-radius: 100% 100%;
}
.svc-climb__step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: calc(-1 * var(--climb-gap) - 1px);
  left: calc(100% + var(--climb-reach) - 6px);
  border-right: 5px solid transparent;
  border-bottom: 8px solid #00c2cb;
  border-left: 5px solid transparent;
}
/* Each step's icon, as on the board: white on the brand's cyan */
.svc-climb__icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 1.2rem;
  background: linear-gradient(145deg, #00c2cb, #00aab2);
  box-shadow: 0 1rem 2rem -1.2rem rgba(0, 194, 203, 0.8);
  color: #ffffff;
}
.svc-climb__text {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.svc-climb__text strong {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.3;
  color: #0e2a38;
  text-wrap: balance;
}
.svc-climb__tags {
  font-size: 1.3rem;
  line-height: 1.4;
  color: #5a7380;
}
/* All four cards of a line share one height, the tallest any of them needs in any language (measured at the narrowest width
   of each range); --climb-h per line */
.svc-climb--software,
.svc-climb--ai {
  --climb-h: 9rem;
}
.svc-climb--outsourcing {
  --climb-h: 9.7rem;
}
.svc-climb--team {
  --climb-h: 11.5rem;
}
html[lang=ja] .svc-climb__text strong,
html[lang=ja] .svc-climb__tags {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
@media (max-width: 389px) {
  .svc-climb {
    --climb-shift: 2rem;
    --climb-reach: 1.4rem;
  }
  .svc-climb--software,
  .svc-climb--ai {
    --climb-h: 8.6rem;
  }
  .svc-climb--outsourcing {
    --climb-h: 9.3rem;
  }
  .svc-climb--team {
    --climb-h: 11.1rem;
  }
  .svc-climb__step {
    gap: 1rem;
    padding: 1rem 1.2rem;
  }
  .svc-climb__icon {
    width: 4rem;
    height: 4rem;
  }
}
@media (max-width: 359px) {
  .svc-climb--ai {
    --climb-h: 10.4rem;
  }
  .svc-climb--software,
  .svc-climb--outsourcing,
  .svc-climb--team {
    --climb-h: 11.1rem;
  }
}

/* In a line page's banner: the board fills the drawing's place beside the text */
.svc-hero-flow {
  display: flex;
  flex: 1 1 42rem;
  min-width: 0;
}
.svc-hero-flow .svc-flow,
.svc-hero-flow .svc-climb {
  flex: 1;
  min-width: 0;
}
@media (max-width: 767px) {
  .svc-flow {
    flex: 1;
    gap: 2.8rem;
    padding: 2rem 1.4rem;
  }
  .svc-flow__node {
    flex-wrap: wrap;
    min-height: 0;
    padding: 1rem 1.2rem;
  }
  .svc-flow__label {
    max-width: calc(100% - 4.8rem);
  }
  .svc-flow__tags {
    justify-content: flex-start;
  }
  .svc-flow__node:nth-child(odd) {
    margin-right: 2.4rem;
  }
  .svc-flow__node:nth-child(even) {
    margin-left: 2.4rem;
  }
  .svc-flow__wire {
    left: calc(50% + 1.2rem);
    height: 2.8rem;
  }
  .svc-flow__node:nth-child(even) .svc-flow__wire {
    left: calc(50% - 1.2rem);
  }
  .svc-hero-flow {
    flex-basis: 100%;
  }
  /* Phones: the board gives way to the staircase (.svc-climb) under the text */
  .svc-hero-flow {
    margin-top: 2.4rem;
  }
  .svc-hero-flow .svc-flow {
    display: none;
  }
  .svc-hero-flow .svc-climb {
    display: flex;
  }
}
@media (prefers-reduced-motion: reduce) {
  .svc-flow__spark {
    display: none;
  }
}
