/* ------------------------------------------------------------------
   Product showcase — one product at a time: a circular specimen visual
   that trades sides with the details panel, driven by a pill switcher.

   Without JS every product is listed in full. With JS (html.js) the
   section becomes a scroll track: the content pins to the viewport and
   each --showcase-step of scrolling advances one product.
------------------------------------------------------------------ */

/* Registered so the accent and glow position can transition smoothly. */
@property --accent {
  syntax: "<color>";
  inherits: true;
  initial-value: #d6ae6a;
}
@property --glow-x {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 100%;
}

.products {
  --showcase-count: 5;
  --showcase-step: 70vh;
  --accent: #d6ae6a;
  --glow-x: 100%;
  --ease-spring: cubic-bezier(0.3, 1.25, 0.4, 1);

  overflow: clip;
  isolation: isolate;
  transition: --accent 1.2s var(--ease-out), --glow-x 1.2s var(--ease-out);
}

.products:has(.showcase__stage.is-flipped) { --glow-x: 0%; }

/* ---------- Scroll track (JS) ----------------------------------------- */
/* Track = one pinned screen + a step per product + one more screen during
   which the next section (Global Sourcing) slides up over the pinned
   products. That cover length must equal the sticky height. */
.js .products {
  --showcase-screen: 100vh;
  height: calc(2 * var(--showcase-screen) + var(--showcase-count) * var(--showcase-step));
  padding-block: 0;
  /* The pinned layout already clears the fixed header. */
  scroll-margin-top: 0;
}
@supports (height: 100svh) {
  .js .products { --showcase-screen: 100svh; }
}
.js .showcase__sticky {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: var(--showcase-screen);
  /* --cover (0→1, set by JS) as the next section slides over: recede. */
  transform: scale(calc(1 - var(--cover, 0) * 0.06));
  transform-origin: 50% 30%;
  padding-top: calc(var(--header-h) + clamp(12px, 3vh, 40px));
  padding-bottom: clamp(16px, 3.5vh, 36px);
}
.js .showcase__sticky > .container {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.js .products .section__head {
  gap: 10px;
  margin-bottom: 0;
}
.js .products .section__title { font-size: clamp(28px, 2.8vw, 42px); }
.js .showcase__stage {
  flex: 1;
  min-height: 0;
}
.js .showcase__sticky::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: var(--color-bg);
  opacity: calc(var(--cover, 0) * 0.7);
}

.showcase__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--glow-x) 55%,
    color-mix(in srgb, var(--accent) 15%, transparent),
    transparent 50%
  );
}

/* ---------- Stage ---------------------------------------------------- */
.showcase__stage {
  display: grid;
  grid-template-columns: auto minmax(0, 30rem);
  align-items: center;
  justify-content: center;
  gap: clamp(64px, 10vw, 180px);
}
/* RTL: the visual starts on the right; flipped puts it on the left. */
.showcase__stage.is-flipped .showcase__visual { order: 2; }

/* ---------- Visual --------------------------------------------------- */
.showcase__visual {
  position: relative;
  width: clamp(240px, min(32vw, 50svh), 440px);
  aspect-ratio: 1;
  margin-bottom: 40px; /* room for the status pill */
}

.showcase__ring {
  position: absolute;
  inset: -14%;
  border: 1px dashed rgb(255 255 255 / 0.16);
  border-inline-start-color: color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 50%;
  animation: showcase-spin 20s linear infinite;
}

.showcase__aura {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 20%, #000));
  filter: blur(42px);
  opacity: 0.32;
  animation: showcase-breathe 4s ease-in-out infinite;
}

.showcase__disc {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.06);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 32%, rgb(255 255 255 / 0.06), rgb(0 3 11 / 0.6) 72%);
  box-shadow: 0 40px 90px rgb(0 0 0 / 0.55);
}

.showcase__float {
  position: absolute;
  inset: 0;
  animation: showcase-float 6s ease-in-out infinite;
}

/* Product photo. Slightly over-scaled so the float never reveals its edge;
   the photo's own navy studio backdrop blends into the disc. */
.showcase__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  scale: 1.06;
  user-select: none;
  -webkit-user-drag: none;
}
.js .showcase__art { visibility: hidden; }
.js .showcase__art.is-active,
.js .showcase__art.is-leaving { visibility: visible; }

.showcase__status {
  position: absolute;
  top: calc(100% + 28px);
  left: 50%;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid rgb(255 255 255 / 0.06);
  border-radius: 999px;
  background: rgb(0 3 11 / 0.8);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-text-muted);
}
.showcase__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: showcase-pulse 2s ease-in-out infinite;
}

/* ---------- Details -------------------------------------------------- */
.showcase__panels {
  display: grid;
  gap: 96px;
}
.js .showcase__panels > .product { grid-area: 1 / 1; }
.js .product { visibility: hidden; }
.js .product.is-active,
.js .product.is-leaving { visibility: visible; }

.product__kicker {
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: right;
  color: var(--color-text-muted);
}
.product__kicker span { opacity: 0.5; }

