/* Adaptive Safety Solutions: "Het team", the people behind the services (04, in place of the client quotes).
 *
 * A row of panels in a fixed order: the open one has the room (flex-grow --sq-grow), the others stand narrow beside
 * it. Opening another panel widens it where it stands while the open one narrows; the panel under the mouse takes a
 * little more. The open panel shows the person's number, name and role. The last, "Jij?", is the free seat in the
 * team: a dashed outline with a plus; open, the whole seat is the link to Werken bij. team.js marks the open panel and sets --sq-hero.
 * On phones (.is-rows, under 760 px) the panels are rows: the open one tall with its copy under it, the others a
 * bar with their number and role.
 * Until the portraits are there (with written permission), each panel is a toned field with the logo mark. A photo
 * goes in .sq__art as an <img>: it is drawn at the open panel's size (--sq-hero) and centred, so a panel that narrows
 * only shows less of it.
 * Without JavaScript the cards stand in a row that scrolls sideways, the invitation under the last one.
 * Uses the site's tokens and its .wrap, .kicker and .cta-btn. */

.team {
  --sq-h: clamp(380px, 112vw, 460px); /* the row's height on phones */
  --sq-radius: 14px;
  --sq-ms: 900ms;
  --sq-grow: 14; /* the open panel's share of the row, against 1 for each of the others (team.js reads it) */
  --sq-gap: 6px;

  border-bottom: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.team__inner {
  padding-block: clamp(64px, 9vw, 128px);
}

/* Heading ---------------------------------------------------------------------------------------------------- */

.team__head {
  display: grid;
  row-gap: 16px;
  margin-bottom: clamp(32px, 4.4vw, 60px);
}

.team__head .kicker {
  margin: 0;
}

.team__title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.25rem, 3.6vw, 3.6rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.team__title span {
  color: var(--olive);
}

.team__intro {
  max-width: 34rem;
  margin: 0;
  color: var(--graphite);
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.7;
  text-wrap: pretty;
}

@media (min-width: 901px) {
  .team {
    --sq-h: clamp(340px, 29vw, 440px);
    --sq-grow: 8;
    --sq-gap: 12px;
  }

  .team__head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
    grid-template-areas:
      "eyebrow eyebrow"
      "title intro";
    align-items: end;
    column-gap: 64px;
  }

  .team__head .kicker {
    grid-area: eyebrow;
  }

  .team__title {
    grid-area: title;
  }

  .team__intro {
    grid-area: intro;
  }
}

/* A panel ---------------------------------------------------------------------------------------------------- */

.sq__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sq__card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: 100%;
  border-radius: var(--sq-radius);
  background: var(--tone, var(--forest));
  color: var(--on-dark);
}

/* The field: a soft light in the tone, the mark in sage. One size for every panel (the open one's), centred. */
.sq__art {
  position: absolute;
  inset-block: 0;
  left: 50%;
  display: grid;
  place-items: center;
  width: var(--sq-hero, 100%);
  min-width: 100%;
  transform: translateX(-50%);
  background:
    radial-gradient(90% 80% at 50% 42%, rgba(255, 255, 255, 0.12), transparent 70%),
    linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.28)),
    var(--tone, var(--forest));
}

.sq__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sq__mark {
  width: clamp(96px, 26%, 200px);
  height: auto;
  color: var(--sage);
  opacity: 0.9;
}

/* "Jij?" is the free seat in the team: no fill, a dashed outline and a plus */
.sq__item--you .sq__card {
  border: 1.5px dashed rgba(78, 81, 38, 0.6);
  background: transparent;
  color: var(--forest);
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.sq__plus {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
}

.sq__plus::before,
.sq__plus::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  margin-top: -1px;
  border-radius: 1px;
  background: currentColor;
}

.sq__plus::after {
  transform: rotate(90deg);
}

.sq__card > .sq__plus {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* The role, bottom left of the open panel */
.sq__tag {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 48px 24px 22px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.42), transparent);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.005em;
  white-space: nowrap;
  pointer-events: none;
}

/* The name in bold, the role lighter */
.sq__name {
  flex: none;
  font-weight: 700;
}

.sq__role {
  min-width: 0;
  overflow: hidden;
  font-weight: 300;
  text-overflow: ellipsis;
  opacity: 0.88;
}

.sq__tag small {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--sage);
}

.sq__item--you .sq__tag {
  background: none;
}

