/* ============================================================
   PIECE — the product page and its configurator
   ============================================================ */

.slab-piece{ min-height: 0; }

.piece-view{
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(26px, 4vw, 64px);
  padding: clamp(14px, 2.4vw, 34px) clamp(18px, 3vw, 44px) clamp(34px, 4vw, 60px);
}

/* — the stage the piece stands on — */

.piece-stage{
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(300px, 40vw, 520px);
}
.piece-blob{
  position: relative;
  inset: auto;
  width: min(100%, 520px);
  aspect-ratio: 1 / .92;
  animation: morph-b 21s ease-in-out infinite;
}
.piece-blob .piece-art{
  width: 78%;
  margin-bottom: 8%;
  /* the colour change should read as a material swap, not a flicker */
  transition: opacity .18s var(--ease);
}
.piece-stage.is-swapping .piece-art{ opacity: .55; }

.stage-note{
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  color: var(--on-dark-faint);
}

/* — the detail column — */

.piece-detail{ max-width: 520px; }

.piece-detail .eyebrow{ margin-bottom: 14px; }
.dot-mark{
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--clay-soft);
  box-shadow: 0 0 0 4px rgba(200, 148, 104, .14);
}

.piece-title{
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.2rem, 4.6vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -.02em;
}
.piece-price{
  margin: 12px 0 0;
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--clay-soft);
  font-variant-numeric: tabular-nums;
}
.piece-detail .lead{ margin-top: 20px; opacity: 1; }

/* — swatches — */

.config-set{ margin-top: clamp(20px, 2.4vw, 28px); }
.config-set .label{ margin: 0 0 12px; color: var(--on-dark-faint); }

.dots{ display: flex; flex-wrap: wrap; gap: 10px; }
.dot{
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease);
}
.dot::after{
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: border-color .35s var(--ease);
}
.dot:hover{ transform: scale(1.08); }
.dot.is-on::after{ border-color: var(--bone-hi); }

.config-chosen{
  margin: 12px 0 0;
  font-size: .86rem;
  color: var(--on-dark-mute);
}

.piece-foot{
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line-dark);
  font-size: .8rem;
  line-height: 1.6;
  color: var(--on-dark-faint);
}

.u-hide{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* — specification band — */

.spec-band{
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(26px, 4vw, 68px);
}
.spec-copy .sec-label{ display: block; margin-bottom: 18px; color: var(--on-light-mute); }
.spec-copy h2{ margin-bottom: 24px; }
.spec-list-wide{ margin-bottom: 0; }

.spec-notes{
  display: grid;
  gap: clamp(14px, 1.8vw, 22px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.spec-notes li{
  padding: clamp(20px, 2.4vw, 28px);
  border-radius: clamp(16px, 1.8vw, 22px);
  background: var(--bone-hi);
  border: 1px solid var(--line-light);
}
.spec-notes h3{
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.28rem;
  line-height: 1.16;
}
.spec-notes p{
  margin: 0;
  font-size: .88rem;
  line-height: 1.62;
  color: var(--on-light-mute);
}

@media (max-width: 1080px){
  .piece-view{ grid-template-columns: 1fr; }
  .piece-detail{ max-width: 100%; }
  .piece-stage{ min-height: clamp(280px, 52vw, 420px); }
  .stage-note{ position: static; margin-top: 12px; }
  .spec-band{ grid-template-columns: 1fr; }
}

@media (max-width: 460px){
  .dot{ width: 32px; height: 32px; }
  .piece-view .btn-solid,
  .piece-view .btn-glass{ flex: 1 1 100%; justify-content: center; }
}

/* ============================================================
   ASSEMBLY — the chair built stage by stage on scroll
   ============================================================ */

.assembly-body{
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .82fr);
  gap: clamp(26px, 4vw, 72px);
  align-items: start;
}

.assembly-stage{
  position: sticky;
  top: 14vh;
}
.assembly-frame{
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / .94;
  border-radius: clamp(18px, 2vw, 28px);
  overflow: hidden;
  background: radial-gradient(74% 64% at 42% 22%, #EFE9DE, #D9CDB9 64%, #C6B79E);
}
.assembly-frame::after{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 180px 180px;
  opacity: .1;
  mix-blend-mode: multiply;
}
.assembly-art{
  position: relative;
  z-index: 1;
  width: 74%;
}

/* every layer waits its turn */
.a-layer{
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity .7s var(--ease-out),
    transform .7s var(--ease-out);
}
.a-layer.is-on{ opacity: 1; transform: none; }
/* the dashed drawing fades back out once the timber arrives */
.assembly-frame[data-at="3"] .a-layer[data-layer="1"] path,
.assembly-frame[data-at="3"] .a-layer[data-layer="1"] rect,
.assembly-frame[data-at="4"] .a-layer[data-layer="1"] path,
.assembly-frame[data-at="4"] .a-layer[data-layer="1"] rect{ opacity: 0; transition: opacity .6s var(--ease); }

.assembly-caption{
  position: absolute;
  z-index: 2;
  inset-inline-start: 18px;
  bottom: 16px;
  margin: 0;
  padding: 8px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  color: var(--espresso);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.assembly-steps{
  display: grid;
  gap: clamp(20px, 3vw, 34px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.a-step{
  padding: clamp(20px, 2.4vw, 30px) 0;
  border-top: 1px solid var(--line-light);
  opacity: .34;
  transition: opacity .55s var(--ease);
}
.a-step.is-live{ opacity: 1; }
.a-step h3{
  margin: 12px 0 10px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.1;
  letter-spacing: -.01em;
}
.a-step p{
  max-width: 46ch;
  margin: 0;
  font-size: .94rem;
  line-height: 1.66;
  color: var(--on-light-mute);
}

@media (max-width: 860px){
  .assembly-body{ grid-template-columns: 1fr; }
  .assembly-stage{
    top: 8px;
    z-index: 3;
    margin-bottom: 8px;
  }
  .assembly-frame{ aspect-ratio: 3 / 2; }
  .assembly-art{ width: 46%; }
  .a-step{ opacity: 1; }
}

@media (prefers-reduced-motion: reduce){
  .assembly-stage{ position: static; }
  .a-layer{ opacity: 1; transform: none; }
  .a-step{ opacity: 1; }
}

/* — print action — */

.sheet-actions{ margin-top: 18px; }
.sheet-btn{
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--line-dark);
  font-size: .8rem;
  font-weight: 500;
  color: var(--on-dark-mute);
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.sheet-btn:hover{ border-color: var(--glass-edge); color: var(--on-dark); }
