.portfolioCarousel{
  position:relative;
  margin-top:32px;
  padding-inline:clamp(34px, 6vw, 88px);
}

.portfolioViewport{
  position:relative;
  height:clamp(320px, 48vw, 540px);
  overflow:hidden;
  cursor:grab;
  user-select:none;
  touch-action:pan-y;
}

.portfolioViewport.is-dragging{
  cursor:grabbing;
}

.portfolioViewport::before,
.portfolioViewport::after{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  width:clamp(34px, 8vw, 116px);
  z-index:6;
  pointer-events:none;
}

.portfolioViewport::before{
  left:0;
  background:linear-gradient(90deg, rgba(248,250,252,.96), rgba(248,250,252,0));
}

.portfolioViewport::after{
  right:0;
  background:linear-gradient(270deg, rgba(248,250,252,.96), rgba(248,250,252,0));
}

.portfolioCarousel .gallery{
  position:relative;
  display:block;
  height:100%;
  overflow:visible;
}

.portfolioCarousel .work{
  position:absolute;
  top:50%;
  left:50%;
  width:clamp(190px, 30vw, 410px);
  aspect-ratio:4 / 5;
  margin:0;
  overflow:hidden;
  border-radius:30px;
  border:1px solid rgba(15,23,42,.08);
  background:rgba(255,255,255,.9);
  box-shadow:0 24px 64px rgba(15,23,42,.14);
  transform-style:preserve-3d;
  will-change:transform, opacity, filter;
  transition:
    transform .42s cubic-bezier(.22,.61,.36,1),
    opacity .32s ease,
    filter .32s ease,
    box-shadow .32s ease,
    border-color .32s ease;
  transform:
    translate3d(calc(-50% + var(--carousel-x, 0px)), calc(-50% + var(--carousel-y, 0px)), 0)
    scale(var(--carousel-scale, 1))
    rotateY(var(--carousel-rotate, 0deg));
  opacity:var(--carousel-opacity, 1);
  z-index:var(--carousel-z, 1);
  filter:blur(var(--carousel-blur, 0px)) saturate(var(--carousel-saturate, 1));
}

.portfolioViewport.is-dragging .work{
  transition:none;
}

.portfolioCarousel .work::before{
  content:attr(data-title);
  position:absolute;
  left:18px;
  top:18px;
  z-index:2;
  max-width:calc(100% - 36px);
  padding:10px 14px;
  border-radius:999px;
  background:rgba(255,255,255,.86);
  color:#0f172a;
  font-size:10px;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
  box-shadow:0 16px 34px rgba(15,23,42,.12);
  backdrop-filter:blur(14px);
}

.portfolioCarousel .work::after{
  content:none;
}

.portfolioCarousel .work:hover{
  transform:
    translate3d(calc(-50% + var(--carousel-x, 0px)), calc(-50% + var(--carousel-y, 0px)), 0)
    scale(var(--carousel-scale, 1))
    rotateY(var(--carousel-rotate, 0deg));
  border-color:rgba(15,23,42,.14);
  box-shadow:0 28px 72px rgba(15,23,42,.16);
}

.portfolioCarousel .work img,
.portfolioCarousel .work:hover img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  transform:none !important;
}

.portfolioCarousel .work figcaption{
  display:none;
}

.portfolioCarousel .work[aria-hidden="true"]{
  pointer-events:none;
}

.portfolioCarousel .work.is-active{
  border-color:rgba(8,145,178,.22);
  box-shadow:0 34px 86px rgba(15,23,42,.18);
}

.portfolioNav{
  position:absolute;
  top:50%;
  z-index:8;
  display:grid;
  place-items:center;
  width:52px;
  height:52px;
  padding:0;
  border:1px solid rgba(15,23,42,.08);
  border-radius:999px;
  background:rgba(255,255,255,.88);
  color:#0f172a;
  box-shadow:0 16px 36px rgba(15,23,42,.12);
  cursor:pointer;
  transform:translateY(-50%);
  transition:transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
  backdrop-filter:blur(14px);
}

.portfolioNav:hover{
  transform:translateY(calc(-50% - 2px));
  border-color:rgba(8,145,178,.24);
  box-shadow:0 20px 42px rgba(15,23,42,.14);
}

.portfolioNav:focus-visible,
.portfolioCarousel .work:focus-visible,
.clientLogoCarousel .logoGrid img:focus-visible{
  outline:2px solid rgba(8,145,178,.42);
  outline-offset:4px;
}

.portfolioNavPrev{
  left:0;
}

.portfolioNavNext{
  right:0;
}

.portfolioNavIcon{
  font-size:24px;
  line-height:1;
}

.portfolioNavSubtle{
  width:46px;
  height:46px;
  border-color:rgba(255,255,255,.12);
  background:rgba(8,12,18,.48);
  color:#f8fafc;
  box-shadow:0 14px 32px rgba(0,0,0,.28);
}

.portfolioNavSubtle:hover{
  border-color:rgba(255,255,255,.22);
  box-shadow:0 18px 36px rgba(0,0,0,.32);
}

.portfolioSummary{
  display:grid;
  gap:10px;
  justify-items:center;
  margin-top:18px;
  text-align:center;
}

.portfolioSummaryTitle{
  margin:0;
  color:#0f172a;
  font-size:clamp(24px, 2.4vw, 34px);
  line-height:1.05;
  letter-spacing:-.04em;
}

.portfolioSummaryCaption{
  margin:0;
  max-width:58ch;
  color:#5b667a;
  font-size:15px;
  line-height:1.8;
}

.carouselStatus{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0, 0, 0, 0);
  white-space:nowrap;
  border:0;
}