.sq__item--you .sq__tag small {
  color: var(--forest);
}

/* "Jij?" open: the whole seat is the link to Werken bij */
.sq__you {
  display: grid;
  justify-items: start;
  color: var(--ink);
  text-decoration: none;
}

/* The sign: a disc with a plus, and two lines that meet at it */
.sq__you-sign {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
}

/* a soft light behind the disc, so the seat is not flat */
.sq__you-sign::before {
  content: "";
  position: absolute;
  inset: -70px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(205, 208, 143, 0.6), rgba(205, 208, 143, 0));
}

.sq__you-beam {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--sq-hero, 100%);
  height: 2px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sq__you-beam i {
  position: absolute;
  top: 0;
  width: calc(50% - 48px);
  height: 100%;
  background: var(--forest);
  clip-path: inset(0 100% 0 0);
}

.sq__you-beam i:first-child {
  left: 0;
  background: linear-gradient(90deg, rgba(78, 81, 38, 0), var(--forest));
}

.sq__you-beam i:last-child {
  right: 0;
  background: linear-gradient(270deg, rgba(78, 81, 38, 0), var(--forest));
  clip-path: inset(0 0 0 100%);
}

.sq__you-disc {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1.5px solid var(--forest);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 12px 30px -14px rgba(78, 81, 38, 0.55);
  color: var(--forest);
  transition: background-color 0.35s ease, color 0.35s ease;
}

.sq__you-disc .sq__plus {
  grid-area: 1 / 1;
  width: 22px;
  height: 22px;
  transition: transform 0.45s var(--ease-out), opacity 0.3s ease;
}

.sq__you-disc svg,
.sq__you-go svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sq__you-disc svg {
  grid-area: 1 / 1;
  width: 24px;
  height: 24px;
  opacity: 0;
  transform: rotate(-45deg) scale(0.6);
  transition: transform 0.45s var(--ease-out), opacity 0.3s ease;
}

