/* =========================================================
   Collection page — 3D slider (sizes copied from the reference)
   ========================================================= */

.slider {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: pan-y;
  z-index: 0;
}

/* ---------- Title ---------- */
.slider__title {
  position: absolute;
  top: 80px;
  left: 24px;
  z-index: 3;
  max-width: 10ch;
  margin: 0;
  font-size: clamp(40px, 4.45vw, 64px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.01em;
  opacity: 0;
  animation: fadeIn .9s var(--ease) .2s forwards;
}
@media (min-width: 1050px) {
  .slider__title { top: 64px; left: 32px; }
}

/* ---------- Pieces ---------- */
.slider__wrapper {
  --base-size: 225px;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (min-width: 800px)  { .slider__wrapper { --base-size: 350px; } }
@media (min-width: 1200px) { .slider__wrapper { --base-size: 450px; } }
@media (min-width: 1600px) { .slider__wrapper { --base-size: 550px; } }

/* soft white fades in the corners on very large screens, like the reference */
@media (min-width: 1920px) {
  .slider__wrapper::before,
  .slider__wrapper::after {
    content: "";
    position: absolute;
    z-index: 9999;
    pointer-events: none;
  }
  .slider__wrapper::before {
    left: 0; bottom: 0; width: 60vw; height: 75vh;
    -webkit-mask-image: radial-gradient(ellipse at bottom left, black 60%, transparent 75%);
            mask-image: radial-gradient(ellipse at bottom left, black 60%, transparent 75%);
    background-image: linear-gradient(25deg, #fff, #fffc, #fff9 10%, #fff3, #fff0 70%);
  }
  .slider__wrapper::after {
    right: 0; top: 0; width: 75vw; height: 50vh;
    -webkit-mask-image: radial-gradient(ellipse at top right, black 60%, transparent 75%);
            mask-image: radial-gradient(ellipse at top right, black 60%, transparent 75%);
    background-image: linear-gradient(195deg, #fff, #fffc, #fff9 10%, #fff3, #fff0 70%);
  }
}

.piece {
  --cursor: grab;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--base-size);
  height: calc(var(--base-size) * 1.2);
  cursor: var(--cursor);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  opacity: 0;
  will-change: transform, opacity;
}
.piece.is-active { --cursor: pointer; }
.slider.is-dragging .piece:not(.is-active) { --cursor: grabbing; }

.piece__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  cursor: var(--cursor);
  -webkit-user-drag: none;
}
.piece__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
}
/* spinning clothes: all views stacked, the script fades between them */
.piece__spin {
  position: relative;
  width: 100%;
  height: 100%;
  transform: scale(1.14);   /* the spin pictures keep one size per piece, so give them a bit more room */
}
.piece__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  user-select: none;
}
.piece__frame:first-child { opacity: 1; }
.piece.is-active.has-spin { --cursor: grab; }
.slider.is-spinning,
.slider.is-spinning .piece.is-active { cursor: grabbing; --cursor: grabbing; }

/* placeholder until the real pictures arrive: a black square */
.piece__placeholder {
  width: var(--base-size);
  height: var(--base-size);
  background: #111;
}

/* ---------- Artist + title ---------- */
.slider__info {
  position: absolute;
  bottom: 80px;
  left: 24px;
  right: 24px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
  user-select: none;
}
.slider__info-line {
  margin: 0;
  clip-path: inset(0);
  font-size: 18px;
  line-height: 1.15;
}
.slider__info-line span { display: block; }
.slider__info-line--artist { font-weight: 600; }

@media (min-width: 768px) {
  .slider__info { left: auto; right: 32px; align-items: flex-end; }
  .slider__info-line { font-size: 20px; text-align: right; }
}

/* ---------- Prev / next buttons ---------- */
.slider__controls {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 32px;
  pointer-events: none;
}
@media (min-width: 768px) { .slider__controls { display: flex; } }
/* on phones dragging the middle piece spins it, so keep small arrows for changing piece */
@media (max-width: 767px) { .slider__controls { display: flex; padding: 12px; } }

.slider__btn {
  position: relative;
  width: 32px;
  height: 32px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  pointer-events: auto;
  transition: border-color .25s var(--ease), opacity .6s var(--ease);
}
.slider__btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M5 12h13M13 6.5l5.5 5.5-5.5 5.5'/%3E%3C/svg%3E") center / 24px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M5 12h13M13 6.5l5.5 5.5-5.5 5.5'/%3E%3C/svg%3E") center / 24px no-repeat;
}
.slider__btn--prev::before { transform: scaleX(-1); }
.slider__btn:hover, .slider__btn:focus-visible { border-color: rgba(34, 34, 34, .5); outline-offset: 4px; }
.slider__btn:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- Bottom bar (same shape as the top menu) ---------- */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 10;
  width: min(396px, calc(100vw - 2 * var(--gutter)));
  transform: translate(-50%, 100%);
  background: var(--panel);
  color: #fff;
  animation: barUp .9s var(--ease) .1s forwards;
}
.bottom-bar__text {
  margin: 0;
  display: flex;
  align-items: center;
  height: 66px;
  padding: 0 24px;
  font-size: 18px;
}
@keyframes barUp { to { transform: translate(-50%, 0); } }

/* ---------- "Drag to rotate" hint under the middle piece (same look as the piece pages) ---------- */
.slider__hint {
  position: absolute;
  left: 50%;
  bottom: 96px;               /* just above the bottom bar */
  z-index: 2;
  margin: 0;
  transform: translateX(-50%);
  font-size: 13px;
  letter-spacing: .04em;
  color: #777;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  animation: fadeIn .8s var(--ease) 1s forwards;
  transition: opacity .4s var(--ease);
}
.slider.is-spinning .slider__hint { opacity: 0; animation: none; }
/* phones: the piece name sits bottom-left, so put the hint just under the clothes instead */
@media (max-width: 767px) {
  .slider__hint { bottom: auto; top: calc(50% + 150px); }
}
