.showcase {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  gap: 0 clamp(25px, 4vw, 68px);
  padding-top: clamp(46px, 5.3vw, 92px);
}

.showcase .showcase-intro {
  display: flex;
  grid-area: 1 / 1;
  align-items: center;
  min-height: min(560px, 65svh);
  padding: 0 0 clamp(34px, 6vw, 96px);
}
.showcase .hero h1 { font-size: clamp(3.4rem, 6.35vw, 7.2rem); }
.showcase-work { grid-area: 2 / 1; }
.showcase-work .section-heading { padding-top: 38px; }
.showcase-work .section-heading h2 { font-size: clamp(2.42rem, 4.35vw, 5rem); }

.study-rail { grid-area: 1 / 2 / 3 / 3; min-width: 0; }
.study-rail .study { margin: 0; }
@media (width > 800px) {
  .showcase.is-morphing .study { position: sticky; top: clamp(18px, 7vh, 76px); }
}
.study-rail .study-art {
  max-height: calc(73svh - 60px);
  background: radial-gradient(ellipse at 50% 42%, #303029 0%, #171a17 63%, #101310);
}
.study-rail .study { border-color: #46463b; border-radius: 10px; }
.study-art::before { opacity: .045; }
.study-caption { background: #171a17; }
.study-cross { opacity: .5; }
.study-art::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(ellipse at center, var(--study-glow, transparent), transparent 73%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}
.study[data-artwork="vpean"] { --study-glow: #243e2a; }
.study[data-artwork="blackjack"] { --study-glow: #45344f; }
.study[data-artwork="blockdrop"] { --study-glow: #28405a; }
.study[data-artwork] .study-art::after { opacity: 1; }
.study.is-in-work .shape-controls:not(:focus-within) { visibility: hidden; }
.study-title { text-transform: none; letter-spacing: .04em; }
.study-still { inset: 17%; width: 66%; height: 66%; }
.project-morph-canvas { display: none; }
@media (800px < width <= 1000px) {
  .study-caption { flex-wrap: wrap; }
}

.showcase-work .work-grid { grid-template-columns: minmax(0, 1fr); gap: clamp(16px, 2.1vw, 31px); }
.showcase-work .project-blockdrop .project-link { grid-template: auto 1fr / minmax(0, 1fr); }
.showcase-work .project-blockdrop .project-info { padding-inline: clamp(16px, 2.1vw, 34px); }
.showcase-work .blockdrop-art { min-height: 0; aspect-ratio: 1.96; }
.showcase-work .blockdrop-logo { width: 23%; }

@media (max-width: 800px) {
  .showcase {
    display: block;
    padding-top: clamp(27px, 5vw, 46px);
  }
  .showcase .showcase-intro {
    display: block;
    min-height: 0;
    padding-bottom: 10px;
  }
  .showcase .hero h1 { font-size: clamp(2.7rem, 10vw, 5.7rem); }
  .showcase .hero h1 br:nth-of-type(2) { display: inline; }
  .study-rail .study {
    border: 0;
    background: transparent;
    border-radius: 0;
  }
  .study-rail .study-art {
    max-height: clamp(106px, 37vw, 190px);
    aspect-ratio: 2 / 1;
    background: radial-gradient(ellipse at center, #e7d5c154, transparent 65%);
  }
  .study-rail .study-still {
    inset: 12%;
    width: 76%;
    height: 76%;
    visibility: visible;
    transform: perspective(600px) rotateY(-11deg) rotateX(5deg);
    filter: drop-shadow(-2px 2px 0 #b1977c) drop-shadow(-3px 3px 0 #b1977c) drop-shadow(0 12px 12px #55452918);
  }
  .showcase-work .project-art { aspect-ratio: 1.48; }
  .study-rail :is(.study-canvas, .study-cross, .study-caption),
  .study-rail .study-art::before,
  .study-rail .study-art::after { display: none; }
  .showcase-work { margin-top: 14px; }
  .showcase-work .section-heading { padding-top: 24px; }
}
@media (width > 800px) and (max-height: 460px) {
  .study-rail .study-art { max-height: 47svh; }
}

/* On small screens the wire sculptures live inside the page and project artwork. */
@media (max-width: 800px) {
  .study-rail .study-art { max-height: none; height: clamp(180px, 55vw, 280px); aspect-ratio: auto; background: none; }
  .study-rail .study-canvas { display: block; }
  .study-rail .study.is-rendered .study-still { visibility: hidden; }
  .study-rail .study-caption { display: flex; justify-content: flex-end; min-height: 44px; border: 0; background: transparent; padding: 0; }
  .study-rail .study-title, .study-rail .shape-controls { display: none; }
  .study-rail .motion-control { color: #594a3b; border-color: #bfb5a5; border-radius: 50%; }
  .study-rail .motion-control:hover { background: #e9e2d7; }

}

.mobile-wire-stage, .gallery-controls { display: none; }
@media (max-width: 800px) {
  .project-gallery { position: relative; --gallery-art-height: clamp(210px, 66vw, 310px); }
  .showcase-work .work-grid {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    gap: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  .showcase-work .work-grid::-webkit-scrollbar { display: none; }
  .showcase-work .project {
    min-width: 0;
    border: 0;
    border-radius: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
  .showcase-work .project:focus-within { outline-offset: -3px; }
  .showcase-work .work-grid:focus-visible { outline: 2px solid #bb482f; outline-offset: 4px; }
  .showcase-work .project-art { height: var(--gallery-art-height); aspect-ratio: auto; }
  .showcase-work .project-info { align-items: flex-start; padding: 24px 20px 26px; gap: 12px; }
  .showcase-work .project-arrow { width: 38px; height: 38px; margin-top: 8px; }
  .showcase-work .project-info h3 { font-size: clamp(1.55rem, 7vw, 2rem); }
  .showcase-work .project-info p:last-child { font-size: .92rem; line-height: 1.55; }
  .has-wire-gallery .project-art { visibility: hidden; }
  .has-wire-gallery .mobile-wire-stage {
    display: block;
    position: absolute;
    inset: 1px 1px auto;
    height: var(--gallery-art-height);
    z-index: 2;
    border-radius: 9px 9px 0 0;
    overflow: hidden;
    pointer-events: none;
    background: #14231e;
    transition: background-color 300ms ease;
  }
  .mobile-wire-stage[data-artwork="blackjack"] { background-color: #231d2c; }
  .mobile-wire-stage[data-artwork="blockdrop"] { background-color: #172c3b; }
  .mobile-wire-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 48%, #d4e5c610, transparent 72%);
  }
  .mobile-wire-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
  .gallery-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin: 12px 0 28px; }
  .gallery-hint { font: 600 .61rem/1.4 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
  .gallery-hint span { font-size: .9rem; margin-left: 5px; }
  .gallery-navigation { display: flex; align-items: center; gap: 3px; }
  .gallery-navigation button { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: transparent; cursor: pointer; font-size: 1.15rem; }
  .gallery-navigation button:hover:not(:disabled) { background: #e9e2d7; }
  .gallery-navigation button:disabled { opacity: .28; cursor: default; }
  .gallery-navigation .gallery-motion { border-color: transparent; margin-right: 4px; }
  .gallery-motion svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
  .gallery-count { min-width: 47px; text-align: center; color: var(--muted); font: 500 .66rem/1 var(--mono); letter-spacing: .02em; }
}
@media (max-width: 370px) {
  .gallery-hint { flex-basis: 100%; }
  .gallery-navigation { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-wire-stage { transition: none !important; }
}
