/* Clients: three finite logo lanes + a finite, user-controlled testimonial rail. */
html body.home-page #clients .cli-layout,
html body.home-page #clients .cli-layout.wrap {
  --client-grid-gap: clamp(.75rem, 1.2vw, 1.125rem);
  --cli-logo-gap: calc(var(--client-grid-gap) * var(--clients-logo-spacing-scale, 1.15));
  --cli-gap: var(--cli-logo-gap);
  --cli-row-gap: clamp(.36rem, .66vw, .6rem);
  --clients-testimonial-gap: clamp(1.5rem, 3.2vh, 3rem);
  --cli-guide-line: var(--clients-guide-line-color, #c1c0bf);
  --cli-guide-surface: transparent;
  --cli-guide-ink: var(--clients-guide-plus-color, rgba(16, 16, 16, .52));
  --cli-guide-mask: calc((clamp(.75rem, 1.15vw, 1rem) * .75) * var(--clients-guide-plus-scale, 1));
  --cli-guide-arm: calc((clamp(.9375rem, 1.425vw, 1.3125rem) * .75) * var(--clients-guide-plus-scale, 1));
  --cli-guide-edge: calc((var(--cli-guide-arm) * .5) + 1px);
  --cli-card-size: clamp(5.9rem, 8.45vw, 7.85rem);
  --cli-card-height: calc(var(--cli-card-size) * .515);
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto auto auto !important;
  grid-template-areas: "copy" "logos" "testimonials" !important;
  align-content: start;
  align-items: stretch;
  column-gap: 0 !important;
  row-gap: clamp(1.5rem, 4vh, 3.5rem) !important;
  width: 100%;
  min-height: 0 !important;
  padding: clamp(4.5rem, 10vh, 8rem) var(--gutter) !important;
  overflow: clip;
}

html body.home-page #clients .cli-copy {
  grid-area: copy;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: clamp(.5rem, .9vw, .75rem);
  width: min(100%, 46rem);
  text-align: right;
}

html body.home-page #clients .cli-copy h2 {
  max-width: none;
  white-space: nowrap;
  text-wrap: nowrap;
  text-align: right;
}

html body.home-page #clients .cli-copy-sub,
html body.home-page #clients .ct-headline-sub {
  margin: 0;
  font-family: "Aeonik", sans-serif;
  font-size: clamp(.8125rem, 1vw, .9375rem);
  font-weight: 400;
  line-height: 1.45;
  color: rgba(16, 18, 26, .68);
  text-wrap: pretty;
}

html body.home-page #clients .cli-copy-sub {
  max-width: 44ch;
  text-align: right;
}

html body.home-page #clients .ct-heading-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(.4rem, .7vw, .625rem);
  min-width: 0;
}

html body.home-page #clients .ct-headline-sub {
  max-width: 48ch;
  text-align: left;
}

@media (min-width: 1025px) {
  html body.home-page #clients .cli-copy-sub:empty,
  html body.home-page #clients .ct-headline-sub:empty {
    display: none;
  }
}

html body.home-page #clients .cli-logos-panel {
  --cli-gap: var(--cli-logo-gap);
  --cli-card-size: clamp(5.9rem, 8.45vw, 7.85rem);
  --cli-card-height: calc(var(--cli-card-size) * .515);
  grid-area: logos !important;
  justify-self: stretch !important;
  align-self: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0 0 var(--clients-testimonial-gap) !important;
  overflow: hidden !important;
  contain: layout paint;
}

html body.home-page #clients .cli-grid-scroll {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

html body.home-page #clients .cli-grid.is-lanes-ready {
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
  gap: var(--cli-row-gap) 0 !important;
  width: 100%;
  height: calc((var(--cli-card-height) * 3) + (var(--cli-row-gap) * 2) + (var(--cli-guide-edge) * 2));
  min-height: calc((var(--cli-card-height) * 3) + (var(--cli-row-gap) * 2) + (var(--cli-guide-edge) * 2)) !important;
  padding-block: var(--cli-guide-edge);
  box-sizing: border-box;
  margin: 0;
  grid-auto-rows: auto !important;
}

html body.home-page #clients .cli-logo-row {
  position: relative;
  z-index: 1;
  width: auto;
  max-width: none;
  height: 100%;
  margin-inline: var(--cli-guide-edge);
  overflow: hidden;
}

html body.home-page #clients .cli-logo-track {
  display: flex;
  align-items: stretch;
  gap: var(--cli-gap);
  width: max-content;
  min-width: 100%;
  height: 100%;
  will-change: transform;
}

/* Services-style frame: four horizontal boundaries and the two outer sides.
   Joints are distributed across each rule; no internal column rules are drawn. */
