/* CENSENSE PRIVÉ membership card, presented as a real 3D object.
   CSS 3D transforms and the Web Animations API only: no library and no WebGL.
   The front is the supplied card artwork, untouched; thickness, edge, shadow and light are modelled around it. */
.pc {
  position: relative;
  width: 100%;
  aspect-ratio: 948 / 1311;          /* proportions of the supplied card */
  margin-inline: auto;
  margin-bottom: 12px;               /* room for the corner that swings toward the viewer */
  container-type: inline-size;
}
.pc-stage {
  --pc-t: 4px;                       /* thickness of the card */
  --pc-r: 8px;                       /* corner radius */
  position: absolute;
  inset: 0;
  perspective: 1620px;
  perspective-origin: 50% 46%;
}
@supports (width: 1cqw) {
  .pc-stage { --pc-t: 1.55cqw; --pc-r: 2.8cqw; perspective: 540cqw; }
}

/* the card; this is also the still pose shown when motion is reduced or scripts are unavailable */
.pc-card {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(-3deg) rotateY(-15deg);
}
.pc-card > * { position: absolute; inset: 0; display: block; border-radius: var(--pc-r); }

/* edge: thin slices between the two faces, so the rounded corners keep their thickness from every angle */
.pc-edge { background: linear-gradient(180deg, #c6d5f1 0%, #8ea9db 42%, #5a7bc0 100%); }
.pc-edge:nth-child(1) { transform: translateZ(calc(var(--pc-t) * -.4375)); }
.pc-edge:nth-child(2) { transform: translateZ(calc(var(--pc-t) * -.3125)); }
.pc-edge:nth-child(3) { transform: translateZ(calc(var(--pc-t) * -.1875)); }
.pc-edge:nth-child(4) { transform: translateZ(calc(var(--pc-t) * -.0625)); }
.pc-edge:nth-child(5) { transform: translateZ(calc(var(--pc-t) * .0625)); }
.pc-edge:nth-child(6) { transform: translateZ(calc(var(--pc-t) * .1875)); }
.pc-edge:nth-child(7) { transform: translateZ(calc(var(--pc-t) * .3125)); }
.pc-edge:nth-child(8) { transform: translateZ(calc(var(--pc-t) * .4375)); }

.pc-back {
  transform: translateZ(calc(var(--pc-t) * -.5)) rotateY(180deg);
  background: linear-gradient(160deg, #0a3d96 0%, #033385 46%, #022a6c 100%);
  backface-visibility: hidden;
}
.pc-front {
  transform: translateZ(calc(var(--pc-t) * .5));
  overflow: hidden;
  background: #033385;               /* the blue of the artwork, shown until the image has loaded */
  backface-visibility: hidden;
}
.pc-front::after {                   /* hairline where the bevel catches the light */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(214, 228, 255, .2);
}
.pc-art { display: block; width: 100%; height: 100%; }

/* light on the face: both layers are fully transparent when the card is face-on, so the artwork is shown as supplied */
.pc-sheen, .pc-shade { position: absolute; inset: 0; }
.pc-sheen {
  background: linear-gradient(100deg, transparent 0, transparent 34%, rgba(255, 255, 255, .16) 46%, rgba(255, 255, 255, .06) 55%, transparent 67%, transparent 100%);
  transform: translateX(-39%);
}
.pc-shade {
  background: linear-gradient(90deg, rgba(0, 10, 40, 0) 0%, rgba(0, 10, 40, .4) 100%);
  opacity: 0;
}

/* soft shadow that travels with the card, just behind it; it also sets the blue card apart from the blue background */
.pc-shadow {
  transform: translateZ(calc(var(--pc-t) * -.5 - 1px));
  box-shadow: 0 16px 32px rgba(0, 6, 26, .55), 0 3px 8px rgba(0, 6, 26, .42);
}
@supports (width: 1cqw) {
  .pc-shadow { box-shadow: 0 5.5cqw 11cqw rgba(0, 6, 26, .55), 0 1.2cqw 3cqw rgba(0, 6, 26, .42); }
}

/* sizing inside the two places that carry the card */
.prive-card-art .pc { width: min(100%, 300px); }
@media (max-width: 760px) {
  .prive-card-art .pc { width: min(100%, 280px); }
}
