/*
 * Bharath Jewellery — "Cinematic" motion style (Le Borrel-style pinned scenes).
 * Layout helpers for the scroll-scrubbed home page + page curtain + smooth scroll.
 */

/* ---------- Lenis ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* ---------- Page curtain ---------- */
.bj-curtain { display: none; }
.bj-cine .bj-curtain {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: var(--gradient-emerald), var(--emerald-deep);
  transition: transform 1.15s cubic-bezier(.77, 0, .18, 1), visibility 0s linear 1.2s;
}
.bj-curtain img { height: 5rem; width: auto; opacity: 0; transform: translateY(12px); animation: bj-curtain-logo .9s cubic-bezier(.2,.7,.2,1) .1s forwards; }
.bj-curtain::after { content: ""; position: absolute; left: 50%; bottom: 22%; width: 120px; height: 1px; margin-left: -60px; background: linear-gradient(90deg, transparent, var(--gold), transparent); transform: scaleX(0); animation: bj-curtain-line 1.4s cubic-bezier(.2,.7,.2,1) .2s forwards; }
@keyframes bj-curtain-logo { to { opacity: 1; transform: none; } }
@keyframes bj-curtain-line { to { transform: scaleX(1); } }
.bj-curtain-lifted .bj-curtain { transform: translateY(-100%); visibility: hidden; }
.bj-static .bj-curtain, .no-js .bj-curtain { display: none; }

/* ---------- Scenes ---------- */
.bj-scene { position: relative; }
.bj-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.bj-scene--hero { height: 260vh; }
.bj-scene--bento { height: 230vh; }
.bj-scene--split { height: 135vh; }
.bj-scene--steps { height: 320vh; }
.bj-scene--scheme { height: 230vh; }

/* Not pinned (small screens / reduced motion): plain flowing sections */
.bj-unpinned, .bj-static .bj-scene { height: auto !important; }
.bj-unpinned > .bj-stage, .bj-static .bj-stage { position: relative; height: auto; min-height: 0; overflow: visible; }
.bj-static [data-k], .bj-static [data-k-sm] { opacity: 1 !important; transform: none !important; clip-path: none !important; filter: none !important; }
.bj-static .bj-hide-static { display: none !important; }

/* Elements that start hidden (engine sets their real values every frame) */
.bj-cine:not(.bj-cine-ready) [data-k*="opacity: 0 ->"] { opacity: 0; }

/* ---------- Hero ---------- */
.bj-hero-stage { background: var(--emerald-deep); }
.bj-hero-img { position: absolute; inset: 0; will-change: clip-path; }
.bj-hero-img img { width: 100%; height: 100%; object-fit: cover; object-position: 70% center; }
.bj-wordmark {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  font-family: var(--font-display); font-weight: 500; line-height: .8; letter-spacing: -.02em;
  font-size: clamp(5rem, 22vw, 26rem); white-space: nowrap;
  background-image: var(--gradient-gold); -webkit-background-clip: text; background-clip: text; color: transparent;
  pointer-events: none; user-select: none;
}
.bj-side-word { position: absolute; top: 50%; translate: 0 -50%; }
.bj-side-word--l { left: clamp(1.25rem, 6vw, 6rem); text-align: left; }
.bj-side-word--r { right: clamp(1.25rem, 6vw, 6rem); text-align: right; }
.bj-scroll-cue { position: absolute; left: 50%; bottom: 1.75rem; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.bj-scroll-cue span { width: 1px; height: 46px; background: linear-gradient(var(--gold), transparent); animation: bj-cue 2.2s cubic-bezier(.6,0,.2,1) infinite; transform-origin: top; }
@keyframes bj-cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
@media (max-width: 767px) {
  .bj-side-word { top: auto; translate: none; }
  .bj-side-word--l { bottom: 25vh; }
  .bj-side-word--r { bottom: 12vh; }
}

/* ---------- Collections bento (fits one screen) ---------- */
.bj-bento-stage { display: flex; flex-direction: column; justify-content: center; }
.bj-bento {
  --row: min(calc((100svh - 26.5rem) / 2), 22rem);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: var(--row) var(--row); gap: 1rem;
  width: min(100%, calc(var(--row) * 3.3));
  margin-inline: auto;
}
.bj-bento > a { aspect-ratio: auto !important; height: 100%; }
.bj-bento > a:first-child { grid-column: span 2; grid-row: span 2; }
@media (max-width: 767px) {
  .bj-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; width: 100%; gap: .75rem; }
  .bj-bento > a { aspect-ratio: 4 / 5 !important; height: auto; }
  .bj-bento > a:first-child { grid-row: auto; aspect-ratio: 4 / 3 !important; }
}

/* ---------- For her / him split ---------- */
.bj-split-stage { display: grid; grid-template-columns: 1fr 1fr; }
.bj-split-stage > a { min-height: 100%; }
.bj-static .bj-split-stage > a, .bj-unpinned .bj-split-stage > a { min-height: 520px; }
.bj-static .bj-hero-stage { min-height: 100svh; }
@media (max-width: 767px) { .bj-split-stage { grid-template-columns: 1fr; } .bj-split-stage > a { min-height: 520px; } }

/* ---------- Custom steps ---------- */
.bj-steps-stage { display: flex; align-items: center; }
.bj-steps-line { position: absolute; left: -1.5rem; top: .5rem; bottom: .5rem; width: 1px; background: color-mix(in oklab, var(--gold) 25%, transparent); }
.bj-steps-line i { position: absolute; inset: 0; background: var(--gold); transform-origin: top; }
@media (max-width: 1023px) { .bj-steps-line { display: none; } }

/* ---------- Gold scheme ---------- */
.bj-scheme-stage { display: grid; place-items: center; }

/* ---------- Featured grid ---------- */
[data-colpar] > * { will-change: translate; }

/* ---------- Footer wordmark ---------- */
.bj-footer-mark {
  overflow: hidden; line-height: .78; padding: 0 1.25rem .35rem;
  font-family: var(--font-display); font-weight: 500; letter-spacing: -.03em; text-align: center; white-space: nowrap;
  font-size: clamp(2.4rem, 11.4vw, 16rem);
}
/* Gradient text must live on the element that moves, or Chrome won't paint it */
.bj-footer-mark span { display: inline-block; padding: 0 .04em .06em; background-image: var(--gradient-gold); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .92; }

/* ---------- Header progress line (shared with subtle style) ---------- */
.bj-header > div:first-child { transition: height .45s cubic-bezier(.2,.7,.2,1); }
.bj-header img { transition: height .45s cubic-bezier(.2,.7,.2,1); }
.bj-header { transition: box-shadow .45s cubic-bezier(.2,.7,.2,1); }
.bj-header.is-scrolled > div:first-child { height: 4rem; }
.bj-header.is-scrolled img { height: 2.6rem; }
.bj-header.is-scrolled { box-shadow: 0 18px 40px -24px rgba(0,0,0,.55); }
.bj-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background-image: var(--gradient-gold); transform-origin: 0 50%; transform: scaleX(var(--bj-progress, 0)); pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .bj-curtain { display: none; }
  .bj-scroll-cue span { animation: none; }
}
