/* ==========================================================================
   Bow & Beads — experience layer: the film hero, GSAP/Lenis motion hooks and the floating
   WhatsApp button. Pairs with assets/motion.js. Tokens come from snippets/css-variables.liquid.
   Everything degrades to a finished, static page without JavaScript or with reduced motion.
   ========================================================================== */

/* ---------- Lenis (smooth scrolling) ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* ---------- word masks (hero heading, section headings) ---------- */
.mw { display: inline-block; vertical-align: top; overflow: hidden; padding: .1em .06em .16em; margin: -.1em -.06em -.16em; }
.mw__i { display: inline-block; }
em .mw, .mw em { padding: .34em .2em .3em; margin: -.34em -.2em -.3em; }

/* ---------- film hero ---------- */
.bb-vhero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; align-items: center;
  height: clamp(560px, calc(100svh - 190px), 900px);
  background: var(--c-soft); color: var(--c-text);
}
.bb-vhero--large { height: clamp(520px, calc(86svh - 190px), 780px); }
.bb-vhero__media { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.bb-vhero__poster, .bb-vhero__poster img, .bb-vhero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bb-vhero__poster img { display: block; }
.bb-vhero__video { opacity: 0; transition: opacity 1.4s ease; background: transparent; }
.bb-vhero.is-playing .bb-vhero__video { opacity: 1; }
/* The film plays clear; a cream veil only sits behind the copy (left on wide screens, the bottom
   on phones) so the text stays readable. "Cream veil" in the editor sets how strong it is. */
.bb-vhero__video { filter: contrast(1.04) saturate(1.06); }
.bb-vhero__scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--c-bg) calc(var(--vhero-scrim, .55) * 100%), transparent) 0%,
      color-mix(in srgb, var(--c-bg) calc(var(--vhero-scrim, .55) * 80%), transparent) 26%,
      color-mix(in srgb, var(--c-bg) calc(var(--vhero-scrim, .55) * 30%), transparent) 42%,
      transparent 56%),
    linear-gradient(0deg, color-mix(in srgb, var(--c-bg) 45%, transparent) 0%, transparent 10%);
}
/* The bead-ring motif as a giant, slowly turning arc that frames the right of the film. */
.bb-vhero__ring-wrap { position: absolute; top: 50%; right: calc(min(118svh, 1060px) * -.58); width: min(118svh, 1060px); aspect-ratio: 1; margin-top: calc(min(118svh, 1060px) / -2); opacity: .62; pointer-events: none; }
.bb-vhero__ring { width: 100%; height: 100%; animation: ring-turn 160s linear infinite; filter: drop-shadow(0 3px 4px rgba(22, 33, 61, .22)); }
.bb-vhero__inner { position: relative; width: 100%; }
.bb-vhero__copy { display: flex; flex-direction: column; align-items: flex-start; max-width: 600px; }
.bb-vhero__eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 22px; font-size: 11px; font-weight: 500; letter-spacing: .36em; text-transform: uppercase; }
.bb-vhero__dot { display: inline-flex; color: var(--c-burgundy); }
.bb-vhero__title { margin: 0; font-size: inherit; letter-spacing: 0; width: 100%; display: flex; flex-direction: column; align-items: inherit; }
.bb-vhero__mark { display: block; width: min(100%, 540px); transform-origin: 0 50%; }
.bb-vhero__wordmark { width: 100%; color: var(--c-text); filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .7)); }
.bb-vhero__heading { display: block; filter: drop-shadow(0 0 12px color-mix(in srgb, var(--c-bg) 85%, transparent)); margin-top: 16px; font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: calc(clamp(25px, 2.5vw, 38px) * var(--heading-scale)); line-height: 1.22; color: var(--c-text); text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
.bb-vhero__heading--solo { font-family: var(--font-heading); font-style: normal; font-size: calc(clamp(34px, 4.6vw, 64px) * var(--heading-scale)); letter-spacing: .04em; margin: 0; }
.bb-vhero__heading em { font-family: var(--font-script); font-style: normal; font-size: 1.32em; line-height: .8; color: var(--c-accent-strong); }
.has-gsap .bb-vhero__heading .mw__i.is-gold {
  background: linear-gradient(100deg, var(--c-accent-strong) 0%, var(--c-accent-strong) 40%, #fff1c9 50%, var(--c-accent-strong) 60%, var(--c-accent-strong) 100%);
  background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; /* a text-shadow would paint over the clipped gradient */
}
.bb-vhero__ornament { margin: 22px 0 0; width: 260px; }
.bb-vhero__text { max-width: 460px; margin: 20px 0 0; font-size: 17px; color: var(--c-text-soft); }
.bb-vhero__eyebrow, .bb-vhero__text { text-shadow: 0 0 14px color-mix(in srgb, var(--c-bg) 90%, transparent), 0 0 3px color-mix(in srgb, var(--c-bg) 80%, transparent); }
.bb-vhero__actions { display: flex; flex-wrap: wrap; gap: 12px 14px; margin-top: 30px; }
.button--glass {
  background: color-mix(in srgb, var(--c-bg) 58%, transparent); color: var(--c-text);
  border-color: color-mix(in srgb, var(--c-text) 55%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
}
.button--glass:hover { background: var(--c-text); color: var(--c-bg); border-color: var(--c-text); }
.bb-vhero__toggle {
  position: absolute; top: 18px; right: clamp(16px, 4vw, 48px); z-index: 2;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; padding: 0; cursor: pointer;
  color: var(--c-text); background: color-mix(in srgb, var(--c-bg) 62%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-accent) 70%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background-color .3s ease, transform .3s ease;
}
.bb-vhero__toggle:hover { background: var(--c-bg); transform: scale(1.05); }
.bb-vhero__toggle[hidden] { display: none; }
.bb-vhero__toggle-play { display: none; }
.bb-vhero.is-paused .bb-vhero__toggle-play { display: block; }
.bb-vhero.is-paused .bb-vhero__toggle-pause { display: none; }
.bb-vhero__cue { position: absolute; left: 50%; bottom: 22px; translate: -50% 0; display: grid; justify-items: center; gap: 8px; font-size: 10px; letter-spacing: .34em; text-transform: uppercase; color: var(--c-text); pointer-events: none; }
.bb-vhero__cue-line { position: relative; display: block; width: 1px; height: 46px; background: linear-gradient(var(--c-accent), transparent); overflow: hidden; }
.bb-vhero__cue-bead { position: absolute; left: -3px; top: 0; width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #fff6dc, var(--c-accent) 70%); animation: cue-drop 2.4s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes cue-drop { 0% { transform: translateY(-8px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(48px); opacity: 0; } }
.bb-vhero__strand { margin-top: clamp(26px, 4vw, 48px); }
/* CSS entrance when GSAP is unavailable (theme.js adds .is-in); GSAP takes over otherwise. */
.js .bb-vhero:not(.is-gsap) [data-vhero-line], .js .bb-vhero:not(.is-gsap) [data-vhero-mark], .js .bb-vhero:not(.is-gsap) [data-vhero-split] { opacity: 0; transform: translateY(22px); }
.js .bb-vhero.is-in:not(.is-gsap) [data-vhero-line], .js .bb-vhero.is-in:not(.is-gsap) [data-vhero-mark], .js .bb-vhero.is-in:not(.is-gsap) [data-vhero-split] { opacity: 1; transform: none; transition: opacity 1s ease, transform 1.2s cubic-bezier(.16,.7,.25,1); }

@media (max-width: 989px) {
  .bb-vhero { height: clamp(540px, calc(100svh - 150px), 820px); align-items: end; }
  .bb-vhero--large { height: clamp(500px, calc(88svh - 150px), 760px); }
  .bb-vhero__scrim {
    background:
      linear-gradient(0deg,
        var(--c-bg) 0%, var(--c-bg) 15%,
        color-mix(in srgb, var(--c-bg) calc(var(--vhero-scrim, .55) * 100% + 20%), transparent) 21%,
        color-mix(in srgb, var(--c-bg) calc(var(--vhero-scrim, .55) * 100%), transparent) 32%,
        color-mix(in srgb, var(--c-bg) calc(var(--vhero-scrim, .55) * 45%), transparent) 44%,
        transparent 58%);
  }
  /* Phones: the film sits higher, so its subject shows above the copy at the bottom; the strip
     it leaves at the very bottom is under the solid part of the cream veil. */
  .bb-vhero__poster, .bb-vhero__video { transform: translateY(-14%); }
  .bb-vhero__inner { padding-bottom: clamp(30px, 6vw, 56px); }
  .bb-vhero__copy { align-items: center; text-align: center; margin-inline: auto; max-width: 560px; }
  .bb-vhero__eyebrow, .bb-vhero__actions { justify-content: center; }
  .bb-vhero__eyebrow { margin-bottom: 14px; font-size: 10px; letter-spacing: .3em; }
  .bb-vhero__mark { width: min(100%, 380px); margin-inline: auto; transform-origin: 50% 50%; }
  .bb-vhero__heading { margin-top: 10px; font-size: calc(clamp(22px, 5.6vw, 30px) * var(--heading-scale)); }
  .bb-vhero__ornament { margin: 14px auto 0; width: 200px; }
  .bb-vhero__text { margin: 12px auto 0; font-size: 15.5px; line-height: 1.6; }
  .bb-vhero__actions { margin-top: 20px; gap: 10px; }
  .bb-vhero__actions .button { min-height: 48px; padding: 0 22px; }
  .bb-vhero__ring-wrap { display: none; }
  .bb-vhero__cue { display: none; }
}
@media (max-width: 420px) { .bb-vhero__text { display: none; } }

/* ---------- GSAP hand-offs ---------- */
.marquee.is-gsap .marquee__track { animation: none; }
.has-gsap .builder-cta__bow { animation: none; }
.has-gsap [data-gsap-reveal] { transition: none; }

/* ---------- floating WhatsApp ---------- */
.wa-fab {
  --wa: #1d7a4e; --wa-deep: #135c39; --wa-size: 58px;
  position: fixed; z-index: 90; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
  width: var(--wa-size); height: var(--wa-size); border-radius: 50%;
  color: #fff; -webkit-tap-highlight-color: transparent;
  animation: wa-in .9s cubic-bezier(.34, 1.56, .64, 1) 1.2s both;
}
.wa-fab__pill {
  position: absolute; right: 0; top: 0; height: var(--wa-size); width: 204px; border-radius: 999px;
  display: flex; align-items: center; padding-left: 22px;
  background: radial-gradient(120% 140% at 85% 20%, color-mix(in srgb, var(--wa) 80%, #fff) 0%, var(--wa) 45%, var(--wa-deep) 100%);
  box-shadow: inset 0 0 0 1.5px var(--c-accent-light), inset 0 0 0 3px color-mix(in srgb, var(--wa-deep) 60%, transparent), 0 16px 32px -14px rgba(10, 50, 30, .6);
  clip-path: inset(0 0 0 calc(100% - var(--wa-size)) round 999px);
  transition: clip-path .55s cubic-bezier(.2, .8, .2, 1), box-shadow .4s ease;
}
.wa-fab__label { font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; opacity: 0; transform: translateX(14px); transition: opacity .3s ease .05s, transform .5s cubic-bezier(.2, .8, .2, 1); }
.wa-fab__icon { position: absolute; right: 0; top: 0; width: var(--wa-size); height: var(--wa-size); display: grid; place-items: center; pointer-events: none; animation: wa-wiggle 20s ease-in-out 5s infinite; }
.wa-fab__icon .icon { width: 27px; height: 27px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .2)); }
.wa-fab__pulse { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--c-accent); pointer-events: none; opacity: 0; animation: wa-pulse 20s cubic-bezier(.2, .6, .3, 1) 2.2s infinite; }
.wa-fab__pulse--late { animation-delay: 2.7s; border-color: var(--c-accent-light); }
.wa-fab__ribbon { position: absolute; right: 150px; top: 46px; width: 26px; height: 32px; pointer-events: none; transform-origin: 50% 0; opacity: 0; transform: scaleY(0) rotate(-24deg); transition: transform .6s cubic-bezier(.3, 1.5, .5, 1), opacity .25s ease; filter: drop-shadow(0 3px 3px rgba(60, 40, 10, .25)); }
.wa-fab:hover .wa-fab__pill, .wa-fab:focus-visible .wa-fab__pill { clip-path: inset(0 0 0 0 round 999px); box-shadow: inset 0 0 0 1.5px var(--c-accent-light), inset 0 0 0 3px color-mix(in srgb, var(--wa-deep) 60%, transparent), 0 20px 38px -14px rgba(10, 50, 30, .65); }
.wa-fab:hover .wa-fab__label, .wa-fab:focus-visible .wa-fab__label { opacity: 1; transform: none; transition-delay: .12s; }
.wa-fab:hover .wa-fab__ribbon, .wa-fab:focus-visible .wa-fab__ribbon { opacity: 1; transform: scaleY(1) rotate(6deg); transition-delay: .2s; }
.wa-fab:hover .wa-fab__icon, .wa-fab:focus-visible .wa-fab__icon { animation-play-state: paused; }
.wa-fab:focus-visible { outline: none; }
.wa-fab:focus-visible .wa-fab__pill { outline: 2px solid var(--c-accent-strong); outline-offset: 3px; }
.wa-fab:active .wa-fab__pill { filter: brightness(.95); }
@keyframes wa-in { from { opacity: 0; transform: translateY(40px) scale(.4); } to { opacity: 1; transform: none; } }
@keyframes wa-pulse { 0% { opacity: .9; transform: scale(1); } 9% { opacity: 0; transform: scale(1.75); } 100% { opacity: 0; transform: scale(1.75); } }
@keyframes wa-wiggle { 0%, 7%, 100% { transform: none; } 1% { transform: rotate(-14deg) scale(1.08); } 2.2% { transform: rotate(12deg) scale(1.08); } 3.4% { transform: rotate(-8deg); } 4.6% { transform: rotate(5deg); } 5.8% { transform: rotate(0); } }
/* The cart drawer and overlays sit above; the button steps aside while they are open. */
body.is-locked .wa-fab { opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.wa-fab--builder { display: none; }
@media (hover: none) { .wa-fab__pill, .wa-fab__label, .wa-fab__ribbon { transition: none; } }
@media (max-width: 749px) { .wa-fab { --wa-size: 54px; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); } }

/* ---------- helper without JavaScript ---------- */
html.no-js .tom { display: none; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .bb-vhero__video { display: none; }
  .bb-vhero__ring, .bb-vhero__cue-bead, .wa-fab, .wa-fab__icon, .wa-fab__pulse { animation: none !important; }
  .js .bb-vhero [data-vhero-line], .js .bb-vhero [data-vhero-mark], .js .bb-vhero [data-vhero-split] { opacity: 1 !important; transform: none !important; }
  .wa-fab__pill, .wa-fab__label, .wa-fab__ribbon { transition: none !important; }
}
