/* ============================================================
   TR3ES SILVERPLATE
   The holographic authenticity plate bonded to the certificate,
   rebuilt as an interactive object. Every surface is CSS or SVG —
   no bitmap of the plate is used.

   Mouse position arrives as --px / --py (-1 … 1) and tilt as
   --rx / --ry / --rz, all written from add.js on rAF. Nothing in
   here reads layout, so a mousemove never triggers a reflow.
   ============================================================ */

.sp{display:grid;gap:1rem;justify-items:start}
.sp__stage{perspective:1000px;perspective-origin:50% 50%;
  width:clamp(180px,var(--sp-w,17vw),300px)}

.sp__card{
  --rx:0deg; --ry:0deg; --rz:0deg; --px:0; --py:0; --lift:0;
  position:relative;display:block;width:100%;aspect-ratio:300/420;
  padding:0;border:0;background:none;cursor:pointer;
  border-radius:5.6%/4%;
  transform-style:preserve-3d;will-change:transform;
  transform:rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz))
            translateZ(calc(var(--lift) * 14px)) scale(calc(1 + var(--lift) * .018));
  transition:transform 620ms cubic-bezier(.16,.84,.28,1);
  box-shadow:
    0 1px 0 rgba(255,255,255,.35),
    0 calc(10px + var(--lift) * 14px) calc(24px + var(--lift) * 26px) rgba(0,0,0,.55),
    0 2px 6px rgba(0,0,0,.4);
  -webkit-tap-highlight-color:transparent;
}
.sp__card.live{transition:none}          /* pointer drives it directly while hovering */
.sp__card:focus-visible{outline:none}
.sp__card:focus-visible::after{
  content:"";position:absolute;inset:-7px;border-radius:8%/6%;
  border:1px solid rgba(226,232,238,.75);
  box-shadow:0 0 0 1px rgba(12,16,20,.9)}

.sp__art,
.sp__face,
.sp__holo,.sp__sweep,.sp__spec,.sp__edge,.sp__iri{
  position:absolute;inset:0;width:100%;height:100%;
  border-radius:5.6%/4%;pointer-events:none}
.sp__art{display:block}

/* ---------- content struck into the plate ---------- */
.sp__face{display:block;overflow:hidden}
.sp__mark,.sp__word{
  position:absolute;display:block;
  background:#10161D;
  /* a hairline of light along the lower edge is what reads as "pressed in" */
  filter:drop-shadow(0 .8px 0 rgba(255,255,255,.6));
  -webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;
  -webkit-mask-size:contain;mask-size:contain;
  -webkit-mask-position:center;mask-position:center;
  opacity:.9}
.sp__mark{left:29%;top:5.4%;width:42%;height:19%;
  -webkit-mask-image:url("../img/mark.png");mask-image:url("../img/mark.png")}
.sp__word{left:9%;top:26.5%;width:82%;height:19%;
  -webkit-mask-image:url("../img/word.png");mask-image:url("../img/word.png")}

.sp__no{
  position:absolute;right:9%;top:47.5%;
  font-family:"Archivo",system-ui,sans-serif;font-weight:300;
  font-size:clamp(15px,4.6cqw,26px);letter-spacing:.02em;line-height:1;
  color:#10161D;opacity:.88;
  text-shadow:0 .8px 0 rgba(255,255,255,.6)}

.sp__foot{position:absolute;left:8%;right:7%;bottom:6.5%;
  display:flex;align-items:flex-end;gap:6%}
.sp__qr{width:31%;height:auto;flex:none;display:block}
.sp__code{
  font-family:"IBM Plex Mono",ui-monospace,monospace;
  font-size:clamp(6px,2.35cqw,11px);letter-spacing:.06em;
  color:#10161D;opacity:.86;padding-bottom:6%;
  text-shadow:0 .7px 0 rgba(255,255,255,.55)}

/* ---------- light ----------
   Screen-blending blue over bright silver just gives white, which is why the
   first pass showed no colour at all. The hologram core therefore blends
   normally — it genuinely replaces the silver, the way the foil does — and
   only the shimmer, sweep and specular are screened on top of it. */
.sp__holo{
  background:
    radial-gradient(74% 108% at calc(6% + var(--px) * 26%) calc(38% + var(--py) * 24%),
      rgba(30,74,222,.82) 0%, rgba(62,58,200,.62) 22%,
      rgba(44,120,196,.32) 40%, rgba(120,150,200,.08) 56%, transparent 68%),
    radial-gradient(56% 46% at calc(92% - var(--px) * 22%) calc(86% - var(--py) * 20%),
      rgba(88,140,214,.18) 0%, transparent 72%);
  opacity:calc(.72 + var(--lift) * .28);
  transition:opacity 480ms ease}

/* the fine iridescence that only metal foil does */
.sp__iri{
  position:absolute;inset:0;width:100%;height:100%;pointer-events:none;
  border-radius:5.6%/4%;
  background:repeating-linear-gradient(calc(102deg + var(--px) * 22deg),
    rgba(120,255,240,.10) 0px, rgba(150,190,255,.09) 3px,
    rgba(210,160,255,.08) 6px, rgba(255,255,255,0) 11px);
  mix-blend-mode:screen;
  opacity:calc(.34 + var(--lift) * .38);
  transition:opacity 480ms ease}

.sp__sweep{
  background:linear-gradient(105deg,
    transparent 38%,
    rgba(190,240,255,.14) 45%,
    rgba(255,255,255,.62) 50%,
    rgba(200,190,255,.26) 55%,
    transparent 62%);
  background-size:280% 280%;
  mix-blend-mode:screen;
  opacity:.32;
  animation:spSweep 7.5s linear infinite;
  transition:opacity 480ms ease}
.sp__card.hot .sp__sweep{opacity:.9;animation-duration:3.4s}
@keyframes spSweep{from{background-position:130% 0}to{background-position:-70% 0}}

.sp__spec{
  background:radial-gradient(34% 24% at calc(50% + var(--px) * 44%) calc(46% + var(--py) * 42%),
    rgba(255,255,255,.80) 0%, rgba(255,255,255,.20) 36%, transparent 70%);
  mix-blend-mode:screen;
  opacity:calc(.30 + var(--lift) * .55);
  transition:opacity 480ms ease}

.sp__edge{
  border-radius:5.6%/4%;
  box-shadow:
    inset calc(var(--px) * 2.6px) calc(var(--py) * 2.6px) 0 rgba(255,255,255,calc(.34 + var(--lift) * .3)),
    inset calc(var(--px) * -2.2px) calc(var(--py) * -2.2px) 0 rgba(8,12,17,.34);
  background:linear-gradient(calc(90deg + var(--px) * 60deg),
    rgba(255,255,255,calc(.10 + var(--lift) * .10)) 0%, transparent 22%,
    transparent 78%, rgba(255,255,255,calc(.06 + var(--lift) * .08)) 100%)}

.sp__cap{color:var(--low)}

/* ---------- placement: under the field that checks it ---------- */
.sp{container-type:inline-size;margin-top:clamp(2rem,5vw,3rem)}
@media (min-width:560px){
  .sp{grid-template-columns:auto 1fr;align-items:end;
    gap:clamp(1.2rem,3vw,2rem);justify-items:start}
  .sp__cap{padding-bottom:.4rem;max-width:22ch}
}

@media (prefers-reduced-motion:reduce){
  .sp__card{transition:none;transform:none}
  .sp__sweep{animation:none;opacity:.3}
  .sp__holo,.sp__spec{transition:none}
}