/* "Jij?" large, then the line in olive: the site's two-part headline */
.sq__you-q {
  font-size: clamp(56px, 6.2vw, 96px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.sq__you-sub {
  margin-top: 8px;
  color: var(--olive);
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

/* A line draws itself under the link text when the seat opens */
.sq__you-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-bottom: 4px;
  background: linear-gradient(currentColor, currentColor) 0 100% / var(--line-w, 100%) 1.5px no-repeat;
  color: var(--forest);
  font-size: 16px;
  font-weight: 600;
  transition: background-size 0.9s var(--ease-out);
}

.sq__you-go svg {
  width: 18px;
  height: 18px;
  transition: transform 0.35s var(--ease-out);
}

@media (hover: hover) {
  .sq__you:hover .sq__you-disc {
    background: var(--forest);
    color: var(--sage);
  }

  .sq__you:hover .sq__you-disc .sq__plus {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
  }

  .sq__you:hover .sq__you-disc svg {
    opacity: 1;
    transform: none;
  }

  .sq__you:hover .sq__you-go svg {
    transform: translate(2px, -2px);
  }

  .sq.is-ready .sq__item--you:not(.is-open) .sq__card:hover {
    border-color: var(--forest);
    background: rgba(205, 208, 143, 0.18);
  }
}

/* Without JavaScript: a row of cards that scrolls sideways ---------------------------------------------------- */

.sq:not(.is-ready) .sq__list {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}

.sq:not(.is-ready) .sq__item {
  flex: none;
  display: grid;
  align-content: start;
  gap: 16px;
  width: min(78vw, 300px);
  scroll-snap-align: start;
}

.sq:not(.is-ready) .sq__card {
  height: 340px;
}

.sq:not(.is-ready) .sq__you-sign {
  display: none;
}

.sq:not(.is-ready) .sq__you-q {
  font-size: 44px;
}

.sq:not(.is-ready) .sq__you-sub {
  font-size: 20px;
}

/* With team.js ----------------------------------------------------------------------------------------------- */

.sq.is-ready .sq__view {
  position: relative;
  height: var(--sq-h);
  overflow: hidden;
  touch-action: pan-y; /* a sideways swipe moves the row; up and down still scroll the page */
}

.sq.is-ready .sq__list {
  display: flex;
  gap: var(--sq-gap);
  height: 100%;
}

.sq.is-ready .sq__item {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  transition: flex-grow var(--sq-ms) var(--ease-out), transform 1.1s var(--ease-out) var(--dd, 0ms),
    opacity 0.7s ease var(--dd, 0ms);
}

/* On the way in the panels come from the left and the right and close up in the middle (team.js sets --dx, how far
   out each one starts, and --dd, the outer ones first). The row itself does not rise as well. */
html.reveal .sq.is-ready .sq__view[data-reveal]:not(.is-in) {
  opacity: 1;
  transform: none;
}

html.reveal .sq.is-ready .sq__view[data-reveal]:not(.is-in) .sq__item {
  opacity: 0;
  transform: translateX(var(--dx, 0px));
}

.sq.is-ready .sq__item.is-open {
  flex-grow: var(--sq-grow);
}

@media (hover: hover) and (min-width: 901px) {
  .sq.is-ready .sq__item:not(.is-open):hover {
    flex-grow: 1.8;
  }
}

.sq.is-ready .sq__card {
  border-radius: min(var(--sq-radius), 10px);
  cursor: pointer;
}

.sq.is-ready .is-open .sq__card {
  border-radius: var(--sq-radius);
}

.sq.is-ready .sq__item.is-open .sq__card {
  cursor: default;
}

.sq.is-ready .sq__card:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: -6px;
}

.sq.is-ready .sq__tag {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.sq.is-ready .is-open .sq__tag {
  opacity: 1;
  transition-delay: calc(var(--sq-ms) * 0.45);
}

/* The mark is clear on the open panel only, so the row reads as one face and a queue */
.sq.is-ready .sq__mark {
  opacity: 0.3;
  transition: opacity 0.6s ease;
}

.sq.is-ready .sq__card:hover .sq__mark {
  opacity: 0.55;
}

.sq.is-ready .is-open .sq__mark {
  opacity: 0.9;
}

/* "Jij?" open: the seat fills with its invitation ---------------------------------------------------------- */

.sq.is-ready .sq__item {
  position: relative;
}

/* Rounded like its card, so the dashed corners are not clipped */
.sq.is-ready .sq__item--you {
  overflow: hidden;
  border-radius: min(var(--sq-radius), 10px);
}

.sq.is-ready .sq__item--you.is-open {
  border-radius: var(--sq-radius);
}

.sq.is-ready .sq__item--you.is-open .sq__card {
  border-color: rgba(78, 81, 38, 0.7);
  background: rgba(205, 208, 143, 0.16);
}

.sq.is-ready .sq__item--you .sq__card > .sq__plus {
  transition: opacity 0.3s ease;
}

.sq.is-ready .sq__item--you.is-open .sq__card > .sq__plus,
.sq.is-ready .sq__item--you.is-open .sq__tag {
  opacity: 0;
  transition-delay: 0s;
}

/* Drawn at the open panel's width, so the text does not reflow while the seat widens */
.sq.is-ready .sq__you {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sq-hero, 100%);
  grid-template-rows: 1fr auto auto auto;
  padding: clamp(24px, 3vw, 44px);
  border-radius: var(--sq-radius);
  visibility: hidden;
  transition: visibility 0s linear 0.35s;
}

.sq.is-ready .sq__you:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: -6px;
}

.sq.is-ready .sq__you-sign {
  align-self: center;
  justify-self: center;
}

.sq.is-ready .is-open .sq__you {
  visibility: visible;
  transition: visibility 0s;
}

/* Closed, everything waits: the disc small, the words out to the sides */
.sq.is-ready .sq__you-sign::before,
.sq.is-ready .sq__you-disc {
  opacity: 0;
  transform: scale(0.3);
  transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.35s ease, color 0.35s ease;
}

.sq.is-ready .sq__you-q,
.sq.is-ready .sq__you-sub,
.sq.is-ready .sq__you-go {
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease, background-size 0.25s ease;
}

.sq.is-ready .sq__you-q {
  transform: translateX(-56px);
}

.sq.is-ready .sq__you-sub {
  transform: translateX(56px);
}

.sq.is-ready .sq__you-go {
  --line-w: 0%;
  transform: translateY(10px);
}

/* Open: two lines run in from the edges and meet in the middle; there the disc appears. "Jij?" comes in from the
   left, its line from the right, and they settle one above the other. Then the link, and its underline. */
.sq.is-ready .is-open .sq__you-beam i:first-child {
  animation: sq-beam-l 1s var(--ease-out) calc(var(--sq-ms) * 0.3) both;
}

