/* One finish travels with the card from its 360° view to the wallet. */
.bm-metal-surface[data-finish="purple"] {
  --metal-base: #6e3ba0;
  --metal-small: url("./assets/metal/purple-sm.webp");
  --metal-large: url("./assets/metal/purple.webp");
}
.bm-metal-surface[data-finish="silver"] {
  --metal-base: #b4bcc5;
  --metal-small: url("./assets/metal/silver-sm.webp");
  --metal-large: url("./assets/metal/silver.webp");
}
.bm-metal-surface[data-finish="black"] {
  --metal-base: #1c1f24;
  --metal-small: url("./assets/metal/black-sm.webp");
  --metal-large: url("./assets/metal/black.webp");
}
.bm-metal-surface[data-finish="gold"] {
  --metal-base: #cfae58;
  --metal-small: url("./assets/metal/gold-sm.webp");
  --metal-large: url("./assets/metal/gold.webp");
}
.bm-metal-surface {
  isolation: isolate;
  background-color: var(--metal-base);
  background-image: var(--metal-small);
  background-image: image-set(var(--metal-small) 1x, var(--metal-large) 2x);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}
.bm-gallery-viewer .bm-metal-surface {
  background-image: var(--metal-large);
}

.bm-gallery-face {
  --letter-metal: #dbe1e4;
  --letter-light: #fffdfaab;
  --letter-edge: #51586345;
  --etch-light-x: var(--metal-shift-x, 3%);
}
.bm-gallery-face[data-finish="gold"] {
  --letter-metal: #a4adb5;
  --letter-light: #fcffff69;
  --letter-edge: #4b525a80;
}
.bm-gallery-face[data-finish="silver"] {
  --letter-metal: #697987;
  --letter-light: #eef7ff40;
  --letter-edge: #4e5a644a;
}
.bm-metal-reverse { --etch-light-x: calc(0% - var(--metal-shift-x, 3%)); }
.bm-gallery-face .bm-face-mark {
  --etch-low: #6c39a9;
  --etch-middle: #975ae0;
  --etch-peak: #c299f2;
  --etch-groove: #2c193ee0;
  --etch-lip: #dcc1f4a8;
}
.bm-gallery-face .bm-face-mark::before {
  background-color: var(--etch-middle);
  background-image:
    repeating-linear-gradient(177.7deg, #fff9ee26 0 .05cqw, transparent .11cqw .25cqw, #1820271c .29cqw .33cqw, transparent .38cqw .57cqw),
    linear-gradient(calc(112deg + var(--metal-roll, -2deg)),
      var(--etch-middle) 7%, var(--etch-low) 24%, var(--etch-middle) 42%,
      var(--etch-peak) 48%, var(--etch-middle) 55%, var(--etch-low) 72%, var(--etch-middle) 94%);
  background-size: auto, 32cqw 100%;
  background-position: 0 0, var(--etch-light-x) center;
}
.bm-gallery-face .bm-face-mark {
  filter: drop-shadow(0 clamp(-.85px,-.09cqw,-.32px) .13px var(--etch-groove))
    drop-shadow(0 clamp(.34px,.095cqw,.8px) .13px var(--etch-lip));
}
.bm-gallery-face .bm-face-mark::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  mask: url("./assets/mark.svg") center / contain no-repeat;
}
.bm-gallery-face :is(.bm-gallery-brand, .bm-gallery-rear-tier) b {
  /* The grain is fixed to the inscription. Turning the card can only add
     light to the satin base, so a dark band never travels across the name. */
  background-color: var(--letter-metal);
  background-image: repeating-linear-gradient(178deg, #ffffff0f 0 .06cqw, transparent .12cqw .42cqw),
    linear-gradient(110deg, transparent 15%, var(--letter-light) 52%, transparent 89%);
  background-repeat: repeat, no-repeat;
  background-size: auto, 185% 100%;
  background-position: 0 0, calc(50% + var(--etch-light-x)) center;
  display: inline-block;
  padding-inline-end: .12em;
  margin-inline-end: -.12em;
  font-weight: 750;
  color: transparent;
  -webkit-text-stroke: clamp(.15px, .045cqw, .48px) var(--letter-edge);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
}
.bm-gallery-face .bm-gallery-brand b { font-size: 5.85cqw; }
.bm-gallery-face .bm-gallery-rear-tier b { font-size: 3.4cqw; }
@media (forced-colors: active) {
  .bm-gallery-face .bm-face-mark::before { forced-color-adjust: none; background: CanvasText; }
  .bm-gallery-face :is(.bm-gallery-brand, .bm-gallery-rear-tier) b { color: CanvasText; -webkit-text-stroke: 0; }
}

/* The texture provides broad brushed variation. These fine cuts remain
   native to the display at high pixel density and in the enlarged view. */
.bm-gallery-front::before,
.bm-gallery-macro-sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(177.7deg, #fff8e80c 0 .42px, transparent .6px 2.8px, #0b0b1109 3px 3.4px, transparent 3.7px 7.1px),
    repeating-linear-gradient(178.5deg, transparent 0 4.8px, #fff9eb0a 5px 5.5px, transparent 6px 11.4px);
}
.bm-gallery-front .bm-face-engraving {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mask-image: linear-gradient(112deg, transparent 22%, #0007 43%, #000 66%, #0008 94%);
  mask-size: 135% 100%;
  mask-position: calc(54% + var(--metal-shift-x, 3%)) center;
}
.bm-face-groove { stroke: #17121a44; stroke-width: .77; }
.bm-face-bevel { stroke: #fffaeb57; stroke-width: .7; }
.bm-gallery-front[data-finish="black"] .bm-face-bevel { stroke: #c9d0d85c; }
@media (min-resolution: 1.5dppx), (min-width: 2400px) {
  .bm-gallery-front { background-image: var(--metal-large); }
}
.bm-metal-reflection {
  pointer-events: none;
  display: block;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
}
/* Adjacent light panels and dark flags reflect across the brushed stock.
   Moving the panels behind the crop keeps the physical grain stationary. */
.bm-metal-reflection::before {
  content: "";
  position: absolute;
  inset: -50% -67%;
  background:
    radial-gradient(ellipse at 60% -12%, #fffcf37d, transparent 44%),
    linear-gradient(112deg,
      #05070a66 5%, #0a0d0e0a 23%, #e7e8e920 30%,
      #ffedd330 34.5%, #fff8e95c 37.8%, #fffefa78 39.3%,
      #fdfbf63b 40.5%, #d4dce10a 43%, #0c101233 50%,
      #090c1057 55%, #191b1c29 63%, #e6e1d61f 69%,
      #fffced61 72%, #e6e6e528 73.2%, #080a0c38 85%);
  transform: translate3d(var(--metal-shift-x, 3%), var(--metal-shift-y, 0%), 0)
    rotate(var(--metal-roll, -2deg));
  transition: transform 150ms ease-out;
}
.bm-metal-reflection::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1.2px 0 #fff8, inset 1px 0 0 #fff5,
    inset -1.4px -1.7px 0 #0a0b0b8a, inset 0 0 0 2.4px #f7ede821;
  background: radial-gradient(ellipse 92% 66% at 55% 115%, #0506083b, transparent 85%);
}
.bm-metal-reverse .bm-metal-reflection::before {
  transform: translate3d(calc(-1 * var(--metal-shift-x, 3%)), var(--metal-shift-y, 0%), 0)
    rotate(var(--metal-roll, -2deg));
}
.bm-gallery-card.is-dragging .bm-metal-reflection::before { transition: none; }
.bm-gallery-macro { touch-action: pan-y; }
.bm-gallery-card::before {
  transform: translate(2%, 8%) rotate(-4deg) scaleX(var(--metal-shadow-width, .99));
}
.bm-gallery-chip { overflow: hidden; }
.bm-gallery-chip::after {
  content: "";
  position: absolute;
  inset: -32% -85%;
  pointer-events: none;
  background: linear-gradient(108deg, transparent 30%, #fff9db10 39%, #fff9da7d 45%, #fff9dc15 50%, transparent 62%);
  transform: translateX(calc(var(--metal-shift-x, 3%) * 1.25));
  transition: transform 150ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .bm-metal-reflection::before, .bm-gallery-chip::after { transition: none; }
}