html body.home-page #clients .cli-logo-row-guides {
  position: absolute;
  inset: var(--cli-guide-edge);
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}

html body.home-page #clients .cli-logo-row-guides::before,
html body.home-page #clients .cli-logo-row-guides::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  display: block;
  background: var(--cli-guide-line);
}

html body.home-page #clients .cli-logo-row-guides::before {
  left: 0;
}

html body.home-page #clients .cli-logo-row-guides::after {
  right: 0;
}

html body.home-page #clients .cli-logo-row-guide {
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  top: calc(var(--cli-guide-row) * 33.333333%);
  height: 1px;
  display: block;
  background: var(--cli-guide-line);
}

html body.home-page #clients .cli-logo-row-guide:first-child {
  top: 0;
}

html body.home-page #clients .cli-logo-row-guide:last-child {
  top: auto;
  bottom: 0;
}

html body.home-page #clients .cli-logo-row-joint {
  position: absolute;
  z-index: 1;
  left: var(--cli-guide-x);
  top: 50%;
  width: var(--cli-guide-mask);
  height: var(--cli-guide-mask);
  display: block;
  background: var(--cli-guide-surface);
  transform: translate(-50%, -50%);
}

html body.home-page #clients .cli-logo-row-joint::before,
html body.home-page #clients .cli-logo-row-joint::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  background: var(--cli-guide-ink);
  transform: translate(-50%, -50%);
}

html body.home-page #clients .cli-logo-row-joint::before {
  width: var(--cli-guide-arm);
  height: 1px;
}

html body.home-page #clients .cli-logo-row-joint::after {
  width: 1px;
  height: var(--cli-guide-arm);
}

html body.home-page #clients .cli-card {
  flex: 0 0 var(--cli-card-size);
  width: var(--cli-card-size) !important;
  height: 100% !important;
  padding: clamp(.15rem, .25vw, .25rem) !important;
  box-sizing: border-box;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Use more of the transparent cell while preserving the intrinsic logo ratio.
   Compact canvases receive extra height so emblems do not read as undersized. */
html body.home-page #clients .cli-card-logo img,
html body.home-page #clients .cli-card-logo svg {
  max-width: 90% !important;
  max-height: 70% !important;
}

html body.home-page #clients .cli-card-logo[data-cli-fit="wide"] img,
html body.home-page #clients .cli-card-logo img[data-cli-fit="wide"] {
  max-width: 94% !important;
  max-height: 72% !important;
}

html body.home-page #clients .cli-card-logo[data-cli-fit="mark"] img,
html body.home-page #clients .cli-card-logo img[data-cli-fit="mark"] {
  max-width: 76% !important;
  max-height: 78% !important;
}

html body.home-page #clients .cli-card-logo[data-cli-shape="compact"] img {
  max-width: 82% !important;
  max-height: 82% !important;
}

/* Ericsson already carries a CMS scale boost, so its compact cap is slightly
   lower to keep the mark clear of the row edge. */
html body.home-page #clients .cli-card[data-cli-brand="ericsson"] .cli-card-logo img {
  max-width: 76% !important;
  max-height: 72% !important;
}

html body.home-page #clients .testimonials {
  grid-area: testimonials !important;
  display: block !important;
  width: 100%;
  min-width: 0;
  align-self: stretch !important;
}

html body.home-page #clients .ct-layout {
  gap: clamp(1rem, 2.2vh, 1.5rem);
  width: 100%;
  min-width: 0;
  height: auto !important;
}

html body.home-page #clients .ct-viewport {
  width: 100%;
  min-width: 0;
  height: auto !important;
  overflow: hidden;
}

html body.home-page #clients .ct-grid {
  --ct-gap: var(--client-grid-gap);
  display: flex;
  align-items: stretch !important;
  gap: var(--ct-gap);
  width: 100%;
  height: auto !important;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  overscroll-behavior-inline: contain;
  touch-action: pan-x pan-y;
  cursor: grab;
  z-index: auto !important;
}

html body.home-page #clients .ct-grid.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

html body.home-page #clients .ct-card,
html body.home-page #clients .ct-card[data-quote-length="long"] {
  flex: 0 0 calc((100% - var(--ct-gap)) / 2);
  min-width: 0;
  height: var(--ct-card-height, auto) !important;
  align-self: stretch !important;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  transform-origin: 50% 50%;
}

html body.home-page #clients .ct-card-shell,
html.tablet-portrait body.home-page #clients .ct-card-shell {
  width: 100%;
  height: 100% !important;
  min-height: clamp(18rem, 34vw, 25rem) !important;
  max-height: none !important;
  border: 0 !important;
  overflow: hidden;
}

