/* V9: approved graphic-design layout reused verbatim for the four visual galleries.
   Thumbnail crop is intentional; the full original opens on click, without captions. */
.portfolio-unified {
  position:relative!important;
  min-height:0!important;
  padding:48px var(--frame) 24px!important;
  overflow:hidden;
  isolation:isolate;
}
.portfolio-unified .unified-chapter {display:none!important;}
.portfolio-unified .unified-gallery.gallery-stage {
  position:relative!important;
  display:block!important;
  width:100%!important;
  max-width:1520px!important;
  padding:0!important;
  margin:0 auto!important;
  overflow:visible!important;
  isolation:isolate;
  min-height:0!important;
  gap:0!important;
}
/* Same moving ultramarine lines and placement as the graphic-design cover stage. */
.portfolio-unified .gallery-stage .graphic-background-text {
  position:absolute;
  z-index:-1;
  overflow:hidden;
  left:-9vw;
  right:-9vw;
  top:auto;
  font:900 clamp(85px,15.3vw,250px)/1.2 var(--display);
  letter-spacing:-.085em;
  color:var(--ultra);
  opacity:.95;
  white-space:nowrap;
  transform:rotate(-4deg);
  pointer-events:none;
}
.portfolio-unified .gallery-stage .graphic-background-text.line-1 {top:1%}
.portfolio-unified .gallery-stage .graphic-background-text.line-2 {top:25%}
.portfolio-unified .gallery-stage .graphic-background-text.line-3 {top:50%}
.portfolio-unified .gallery-stage .graphic-background-text.line-4 {top:74%}
.portfolio-unified .gallery-stage .graphic-background-text .moving-type {animation-duration:30s}
.portfolio-unified .gallery-stage .graphic-background-text.line-2 .moving-type,
.portfolio-unified .gallery-stage .graphic-background-text.line-4 .moving-type {animation-duration:36s}

.portfolio-unified .gallery-stage .gallery-item:nth-child(n) {
  position:absolute!important;
  display:block!important;
  left:var(--x);
  top:var(--y);
  width:var(--w);
  height:auto;
  margin:0!important;
  padding:0!important;
  grid-column:auto!important;
  grid-row:auto!important;
  justify-self:auto!important;
  align-self:auto!important;
  transform-origin:50% 50%;
  z-index:2;
  border:0;
  background:none;
  text-align:left;
  cursor:pointer;
}
/* Identical thrown-on-the-table stagger, timing and hover response. */
.portfolio-unified .gallery-stage .gallery-item.reveal {
  opacity:0!important;
  transform:translate3d(var(--entry-x),var(--entry-y),0)
    rotate(calc(var(--rotation) + var(--entry-rotation))) scale(.87)!important;
  transition:opacity .58s ease-out,transform 1.28s cubic-bezier(.19,1,.28,1)!important;
  transition-delay:var(--delay,0ms)!important;
  will-change:transform,opacity;
}
.portfolio-unified .gallery-stage .gallery-item.reveal.is-visible {
  opacity:1!important;
  transform:translate3d(0,0,0) rotate(var(--rotation)) scale(1)!important;
}
.portfolio-unified .gallery-stage .gallery-item.reveal.is-visible:hover,
.portfolio-unified .gallery-stage .gallery-item.reveal.is-visible:focus-visible {
  z-index:20!important;
  transform:translate3d(0,-11px,0) rotate(0deg) scale(1.055)!important;
  transition-delay:0ms!important;
}
/* Unified portrait/landscape previews, just like the graphic project's covers.
   The full files are never cropped in the overlay. */
.portfolio-unified .gallery-stage .gallery-art {
  display:block;
  position:relative;
  width:100%;
  aspect-ratio:1100/860;
  overflow:hidden;
  background:var(--paper);
  box-shadow:0 13px 28px rgba(0,0,0,.15);
}
.portfolio-unified .gallery-stage .gallery-art img {
  position:absolute;
  inset:0;
  display:block;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  aspect-ratio:auto!important;
  object-fit:cover!important;
  object-position:center;
}
.portfolio-unified .gallery-stage .project-hover {z-index:3}

@media(max-width:700px){
  .portfolio-unified {padding:45px 13px 24px!important;}
  .portfolio-unified .unified-gallery.gallery-stage {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    column-gap:12px!important;
    row-gap:36px!important;
    padding:10px 0 30px!important;
    height:auto!important;
  }
  .portfolio-unified .gallery-stage .gallery-item:nth-child(n){
    position:relative!important;
    left:auto!important;top:auto!important;width:100%!important;
    min-width:0;
    grid-column:auto!important;
    grid-row:auto!important;
    margin-top:0!important;
  }
  .portfolio-unified .gallery-stage .gallery-item:nth-of-type(2n){margin-top:55px!important}
  .portfolio-unified .gallery-stage .gallery-item:nth-of-type(3n){margin-top:10px!important}
  .portfolio-unified .gallery-stage .graphic-background-text {font-size:28vw;left:-12%;right:-12%;}
  .portfolio-unified .gallery-stage .gallery-item.reveal {
    transform:translate3d(calc(var(--entry-x)*.35),-30px,0)
      rotate(calc(var(--rotation) + 6deg)) scale(.92)!important;
  }
  .portfolio-unified .gallery-stage .gallery-item.reveal.is-visible {
    transform:translate3d(0,0,0) rotate(var(--rotation)) scale(1)!important;
  }
  .portfolio-unified .gallery-stage .gallery-item.reveal.is-visible:hover,
  .portfolio-unified .gallery-stage .gallery-item.reveal.is-visible:focus-visible {
    transform:translate3d(0,-7px,0) rotate(0deg) scale(1.04)!important;
  }
}
@media(prefers-reduced-motion:reduce){
  .portfolio-unified .gallery-stage .gallery-item.reveal,
  .portfolio-unified .gallery-stage .gallery-item.reveal.is-visible{
    opacity:1!important;transform:rotate(var(--rotation))!important;transition:none!important;
  }
}