.sq.is-ready .is-open .sq__you-beam i:last-child {
  animation: sq-beam-r 1s var(--ease-out) calc(var(--sq-ms) * 0.3) both;
}

.sq.is-ready .is-open .sq__you-disc,
.sq.is-ready .is-open .sq__you-sign::before {
  opacity: 1;
  transform: none;
  transition: opacity 0.4s ease calc(var(--sq-ms) * 0.3 + 0.5s),
    transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--sq-ms) * 0.3 + 0.5s),
    background-color 0.35s ease, color 0.35s ease;
}

.sq.is-ready .is-open .sq__you-q,
.sq.is-ready .is-open .sq__you-sub {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease calc(var(--sq-ms) * 0.4), transform 1.1s var(--ease-out) calc(var(--sq-ms) * 0.4);
}

.sq.is-ready .is-open .sq__you-sub {
  transition-delay: calc(var(--sq-ms) * 0.48);
}

.sq.is-ready .is-open .sq__you-go {
  --line-w: 100%;
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease calc(var(--sq-ms) * 0.7), transform 0.9s var(--ease-out) calc(var(--sq-ms) * 0.7),
    background-size 0.9s var(--ease-out) calc(var(--sq-ms) + 0.3s);
}

/* The seat asks to be taken: once the disc is there its ring swells twice */
@media (prefers-reduced-motion: no-preference) {
  .sq.is-ready .is-open .sq__you-disc {
    animation: sq-ask 1.3s ease-out calc(var(--sq-ms) + 0.6s) 2;
  }
}

@keyframes sq-beam-l {
  0% { clip-path: inset(0 100% 0 0); }
  55% { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 0 0 100%); }
}

@keyframes sq-beam-r {
  0% { clip-path: inset(0 0 0 100%); }
  55% { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 100% 0 0); }
}

@keyframes sq-ask {
  0% { box-shadow: 0 12px 30px -14px rgba(78, 81, 38, 0.55), 0 0 0 0 rgba(78, 81, 38, 0.35); }
  100% { box-shadow: 0 12px 30px -14px rgba(78, 81, 38, 0.55), 0 0 0 18px rgba(78, 81, 38, 0); }
}

/* Phones: rows that open downwards ------------------------------------------------------------------------- */

.sq.is-rows {
  --sq-row: 56px;                        /* a closed row */
  --sq-row-open: min(100vw, 420px);      /* the open one */
}

.sq.is-rows .sq__view {
  height: auto;
  overflow: visible;
}

.sq.is-rows .sq__list {
  flex-direction: column;
  height: auto;
}

.sq.is-rows .sq__item {
  flex: none;
  height: auto;
}

.sq.is-rows .sq__card {
  height: var(--sq-row);
  transition: height var(--sq-ms) var(--ease-out);
}

.sq.is-rows .sq__item.is-open .sq__card {
  height: var(--sq-row-open);
}

.sq.is-rows .sq__art {
  width: 100%;
}

.sq.is-rows .sq__item:not(.is-open) .sq__mark {
  opacity: 0;
}

/* A closed row: its number, name and role, and a chevron */
.sq.is-rows .sq__item:not(.is-open) .sq__tag {
  inset: 0;
  align-items: center;
  padding: 0 52px 0 20px;
  background: none;
  opacity: 1;
  transition-delay: 0s;
}

.sq.is-rows .sq__item:not(.is-open) .sq__tag::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 22px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.7;
  transform: translateY(-70%) rotate(45deg);
}

.sq.is-rows .sq__you {
  width: 100%;
  padding: 24px;
}

.sq.is-rows .sq__you-q {
  font-size: 56px;
}

.sq.is-rows .sq__you-sub {
  font-size: 22px;
}

/* A closed "Jij?" row: the plus where the others have their chevron */
.sq.is-rows .sq__item--you:not(.is-open) .sq__tag::after {
  content: none;
}

.sq.is-rows .sq__item--you .sq__card > .sq__plus {
  left: auto;
  right: 18px;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
}

@media (prefers-reduced-motion: reduce) {
  .sq.is-ready .sq__card,
  .sq.is-ready .sq__item,
  .sq.is-ready .sq__you,
  .sq.is-ready .sq__you *,
  .sq.is-ready .sq__you-sign::before,
  .sq.is-ready .sq__tag {
    transition: none !important;
  }

  .sq.is-ready .sq__you-beam {
    display: none;
  }
}
