.gambeson-rack {
  --rack-height: 720px;
  width: 100%;
  min-height: var(--rack-height);
  overflow: hidden;
  color: #eee9df;
  background: radial-gradient(circle at 50% 18%, #454039 0%, #1c1a18 62%, #0e0d0c 100%);
  font-family: Georgia, "Times New Roman", serif;
}

.gr-stage {
  position: relative;
  min-height: var(--rack-height);
  isolation: isolate;
}

.gr-heading,
.gr-subheading {
  position: relative;
  z-index: 5;
  text-align: center;
}

.gr-heading {
  padding-top: 42px;
  font-size: clamp(28px, 4vw, 54px);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.gr-subheading {
  margin-top: 8px;
  color: #b9b1a2;
  font: 13px/1.4 Arial, sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.gr-rack-bar {
  position: absolute;
  z-index: 1;
  top: 190px;
  left: 8%;
  right: 8%;
  height: 18px;
  border-radius: 20px;
  background: linear-gradient(#7b6954, #2a211a 42%, #9a805f 58%, #32261c);
  box-shadow: 0 15px 22px rgba(0,0,0,.45), inset 0 2px 3px rgba(255,255,255,.24);
}

.gr-finial {
  position: absolute;
  top: -8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #604c38;
  box-shadow: inset 3px 3px 4px rgba(255,255,255,.2), inset -4px -4px 7px rgba(0,0,0,.45);
}

.gr-finial.left { left: -20px; }
.gr-finial.right { right: -20px; }

.gr-garments {
  position: absolute;
  z-index: 2;
  top: 205px;
  left: 8%;
  right: 8%;
  display: flex;
  justify-content: center;
  gap: clamp(8px, 3vw, 54px);
}

.gr-garment {
  position: relative;
  width: min(25vw, 220px);
  min-width: 130px;
  height: 455px;
  outline: none;
  cursor: pointer;
  transform-origin: 50% 0;
  transition: transform 520ms cubic-bezier(.2,.8,.2,1), filter 350ms ease;
}

.gr-garment:hover,
.gr-garment:focus,
.gr-garment.is-active {
  z-index: 10;
  transform: translateY(18px) translateZ(30px) rotateY(-5deg) rotateZ(1.5deg) scale(1.05);
  filter: brightness(1.12);
}

.gr-hook {
  position: absolute;
  z-index: 4;
  top: -15px;
  left: calc(50% - 7px);
  width: 14px;
  height: 45px;
  border: 5px solid #9c8a6d;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  transform: rotate(180deg);
  filter: drop-shadow(2px 4px 2px rgba(0,0,0,.55));
}

.gr-hanger {
  position: absolute;
  z-index: 3;
  top: 17px;
  left: 10%;
  width: 80%;
  height: 84px;
  border-top: 6px solid #9a8464;
  border-radius: 50% 50% 0 0;
  transform: perspective(250px) rotateX(-12deg);
  filter: drop-shadow(2px 6px 3px rgba(0,0,0,.5));
}

.gr-hanger span {
  position: absolute;
  left: 50%;
  top: -9px;
  width: 12px;
  height: 44px;
  border-left: 5px solid #9a8464;
  transform: translateX(-50%);
}

.gr-body {
  position: absolute;
  top: 58px;
  left: 18%;
  width: 64%;
  height: 335px;
  border-radius: 25px 25px 16px 16px;
  background:
    linear-gradient(100deg, rgba(255,255,255,.16), transparent 22%, transparent 71%, rgba(0,0,0,.25)),
    repeating-linear-gradient(92deg, rgba(255,255,255,.035) 0 2px, rgba(0,0,0,.035) 2px 5px),
    var(--garment-color);
  box-shadow: inset 8px 0 18px rgba(255,255,255,.06), inset -13px 0 22px rgba(0,0,0,.22), 0 22px 22px rgba(0,0,0,.42);
  transform: perspective(500px) rotateX(4deg);
}

.gr-collar {
  position: absolute;
  top: -14px;
  left: 22%;
  width: 56%;
  height: 45px;
  border: 12px solid color-mix(in srgb, var(--garment-color) 78%, black);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  background: #191715;
}

.gr-sleeve {
  position: absolute;
  top: 12px;
  width: 35%;
  height: 220px;
  background: var(--garment-color);
  box-shadow: inset 5px 0 9px rgba(255,255,255,.05), 0 12px 14px rgba(0,0,0,.3);
}

.gr-sleeve.left { left: -27%; transform: rotate(12deg); border-radius: 20px 8px 24px 18px; }
.gr-sleeve.right { right: -27%; transform: rotate(-12deg); border-radius: 8px 20px 18px 24px; }

.gr-hem {
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 24px;
  border-radius: 0 0 16px 16px;
  background: color-mix(in srgb, var(--garment-color) 75%, black);
}

.gr-logo {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--garment-accent);
  font: 700 22px Arial, sans-serif;
  letter-spacing: .12em;
  opacity: .8;
}

.gr-caption {
  position: absolute;
  top: 410px;
  left: -25%;
  width: 150%;
  text-align: center;
  opacity: .72;
  transition: opacity 300ms ease;
}

.gr-garment:hover .gr-caption,
.gr-garment:focus .gr-caption,
.gr-garment.is-active .gr-caption { opacity: 1; }

.gr-caption strong,
.gr-caption small { display: block; }
.gr-caption strong { font-size: 16px; }
.gr-caption small { margin-top: 6px; color: #b9b1a2; font: 11px Arial, sans-serif; }

.gr-rack-shadow {
  position: absolute;
  z-index: 0;
  left: 15%;
  right: 15%;
  bottom: 42px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  filter: blur(16px);
}

@media (max-width: 700px) {
  .gambeson-rack { --rack-height: 560px; }
  .gr-garments { left: 2%; right: 2%; gap: 0; }
  .gr-garment { min-width: 100px; height: 350px; transform: scale(.82); }
  .gr-garment:hover, .gr-garment:focus, .gr-garment.is-active { transform: translateY(12px) scale(.9); }
  .gr-body { height: 270px; }
  .gr-caption { top: 330px; }
  .gr-heading { padding-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .gr-garment { transition: none; }
}


.gr-photo {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 25px 25px 16px 16px;
  mix-blend-mode: normal;
  filter: saturate(.9) contrast(1.03);
}

.gr-body > .gr-collar,
.gr-body > .gr-logo,
.gr-body > .gr-sleeve,
.gr-body > .gr-hem {
  z-index: 2;
}


/* Actual transparent gambeson photographs */
.gr-garment .gr-photo {
  position: absolute;
  z-index: 6;
  top: -10px;
  left: -18%;
  width: 136%;
  height: 440px;
  object-fit: contain;
  object-position: center top;
  border: 0;
  border-radius: 0;
  background: transparent;
  mix-blend-mode: normal;
  filter: drop-shadow(0 12px 12px rgba(0,0,0,.28));
}
.gr-garment.has-real-photo .gr-body,
.gr-garment.has-real-photo .gr-hook,
.gr-garment.has-real-photo .gr-hanger {
  display: none;
}
@media (max-width: 700px) {
  .gr-garment .gr-photo {
    top: 0;
    left: -20%;
    width: 140%;
    height: 340px;
  }
}
