/* SafeAsset's metal card (mockup/card v1): the member's own card on the dashboard and the three in the landing's hero.
   With it the metals (saCardMetal), worn also by the dashboard's balance panel (.trim), the member header's avatar
   ring (.ring) and the menu's card (.me). layouts/vault and layouts/landing link this sheet; on the tokens of
   sa-member.css or safeasset.css (--fd, --fb, --g-gold). */
/* ---------- the metals (saCardMetal): worn by the dashboard's card and its balance panel, the header's avatar ring and the menu's card ---------- */
:is(.mc, .trim, .me, .ring) {
  --m1: #2b1160; --m2: #4c2196; --m3: #9b74f5; --m4: #160832;
  --shine: rgba(236, 222, 255, .55);
  --ink: #f4eefe; --ink2: rgba(244, 238, 254, .6);
  --eng-l: rgba(255, 255, 255, .16); --eng-d: rgba(0, 0, 0, .5);
  --bal: linear-gradient(180deg, #fff7de 0%, #f1d08a 42%, #c88d38 70%, #f4dea2 100%);
  --sig: linear-gradient(100deg, #fdf0c9, #e8b85f 45%, #c88d38 80%, #f3d68f); --sigc: #e8b85f;
  --tier: var(--g-gold);
}
:is(.mc, .trim, .me, .ring).m-bronze { --m1: #9a5f34; --m2: #c4834f; --m3: #f3cfa6; --m4: #63391a; --shine: rgba(255, 236, 214, .6); --ink: #2e1708; --ink2: rgba(46, 23, 8, .62); --eng-l: rgba(255, 235, 210, .5); --eng-d: rgba(60, 25, 5, .35);
  --bal: linear-gradient(180deg, #5a2f12 0%, #2a1406 55%, #4a270e 100%); }
:is(.mc, .trim, .me, .ring).m-platinum { --m1: #9a9ea9; --m2: #c8cbd4; --m3: #f7f8fb; --m4: #6c707b; --shine: rgba(255, 255, 255, .7); --ink: #23212b; --ink2: rgba(35, 33, 43, .62); --eng-l: rgba(255, 255, 255, .55); --eng-d: rgba(30, 30, 40, .35);
  --bal: linear-gradient(180deg, #4b4d58 0%, #1d1e24 55%, #3d3f4a 100%); }
:is(.mc, .trim, .me, .ring).m-gold { --m1: #b07a28; --m2: #d9ad5c; --m3: #fbe7b0; --m4: #7a4f14; --shine: rgba(255, 248, 225, .65); --ink: #33200a; --ink2: rgba(51, 32, 10, .62); --eng-l: rgba(255, 245, 215, .55); --eng-d: rgba(70, 40, 5, .35);
  --bal: linear-gradient(180deg, #5a3a0e 0%, #2a1904 55%, #4a2f0b 100%); }
:is(.mc, .trim, .me, .ring):is(.m-bronze, .m-platinum, .m-gold) { --tier: linear-gradient(180deg, #4c1d95, #2a1058); --sig: linear-gradient(100deg, #2a1058, #4c1d95 50%, #2a1058); --sigc: #3b1278; }
:is(.mc, .trim, .me, .ring).m-obsidian { --m1: #0e0d13; --m2: #24222d; --m3: #625e72; --m4: #050407; --shine: rgba(255, 255, 255, .28); --ink: #efeaf8; --ink2: rgba(239, 234, 248, .55); --eng-l: rgba(255, 255, 255, .12); --eng-d: rgba(0, 0, 0, .7); }

/* the card, cut from metal (mockup/card v1): brushed grain, light bands that move with the pointer and a slow
   sweep, a bevelled edge, a laser-engraved guilloche and shield (images/safeasset/card-*.svg as masks, each
   cut twice: a shadowed edge and a lit one), a gold EMV chip, a hologram crest, the balance struck in foil and
   the house signature written in ink. The metal is the highest vault level running: none amethyst, then
   bronze, platinum, gold and obsidian (the dashboard's $saMetal). */
.mc {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column;
  aspect-ratio: 1.586; padding: 26px 30px 22px; border-radius: 22px; color: var(--ink);
  background:
    radial-gradient(120% 90% at var(--mx, 18%) var(--my, 0%), var(--shine), transparent 46%),
    linear-gradient(118deg, var(--m4) 0%, var(--m2) 22%, var(--m3) 34%, var(--m1) 47%, var(--m2) 61%, var(--m3) 72%, var(--m1) 86%, var(--m4) 100%);
  background-size: 100% 100%, 220% 100%;
  background-position: 0 0, calc(var(--mx, 30%) * .6) 0;
  box-shadow: 0 34px 60px -26px rgba(0, 0, 0, .9), 0 12px 24px -12px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -2px 1px rgba(0, 0, 0, .35);
  transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
/* the bevel: a light top-left edge, a dark bottom-right one */
.mc::before { content: ""; position: absolute; inset: 0; z-index: 5; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .08) 28%, rgba(0, 0, 0, .35) 55%, rgba(255, 255, 255, .5) 82%, rgba(255, 255, 255, .12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
/* the brushed grain: long thin streaks */
.mc-grain { position: absolute; inset: 0; z-index: -1; opacity: .2; mix-blend-mode: overlay; pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='400'><filter id='b'><feTurbulence type='fractalNoise' baseFrequency='0.003 0.9' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  1.2 0 0 0 -.2'/></filter><rect width='100%' height='100%' filter='url(%23b)'/></svg>") 0 0 / 100% 100%; }
/* a slow sweep of light now and then */
.mc-sheen { position: absolute; inset: -40% -60%; z-index: 4; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(105deg, transparent 44%, rgba(255, 255, 255, .55) 49%, rgba(255, 255, 255, .1) 52%, transparent 56%);
  transform: translateX(-55%); animation: mcSweep 8s ease-in-out 1.2s infinite; }
@keyframes mcSweep { 0%, 50% { transform: translateX(-55%); } 80%, 100% { transform: translateX(55%); } }
/* laser-engraved: the art cut in, lit on one side, shadowed on the other */
.mc-eng { position: absolute; z-index: -1; pointer-events: none; }
.mc-eng i { position: absolute; inset: 0; -webkit-mask: var(--art) 0 0 / 100% 100% no-repeat; mask: var(--art) 0 0 / 100% 100% no-repeat; }
.mc-eng i:first-child { background: var(--eng-d); translate: .8px .8px; }
.mc-eng i + i { background: var(--eng-l); }
.mc-guil { --art: url(../images/safeasset/card-guilloche.svg); inset: 0; opacity: .75;
  -webkit-mask: linear-gradient(90deg, transparent 8%, #000 42%); mask: linear-gradient(90deg, transparent 8%, #000 42%); }
.mc-shield { --art: url(../images/safeasset/card-shield.svg); right: -9%; top: 22%; width: 40%; aspect-ratio: 1; opacity: .55;
  -webkit-mask: linear-gradient(180deg, #000 40%, transparent 92%); mask: linear-gradient(180deg, #000 40%, transparent 92%); }
.mc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mc-brand { display: flex; align-items: center; gap: 9px; min-width: 0; font: 700 15px/1 'Bodoni Moda', Georgia, serif; font-variation-settings: 'opsz' 11; letter-spacing: .12em; text-transform: uppercase; text-shadow: 0 1px 0 var(--eng-d), 0 -1px 0 var(--eng-l); }
.mc-brand img { width: 26px; height: 26px; flex: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); }
.mc-tier { flex: none; text-align: right; font: 700 15px/1.1 var(--fd); letter-spacing: .14em; text-transform: uppercase; background: var(--tier); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .35)); }
.mc-tier small { display: block; margin-bottom: 6px; color: var(--ink2); -webkit-text-fill-color: var(--ink2); font: 800 8.5px/1 var(--fb); letter-spacing: .32em; }
.mc-mid { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.mc-chip { width: 50px; height: 38px; flex: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); }
.mc-nfc { width: 24px; height: 24px; color: var(--ink2); }
/* the hologram crest: rainbow foil that turns with the light */
.mc-holo { position: relative; margin-left: auto; width: 54px; height: 40px; flex: none; overflow: hidden; border-radius: 7px;
  background: conic-gradient(from calc(var(--hx, 0) * 1turn + 20deg) at 50% 55%, #ffb3e6, #b3c7ff, #a8ffe0, #fff1a8, #ffc2b3, #d4b3ff, #ffb3e6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45), 0 2px 5px rgba(0, 0, 0, .4); filter: saturate(.75) brightness(1.02); }
.mc-holo::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .35) 0 1px, transparent 1px 4px); mix-blend-mode: overlay; }
.mc-holo svg { position: absolute; inset: 5px 0; width: 100%; height: calc(100% - 10px); fill: none; stroke: rgba(60, 30, 90, .55); stroke-width: 1.4; }
.mc-bal { margin-top: auto; }
.mc-lbl { display: flex; align-items: center; gap: 6px; color: var(--ink2); font: 800 9.5px/1 var(--fb); letter-spacing: .28em; text-transform: uppercase; }
.mc .eye { color: var(--ink2); }
.mc-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 6px; }
.mc-row > b { font: 700 52px/1 var(--fd); letter-spacing: .01em; white-space: nowrap; background: var(--bal); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .18)) drop-shadow(0 2px 1px rgba(0, 0, 0, .45)); }
.mc-row > b span { font-size: .55em; }
.bal-off .mc-row > b { filter: blur(8px); }
.mc-row .up { margin-bottom: 7px; }
.mc-foot { display: flex; align-items: flex-end; gap: 26px; margin-top: 16px; }
.mc-foot > span:not(.mc-sign) { min-width: 0; }
.mc-foot > span:not(.mc-sign) small { display: block; margin-bottom: 6px; color: var(--ink2); font: 800 8px/1 var(--fb); letter-spacing: .26em; text-transform: uppercase; }
.mc-foot > span:not(.mc-sign) b { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font: 700 13.5px/1.1 var(--fb); letter-spacing: .16em; text-transform: uppercase; text-shadow: 0 1px 0 var(--eng-d), 0 -1px 0 var(--eng-l); }
/* the house signature, written in ink as the card arrives. The script's loops reach far past its line: room
   all round so the ink is painted whole (background-clip: text paints inside the box only), taken back by the
   margin so nothing moves */
.mc-sign { position: relative; flex: none; margin-left: auto; padding: 0 2px 6px; transform: rotate(-5deg); transform-origin: 100% 100%; }
.mc-sign b { display: block; margin: -.34em -.26em -.4em -.34em; padding: .34em .26em .4em .34em; font: 400 42px/1 'Mrs Saint Delafield', cursive; white-space: nowrap; background: var(--sig); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .35)); clip-path: inset(0 100% 0 0); animation: mcSign 1.6s cubic-bezier(.5, .1, .3, 1) .5s forwards; }
.mc-sign svg { position: absolute; left: -6px; bottom: -2px; width: calc(100% + 10px); height: 14px; fill: none; stroke: var(--sigc); stroke-width: 1.4; stroke-linecap: round;
  stroke-dasharray: 220; stroke-dashoffset: 220; animation: mcFlourish .8s ease-out 1.9s forwards; }
@keyframes mcSign { to { clip-path: inset(0 0 0 0); } }
@keyframes mcFlourish { to { stroke-dashoffset: 0; } }
.mc.m-bronze .mc-brand img, .mc.m-platinum .mc-brand img, .mc.m-gold .mc-brand img { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); }
.mc.m-bronze .eye:hover, .mc.m-platinum .eye:hover, .mc.m-gold .eye:hover,
.mc.m-bronze .eye[aria-pressed=true], .mc.m-platinum .eye[aria-pressed=true], .mc.m-gold .eye[aria-pressed=true] { background: rgba(0, 0, 0, .08); color: var(--ink); }
/* on a light metal the day's gain is a dark green stamp */
.mc.m-bronze .up, .mc.m-platinum .up, .mc.m-gold .up { border-color: rgba(21, 94, 50, .4); background: rgba(21, 94, 50, .12); color: #14532d; }
@media (prefers-reduced-motion: reduce) {
  .mc-sheen { display: none; }
  .mc-sign b { animation: none; clip-path: none; }
  .mc-sign svg { animation: none; stroke-dashoffset: 0; }
}