.lightboxCaption[hidden]{
  display:none;
}

.lightboxImg.is-logo{
  object-fit:contain;
  padding:42px;
  background:
    radial-gradient(circle at 50% 0, rgba(255,255,255,.08), transparent 46%),
    #0b0d10;
  filter:brightness(0) invert(1) drop-shadow(0 18px 34px rgba(0,0,0,.4));
}

.clientLogoCarousel{
  position:relative;
  padding-inline:52px;
}

.clientLogoViewport{
  position:relative;
  height:clamp(196px, 24vw, 260px);
  overflow:hidden;
  cursor:grab;
  user-select:none;
  touch-action:pan-y;
}

.clientLogoViewport.is-dragging{
  cursor:grabbing;
}

.clientLogoViewport::before,
.clientLogoViewport::after{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  width:clamp(36px, 8vw, 98px);
  z-index:6;
  pointer-events:none;
}

.clientLogoViewport::before{
  left:0;
  background:linear-gradient(90deg, rgba(8,12,18,.76), rgba(8,12,18,0));
}

.clientLogoViewport::after{
  right:0;
  background:linear-gradient(270deg, rgba(8,12,18,.76), rgba(8,12,18,0));
}

.clientLogoCarousel .logoGrid{
  position:relative;
  display:block;
  height:100%;
  margin:0;
  overflow:visible;
}

.clientLogoCarousel .logoGrid img{
  position:absolute;
  top:50%;
  left:50%;
  width:clamp(256px, 24vw, 336px);
  height:clamp(92px, 8.4vw, 116px);
  margin:0;
  padding:22px 26px;
  object-fit:contain;
  object-position:center;
  border-radius:28px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.06);
  box-shadow:0 18px 36px rgba(0,0,0,.18);
  cursor:pointer;
  will-change:transform, opacity;
  transition:
    transform .4s cubic-bezier(.22,.61,.36,1),
    opacity .28s ease,
    box-shadow .28s ease,
    border-color .28s ease,
    background .28s ease;
  transform:
    translate3d(calc(-50% + var(--carousel-x, 0px)), calc(-50% + var(--carousel-y, 0px)), 0)
    scale(var(--carousel-scale, 1))
    rotateY(var(--carousel-rotate, 0deg));
  opacity:var(--carousel-opacity, 1);
  z-index:var(--carousel-z, 1);
  filter:brightness(0) invert(1) drop-shadow(0 12px 24px rgba(0,0,0,.35));
}

.clientLogoViewport.is-dragging .logoGrid img{
  transition:none;
}

.clientLogoCarousel .logoGrid img:hover{
  transform:
    translate3d(calc(-50% + var(--carousel-x, 0px)), calc(-50% + var(--carousel-y, 0px)), 0)
    scale(var(--carousel-scale, 1))
    rotateY(var(--carousel-rotate, 0deg));
  opacity:1;
  border-color:rgba(255,255,255,.18);
  background:rgba(255,255,255,.08);
  box-shadow:0 18px 36px rgba(0,0,0,.24);
}

.clientLogoCarousel .logoGrid img[aria-hidden="true"]{
  pointer-events:none;
}

.clientLogoCarousel .logoGrid img.is-active{
  border-color:rgba(255,255,255,.22);
  background:rgba(255,255,255,.14);
  box-shadow:0 28px 52px rgba(0,0,0,.3);
}

.clientLogoCarousel .portfolioNav{
  top:50%;
  bottom:auto;
  transform:translateY(-50%);
}

.clientLogoCarousel .portfolioNav:hover{
  transform:translateY(calc(-50% - 2px));
}

@media (max-width: 760px){
  .portfolioCarousel{
    padding-inline:12px;
    margin-top:24px;
  }

  .portfolioViewport{
    height:clamp(300px, 88vw, 420px);
  }

  .portfolioCarousel .work{
    width:clamp(180px, 58vw, 280px);
    border-radius:24px;
  }

  .portfolioCarousel .work::before{
    left:14px;
    top:14px;
    padding:8px 11px;
    font-size:9px;
    letter-spacing:.1em;
  }

  .portfolioNav{
    top:auto;
    bottom:14px;
    width:46px;
    height:46px;
    transform:none;
  }

  .portfolioNav:hover{
    transform:translateY(-2px);
  }

  .portfolioNavPrev{
    left:14px;
  }

  .portfolioNavNext{
    right:14px;
  }

  .portfolioSummary{
    margin-top:20px;
    padding-inline:12px;
  }

  .portfolioSummaryCaption{
    font-size:14px;
    line-height:1.75;
  }

  .clientLogoCarousel{
    padding-inline:8px;
  }

  .clientLogoViewport{
    height:176px;
  }

  .clientLogoCarousel .logoGrid img{
    width:clamp(196px, 56vw, 256px);
    height:clamp(76px, 20vw, 96px);
    padding:18px 20px;
    border-radius:22px;
  }

  .clientLogoCarousel .portfolioNav{
    width:40px;
    height:40px;
    top:50%;
    bottom:auto;
    transform:translateY(-50%);
  }

  .clientLogoCarousel .portfolioNav:hover{
    transform:translateY(calc(-50% - 2px));
  }

  .clientLogoCarousel .portfolioNavPrev{
    left:4px;
  }

  .clientLogoCarousel .portfolioNavNext{
    right:4px;
  }
}

@media (max-width: 480px){
  .portfolioViewport::before,
  .portfolioViewport::after{
    width:44px;
  }

  .portfolioSummaryTitle{
    font-size:22px;
  }

  .lightboxImg.is-logo{
    padding:26px;
  }
}
