/* 3D Badge mark: a CSS 3D solid with a cream face (badge3d.js). */
/* 3D badge (see badge3d.js). Same build as the landing gate's badge. */
.vn-b3 { position: relative; display: grid; place-items: center; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.vn-b3.vn-is-dragging { cursor: grabbing; }
.vn-b3__shadow { position: absolute; left: 50%; bottom: -10%; width: 70%; height: 16%; transform: translateX(-50%); background: radial-gradient(ellipse at center, rgba(0,0,0,.22), transparent 70%); filter: blur(10px); pointer-events: none; }
.vn-b3__stage { position: relative; width: 100%; height: 100%; perspective: 1200px; perspective-origin: 50% 48%; }
/* Only the rig and the stack hold the 3D scene; the layers in it are flat leaves (the face clips with
   overflow: hidden, which flattens anyway). */
.vn-b3__rig, .vn-b3__stack { transform-style: preserve-3d; }
.vn-b3__rig { width: 100%; height: 100%; will-change: transform; }
.vn-b3__stack { position: relative; width: 100%; height: 100%; }
.vn-b3__face, .vn-b3__wall { position: absolute; pointer-events: none; }
.vn-b3__face { inset: 0; }
/* Rim walls face outward and hide their backs, so only the ones turned toward you draw (badge3d.js). */
.vn-b3__wall { background: var(--b3-edge); box-shadow: 0 0 0 1px var(--b3-edge); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.vn-b3__face { border-radius: 21.74%; overflow: hidden; /* iOS WebKit ignores rounded overflow on a composited 3D layer; clip-path and a same-radius mask keep the 3x gleam inside the face. */
  -webkit-clip-path: inset(0 round 21.74%); clip-path: inset(0 round 21.74%);
  -webkit-mask-image: url("../assets/badge/badge-face-mask.svg");
  -webkit-mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-image: url("../assets/badge/badge-face-mask.svg");
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.vn-b3__face > svg, .vn-b3__face > img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
/* The sheen: its own composited layer, 3x the face (so it still covers the face when rotated), with a
   fixed left-to-right gradient. badge3d.js moves it by transform only (rotate, then translateX); nothing
   repaints per frame. Stops are the old ones (relative to the face's gradient line) scaled to 3x. */
.vn-b3__gleam, .vn-b3__gleam::after { position: absolute; pointer-events: none; }
.vn-b3__gleam { inset: -100%; will-change: transform; transform: rotate(28deg) translateX(-3.6%);
  background: linear-gradient(90deg, transparent 0%, transparent 40.1%, rgba(255,255,255,.03) 45.5%, rgba(255,255,255,.10) 48.65%, rgba(255,255,255,.38) 50%, rgba(255,255,255,.08) 51.8%, transparent 56.3%, transparent 100%); mix-blend-mode: soft-light; opacity: .8; }
.vn-b3__gleam::after { content: ""; inset: 0; background: linear-gradient(90deg, transparent 0%, transparent 47.75%, rgba(255,255,255,.22) 50%, transparent 52.25%, transparent 100%); mix-blend-mode: overlay; opacity: .6; }
@media (prefers-reduced-motion: reduce) { .vn-b3__gleam { will-change: auto; } }
/* A picture sits on pure black, so a transparent one does not show the graphite rim colour through it.
   The popup badge keeps its cream tile. A faint plain-white streak keeps a gleam visible on the black. */
.vn-b3:not(.vn-pf-pop-badge) .vn-b3__face:has(> img:not(.vn-b3-default)) { background: var(--b3-edge); } /* rim colour, so the photo's anti-aliased rounded edge shows no dark hairline */
.vn-b3:not(.vn-pf-pop-badge) .vn-b3__face:has(> img:not(.vn-b3-default)) .vn-b3__gleam { mix-blend-mode: screen; opacity: .3; }
.vn-b3:not(.vn-pf-pop-badge) .vn-b3__face:has(> img:not(.vn-b3-default)) .vn-b3__gleam::after { mix-blend-mode: screen; opacity: .25; }
/* The default cream face (logo.svg has an 8/200 transparent margin): scaled to fill, like the / page's badge. */
.vn-b3__face img.vn-b3-default { transform: scale(1.087); }
/* Popup badge (mountPopBadge): logo.svg has an 8/200 transparent margin around the tile, so it is
   scaled to fill the face, like the / page's badge. */
.vn-pf-pop-badge { width: 64px; height: 64px; margin: 2px auto 14px; }
.vn-pf-pop-badge .vn-b3__shadow { bottom: -14%; filter: blur(4px); }
.vn-pf-pop-badge .vn-b3__face img { transform: scale(1.087); }
/* Popup badge: no drag, so a normal cursor and normal touch scrolling. */
.vn-b3.vn-b3--float { cursor: default; touch-action: auto; }

/* Upside down (badge3d.js adds .vn-is-upside): the picture turns so it still reads the right way up.
   The default art keeps its fill scale; a plain rotate would uncover the logo's margin as a second rim. */
.vn-b3.vn-is-upside .vn-b3__face > img, .vn-b3.vn-is-upside .vn-b3__face > svg { transform: rotate(180deg); }
.vn-b3.vn-is-upside .vn-b3__face img.vn-b3-default { transform: rotate(180deg) scale(1.087); }

/* vn-badge-3d sizes. md matches Badge's popup badge (64px). */
vn-badge-3d,
.vn-badge-3d {
  display: block;
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto;
}
vn-badge-3d[size="sm"] { width: 48px; height: 48px; }
vn-badge-3d[size="md"] { width: 64px; height: 64px; }
vn-badge-3d[size="lg"] { width: 120px; height: 120px; }
vn-badge-3d[size="xl"] { width: 200px; height: 200px; }
vn-badge-3d[size="hero"] { width: min(280px, 70vw); height: min(280px, 70vw); }
vn-badge-3d.vn-b3 { display: grid; }
