/* Nex8 | Home portfolio carousel v2
   Scope: ONLY the public Home. Keeps #375 circular rotation and
   #374 real-image precedence. Compact dark editorial design, not a white card.
*/
.nex8-home .nex8-portfolio-carousel{
  --portfolio-gap:18px;
  --portfolio-orange:#ff831a;
  --portfolio-navy:#071c31;
  min-width:0;
  position:relative;
}
.nex8-home .nex8-portfolio-carousel-viewport{
  width:100%;
  min-width:0;
  overflow-x:auto;
  overflow-y:hidden;
  border-radius:24px;
  scroll-snap-type:x mandatory;
  scrollbar-width:none;
  touch-action:pan-y;
}
.nex8-home .nex8-portfolio-carousel-viewport::-webkit-scrollbar{display:none}
.nex8-home .nex8-portfolio-carousel.is-ready .nex8-portfolio-carousel-viewport{
  overflow:hidden;
  scroll-snap-type:none;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track{
  display:flex;
  flex-direction:row;
  flex-wrap:nowrap;
  align-items:stretch;
  gap:var(--portfolio-gap);
  width:100%;
  min-width:0;
  margin:0;
  padding:2px 2px 14px;
  transition:none;
  will-change:transform;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card,
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:first-child{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  flex:0 0 calc((100% - (var(--portfolio-gap) * 2) - 4px) / 3);
  width:calc((100% - (var(--portfolio-gap) * 2) - 4px) / 3);
  min-width:0;
  max-width:none;
  min-height:0;
  height:auto;
  grid-column:auto;
  overflow:hidden;
  border:1px solid #2a526f;
  border-radius:22px;
  background:linear-gradient(148deg,#102e49 0%,#071b2e 100%);
  box-shadow:0 13px 34px #081b2d27,inset 0 1px 0 #ffffff19;
  color:#fff;
  scroll-snap-align:start;
  transform:none;
  transition:border-color .2s ease,box-shadow .2s ease;
  isolation:isolate;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:hover{
  transform:none;
  border-color:#5b9bc2;
  box-shadow:0 19px 44px #081b2d32,inset 0 1px 0 #ffffff24;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:after{content:none;display:none}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-visual,
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:first-child .nex8-work-visual{
  position:relative;
  display:grid;
  place-items:center;
  grid-column:auto;
  flex:0 0 auto;
  width:100%;
  height:clamp(185px,19vw,245px);
  min-height:0;
  padding:16px 18px 8px;
  overflow:hidden;
  border-radius:0;
  background:
    radial-gradient(ellipse 80% 75% at 57% 50%,#15547e 0%,#0d3555 39%,transparent 78%),
    linear-gradient(145deg,#0c2c47 0%,#07192b 100%);
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-visual:before{
  content:"";
  position:absolute;
  inset:auto 5% -27% 5%;
  height:60%;
  border-radius:50%;
  background:radial-gradient(ellipse,#1785b634,transparent 66%);
  pointer-events:none;
  z-index:0;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-visual:after{
  content:"";
  position:absolute;
  inset:auto 0 0;
  height:24px;
  background:linear-gradient(0deg,#0b263c,transparent);
  pointer-events:none;
  z-index:2;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-visual img{
  display:block;
  position:relative;
  z-index:1;
  width:100%;
  height:100%;
  max-height:100%;
  object-fit:contain;
  filter:drop-shadow(0 13px 17px #0007);
  transition:transform .3s ease;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-portfolio-demo-media,
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:first-child .nex8-portfolio-demo-media{
  z-index:1;
  width:min(80%,215px);
  max-width:100%;
  filter:drop-shadow(0 12px 15px #0008);
  transform:none;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:hover .nex8-portfolio-demo-media,
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:hover .nex8-work-visual img{
  transform:scale(1.035);
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-counter{
  /* The compact pager below is the only visible position indicator. */
  display:none;
  top:13px;
  left:17px;
  z-index:4;
  padding:5px 9px;
  border-radius:50px;
  background:#06192b8f;
  border:1px solid #ffffff2a;
  color:#e9f6ff;
  font-size:.62rem;
  font-weight:770;
  letter-spacing:.13em;
  text-shadow:none;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-demo-label{
  z-index:4;
  right:12px;
  bottom:13px;
  max-width:89%;
  padding:5px 9px;
  border:1px solid #d7eaf342;
  background:#091e30bd;
  border-radius:50px;
  color:#d5e6f0;
  font-size:.54rem;
  font-weight:780;
  letter-spacing:.085em;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-brand-placeholder{
  position:relative;
  z-index:1;
  opacity:.45;
  color:#83c9ee;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-info,
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:first-child .nex8-work-info{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-start;
  grid-column:auto;
  flex:1;
  min-width:0;
  padding:22px 24px 22px;
  background:linear-gradient(180deg,#0c273f 0%,#071c2e 100%);
  color:#fff;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-info:before{
  content:"";
  position:absolute;
  top:0;
  left:24px;
  width:38px;
  height:3px;
  background:#ff831a;
  border-radius:0 0 3px 3px;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-info .nex8-work-category{
  margin:0 0 10px;
  color:#79c9e9;
  font-size:.64rem;
  font-weight:800;
  letter-spacing:.16em;
  line-height:1.3;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-info .nex8-work-category:before{
  content:none;
  display:none;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-info h3,
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:first-child .nex8-work-info h3{
  margin:0;
  width:100%;
  min-height:0;
  max-width:100%;
  color:#fff;
  font-size:clamp(1.18rem,1.8vw,1.56rem);
  line-height:1.19;
  letter-spacing:-.035em;
  font-weight:820;
  text-shadow:none;
  overflow-wrap:break-word;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-info p,
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:first-child .nex8-work-info p{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  margin:10px 0 0;
  color:#b3cbdc;
  font-size:.82rem;
  line-height:1.48;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-link{
  display:inline-flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  min-height:39px;
  margin:16px 0 0;
  padding:9px 14px;
  border:1px solid #ff8e3d85;
  border-radius:50px;
  background:linear-gradient(105deg,#ff7311,#eb5800);
  color:#fff;
  font-size:.8rem;
  font-weight:830;
  letter-spacing:0;
  line-height:1.1;
  box-shadow:0 8px 17px #f46c171f;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-link span{
  color:#fff;
  font-size:1.2rem;
}
.nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-info small{
  margin:9px 0 0;
  color:#94aebf;
  font-size:.65rem;
  line-height:1.4;
}
.nex8-home .nex8-portfolio-carousel-controls{
  display:none;
  grid-template-columns:auto minmax(40px,1fr) auto;
  align-items:center;
  gap:9px 15px;
  padding:5px 3px 0;
  margin:0;
}
.nex8-home .nex8-portfolio-carousel.is-ready:not(.is-static) .nex8-portfolio-carousel-controls{
  display:grid;
}
.nex8-home .nex8-portfolio-carousel-counter{
  grid-column:1;
  grid-row:1;
  color:#496176;
  font-size:.75rem;
  font-weight:750;
  line-height:1;
  letter-spacing:.04em;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.nex8-home .nex8-portfolio-carousel-counter [data-portfolio-position]{
  color:#e66e15;
  font-size:.9rem;
}
.nex8-home .nex8-portfolio-carousel-dots{
  grid-column:2;
  grid-row:1;
  justify-self:center;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-width:0;
}
.nex8-home .nex8-portfolio-carousel-dot{
  appearance:none;
  width:8px;
  height:8px;
  padding:0;
  border:0;
  border-radius:50px;
  background:#bccdd7;
  cursor:pointer;
  transition:width .2s ease,background .2s ease;
}
.nex8-home .nex8-portfolio-carousel-dot.is-active{
  width:24px;
  background:var(--portfolio-orange);
}
.nex8-home .nex8-portfolio-carousel-actions{
  display:flex;
  grid-column:3;
  grid-row:1;
  flex-wrap:nowrap;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
}
.nex8-home .nex8-portfolio-carousel-actions button{
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:39px;
  min-width:39px;
  height:39px;
  width:39px;
  padding:6px;
  border:1px solid #d1dee7;
  border-radius:50%;
  background:#fff;
  color:#132d42;
  font-size:1.12rem;
  line-height:1;
  cursor:pointer;
  transition:background .2s ease,border-color .2s ease;
}
.nex8-home .nex8-portfolio-carousel-actions button:hover{
  color:#ea6711;
  border-color:#ff9a51;
  background:#fff6ee;
}
.nex8-home .nex8-portfolio-carousel-actions [data-portfolio-pause]{
  min-width:39px;
  width:39px;
  font-size:1rem;
  border-color:#ff9a53;
  background:#ffefe4;
  color:#e46710;
}
.nex8-home .nex8-portfolio-carousel-actions [data-portfolio-pause]:before{
  content:"Ⅱ";
  font-size:1.18rem;
  font-weight:800;
  transform:translateY(-1px);
}
.nex8-home .nex8-portfolio-carousel-actions [data-portfolio-pause][aria-pressed="true"]:before{
  content:"▶";
  font-size:.89rem;
  transform:none;
}
.nex8-home .nex8-portfolio-carousel-progress{
  grid-column:1/-1;
  grid-row:2;
  width:100%;
  min-width:0;
  height:4px;
  margin:4px 0 0;
  border-radius:50px;
  overflow:hidden;
  background:#d6e2ea;
}
.nex8-home .nex8-portfolio-carousel-progress span{
  display:block;
  width:100%;
  height:100%;
  border-radius:50px;
  background:linear-gradient(90deg,#ed6510,#ff9a24);
  transform:scaleX(0);
  transform-origin:left center;
}
.nex8-home .nex8-portfolio-carousel-progress[hidden],
.nex8-home .nex8-portfolio-carousel-actions button[hidden]{display:none!important}
.nex8-home .nex8-portfolio-carousel :is(button,a,[tabindex]):focus-visible{
  outline:3px solid #ff9d4e;
  outline-offset:3px;
}
@media(max-width:980px){
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card,
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:first-child{
    flex-basis:calc((100% - var(--portfolio-gap) - 4px) / 2);
    width:calc((100% - var(--portfolio-gap) - 4px) / 2);
  }
}
@media(max-width:680px){
  .nex8-home .nex8-portfolio-carousel{--portfolio-gap:12px}
  .nex8-home .nex8-portfolio-carousel-viewport{border-radius:21px}
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track{
    padding:1px 1px 10px;
  }
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card,
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:first-child{
    flex-basis:calc(100% - 2px);
    width:calc(100% - 2px);
    border-radius:20px;
    box-shadow:0 9px 23px #0a1e3226;
  }
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-visual,
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:first-child .nex8-work-visual{
    height:clamp(188px,57vw,240px);
    min-height:0;
    padding:10px 12px 4px;
  }
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-portfolio-demo-media,
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:first-child .nex8-portfolio-demo-media{
    width:min(73%,202px);
    max-width:100%;
  }
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-info,
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:first-child .nex8-work-info{
    flex:1;
    min-width:0;
    padding:18px 20px 19px;
  }
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-info .nex8-work-category{
    margin-bottom:8px;
    font-size:.63rem;
  }
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-info h3,
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:first-child .nex8-work-info h3{
    font-size:clamp(1.25rem,5.25vw,1.52rem);
    line-height:1.16;
    min-height:0;
  }
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-info p,
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:first-child .nex8-work-info p{
    margin-top:8px;
    font-size:.78rem;
    line-height:1.42;
    -webkit-line-clamp:2;
  }
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-link{
    margin-top:12px;
    min-height:36px;
    padding:8px 13px;
    font-size:.77rem;
  }
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-info small{
    margin-top:7px;
    font-size:.62rem;
  }
  .nex8-home .nex8-portfolio-carousel-controls{
    gap:7px 9px;
    padding:2px 2px 0;
  }
  .nex8-home .nex8-portfolio-carousel-actions{gap:5px}
  .nex8-home .nex8-portfolio-carousel-actions button,
  .nex8-home .nex8-portfolio-carousel-actions [data-portfolio-pause]{
    width:35px;
    min-width:35px;
    height:35px;
    min-height:35px;
    font-size:1rem;
  }
  .nex8-home .nex8-portfolio-carousel-dot.is-active{width:19px}
}
@media(max-width:350px){
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-info,
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:first-child .nex8-work-info{padding:16px 16px 18px}
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-visual,
  .nex8-home .nex8-work-grid--premium.nex8-portfolio-carousel-track .nex8-work-card:first-child .nex8-work-visual{height:185px}
}
@media(prefers-reduced-motion:reduce){
  .nex8-home .nex8-portfolio-carousel *,
  .nex8-home .nex8-portfolio-carousel *:before,
  .nex8-home .nex8-portfolio-carousel *:after{
    transition:none!important;
    animation:none!important;
  }
}

/* CAROUSEL-MOBILE-20261031: portfolio controls use distinct rows
   on phones; arrows and pause never compete with the dots/counter. */
@media(max-width:680px){
  .nex8-home .nex8-portfolio-carousel-controls{
    grid-template-columns:auto minmax(0,1fr);
    grid-template-rows:auto auto auto;
    column-gap:10px;
    row-gap:10px;
    padding:8px 2px 0;
    min-width:0;
  }
  .nex8-home .nex8-portfolio-carousel-counter{
    grid-column:1;
    grid-row:1;
    align-self:center;
  }
  .nex8-home .nex8-portfolio-carousel-dots{
    grid-column:2;
    grid-row:1;
    justify-self:end;
    justify-content:flex-end;
    min-width:0;
    max-width:100%;
    flex-wrap:nowrap;
    overflow-x:auto;
    scrollbar-width:none;
  }
  .nex8-home .nex8-portfolio-carousel-dots::-webkit-scrollbar{display:none}
  .nex8-home .nex8-portfolio-carousel-dot{
    flex:0 0 auto;
  }
  .nex8-home .nex8-portfolio-carousel-actions{
    grid-column:1/-1;
    grid-row:2;
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    justify-self:stretch;
    width:100%;
    min-width:0;
    gap:9px;
    /* The fixed WhatsApp control must not cover the next arrow. */
    padding-right:64px;
    box-sizing:border-box;
  }
  .nex8-home .nex8-portfolio-carousel-actions button,
  .nex8-home .nex8-portfolio-carousel-actions [data-portfolio-pause]{
    box-sizing:border-box;
    width:100%;
    min-width:0;
    min-height:45px;
    height:45px;
    border-radius:12px;
  }
  .nex8-home .nex8-portfolio-carousel-progress{
    grid-column:1/-1;
    grid-row:3;
    width:100%;
    min-width:0;
    margin:2px 0 0;
  }
}
