/* Charlbeck Jewellers — products showcase
   A scroll-driven, pinned bento that morphs through the pieces genuinely in the
   cases, ending on the family behind the counter. Loaded on top of site.css,
   only on products.html. Namespaced .showcase-* so it never collides with the
   single-product stage in product.css.

   Honesty: every card is a real Charlbeck photograph. The only permitted repeat
   is the tight diamond macro (empty alt, aria-hidden), never shown beside an
   uncropped duplicate of itself. */

:root {
  --sc-black: #0e0e0c;
  --sc-black-soft: #141310;
  --sc-charcoal: #28251f;
  --sc-ivory: #f3f0e8;
  --sc-ivory-muted: rgba(243, 240, 232, 0.68);
  --sc-line: rgba(243, 240, 232, 0.16);
  --sc-line-strong: rgba(243, 240, 232, 0.28);
  --sc-champagne: #b6a581;
  --sc-radius: clamp(20px, 1.8vw, 32px);
  --sc-card-radius: 0px;   /* pieces meet the frame edge-to-edge — no pasted-card corners */
}

/* ---------- Pinned section ---------- */
/* Full-bleed: the stage IS the screen. No gutters, no rounded frame, no paper
   margin — the pieces fill the viewport edge to edge, not a floating card. */
.showcase {
  padding: 0;
  /* the graded clip whites, the letterboxing and the stage are one flat field,
     within ~2 levels of the page --paper so the section melts into the page */
  background: rgb(245,244,242);
}

.showcase-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  min-height: 100svh;
  border-radius: 0;
  background: rgb(245,244,242);
  color: var(--ink);
}

.showcase-canvas {
  position: absolute;
  inset: 0;                 /* pieces run to the stage edge — the page shows through */
  z-index: 1;
}

/* the stage now blends straight into the page — no dark legibility floor */
.showcase-stage::after { content: none; }

/* ---------- Morphing cards ---------- */
.sc-card {
  position: absolute;
  overflow: hidden;
  border-radius: var(--sc-card-radius);
  will-change: transform, left, top, width, height;
  backface-visibility: hidden;
  /* GSAP owns every geometry + transform write, frame by frame. A CSS
     transition here (site.css sets one globally on links) double-eases those
     writes and makes the scrub feel rubbery — kill it outright on the cards. */
  transition: none;
  contain: paint;
}
.sc-card[hidden] { display: none; }

/* product / photo cards are links */
a.sc-card { color: inherit; text-decoration: none; display: block; }

.sc-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  background: rgb(245,244,242);   /* contain letterboxing = the unified clip white, not a box */
}
.sc-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;        /* never crop a piece — fit it whole, page shows around it */
  filter: none;               /* true colour so a clip/poster matches its panel letterbox */
  transition: filter .4s ease;   /* transform is driven by GSAP — never CSS-transitioned */
}
/* the tight decorative macro reads closer in */
.sc-card[data-card="macro"] .sc-media img { transform: scale(1.5); }

/* A product card that carries a live loop: poster under, video over, both cover-fit.
   Same grade as the still cards so the clip sits in the same world. */
.sc-media .sc-card-poster,
.sc-media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block; object-fit: contain; object-position: 50% 50%;
}
.sc-media .sc-card-poster { z-index: 1; }
.sc-media video {
  z-index: 2;
  /* no grade — the clip must display at its true backdrop so it matches the
     panel's letterbox colour exactly (any filter would reintroduce a seam) */
  filter: none;
}

/* a slim caption plate that rides the lower edge of a photo card */
.sc-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: clamp(14px, 1.4vw, 22px) clamp(14px, 1.4vw, 22px) clamp(12px, 1.2vw, 18px);
  background: linear-gradient(0deg, rgba(247,246,242,0.9) 0%, rgba(247,246,242,0) 100%);
  pointer-events: none;
}
.sc-cap .cap-cat {
  font-size: 8.5px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--sc-champagne);
}
.sc-cap .cap-title {
  margin: 5px 0 0;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(15px, 1.35vw, 21px); line-height: 1.2; color: var(--ink);
}

/* ---------- Persistent Card-3 video layer ----------
   One element for the whole thread: it is a box placed per scene (left/top/width/
   height, exactly like a product card), so the same playing video travels from an
   opening card → lower-right bento → wide band → full hero without ever reparenting
   or reloading. Because it is a real box, `object-fit: contain` fits the clip WHOLE
   inside whatever rectangle it currently occupies — never cropped by the window.
   GSAP owns the box + the descent transform; a still poster covers the first frames
   until playback is live. */