@media (min-width: 1025px) {
  html body.home-page #clients .ct-card-shell,
  html body.home-page #clients .ct-card.is-active .ct-card-shell {
    background: var(--testimonials-container-color, #fff);
  }
}

html body.home-page #clients .ct-quote-block,
html.tablet-portrait body.home-page #clients .ct-quote-block {
  flex: 0 1 auto;
  max-width: 75ch;
  max-height: none !important;
  overflow: visible !important;
}

/* Every testimonial uses a static LED project image with its quote held in a
   CMS-positioned frosted panel. */
html body.home-page #clients .ct-card.ct-card--led,
html body.home-page #clients .ct-card.ct-card--led[data-quote-length="long"] {
  flex-basis: 100%;
}

html body.home-page #clients .ct-card--led .ct-card-shell,
html body.home-page #clients .ct-card--led.is-active .ct-card-shell {
  min-height: clamp(30rem, 47vw, 39rem) !important;
  height: auto !important;
  aspect-ratio: 16 / 7.5;
  padding: clamp(1rem, 2.4vw, 2rem) !important;
  border: 0;
  background: #080b11 !important;
  color: var(--testimonials-card-ink, #10121a);
  isolation: auto;
}

html body.home-page #clients .ct-card--led .ct-frost-card .ct-quote,
html body.home-page #clients .ct-card--led .ct-frost-card .ct-mark,
html body.home-page #clients .ct-card--led .ct-frost-card .ct-name,
html body.home-page #clients .ct-card--led .ct-frost-card .ct-role,
html body.home-page #clients .ct-card--led .ct-frost-card .ct-company {
  color: var(--testimonials-card-ink, #10121a) !important;
}

html body.home-page #clients .ct-led-media {
  --ct-led-cell: 5px;
  position: absolute;
  inset: 0;
  z-index: 0 !important;
  overflow: hidden;
  background: #080b11;
  pointer-events: none;
}

html body.home-page #clients .ct-led-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.82);
}

html body.home-page #clients .ct-led-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(135deg, rgba(255,255,255,.18), transparent 42%) 0 0 / var(--ct-led-cell, 14px) var(--ct-led-cell, 14px),
    radial-gradient(circle at 50% 35%, transparent 32%, rgba(3,5,10,.28) 100%);
  mix-blend-mode: soft-light;
}

html body.home-page #clients .ct-led-scrim {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(90deg, rgba(4,7,13,.44) 0%, rgba(4,7,13,.12) 54%, rgba(4,7,13,.04) 100%);
}

/* One shared organism stays anchored to the testimonial viewport while the
   cards scroll beneath it. It remains above project media and below frost cards. */
html body.home-page #clients .ct-shared-organism {
  position: absolute;
  left: calc(var(--testimonials-blob-x, 50) * 1%);
  top: calc(var(--testimonials-blob-y, 50) * 1%);
  z-index: 1 !important;
  display: block;
  width: clamp(10rem, 25vw, 24rem);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(var(--testimonials-blob-scale, 1));
  pointer-events: none;
}

html body.home-page #clients .ct-shared-organism::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 75%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 42% 58% 64% 36% / 48% 42% 58% 52%;
  background: radial-gradient(circle at 34% 28%, #fff 0 7%, #efeee9 34%, #c9c7c0 68%, #9c9a94 100%);
  box-shadow: inset -24px -28px 54px rgba(40,40,38,.18), inset 22px 18px 44px rgba(255,255,255,.72);
  filter: drop-shadow(0 22px 48px rgba(29,29,27,.14));
}

html body.home-page #clients .ct-shared-organism.is-gl {
  overflow: hidden;
}

html body.home-page #clients .ct-shared-organism.is-gl::before {
  display: none;
}

html body.home-page #clients .ct-shared-organism canvas {
  display: none;
  width: 100%;
  height: 100%;
}

html body.home-page #clients .ct-shared-organism.is-gl canvas {
  display: block;
}

html body.home-page #clients .ct-frost-card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  width: min(47%, 34rem);
  min-width: 22rem;
  padding: clamp(1.35rem, 2.6vw, 2.5rem);
  border: 0;
  border-radius: var(--container-radius, clamp(.625rem,1.2vw,1rem));
  background: rgba(248,249,251,var(--testimonials-card-opacity,.72));
  background: color-mix(in srgb, var(--testimonials-container-color, #f8f9fb) var(--testimonials-card-opacity-pct, 72%), transparent);
  color: var(--testimonials-card-ink, #10121a);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  backdrop-filter: blur(24px) saturate(135%);
  box-shadow: 0 1.5rem 4rem rgba(4,7,13,.18);
}

html body.home-page #clients .ct-card--led[data-card-placement="left"] .ct-frost-card {
  margin-right: auto;
}

html body.home-page #clients .ct-card--led[data-card-placement="right"] .ct-frost-card {
  margin-left: auto;
  padding-top: clamp(4.5rem, 6vw, 5.5rem);
}

