/* =========================================================
   İSTANBUL PİLİÇ — SHOWCASE
   Six products on one pinned, scrubbed stage.
   Spec: Figma "Showcase — Motion Spec"
   · stage bg butter/50 · diamond hairline frame
   · garnish particles (sparkle / daisy / burst / pebble / ring)
   · split-flap terminal (title top-left, detail card bottom-left)
   · detail card = "The Tag", 3 colorways (A sage / B forest / C coral)
   Motion lives in js/showcase.js — everything here is
   transform/filter/opacity-friendly (GPU-composited, no layout).
   ========================================================= */

/* The section (and the ScrollTrigger pin-spacer that wraps it, which
   inherits the -38vh overlap) rides up over the hero and z-above it, so the
   whole stage is click-transparent — only the detail card opts back in. */
.pin-spacer:has(> .showcase) {
  pointer-events: none;
}

.showcase {
  position: relative;
  z-index: 6;               /* above the hero so product 01 can dolly through the seam */
  pointer-events: none;
  background: var(--neutral-100);
  /* the on-screen length of every product's LONG side. Horizontal shots are
     pinned by width, vertical shots by height, both to this value — so a
     900-wide shot and a 900-tall shot read at the same scale (the vertical's
     height equals the horizontal's width). */
  --sc-size: min(62vh, 50vw);
}

/* Pull the stage up under the hero's faded tail: the hero content is fully
   faded by ~50% of its scroll, so don't make the user ride an empty 40vh
   before the pin engages. Transparent here — the page is one paper surface,
   and the section must not cover the hero's bottom-anchored heading at rest.
   The same pinned engine now runs on every width, so the hero→showcase seam
   is identical on mobile — apply the overlap there too (previously desktop
   only, which left a long empty scroll after the hero on phones). */
.showcase {
  margin-top: -38vh;
  background: transparent;
}

.sc-stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: visible;        /* entries/exits fly beyond the viewport edges */
}

/* ---------- the heart: diamond + product (spirals away as one on X1 exits) ---------- */
.sc-heart {
  position: absolute;
  inset: 0;
  z-index: 2;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  /* purely visual — product 01 dollies up through the hero seam, and this
     full-bleed layer must not eat clicks meant for the hero (e.g. the reel) */
  pointer-events: none;
}

.sc-products {
  position: absolute;
  inset: 0;
}

.sc-product {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  will-change: transform, opacity;
  pointer-events: none;
}

.sc-product-float {
  will-change: transform;
}

/* Horizontal shots (default): the long side is the WIDTH. */
.sc-product img {
  width: var(--sc-size);
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  will-change: filter;
  user-select: none;
  -webkit-user-drag: none;
}

/* Vertical shots: the long side is the HEIGHT — set to the same --sc-size so
   the height of a vertical product matches the width of a horizontal one, and
   all six read at one consistent size on screen. */
.sc-product--v img {
  width: auto;
  height: var(--sc-size);
  max-width: 48vw;
}

/* ---------- garnish particles — 3 parallax float layers ---------- */
.sc-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.sc-p {
  position: absolute;
  left: 50%;
  top: 50%;
  opacity: 0;
  will-change: transform, opacity;
}

.sc-p svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sc-p-float {
  width: 100%;
  height: 100%;
  will-change: transform;
}

/* ---------- macro wipe — a garnish piece at extreme close-up ---------- */
.sc-wipe {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: visible;
  pointer-events: none;
}

.sc-wipe-shape {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 170vmin;
  height: 170vmin;
  margin: -85vmin 0 0 -85vmin;
  color: var(--butter-200);
  opacity: 0;
  will-change: transform, opacity;
}

/* ---------- progress rail — one mark per product, right edge ----------
   A stack of hairlines, one per product. The active mark widens and warms
   to coral; the marks below it are the products still to come, so the rail
   reads at a glance as "how many are left". Absolute inside the pinned
   stage, so it holds its place through the whole scrubbed sequence. */
