/* Round-15 visuals of the B2B home (business/includes/r15_hero_look.html and
 * r13_problem.html). Ink & Signal: square cards, white product grounds, signal
 * yellow only on the anchor product. */

/* ---- Hero: a look created for one product ------------------------------- *
 * The stage is 554 x 438 units; every card is placed in per cent of it, so the
 * picture scales as one. data-step="3" (the markup's default) is the end state:
 * the product, its pieces in a 2x2 and the visualisation beside them. Steps 1
 * and 2 exist only while the script plays (.is-play). */
.r15-hl { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.r15-hl-stage { position: relative; aspect-ratio: 554 / 438; width: 100%; }
.r15-hl-stage:focus { outline: none; }
.r15-hl-card, .r15-hl-look { position: absolute; margin: 0; overflow: hidden; background: #fff;
  transition: left .9s cubic-bezier(.2, .8, .2, 1), top .9s cubic-bezier(.2, .8, .2, 1),
    width .9s cubic-bezier(.2, .8, .2, 1), height .9s cubic-bezier(.2, .8, .2, 1),
    opacity .6s ease, transform .9s cubic-bezier(.2, .8, .2, 1); }
.r15-hl-card img, .r15-hl-look img { display: block; width: 100%; height: 100%; object-fit: cover; }
.r15-hl-anchor { z-index: 2; box-shadow: 0 0 0 3px #F5B82E; }
.r15-hl-tag { position: absolute; left: 0; top: 0; padding: 3px 7px; background: #F5B82E; color: #121110;
  font: 400 11px/1.3 'DM Mono', ui-monospace, monospace; letter-spacing: .04em; white-space: nowrap; }
.r15-hl-look .r15-hl-tag { background: #121110; color: #fff; }

/* End state (step 3) */
.r15-hl-anchor { left: 0; top: 0; width: 38.09%; height: 48.17%; }
.r15-hl-piece { width: 18.05%; height: 22.83%; }
.r15-hl-p1 { left: 0; top: 51.83%; }
.r15-hl-p2 { left: 20.04%; top: 51.83%; }
.r15-hl-p3 { left: 0; top: 77.17%; }
.r15-hl-p4 { left: 20.04%; top: 77.17%; }
.r15-hl-look { left: 40.97%; top: 0; width: 59.03%; height: 100%; background: #F2F2F2; }

/* Steps 1 and 2: the product alone in the middle, then the pieces around it */
.is-play[data-step="1"] .r15-hl-anchor, .is-play[data-step="2"] .r15-hl-anchor {
  left: 31.95%; top: 27.17%; width: 36.1%; height: 45.66%; }
.is-play[data-step="1"] .r15-hl-piece, .is-play[data-step="2"] .r15-hl-piece { width: 21.66%; height: 27.4%; }
.is-play[data-step="1"] .r15-hl-p1, .is-play[data-step="2"] .r15-hl-p1 { left: 7.22%; top: 4.57%; }
.is-play[data-step="1"] .r15-hl-p2, .is-play[data-step="2"] .r15-hl-p2 { left: 71.12%; top: 4.57%; }
.is-play[data-step="1"] .r15-hl-p3, .is-play[data-step="2"] .r15-hl-p3 { left: 7.22%; top: 68.04%; }
.is-play[data-step="1"] .r15-hl-p4, .is-play[data-step="2"] .r15-hl-p4 { left: 71.12%; top: 68.04%; }
.is-play[data-step="1"] .r15-hl-piece { opacity: 0; }
.is-play[data-step="1"] .r15-hl-p1 { transform: translate(-60%, -60%) scale(.8); }
.is-play[data-step="1"] .r15-hl-p2 { transform: translate(60%, -60%) scale(.8); }
.is-play[data-step="1"] .r15-hl-p3 { transform: translate(-60%, 60%) scale(.8); }
.is-play[data-step="1"] .r15-hl-p4 { transform: translate(60%, 60%) scale(.8); }
.is-play[data-step="2"] .r15-hl-p1 { transition-delay: 0s; }
.is-play[data-step="2"] .r15-hl-p2 { transition-delay: .14s; }
.is-play[data-step="2"] .r15-hl-p3 { transition-delay: .28s; }
.is-play[data-step="2"] .r15-hl-p4 { transition-delay: .42s; }
.is-play[data-step="1"] .r15-hl-look, .is-play[data-step="2"] .r15-hl-look { opacity: 0; transform: scale(.96); }
.is-play[data-step="3"] .r15-hl-look { transition-delay: .35s; }
.r15-hl-stage.is-jump .r15-hl-card, .r15-hl-stage.is-jump .r15-hl-look { transition: none; }

/* The three steps under the stage; the playing one in Signal */
.r15-hl-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.r15-hl-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; flex: 1; margin: 0; padding: 0; list-style: none; }
.r15-hl-steps li { border-top: 2px solid #3A3835; padding-top: 7px; font-size: 13px; line-height: 1.35; color: #B5B2AE;
  transition: color .4s ease, border-color .4s ease; }
.r15-hl-steps li.is-done { color: #fff; border-top-color: #B5B2AE; }
.r15-hl-steps li[aria-current="step"] { color: #fff; border-top-color: #F5B82E; }
.r15-hl-n { display: block; font: 400 11px/1.3 'DM Mono', ui-monospace, monospace; color: #F5B82E; margin-bottom: 2px; }
.r15-hl-replay { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; margin-top: -10px;
  background: none; border: 0; color: #fff; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.r15-hl-replay:hover { color: #F5B82E; }
.r15-hl-replay.is-wait { visibility: hidden; }
.r15-hl-replay:focus-visible { outline: 2px solid #F5B82E; outline-offset: 2px; }
@media (max-width: 639px) {
  .r15-hl-tag { font-size: 11px; padding: 2px 5px; }
  .r15-hl-foot { flex-direction: column; align-items: stretch; gap: 4px; }
  .r15-hl-steps { gap: 8px; }
  .r15-hl-steps li { font-size: 12px; }
  .r15-hl-replay { align-self: flex-end; margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .r15-hl-card, .r15-hl-look, .r15-hl-steps li { transition: none; }
}

/* ---- The paradox of choice: the endless grid against three looks -------- */
.r15-pc-grid { position: relative; overflow: hidden; border: 1px solid #E6E4E1; background: #fff; }
.r15-pc-grid img { display: block; width: 100%; height: auto; }
.r15-pc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 10px; border-bottom: 1px solid #E6E4E1;
  font-size: 12px; }
.r15-pc-bar span { border: 1px solid #8E8A85; padding: 0 6px; }
.r15-pc-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 28%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff); pointer-events: none; }
.r15-pc-anchor { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: center; }
.r15-pc-anchor img { display: block; width: 72px; height: 72px; background: #fff; box-shadow: 0 0 0 3px #F5B82E; }
.r15-pc-looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.r15-pc-look { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.r15-pc-look > img { display: block; width: 100%; height: auto; aspect-ratio: 896 / 1200; object-fit: cover; background: #F2F2F2; }
.r15-pc-pieces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.r15-pc-pieces img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; background: #fff; }
.r15-pc-name { font: 400 12px/1.3 'DM Mono', ui-monospace, monospace; color: #F5B82E; }
@media (max-width: 639px) {
  .r15-pc-looks { gap: 8px; }
  .r15-pc-pieces { gap: 3px; }
  .r15-pc-anchor { grid-template-columns: 56px minmax(0, 1fr); }
  .r15-pc-anchor img { width: 56px; height: 56px; }
}