html body.home-page #clients .ct-card--led[data-card-placement="right"] .ct-led-scrim {
  background: linear-gradient(270deg, rgba(4,7,13,.44) 0%, rgba(4,7,13,.12) 54%, rgba(4,7,13,.04) 100%);
}

html body.home-page #clients .ct-frost-card .ct-quote-block {
  max-width: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html body.home-page #clients .ct-frost-card {
    background: var(--testimonials-container-color, #f8f9fb);
  }
}

html body.home-page #clients .ct-controls {
  position: absolute;
  top: clamp(1rem, 2.4vw, 2rem);
  right: clamp(1rem, 2.4vw, 2rem);
  z-index: 8;
  grid-area: auto !important;
  width: auto !important;
  margin: 0;
  padding: 0;
}

@media (max-width: 1050px) {
  html body.home-page #clients .cli-layout,
  html body.home-page #clients .cli-layout.wrap,
  html.tablet-portrait body.home-page #clients .cli-layout,
  html.tablet-portrait body.home-page #clients .cli-layout.wrap {
    --cli-card-size: clamp(5.25rem, 12.5vw, 6.75rem);
    grid-template-areas: "copy" "logos" "testimonials" !important;
    padding-block: clamp(3.5rem, 7vh, 5.5rem) !important;
  }

  html body.home-page #clients .cli-logos-panel,
  html.tablet-portrait body.home-page #clients .cli-logos-panel {
    --cli-card-size: clamp(5.25rem, 12.5vw, 6.75rem);
    --cli-card-height: calc(var(--cli-card-size) * .515);
  }

  html body.home-page #clients .ct-card,
  html body.home-page #clients .ct-card[data-quote-length="long"] {
    flex-basis: min(72vw, 32rem);
  }
}

@media (max-width: 760px) {
  html body.home-page #clients .cli-layout,
  html body.home-page #clients .cli-layout.wrap {
    --client-grid-gap: .5rem;
    --cli-row-gap: .3rem;
    --clients-testimonial-gap: 1.75rem;
    --cli-card-size: clamp(4.75rem, 22vw, 5.5rem);
    row-gap: 1.75rem !important;
    padding: var(--mobile-section-space) var(--mobile-gutter) !important;
  }

  html body.home-page #clients .cli-copy h2,
  html body.home-page #clients .cli-copy h2[data-cms-html] {
    max-width: none;
    white-space: nowrap;
    text-wrap: nowrap;
    font-size: clamp(1.05rem, 5.7vw, 1.5rem) !important;
  }

  html body.home-page #clients .cli-copy {
    width: 100%;
  }

  html body.home-page #clients .cli-copy-sub,
  html body.home-page #clients .ct-headline-sub {
    max-width: 34ch;
  }

  html body.home-page #clients .cli-logos-panel {
    --cli-card-size: clamp(4.75rem, 22vw, 5.5rem);
    --cli-card-height: calc(var(--cli-card-size) * .515);
  }

  html body.home-page #clients .ct-headline,
  html body.home-page #clients .ct-headline [style*="font-size"] {
    max-width: 11ch;
  }

  html body.home-page #clients .ct-card,
  html body.home-page #clients .ct-card[data-quote-length="long"] {
    flex-basis: min(86vw, 22rem);
  }

  html body.home-page #clients .ct-card-shell {
    min-height: 16rem !important;
    padding: 1.25rem;
  }

  html body.home-page #clients .ct-card--led .ct-card-shell,
  html body.home-page #clients .ct-card--led.is-active .ct-card-shell {
    min-height: 31rem !important;
    max-height: none !important;
    height: auto !important;
    aspect-ratio: 4 / 5.3;
    padding: .875rem !important;
  }

  html body.home-page #clients .ct-card--led .ct-frost-card {
    align-self: flex-end;
    width: 100%;
    min-width: 0;
    min-height: 58%;
    margin-inline: 0;
    padding: 1.25rem;
  }

  html body.home-page #clients .ct-controls {
    top: .875rem;
    right: .875rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body.home-page #clients .cli-logo-row {
    overflow-x: auto;
    scrollbar-width: none;
  }

  html body.home-page #clients .cli-logo-row::-webkit-scrollbar {
    display: none;
  }

  html body.home-page #clients .cli-logo-track {
    transform: none !important;
    will-change: auto;
  }

  html body.home-page #clients .ct-card {
    transform: none !important;
    opacity: 1 !important;
  }

}

@media (prefers-reduced-transparency: reduce) {
  html body.home-page #clients .ct-frost-card {
    background: var(--testimonials-container-color, #f8f9fb);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