.sc-progress {
  position: absolute;
  right: var(--pad-side);
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 15px;
  opacity: 0;
  transition: opacity 0.5s var(--ease-soft);
  pointer-events: none;
}

.sc-progress.is-visible {
  opacity: 1;
}

.sc-progress-mark {
  display: block;
  width: 15px;
  height: 2px;
  border-radius: 2px;
  background: var(--neutral-900);
  opacity: 0.26;
  transition:
    width 0.45s var(--ease-soft),
    background-color 0.45s var(--ease-soft),
    opacity 0.45s var(--ease-soft);
}

.sc-progress-mark.is-active {
  width: 30px;
  background: var(--coral-500);
  opacity: 1;
}

@media (max-width: 900px) {
  .sc-progress {
    gap: 12px;
  }

  .sc-progress-mark {
    width: 12px;
  }

  .sc-progress-mark.is-active {
    width: 24px;
  }
}

/* ---------- detail card — "The Tag", bottom-left ---------- */
/* Layout is the Figma 480×240 frame verbatim; colorways swap the custom
   props below and every painted part cross-fades through them. */
.sc-card {
  position: absolute;
  z-index: 6;
  /* the one interactive island in the click-transparent showcase */
  pointer-events: auto;
  width: 480px;
  height: 240px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  overflow: hidden;
  transition: background-color 0.45s var(--ease-soft), border-color 0.45s var(--ease-soft);
  /* the body is revealed by a merging-bubbles mask, not by moving */
  will-change: opacity;
}

/* the card relocates per product — it hops out, teleports, hops back in
   (position classes are swapped by JS while the card is hidden) */
.sc-card--bl {
  left: var(--pad-side);
  bottom: 7vh;
  transform-origin: bottom left;
}

.sc-card--br {
  right: var(--pad-side);
  bottom: 7vh;
  transform-origin: bottom right;
}

.sc-card--tl {
  left: var(--pad-side);
  top: calc(72px + 5vh);
  transform-origin: top left;
}

.sc-card--tr {
  right: var(--pad-side);
  top: calc(72px + 5vh);
  transform-origin: top right;
}

/* Colorway A · Sage Field — tone-on-tone, calm */
.sc-card--a {
  --card-bg: var(--sage-100);
  --card-border: var(--neutral-900);
  --card-spine: var(--sage-700);
  --card-title: var(--sage-700);
  --card-text: var(--neutral-700);
  --card-weight-bg: var(--sage-200);
  --card-weight-text: var(--neutral-700);
  --card-chip-border: var(--neutral-900);
  --card-chip-text: var(--neutral-700);
  --card-bars: var(--sage-700);
  --card-sku: var(--neutral-400);
  --card-cta: var(--neutral-900);
}

/* Colorway B · Golden Butter — warm ochre tone-on-tone. Built on the butter
   ramp with the same light-tint bg + dark same-hue accent structure as the
   Sage card, so it reads as a sibling of A and C rather than an inversion. */
.sc-card--b {
  --card-bg: var(--butter-200);
  --card-border: var(--neutral-900);
  --card-spine: var(--butter-700);
  --card-title: var(--butter-700);
  --card-text: var(--neutral-700);
  --card-weight-bg: var(--butter-500);
  --card-weight-text: var(--neutral-900);
  --card-chip-border: var(--neutral-900);
  --card-chip-text: var(--neutral-700);
  --card-bars: var(--butter-700);
  --card-sku: var(--neutral-400);
  --card-cta: var(--neutral-900);
}

/* Colorway C · Coral Heat — appetite, single-hue umber type */
.sc-card--c {
  --card-bg: var(--coral-100);
  --card-border: var(--coral-700);
  --card-spine: var(--coral-600);
  --card-title: var(--coral-700);
  --card-text: var(--neutral-700);
  --card-weight-bg: var(--coral-500);
  --card-weight-text: var(--butter-50);
  --card-chip-border: var(--coral-700);
  --card-chip-text: var(--coral-700);
  --card-bars: var(--coral-700);
  --card-sku: color-mix(in srgb, var(--coral-700) 75%, transparent);
  --card-cta: var(--coral-700);
}

