/* ============================================================
   MERIDIAN — FLOATING PALETTE BACKGROUND
   Decorative-only layer: rounded swatches in 3 depth tiers,
   drifting on slow vertical loops + optional pointer parallax.
   Pulls colours from the existing brand palette (paper, cream,
   bone, mid, ink-soft) + warm garment tones (taupe, sand, sage,
   stone, clay). pointer-events: none, sits behind all content.
   ============================================================ */

.palette-bg {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none; overflow: hidden;
  /* z-index: -1 (same as the existing .bg-theme); palette-bg is
     inserted AFTER bg-theme in the DOM so it paints above the
     grain/glow but still behind any static-flow page content. */
}

.palette-bg__sw {
  position: absolute;
  border-radius: 26px;
  will-change: transform;
  animation: paletteFloat var(--dur, 16s) ease-in-out infinite;
  animation-delay: var(--dly, 0s);
  transform: translate3d(0, 0, 0);
}

/* parallax composes with the float via nested var */
.palette-bg { --mx: 0; --my: 0; }
.palette-bg__sw {
  transform: translate3d(calc(var(--mx) * var(--px, 0) * 10px), calc(var(--my) * var(--px, 0) * 10px), 0);
}

/* float keyframe targets a separate inner; we layer via box-shadow only — see structure below */
@keyframes paletteFloat {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 var(--rise, -10px); }
}

/* LAYER 1 — large, blurred, lowest opacity */
.palette-bg__sw--lg { width: var(--w); height: var(--h); filter: blur(28px); opacity: 0.07; box-shadow: 0 30px 60px -20px rgba(0,0,0,0.06); }

/* LAYER 2 — medium, light blur, moderate opacity */
.palette-bg__sw--md { width: var(--w); height: var(--h); filter: blur(8px); opacity: 0.12; box-shadow: 0 20px 50px -22px rgba(0,0,0,0.08); }

/* LAYER 3 — small, crisp, highest opacity (still under 20%) */
.palette-bg__sw--sm { width: var(--w); height: var(--h); filter: blur(0); opacity: 0.16; box-shadow: 0 12px 28px -16px rgba(0,0,0,0.1); }

/* MUTED PREMIUM TONES (from the MERIDIAN palette + garment swatches) */
.palette-bg__sw--cream { background: #f5f2ed; }
.palette-bg__sw--bone  { background: #ede9e2; }
.palette-bg__sw--taupe { background: #c2b6a2; }
.palette-bg__sw--sand  { background: #b3a892; }
.palette-bg__sw--sage  { background: #9ba089; }
.palette-bg__sw--stone { background: #a99e88; }
.palette-bg__sw--clay  { background: #8f846d; }
.palette-bg__sw--mid   { background: #6b6860; }
.palette-bg__sw--ink   { background: #2a2620; }

/* IMAGE CARDS — a few corner swatches carry editorial imagery
   instead of flat colour. Higher opacity so the picture reads,
   a soft inner vignette for depth, and a faint label. Decorative
   placeholders now; drop a real photo via background-image to use
   your own campaign shots. Still pointer-events:none + behind UI. */
.palette-bg__sw--img {
  opacity: 0.5; filter: none;
  background-size: cover; background-position: center;
  box-shadow: 0 30px 70px -28px rgba(0,0,0,0.32);
  overflow: hidden;
}
.palette-bg__sw--img::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(150deg, rgba(17,17,16,0) 40%, rgba(17,17,16,0.28));
}
.palette-bg__sw--img.palette-bg__sw--lg { filter: none; }
/* the grain texture already on .palette-bg adds film tooth over images */

@media (prefers-reduced-motion: reduce) {
  .palette-bg__sw { animation: none; }
}

/* On narrow viewports trim the dense set so we don't crowd small
   screens. Cards declared .palette-bg__sw--hide-mobile are dropped. */
@media (max-width: 760px) {
  .palette-bg__sw--hide-mobile { display: none; }
  .palette-bg__sw--lg { filter: blur(18px); }
}
