/* Original Cloud Card art: the lit display case with graded slabs (homepage hero, auth panels).
   Two slab kinds share one footprint (.slab): .slab--photo wraps a cut-out photograph of a real
   slab, which brings its own acrylic, label and reflections, so the CSS adds only what the stage
   adds (rim light, shadow, sheen, tilt); .slab--plain is built from CSS around a card face. */

/* The stage: a lit display case for three slabs */
.stage {
  position: relative; margin: 0; aspect-ratio: 1.12 / 1; min-height: 420px; border-radius: 28px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(60% 55% at 55% 46%, rgba(54, 212, 249, 0.34), transparent 70%),
    radial-gradient(90% 70% at 100% 0%, rgba(20, 146, 253, 0.35), transparent 60%),
    linear-gradient(160deg, #0E3A6E 0%, var(--navy-900) 70%);
  box-shadow: 0 40px 80px -40px rgba(7, 29, 56, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.stage::before { /* scanner-bed dot grid */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.5;
  background-image: radial-gradient(rgba(183, 206, 227, 0.22) 1px, transparent 1.2px);
  background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(75% 70% at 50% 50%, #000 30%, transparent 85%);
  mask-image: radial-gradient(75% 70% at 50% 50%, #000 30%, transparent 85%);
}
.stage__light { position: absolute; left: 50%; top: 4%; width: 70%; height: 86%; transform: translateX(-50%); z-index: -1;
  background: conic-gradient(from 200deg at 50% 0%, transparent 0deg, rgba(87, 218, 249, 0.16) 18deg, transparent 40deg);
  filter: blur(6px); }
.stage__ribbon { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.stage__line { stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 1.6s var(--ease) 0.5s forwards; }
.stage__area { opacity: 0; animation: fade 1.2s var(--ease) 1s forwards; }

.stage__slabs { position: absolute; inset: 0; z-index: 1; perspective: 1200px; transform-style: preserve-3d; transition: transform 600ms var(--ease); }

/* Shared footprint. Width is a share of the stage; every slab keeps the 0.6 width/height of a
   63 x 88 mm card in its case, so the photographs and the CSS slab line up. */
.slab {
  --w: 31%;
  position: absolute; left: 50%; top: 50%; width: var(--w);
  border-radius: 14px; overflow: hidden;
  opacity: 0; animation: rise 900ms var(--ease) forwards;
}
.slab__sheen {
  position: absolute; inset: -20%; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.0) 40%, rgba(255, 255, 255, 0.55) 47%, rgba(87, 218, 249, 0.45) 50%, rgba(255, 120, 220, 0.25) 53%, transparent 60%);
  transform: translateX(-70%);
}

/* Photograph slabs: the corner radius follows the PNG's (--r as % of width, --rv the same length
   as % of height) so the sheen and the rim clip exactly to the acrylic. */
.slab--photo {
  border-radius: var(--r, 2.7%) / var(--rv, 1.62%);
  box-shadow: 0 34px 60px -24px rgba(0, 12, 34, 0.9), 0 0 50px -10px rgba(54, 212, 249, 0.3);
}
.slab--photo picture, .slab--photo img { display: block; width: 100%; height: auto; }
.slab--photo::after { /* rim light: the case edge catching the cone from above */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.14), inset 0 -1px 0 rgba(87, 218, 249, 0.18);
}

/* CSS-built slab (the stand-in until its photograph exists) */
.slab--plain {
  aspect-ratio: 0.6; display: flex; flex-direction: column; gap: 6%; padding: 4.5% 4.5% 6%;
  border-radius: 2.7% / 1.62%; container-type: inline-size;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08) 45%, rgba(255, 255, 255, 0.16));
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 34px 60px -24px rgba(0, 12, 34, 0.9),
    0 0 50px -10px rgba(54, 212, 249, 0.35);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.slab__label {
  display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6% 7%;
  border-radius: 6px; background: linear-gradient(180deg, #FFFFFF, #F3F6FA); color: var(--navy);
  box-shadow: inset 0 -2px 0 var(--line);
}
.slab__lines { display: grid; min-width: 0; line-height: 1.2; }
.slab__set { font-size: 4.1cqi; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slab__player { font-family: var(--font-display); font-weight: 800; font-size: 5.6cqi; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slab__cert { font-size: 3.7cqi; color: var(--muted-2); }
.slab__grade { display: grid; justify-items: center; line-height: 1; }
.slab__grade b { font-family: var(--font-display); font-weight: 800; font-size: 11cqi; letter-spacing: -0.04em; }
.slab__grade small { font-size: 3.7cqi; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.slab__well { flex: 1; min-height: 0; display: grid; place-items: center; border-radius: 6px; background: rgba(4, 18, 38, 0.35); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); padding: 6%; }
.slab__well img, .slab__well svg { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }

/* Placement: the CCG slab front and largest (36% of the stage width, 67% of its height), the
   other two behind at 0.86 of its size, their centres 0.74 of their width either side, so about
   two thirds of each shows: the PSA label's grade and the stand-in's grade both stay in view. */
.slab--front { --w: 36%; transform: translate(-50%, -50%) translateZ(60px); animation-delay: 0.35s; z-index: 3; }
.slab--front .slab__sheen { animation: sheen 7s var(--ease) 1.4s infinite; }
.slab--left { transform: translate(-124%, -49%) rotateY(18deg) rotateZ(-7deg); animation-delay: 0.1s; z-index: 1; filter: saturate(0.95) brightness(0.92); }
.slab--right { transform: translate(24%, -49%) rotateY(-18deg) rotateZ(7deg); animation-delay: 0.2s; z-index: 2; filter: saturate(0.95) brightness(0.92); }

.float-chip {
  position: absolute; z-index: 4; display: flex; align-items: center; gap: 10px; padding: 9px 14px 9px 10px;
  border-radius: 14px; background: rgba(255, 255, 255, 0.96); color: var(--navy); box-shadow: 0 18px 36px -16px rgba(0, 10, 30, 0.7);
  font-size: var(--fs-13); line-height: 1.25; opacity: 0; animation: chip-in 700ms var(--ease) forwards;
}
.float-chip b { display: block; font-family: var(--font-display); font-size: var(--fs-15); letter-spacing: -0.01em; }
.float-chip small { color: var(--muted); font-size: var(--fs-12); }
.float-chip small .gain { font-weight: 700; }
.float-chip__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--info-soft); color: var(--link); }
.float-chip__icon--gain { background: var(--gain-soft); color: var(--gain); }
.float-chip--value { left: 6%; top: 5%; animation-delay: 1.1s; }
.float-chip--value::after { content: ""; position: absolute; top: 10px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--gain-fill); box-shadow: 0 0 0 0 rgba(22, 199, 132, 0.6); animation: pulse 2.4s ease-out 2s infinite; }
.float-chip--grade { right: 7%; top: 12%; padding: 6px; border-radius: 10px; animation-delay: 1.3s; }
.float-chip--offers { right: 7%; bottom: 10%; animation-delay: 1.5s; }
.stage__caption { position: absolute; left: 6%; bottom: 6%; z-index: 4; display: grid; gap: 2px; color: #fff; }
.stage__caption strong { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-20); letter-spacing: -0.015em; }
.stage__caption span { font-size: var(--fs-13); color: var(--muted-on-navy); }

@keyframes rise { from { opacity: 0; margin-top: 40px; } to { opacity: 1; margin-top: 0; } }
@keyframes chip-in { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes sheen { 0% { transform: translateX(-70%); } 22%, 100% { transform: translateX(70%); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 199, 132, 0.55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(22, 199, 132, 0); } }

@media (max-width: 1000px) {
  .stage { min-height: 0; aspect-ratio: 1.15 / 1; }
}
@media (max-width: 560px) {
  /* The stage is 343 px wide on a 375 px phone: the front slab stays whole between the two chips
     along the top and the caption along the bottom; the offers chip gives way as before. */
  .stage { aspect-ratio: 0.95 / 1; border-radius: 20px; }
  .slab { --w: 34%; }
  .slab--front { --w: 39%; transform: translate(-50%, -51%) translateZ(60px); }
  .slab--left { transform: translate(-112%, -50%) rotateY(18deg) rotateZ(-7deg); }
  .slab--right { transform: translate(12%, -50%) rotateY(-18deg) rotateZ(7deg); }
  .float-chip { font-size: var(--fs-12); padding: 7px 10px 7px 8px; }
  .float-chip--value { top: 4%; }
  .float-chip--offers { display: none; }
  .float-chip--grade { top: 4%; right: 3%; }
  .stage__caption strong { font-size: var(--fs-16); }
}
@media (max-width: 360px) {
  .float-chip--grade { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .slab, .float-chip, .stage__area { opacity: 1; animation: none; }
  .stage__line { stroke-dashoffset: 0; animation: none; }
  .slab--front .slab__sheen { animation: none; }
  .float-chip--value::after { animation: none; }
}
