/* Explore different ways to style (includes/home_piece.html), round 15.
 * After the B2B style dial (business/css/r13-style-dial.css): the try-ons
 * sit stacked in one 3:4 frame and crossfade by opacity; the pieces of the
 * current look are framed, Ink for the blazer that stays, Signal for what
 * goes with it. Square corners, solid lines. Phones: controls, then the
 * try-on, then the pieces; from 1024 px the try-on on the left. */
.sw { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.sw-controls { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sw-controls[hidden] { display: none; }
.sw-stage { position: relative; aspect-ratio: 3 / 4; background: #F2F2F2; overflow: hidden; width: 100%; max-width: 520px; }
.sw-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; display: block;
  opacity: 0; transition: opacity .45s cubic-bezier(.2,0,0,1); }
.sw-img.is-on { opacity: 1; }
.sw-looks { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.sw-look { display: flex; flex-direction: column; gap: 16px; }
.sw-look[hidden] { display: none !important; }
.sw-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #121110; }
.sw-btn { position: relative; min-height: 48px; padding: 0 10px; background: #fff; color: #121110; font-size: 15px; font-weight: 500;
  border: 0; border-left: 1px solid #121110; cursor: pointer; transition: background-color .2s, color .2s; }
.sw-btn:first-child { border-left: 0; }
.sw-btn:hover { background: #F2F2F2; }
.sw-btn:focus-visible { outline: 2px solid #121110; outline-offset: 2px; z-index: 1; }
.sw-btn[aria-pressed="true"] { background: #121110; color: #fff; }
.sw-btn[aria-pressed="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #F5B82E; }
.sw-range { width: 100%; height: 32px; margin: 0; accent-color: #121110; cursor: pointer; }
.sw-pieces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; list-style: none; margin: 0; padding: 0; }
.sw-piece { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sw-pic { display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 4; background: #F2F2F2; overflow: hidden; }
.sw-pic img { width: 100%; height: 100%; object-fit: contain; display: block; mix-blend-mode: multiply; }
.sw-piece.is-anchor .sw-pic { outline: 2px solid #121110; outline-offset: -2px; }
.sw-piece.is-paired .sw-pic { outline: 3px solid #F5B82E; outline-offset: -3px; }
.sw-tag { position: absolute; top: 6px; left: 6px; padding: 2px 6px; font: 400 10px/1.4 'DM Mono', ui-monospace, monospace;
  text-transform: uppercase; letter-spacing: .08em; background: #121110; color: #fff; }
.sw-piece.is-paired .sw-tag { background: #F5B82E; color: #121110; }
.sw-name { font-size: 13px; line-height: 1.35; }
/* The change: the pieces enter one after another. */
.sw-look.is-entering .sw-piece.is-paired { animation: sw-in .42s cubic-bezier(.2,0,0,1) both; }
.sw-look.is-entering .sw-piece:nth-child(3) { animation-delay: .06s; }
.sw-look.is-entering .sw-piece:nth-child(4) { animation-delay: .12s; }
.sw-look.is-entering .sw-piece:nth-child(5) { animation-delay: .18s; }
@keyframes sw-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 1023px) {
  .sw-stage { margin: 0 auto; }
}
@media (min-width: 640px) {
  .sw-pieces { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .sw { grid-template-columns: minmax(0, 460px) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 56px; row-gap: 28px; }
  .sw-stage { grid-column: 1; grid-row: 1 / span 2; }
  .sw-controls { grid-column: 2; grid-row: 1; }
  .sw-looks { grid-column: 2; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .sw-img, .sw-btn { transition: none; }
  .sw-look.is-entering .sw-piece.is-paired { animation: none; }
}
