.portfolio-page{
  --gallery-bg:#080a13;
  --gallery-blue:#527bff;
  background:var(--gallery-bg);
}

.portfolio-hero{
  --mountain-position:66% center;
  display:grid;
  align-items:center;
  min-height:clamp(260px,21vw,392px);
  padding-top:var(--header-h);
  background:
    linear-gradient(180deg,
      rgb(7 10 27 / .64),
      rgb(7 10 27 / .32) 31%,
      rgb(8 10 24 / .39) 58%,
      rgb(8 10 19 / .81) 85%,
      var(--gallery-bg) 100%),
    linear-gradient(90deg,rgb(5 8 24 / .24),transparent 32% 68%,rgb(5 8 24 / .20)),
    url('../../image/hero/portfolio-mountain.png') var(--mountain-position) / cover no-repeat #111b35;
}
.portfolio-heading,.portfolio-content{
  width:min(calc(100% - var(--pad) * 2),1240px);
  margin-inline:auto;
}
.portfolio-heading{
  display:flex;
  align-items:center;
  gap:clamp(12px,3.2vw,52px);
  color:#fff;
}
.portfolio-heading h1{
  margin:0;
  font:400 clamp(32px,4vw,64px)/1.15 var(--font-misans-reg);
  white-space:nowrap;
}
.portfolio-heading-rule{
  flex:1;
  min-width:24px;
  height:8px;
  background:repeating-linear-gradient(90deg,rgb(229 234 255 / .30) 0 1px,transparent 1px 13px);
  mask-image:linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent);
}
.portfolio-heading-en{
  display:inline-flex;
  align-items:center;
  gap:clamp(8px,1.35vw,20px);
  font:300 clamp(30px,4vw,64px)/1.15 var(--font-misans-xlight);
  white-space:nowrap;
}
.portfolio-heading-en::before{
  content:'';
  width:15px;
  height:15px;
  flex:none;
  color:rgb(231 237 255 / .87);
  background:
    radial-gradient(circle at 22% 22%,currentColor 0 2px,transparent 2.6px),
    radial-gradient(circle at 78% 22%,currentColor 0 2px,transparent 2.6px),
    radial-gradient(circle at 50% 50%,currentColor 0 2px,transparent 2.6px),
    radial-gradient(circle at 22% 78%,currentColor 0 2px,transparent 2.6px),
    radial-gradient(circle at 78% 78%,currentColor 0 2px,transparent 2.6px);
}
.portfolio-content{ padding-bottom:clamp(48px,7vw,100px); }
.portfolio-carousel{
  --rail-edge:clamp(14px,2.4vw,48px);
  position:relative;
  margin-top:clamp(2px,.5vw,8px);
}
.portfolio-thumbs{
  --thumb-area:min(1240px, calc(100% + 2 * (var(--rail-edge) - var(--pad))));
  --thumb-columns:6;
  --thumb-scale:calc(8 / 9);
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:calc((var(--thumb-area) - (var(--thumb-columns) - 1) * 16px) / var(--thumb-columns) * var(--thumb-scale));
  gap:24px;
  padding:6px var(--rail-edge);
  overflow-x:auto;
  overscroll-behavior-inline:contain;
  scrollbar-width:none;
  scroll-snap-type:x mandatory;
  scroll-padding-inline:var(--rail-edge);
}
.portfolio-thumbs::-webkit-scrollbar{ display:none; }
.portfolio-thumb{
  position:relative;
  isolation:isolate;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-width:0;
  aspect-ratio:4 / 3;
  overflow:hidden;
  border-radius:14px;
  background:#fff;
  outline:2px solid transparent;
  outline-offset:4px;
  scroll-snap-align:center;
  transition:outline-color .2s ease;
}
.portfolio-thumb[data-selected],.portfolio-thumbs:not([data-loop]) .portfolio-thumb[aria-current="true"]{ outline-color:var(--gallery-blue); }
.portfolio-thumb:focus-visible{ outline-color:#b1caff; }
.portfolio-thumb img{
  display:block;
  width:62%;
  height:46%;
  object-fit:contain;
  transition:transform .25s ease;
}
/* The visible mark is above the center of this transparent PNG canvas. */
.portfolio-thumb[data-project="shubang"] img{ width:73%; height:auto; flex:none; translate:0 4.6%; }
.portfolio-thumb:hover img{ transform:scale(1.045); }
.portfolio-arrow{
  --arrow-inset:clamp(16px,3vw,56px);
  position:absolute;
  z-index:2;
  top:50%;
  display:grid;
  place-items:center;
  width:clamp(40px,3.4vw,48px);
  aspect-ratio:1;
  padding:0;
  border:0;
  border-radius:50%;
  transform:translateY(-50%);
  background:rgb(10 12 18 / .76);
  color:#fff;
  cursor:pointer;
}
.portfolio-arrow--previous{ left:var(--arrow-inset); }
.portfolio-arrow--next{ right:var(--arrow-inset); }
.portfolio-arrow::before{
  content:'';
  width:9px;
  height:9px;
  border:solid currentColor;
  border-width:2px 2px 0 0;
  transform:translateX(-2px) rotate(45deg);
}
.portfolio-arrow--previous::before{ transform:translateX(2px) rotate(225deg); }
.portfolio-arrow:hover:not(:disabled){ background:rgb(28 39 66 / .92); }
.portfolio-arrow:disabled{ opacity:.48; cursor:default; }
.portfolio-arrow:focus-visible{ outline:2px solid #b1caff; outline-offset:3px; }
.portfolio-pagination{
  display:flex;
  justify-content:center;
  gap:clamp(4px,.6vw,8px);
  margin-top:12px;
  padding-inline:var(--pad);
}
.portfolio-page-indicator{
  display:grid;
  align-items:center;
  flex:0 1 32px;
  min-width:0;
  height:26px;
  padding:0;
  border:0;
  border-radius:4px;
  background:none;
  cursor:pointer;
  transition:flex-basis .2s ease;
}
.portfolio-page-indicator::before{
  content:'';
  height:3px;
  border-radius:999px;
  background:rgb(218 227 248 / .35);
}
.portfolio-page-indicator[aria-current="true"]{ flex-basis:50px; }
.portfolio-page-indicator[aria-current="true"]::before{ background:#f1f4fc; }
.portfolio-page-indicator:hover:not([aria-current="true"])::before{ background:rgb(218 227 248 / .65); }
.portfolio-page-indicator:focus-visible{ outline:2px solid #b1caff; outline-offset:2px; }
.portfolio-arrow[hidden],.portfolio-platforms[hidden],.portfolio-pagination[hidden]{ display:none; }
.portfolio-platforms{
  --platform-scale:calc(2 / 3);
  display:inline-flex;
  align-items:center;
  gap:calc(clamp(16px,2vw,30px) * var(--platform-scale));
  margin:clamp(24px,3vw,44px) 0 18px;
  padding:calc(10px * var(--platform-scale)) calc(clamp(20px,3vw,36px) * var(--platform-scale));
  border-radius:999px;
  background:rgb(255 255 255 / .075);
  backdrop-filter:blur(10px);
}
.portfolio-platform{
  padding-block:calc(4px * var(--platform-scale));
  color:#737377;
  font-family:var(--font-secondary);
  font-size:calc(clamp(24px,2vw,28px) * var(--platform-scale));
  font-weight:400;
  line-height:1.15;
  white-space:nowrap;
}
.portfolio-platform:hover,.portfolio-platform[aria-current="true"]{ color:#f2f2f4; }
.portfolio-platform[aria-current="true"]{ font-weight:600; }
.portfolio-platform-divider{
  --dot-step:calc(5px * var(--platform-scale));
  position:relative;
  flex:none;
  width:calc(14px * var(--platform-scale));
  height:calc(14px * var(--platform-scale));
  color:#4b4b50;
}
.portfolio-platform-divider::before{
  content:'';
  position:absolute;
  bottom:0;
  left:0;
  width:calc(4px * var(--platform-scale));
  height:calc(4px * var(--platform-scale));
  background:currentColor;
  box-shadow:
    var(--dot-step) calc(-1 * var(--dot-step)) currentColor,
    calc(2 * var(--dot-step)) calc(-2 * var(--dot-step)) currentColor;
}
.portfolio-platform:focus-visible,.portfolio-preview:focus-visible{
  outline:2px solid #b1caff;
  outline-offset:3px;
}
.portfolio-footer{ margin-top:clamp(30px,5vw,66px); }
.portfolio-status{
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%);
}

@media(max-width:980px){
  .portfolio-thumbs{ --thumb-columns:4; }
}
@media(max-width:640px){
  .portfolio-hero{ --mountain-position:right center; min-height:215px; }
  .portfolio-heading{ gap:12px; }
  .portfolio-heading-rule{ height:6px; }
  .portfolio-heading-en::before{ display:none; }
  .portfolio-thumbs{ grid-auto-columns:calc(var(--thumb-area) * .42 * var(--thumb-scale)); gap:20px; }
  .portfolio-thumb{ border-radius:12px; }
}
@media(prefers-reduced-motion:reduce){
  .portfolio-thumb,.portfolio-thumb img,.portfolio-page-indicator{ transition:none; }
}
