/* =============================================================
   Pay Guardian のジャケット（3D のパッケージ）
   6つの面（表・裏・背2つ・天地）を CSS の 3D で組み立て、28秒でゆっくり一周させる。
   金融レグテックの PRODUCTS とトップの PRODUCTS で使う（11/17 page.css・refresh-p-financial.css から切り出し）
   面の絵は画像（11/17 もりもんさんが作成）。画面での大きさの3倍で作ってある：
     表・裏 = --j-w × --j-h（260×330 → 780×990）、背 = --j-d × --j-h（42×330 → 126×990）、天地 = --j-w × --j-d（260×42）
   ============================================================= */
.pg-jacket-stage {
  --j-w: 260px;
  --j-h: 330px;
  --j-d: 42px;
  width: min(100%, 360px);
  height: 390px;
  display: grid;
  place-items: center;
  perspective: 1050px;
  perspective-origin: 50% 45%;
  position: relative;
  isolation: isolate;
}
.pg-jacket-stage::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 240px; height: 34px;
  left: 50%; bottom: 4px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(16,42,67,.17);
  filter: blur(15px);
}
.pg-jacket {
  position: relative;
  width: var(--j-w);
  height: var(--j-h);
  transform-style: preserve-3d;
  animation: pg-jacket-turn 28s linear infinite;
  will-change: transform;
}
.pg-jacket-stage:hover .pg-jacket { animation-play-state: paused; }
@keyframes pg-jacket-turn {
  from { transform: rotateY(-22deg); }
  to { transform: rotateY(338deg); }
}
.pg-jacket-face {
  position: absolute;
  box-sizing: border-box;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #12392c center / 100% 100% no-repeat;
}
.pg-jacket-front, .pg-jacket-back {
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(16,42,67,.08);
}
.pg-jacket-front {
  transform: translateZ(calc(var(--j-d) / 2));
  background-image: url(../images/pg-jacket-front.webp);
  background-size: cover;
}
.pg-jacket-back {
  transform: rotateY(180deg) translateZ(calc(var(--j-d) / 2));
  background-image: url(../images/pg-jacket-back.webp);
  background-size: cover;
}
.pg-jacket-spine {
  top: 0; left: calc(50% - var(--j-d) / 2);
  width: var(--j-d); height: var(--j-h);
  background-image: url(../images/pg-jacket-spine.webp);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.pg-jacket-spine-right { transform: rotateY(90deg) translateZ(calc(var(--j-w) / 2)); }
.pg-jacket-spine-left { transform: rotateY(-90deg) translateZ(calc(var(--j-w) / 2)); }
.pg-jacket-edge {
  left: 0; top: calc(50% - var(--j-d) / 2);
  width: var(--j-w); height: var(--j-d);
  background-image: url(../images/pg-jacket-edge.webp);
}
.pg-jacket-top { transform: rotateX(90deg) translateZ(calc(var(--j-h) / 2)); }
.pg-jacket-bottom { transform: rotateX(-90deg) translateZ(calc(var(--j-h) / 2)); }
/* 掴んで回す（js/pg-jacket.js）。JS が動いたら CSS の回転は止め、JS が角度を入れる */
.pg-jacket-stage.is-js { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.pg-jacket-stage.is-js.is-grabbing { cursor: grabbing; }
.pg-jacket-stage.is-js .pg-jacket { animation: none; }
@media (max-width: 480px) {
  .pg-jacket-stage { --j-w: 190px; --j-h: 245px; --j-d: 32px; height: 300px; }
  .pg-jacket-stage::after { width: 175px; }
}
@media (prefers-reduced-motion: reduce) {
  .pg-jacket { animation: none; transform: rotateY(-22deg); will-change: auto; }
}

/* 濃紺の地（#products）での調整（もとは refresh-p-financial.css） */
#products .pg-jacket-stage { margin-inline: auto; }
#products .pg-jacket-stage::after { background: rgba(0,0,0,.45); }