.sc-video-layer {
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  z-index: 4;
  overflow: hidden;
  border-radius: var(--sc-card-radius);
  opacity: 0;                 /* GSAP autoAlpha reveals it as it descends */
  transition: none;
  will-change: transform, width, height;
  backface-visibility: hidden;
}
.sc-video-layer video,
.sc-video-layer .sc-poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block; object-fit: contain;   /* whole clip, never cropped */
  object-position: 50% 50%;
}
.sc-video-layer video {
  transform: none;            /* no zoom — contain must show the full frame */
  filter: none;               /* true backdrop, so it matches the layer letterbox */
}
.sc-video-layer .sc-poster { z-index: 2; }

/* ---------- Copy cards (intro / founder) ---------- */
.sc-copy {
  position: absolute;
  inset: 0;
  background: var(--sc-charcoal);
  color: var(--sc-ivory);
  border-radius: inherit;
  padding: clamp(20px, 2.2vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(12px, 1.6vw, 22px);
}
.sc-copy .cc-eyebrow {
  font-size: 9px; letter-spacing: .26em; text-transform: uppercase; color: var(--sc-champagne);
}
.sc-copy .cc-head {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(21px, 2.2vw, 36px); line-height: 1.14; letter-spacing: -.01em; color: var(--sc-ivory);
}
.sc-copy .cc-body {
  font-size: clamp(12.5px, 0.95vw, 15px); line-height: 1.74; color: var(--sc-ivory-muted); max-width: 36ch;
}
.sc-copy .cc-cta {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 20px; border-radius: 100px;
  background: var(--sc-ivory); color: var(--sc-black);
  font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase;
  transition: transform .25s cubic-bezier(.16,1,.3,1), background .2s ease;
}
a.sc-copy:hover .cc-cta { transform: translateY(-1px); }

/* ---------- Full-stage statement, revealed by a left→right mask ---------- */
.showcase-statement {
  position: absolute;
  left: clamp(20px, 3vw, 54px);
  top: clamp(84px, 22vh, 220px);
  z-index: 6;
  margin: 0;
  max-width: 15ch;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(30px, 5vw, 76px); line-height: 1.0; letter-spacing: -.02em;
  text-transform: uppercase;
  color: var(--ink);
  clip-path: inset(0 100% 0 0);
  pointer-events: none;
}
.showcase-statement span { display: block; }

/* ---------- Persistent framed interface ---------- */
.showcase-ui {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  display: flex; flex-direction: column; justify-content: flex-end;   /* lone hint row rests at the foot of the stage */
  padding: clamp(16px, 2vw, 30px) clamp(18px, 2.2vw, 34px);
}
.showcase-ui a, .showcase-ui button { pointer-events: auto; }

.su-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.su-kicker {
  display: inline-flex; align-items: center;
  padding: 9px 18px; border-radius: 100px;
  background: rgba(20,17,14,0.04); border: 1px solid rgba(20,17,14,0.14);
  font-size: 9px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink);
}
.su-count { font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-muted); }

.su-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.su-brand {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(22px, 2.4vw, 34px); letter-spacing: .4em; text-transform: uppercase;
  padding-left: .4em; color: var(--ink);
}
.su-hint {
  margin: 0; display: inline-flex; align-items: center; gap: 10px;
  font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-muted);
}
.su-hint::after {
  content: ""; width: 1px; height: 22px; background: rgba(20,17,14,0.28);
  animation: cbCue 2.4s cubic-bezier(.16,1,.3,1) infinite;
}
.showcase-stage[data-settled="true"] .su-hint::after { animation: none; opacity: .3; }

/* ---------- Static fallback (no engine / reduced motion) ---------- */
.showcase-static {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: clamp(120px, 15vh, 200px);
  gap: 0;
  position: absolute; inset: 0;
  z-index: 1;
}

@media (max-width: 760px) {
  .showcase { padding: 0; }
  .showcase-stage { border-radius: 0; min-height: 100svh; }
  .showcase-canvas { inset: 0; }
  .showcase-ui { padding: clamp(14px, 4vw, 22px); }
  .su-hint { display: none; }
  .showcase-statement { font-size: clamp(30px, 9vw, 52px); top: clamp(78px, 16vh, 150px); }
  .sc-cap .cap-title { font-size: clamp(14px, 4.4vw, 19px); }
  /* On the stacked mobile cards the tiny category eyebrow is barely legible over
     the busy photo — show the piece title only. */
  .sc-cap .cap-cat { display: none; }
  .sc-cap .cap-title { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .showcase-statement { clip-path: none !important; }
  .su-hint::after { animation: none; }
}