.sc-spine {
  position: absolute;
  left: -1px;
  top: -1px;
  width: 6px;
  height: 240px;
  background: var(--card-spine);
  transition: background-color 0.45s var(--ease-soft);
}

/* category chip, top-right — label slides through the chip mask on swap */
.sc-card-chip {
  position: absolute;
  right: 24px;
  top: 24px;
  display: inline-flex;
  padding: 7px 12px 7px 12px;
  border: 1px solid var(--card-chip-border);
  border-radius: 999px;
  overflow: hidden;
  transition: border-color 0.45s var(--ease-soft);
}

.sc-card-chip-label {
  display: inline-block;
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 11px;
  color: var(--card-chip-text);
  transition: color 0.45s var(--ease-soft);
  will-change: transform;
}

.sc-card-name-mask {
  position: absolute;
  left: 32px;
  top: 22px;
  height: 40px;
  overflow: hidden;
}

.sc-card-name {
  perspective: 420px;   /* char flips are its direct children */
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  line-height: 38px;
  letter-spacing: -0.01em;
  color: var(--card-title);
  white-space: nowrap;
  transition: color 0.45s var(--ease-soft);
}

.sc-card-name .char {
  display: inline-block;
  white-space: pre;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}

.sc-card-desc-mask {
  position: absolute;
  left: 32px;
  top: 67px;
  right: 32px;
  height: 17px;
  overflow: hidden;
}

.sc-card-desc {
  margin: 0;
  font-family: var(--font-text);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
  color: var(--card-text);
  transition: color 0.45s var(--ease-soft);
  will-change: transform, opacity;
}

/* spec pills — flip individually like tiles */
.sc-chips {
  position: absolute;
  left: 32px;
  top: 101px;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  perspective: 380px;
}

.sc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.08em;
  line-height: 11px;
  text-transform: uppercase;
  transform-origin: 50% 50%;
  will-change: transform;
}

.sc-chip--weight {
  background: var(--card-weight-bg);
  color: var(--card-weight-text);
  transition: background-color 0.45s var(--ease-soft), color 0.45s var(--ease-soft);
  font-variant-numeric: tabular-nums;
}

.sc-chip--spec {
  border: 1px solid var(--card-chip-border);
  color: var(--card-chip-text);
  transition: border-color 0.45s var(--ease-soft), color 0.45s var(--ease-soft);
}

.sc-chip-ic {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
}

/* weight odometer — digits roll one by one inside the pill */
.sc-odo {
  display: inline-flex;
}

.sc-odo .od {
  position: relative;
  display: inline-block;
  height: 11px;
  line-height: 11px;
  overflow: hidden;
  white-space: pre;
}

.sc-odo .od > span {
  display: inline-block;
  white-space: pre;
  will-change: transform;
}

.sc-odo .od .od-new {
  position: absolute;
  left: 0;
  top: 0;
}

/* barcode — redraws per SKU */
.sc-barcode {
  position: absolute;
  left: 32px;
  top: 176px;
  height: 30px;
  display: flex;
  align-items: stretch;
}

.sc-barcode i {
  display: block;
  height: 30px;
  background: var(--card-bars);
  transition: background-color 0.45s var(--ease-soft);
  transform-origin: bottom;
  will-change: transform;
}

.sc-sku {
  position: absolute;
  left: 32px;
  top: 213px;
  font-family: var(--font-text);
  font-size: 8px;
  letter-spacing: 0.14em;
  line-height: 11px;
  color: var(--card-sku);
  transition: color 0.45s var(--ease-soft);
  white-space: nowrap;
}

.sc-card-cta {
  position: absolute;
  right: 28px;
  bottom: 42px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 15px;
  line-height: 20px;
  color: var(--card-cta);
  transition: color 0.45s var(--ease-soft);
}