.product__title {
  font-size: clamp(38px, 4vw, 56px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: right;
  color: transparent;
  background: linear-gradient(to bottom, #fff 30%, #8d96a6);
  -webkit-background-clip: text;
  background-clip: text;
}

.product__title sup {
  font-size: 0.38em;
  font-weight: 400;
  vertical-align: 1.4em;
  line-height: 0;
  margin-inline: 0.04em 0.12em;
}

.product__label {
  margin-top: 12px;
  font-size: clamp(18px, 1.5vw, 22px);
  font-weight: 300;
  color: color-mix(in srgb, var(--accent) 55%, var(--color-text));
}

.product__desc {
  max-width: 36ch;
  margin: 16px 0 32px;
  font-size: 17px;
  line-height: 2;
  color: rgb(238 241 245 / 0.68);
}

.product__panel {
  padding: 6px 24px 22px;
  border: 1px solid rgb(255 255 255 / 0.07);
  border-radius: 18px;
  background: rgb(255 255 255 / 0.025);
}

.product__specs { margin: 0; }
.product__specs > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-line);
}
.product__specs dt {
  font-size: 14px;
  color: var(--color-text-muted);
}
.product__specs dd {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  text-align: end;
}
.product__specs dd[dir="ltr"] { text-align: left; }

.product__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-text);
  transition: color 0.3s;
}
.product__cta svg {
  width: 14px;
  height: 14px;
  transition: transform 0.35s var(--ease-out);
}
.product__cta:hover { color: color-mix(in srgb, var(--accent) 70%, #fff); }
.product__cta:hover svg { transform: translateX(-4px); }

/* ---------- Switcher ------------------------------------------------- */
.showcase__switcher {
  position: relative;
  z-index: 20;
  display: none;
  flex: none;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: clamp(10px, 2.5svh, 28px) auto 0;
  padding: 6px;
  gap: 4px;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 999px;
  background: rgb(8 12 22 / 0.88);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.6), 0 0 0 1px rgb(255 255 255 / 0.03);
}
.js .showcase__switcher { display: flex; }

.showcase__tab {
  position: relative;
  z-index: 1;
  min-width: 88px;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: none;
  font: 500 13px/1 var(--font-sans);
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: rgb(238 241 245 / 0.48);
  cursor: pointer;
  transition: color 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.showcase__tab:hover { color: rgb(238 241 245 / 0.8); }
.showcase__tab[aria-selected="true"] { color: var(--color-text); }
.showcase__tab:focus-visible { outline-offset: -2px; }

.showcase__indicator {
  position: absolute;
  inset-block: 6px;
  left: 0;
  width: var(--indicator-w, 0);
  translate: var(--indicator-x, 0) 0;
  border-radius: 999px;
  background: linear-gradient(to bottom, rgb(255 255 255 / 0.12), rgb(255 255 255 / 0.04));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08);
  transition: translate 0.55s var(--ease-spring), width 0.55s var(--ease-spring);
}
.showcase__indicator::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 24px;
  height: 2px;
  translate: -50% 0;
  border-radius: 2px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
}
.showcase__indicator.is-instant { transition: none; }

/* ---------- Motion --------------------------------------------------- */
@keyframes showcase-spin { to { rotate: 360deg; } }
@keyframes showcase-breathe { 50% { scale: 1.05; } }
@keyframes showcase-float {
  0%, 100% { translate: 0 -10px; }
  50% { translate: 0 10px; }
}
@keyframes showcase-pulse { 50% { opacity: 0.35; } }

/* ---------- Stacked (tablet portrait / phones) ------------------------ */
@media (max-width: 900px) {
  .showcase__stage {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    justify-items: center;
    gap: clamp(56px, 8svh, 88px);
  }
  .showcase__stage.is-flipped .showcase__visual { order: 0; }
  .showcase__visual { width: clamp(180px, min(60vw, 30svh), 340px); }
  .products { --showcase-step: 60vh; }
  .showcase__panels { width: 100%; max-width: 34rem; }
  .products,
  .products:has(.showcase__stage.is-flipped) { --glow-x: 50%; }
}

@media (max-width: 560px) {
  .showcase__switcher { gap: 0; padding: 4px; }
  .showcase__indicator { inset-block: 4px; }
  .showcase__tab {
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    font-size: 12px;
  }
  .product__panel { padding: 0 18px 14px; }
  .product__specs > div { padding: 11px 0; }
  .product__cta { margin-top: 14px; }
  .product__title { font-size: 32px; }
  .product__kicker { margin-bottom: 10px; }
  .product__label { margin-top: 8px; font-size: 17px; }
  .product__desc { margin: 10px 0 18px; font-size: 15px; line-height: 1.85; }
  .js .products .section__head { display: none; }
}

/* Short screens: the specs table gives way, the CTA stays. */
@media (max-height: 760px) and (max-width: 900px), (max-height: 640px) {
  .product__specs { display: none; }
  .product__panel { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .products { transition: none; }
  .showcase__ring,
  .showcase__aura,
  .showcase__float,
  .showcase__dot { animation: none; }
  .showcase__indicator { transition: none; }
}
