.services {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: 100px;
  padding-bottom: 100px;
  background: var(--paper-blue);
}

.services-wash {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.services-geo-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.services > .section-head,
.services > .service-stage {
  position: relative;
  z-index: 1;
}

.services .section-head {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.services .section-head h2 {
  margin-top: 0;
  max-width: 11em;
  font-size: clamp(36px, 5vw, 64px);
}

.services .section-head > p {
  max-width: 36em;
  margin-top: 24px;
  padding-bottom: 0;
  color: var(--muted);
  font-size: var(--fs-lead);
  line-height: 1.65;
}

.service-stage {
  --square: 220px;
  max-width: var(--max);
  margin: 85px 0 0;
  display: grid;
  grid-template-columns: calc(var(--square) * 2) minmax(0, 1fr);
  column-gap: clamp(72px, 8vw, 140px);
  row-gap: 48px;
  align-items: center;
}

.service-panel {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.service-note {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  max-width: 36em;
  margin: 110px 0 0;
  color: var(--muted);
  font-size: var(--fs-lead);
  line-height: 1.65;
}

.service-detail {
  opacity: 0;
  transform: translateX(-10px);
}

.service-detail.is-shown,
.service-detail.is-leaving {
  transition: opacity .3s ease, transform .3s ease;
}

.service-detail.is-shown {
  opacity: 1;
  transform: translateX(0);
}

.service-detail.is-leaving {
  opacity: 0;
  transform: translateX(-10px);
}

.service-detail h3 {
  max-width: 14em;
  margin-top: 18px;
  font-size: var(--fs-display);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -.055em;
}

.service-detail p {
  max-width: 36em;
  margin-top: 22px;
  color: var(--muted);
  font-size: var(--fs-body);
  line-height: 1.65;
}

.service-detail .service-tags {
  margin-top: 28px;
}

.service-list {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.service-card {
  position: relative;
  width: 100%;
  min-height: var(--square);
  aspect-ratio: 1;
  padding: 22px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: background .28s ease, border-color .28s ease, color .28s ease;
}

.service-card:hover {
  background: var(--blue-light);
  border-color: rgba(10, 39, 72, .32);
}

.service-card.is-active,
.service-card.is-active:hover {
  background: var(--ink);
  border-color: rgba(245, 249, 253, .55);
  color: var(--paper);
}

.service-card:focus-visible {
  outline: 1px solid var(--blue);
  outline-offset: -1px;
}

.service-icon {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .5);
  transition: border-color .28s ease, background .28s ease, color .28s ease;
}

.service-icon svg {
  width: 29px;
  height: 29px;
}

.service-card.is-active .service-index,
.service-card.is-active h3,
.service-card.is-active .service-icon {
  color: var(--paper);
}

.service-card.is-active .service-icon {
  border-color: rgba(245, 249, 253, .42);
  background: transparent;
}

.service-card h3 {
  max-width: 9em;
  margin-top: 42px;
  font-size: var(--fs-h3);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -.055em;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-tags span {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue-dark);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

@media (min-width: 821px) {
  .service-stage {
    --cubes-shift: clamp(0px, calc((100vw - 1320px) * 0.9), 140px);
    grid-template-columns: calc(var(--square) * 2 + var(--cubes-shift)) minmax(0, 1fr);
    grid-template-rows: auto auto;
    row-gap: 0;
    align-items: start;
  }

  .service-list {
    grid-row: 1;
    width: calc(var(--square) * 2);
    margin-left: var(--cubes-shift);
    grid-template-columns: repeat(2, var(--square));
    grid-template-rows: repeat(5, calc(var(--square) / 2));
    border-top: 0;
    border-left: 0;
  }

  .service-note {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    align-self: start;
    position: relative;
    left: calc(50vw - var(--pad) - 50%);
    width: max-content;
    max-width: 100%;
    margin: 110px 0 0;
  }

  .service-panel {
    margin-top: 70px;
    display: flex;
    justify-content: center;
  }

  .service-detail {
    width: min(100%, 612px);
  }

  .service-card {
    width: var(--square);
    height: var(--square);
    min-height: 0;
    aspect-ratio: auto;
    border: 1px solid var(--line);
  }

  .service-card:hover {
    z-index: 1;
  }

  .service-card.is-active,
  .service-card.is-active:hover {
    z-index: 2;
    border-color: rgba(245, 249, 253, .55);
  }

  /* Right column dropped by half a square */
  .service-card:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .service-card:nth-child(2) {
    grid-column: 2;
    grid-row: 2 / span 2;
  }

  .service-card:nth-child(3) {
    grid-column: 1;
    grid-row: 3 / span 2;
  }

  .service-card:nth-child(4) {
    grid-column: 2;
    grid-row: 4 / span 2;
  }
}

@media (max-width: 1100px) and (min-width: 821px) {
  .service-stage {
    --square: clamp(168px, 20vw, 220px);
    column-gap: clamp(28px, 4vw, 64px);
  }

  .service-card h3 {
    margin-top: 24px;
  }
}

@media (max-width: 820px) {
  .services {
    padding-bottom: 64px;
  }

  .services .section-head h2 {
    font-size: clamp(32px, 8vw, 44px);
  }

  .service-stage {
    grid-template-columns: 1fr;
    row-gap: 36px;
    margin-top: 48px;
  }

  .service-list,
  .service-panel,
  .service-note {
    grid-column: auto;
    grid-row: auto;
    position: static;
    left: auto;
    width: auto;
    max-width: none;
    margin: 0;
  }

  .service-list {
    order: 1;
    width: min(100%, 520px);
    justify-self: center;
    grid-template-columns: 1fr 1fr;
  }

  .service-panel,
  .service-note {
    width: min(100%, 520px);
    justify-self: center;
    padding-right: 16px;
    padding-left: 16px;
  }

  .service-panel {
    order: 2;
  }

  .service-note {
    order: 3;
  }

  .service-card {
    min-height: 0;
    aspect-ratio: 1;
    padding: 16px;
  }

  .service-card h3 {
    max-width: none;
    margin-top: 22px;
  }

  .service-icon {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }

  .service-icon svg {
    width: 22px;
    height: 22px;
  }

  .service-detail p,
  .service-note {
    font-size: var(--fs-body);
    line-height: 1.6;
  }
}

@media (max-width: 480px) {
  .service-panel,
  .service-note {
    padding-right: 14px;
    padding-left: 14px;
  }

  .service-list {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .service-card {
    aspect-ratio: auto;
    min-height: 120px;
    padding: 18px 16px;
  }

  .service-card h3 {
    margin-top: 16px;
    font-size: var(--fs-sm);
  }

  .service-icon {
    width: 32px;
    height: 32px;
  }

  .service-icon svg {
    width: 20px;
    height: 20px;
  }
}