/* Masked arrow swap: wrapper clips two stacked glyphs. On hover the front one
   flies out to the top-right and a duplicate flies in from the bottom-left. */
.sc-cta-arrow-swap {
  position: relative;
  display: inline-block;
  overflow: hidden;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.sc-cta-arrow {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
}

.sc-cta-arrow-swap .sc-cta-arrow {
  position: absolute;
  inset: 0;
  transition: transform 0.5s var(--ease-soft);
}

.sc-cta-arrow-swap .sc-cta-arrow:last-child {
  transform: translate(-110%, 110%);
}

.sc-card-cta:hover .sc-cta-arrow-swap .sc-cta-arrow:first-child {
  transform: translate(110%, -110%);
}

.sc-card-cta:hover .sc-cta-arrow-swap .sc-cta-arrow:last-child {
  transform: translate(0, 0);
}

/* ===========================================================
   FALLBACK — crossfade slideshow, no pin
   (prefers-reduced-motion, and the ≤900px mobile flow)
   =========================================================== */
.showcase.sc-simple .sc-stage {
  overflow: hidden;
}

.showcase.sc-simple .sc-product {
  opacity: 0;
  transition: opacity 0.6s var(--ease-soft);
}

.showcase.sc-simple .sc-product.is-on {
  opacity: 1;
}

.showcase.sc-simple .sc-wipe {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .showcase.sc-simple .sc-product {
    transition-duration: 0.25s;
  }

  .sc-card,
  .sc-spine,
  .sc-card-chip,
  .sc-card-chip-label,
  .sc-card-name,
  .sc-card-desc,
  .sc-chip--weight,
  .sc-chip--spec,
  .sc-barcode i,
  .sc-sku,
  .sc-card-cta {
    transition-duration: 0.01s;
  }
}

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 1280px) {
  .sc-card {
    transform: scale(0.88);
  }
}

@media (max-width: 900px) {
  .showcase {
    --sc-size: min(50vh, 86vw);
  }

  .sc-product img {
    max-height: 62vh;
  }

  .sc-product--v img {
    max-width: 88vw;
  }

  /* small screens: every position collapses to bottom-left */
  .sc-card--bl,
  .sc-card--br,
  .sc-card--tl,
  .sc-card--tr {
    left: var(--pad-side);
    right: auto;
    top: auto;
    bottom: 4vh;
    transform-origin: bottom left;
  }

  .sc-card {
    transform: scale(0.8);
  }
}

/* Phones: drop the scale-down entirely — the card takes the full available
   width (viewport minus the side padding) at its natural 1:1 coordinate
   system, so the type renders at true pixel sizes instead of being shrunk. */
@media (max-width: 560px) {
  .sc-card {
    width: calc(100vw - 2 * var(--pad-side));
    transform: none;
  }

  /* sit 16px lower than the ≤900px resting spot (bottom: 4vh) */
  .sc-card--bl,
  .sc-card--br,
  .sc-card--tl,
  .sc-card--tr {
    bottom: calc(4vh - 16px);
  }

  /* smaller barcode (30→26px), pulled up 16px closer to the pills; SKU rides
     along keeping its original 7px gap under the bars. The card sheds the same
     16px of height, so the bottom-anchored CTA link moves up with everything. */
  .sc-card {
    height: 224px;
  }

  .sc-spine {
    height: auto;
    bottom: -1px;
  }

  .sc-barcode,
  .sc-barcode i {
    height: 23px;
  }

  /* the bar widths are fixed px from JS — squeeze the whole strip
     horizontally so the barcode is narrower too, not just shorter */
  .sc-barcode {
    top: 160px;
    transform: scaleX(0.72);
    transform-origin: left center;
  }

  .sc-sku {
    top: 190px;
  }

  .sc-card-cta {
    font-size: 14px;   /* base 15px, -1 */
  }
}
