/* ==========================================================
   Work showcase — the shirt steps aside, the work takes the stage
   (driven by work-showcase.js)
   ========================================================== */

/* <html> already hides sideways overflow for the page. <body> also had
   overflow set, which turned it into its own (non-scrolling) scroll box and
   stopped position: sticky from working. Let the page scroll handle it. */
body { overflow: visible; }

.clients-section.work-showcase {
  display: block;
  height: auto;          /* JS sets the real scroll length on desktop */
  min-height: 100vh;
  padding: 0;
  position: relative;
}

.ws-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);   /* keep the long card row from widening the stage */
  box-sizing: border-box;
  padding: clamp(80px, 12vh, 108px) 0 clamp(16px, 3vh, 28px);
  pointer-events: auto;
}

/* ---------- header ---------- */
.ws-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 0 6vw;
}
.ws-eyebrow {
  margin: 0 0 10px;
  font: 600 12px/1 "Montserrat", sans-serif;
  letter-spacing: 0.28em;
  color: #e63946;
}
.ws-head h2 {
  margin: 0;
  font: 400 clamp(2rem, min(4.4vw, 7.2vh), 4.6rem)/0.98 "Anton", sans-serif;
  letter-spacing: 0.5px;
  color: #111;
}
.ws-head .ws-intro {
  margin: 14px 0 0;
  max-width: 460px;
  font: 500 15px/1.6 "Montserrat", sans-serif;
  color: #444;
}
.ws-counter {
  text-align: right;
  font-family: "Montserrat", sans-serif;
  color: #111;
  min-width: 240px;
}
.ws-counter-num {
  font: 400 clamp(2.6rem, min(6vw, 9vh), 6rem)/0.9 "Anton", sans-serif;
  letter-spacing: 1px;
}
.ws-counter-num .ws-total { color: #bbb; font-size: 0.45em; vertical-align: top; margin-left: 6px; }
.ws-counter-label {
  margin-top: 8px;
  max-width: 320px;
  margin-left: auto;
  font: 600 12px/1.45 "Montserrat", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666;
  min-height: 2.9em;
}

/* ---------- card track ---------- */
.ws-viewport {
  position: relative;
  display: flex;
  align-items: center;
  perspective: 1400px;
  min-height: 0;
  min-width: 0;
}
.ws-track {
  display: flex;
  gap: 3.2vw;
  padding: 0 6vw;
  will-change: transform;
  transform: translate3d(100vw, 0, 0);   /* waits off-screen until the shirt exits */
}
.ws-card {
  --tilt: 0deg;
  --lift: 0px;
  --scale: 1;
  --shift: 0%;
  flex: 0 0 auto;
  /* sized by both width and height so the row always fits the screen */
  width: clamp(240px, min(32vw, calc((100vh - 420px) * 1.333)), 600px);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  transform: translateY(var(--lift)) rotateY(var(--tilt)) scale(var(--scale));
  transform-style: preserve-3d;
  transition: transform 0.25s linear;
  font-family: "Montserrat", sans-serif;
  color: #111;
}
.ws-card-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 14px;
  background: #f1f1f1;
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.45);
}
.ws-card-media img {
  position: absolute;
  inset: 0 -8%;
  width: 116%;
  height: 100%;
  object-fit: cover;
  transform: translateX(var(--shift)) scale(1.02);
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ws-card:hover .ws-card-media img,
.ws-card:focus-visible .ws-card-media img { transform: translateX(var(--shift)) scale(1.09); }
.ws-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 45%);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.ws-card:hover .ws-card-media::after,
.ws-card:focus-visible .ws-card-media::after { opacity: 1; }
.ws-card-open {
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 1;
  font: 700 12px/1 "Montserrat", sans-serif;
  letter-spacing: 0.16em;
  color: #fff;
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.ws-card:hover .ws-card-open,
.ws-card:focus-visible .ws-card-open { transform: none; opacity: 1; }
.ws-card-meta {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin-top: 16px;
}
.ws-card-index {
  font: 400 22px/1 "Anton", sans-serif;
  color: #e63946;
}
.ws-card-text small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #777;
}
.ws-card-text strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.ws-card:focus-visible { outline: none; }
.ws-card:focus-visible .ws-card-media { outline: 2px solid #e63946; outline-offset: 4px; }

/* end card: invitation to the full gallery */
.ws-card.ws-card-end .ws-card-media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  color: #fff;
  font: 400 clamp(1.8rem, 2.6vw, 2.8rem)/1.05 "Anton", sans-serif;
  text-align: center;
  padding: 0 12%;
}
.ws-card.ws-card-end .ws-card-media span { position: relative; z-index: 1; }

/* progress line */
.ws-progress {
  position: absolute;
  left: 6vw;
  right: 6vw;
  bottom: -16px;
  height: 2px;
  background: rgba(0, 0, 0, 0.08);
}
.ws-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: #e63946;
  transform-origin: left center;
  transform: scaleX(0);
}

.work-showcase:not(.ws-in) .ws-progress { opacity: 0; }
.ws-progress { transition: opacity 0.5s ease; }
@media (max-height: 760px) and (min-width: 901px) {
  .ws-head .ws-intro { display: none; }
  .ws-counter-label { min-height: 0; }
}

/* ---------- footer: logos + all work ---------- */
.ws-foot {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px 6vw 0;
}
.ws-foot .clients-slider { margin-top: 0; flex: 1; min-width: 0; }
.ws-foot .client-logo img { max-height: 44px; }
.ws-foot .vbtn-wrap { padding: 6px; margin-top: 0; flex: 0 0 auto; }

/* ---------- entrance (JS adds .ws-in) ---------- */
.ws-reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.work-showcase.ws-in .ws-reveal { opacity: 1; transform: none; }
.work-showcase.ws-in .ws-reveal.d2 { transition-delay: 0.08s; }
.work-showcase.ws-in .ws-reveal.d3 { transition-delay: 0.16s; }

/* ---------- mobile & small screens: vertical stack ---------- */
@media (max-width: 900px) {
  .ws-stage {
    position: relative;
    height: auto;
    overflow: visible;
    display: block;
    padding: 90px 0 40px;
  }
  .ws-head { display: block; padding: 0 6vw; text-align: left; }
  .ws-head h2 { font-size: 2.4rem; }
  .ws-head .ws-intro { font-size: 13px; }
  .ws-counter { display: none; }
  .ws-viewport { display: block; perspective: none; margin-top: 26px; }
  .ws-track { flex-direction: column; gap: 34px; padding: 0 6vw; transform: none !important; }
  .ws-card { width: 100%; transform: none; opacity: 0; translate: 0 40px; transition: opacity 0.6s ease, translate 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .ws-card.ws-seen { opacity: 1; translate: 0 0; }
  .ws-card-media { max-height: none; }
  .ws-card-media img { inset: 0; width: 100%; transform: none !important; }
  .ws-card-open { transform: none; opacity: 1; }
  .ws-card-media::after { opacity: 0.7; }
  .ws-progress { display: none; }
  .ws-foot { flex-direction: column; align-items: stretch; padding-top: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .ws-card, .ws-card-media img, .ws-reveal { transition: none; }
  .ws-card { translate: none; opacity: 1; }
}
