/* Day 3 (@erickmarti_): The Autograph, a 1 of 1 holo card */
.autograph {
  margin-top: 48px;
  scroll-margin-top: 24px;
}

.autograph-intro {
  margin-bottom: 16px;
  color: #555;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 16px 32px;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 35%, #2c2547 0%, #141221 55%, #0b0a12 100%);
  overflow: hidden;
}

.stage-hint {
  margin-top: 32px;
  color: #a7a3b8;
  font-size: 14px;
  text-align: center;
}

.hint-touch {
  display: none;
}

@media (hover: none) {
  .hint-pointer {
    display: none;
  }

  .hint-touch {
    display: block;
  }
}

/* The card. JS feeds --mx/--my (glare position), --bgx/--bgy (foil position)
   and --hyp (how far it's tilted, 0 to 1) on every frame. */
.card {
  --mx: 50%;
  --my: 50%;
  --bgx: 50%;
  --bgy: 50%;
  --hyp: 0.3;
  --radius: 4.5cqw;
  container-type: inline-size;
  width: var(--card-w, min(300px, 72vw));
  aspect-ratio: 31 / 60;
  perspective: 1400px;
  cursor: pointer;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: 16px;
  outline: none;
}

.card:focus-visible {
  outline: 3px solid #a35cff;
  outline-offset: 10px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 30px 50px -20px rgba(0, 0, 0, 0.8);
}

/* Front: brushed silver frame, the photo, a dark nameplate */
.card-front {
  display: flex;
  flex-direction: column;
  padding: 4cqw 4cqw 0;
  background: linear-gradient(
    135deg,
    #d9d9e0 0%,
    #84848f 28%,
    #f4f4f8 48%,
    #7b7b86 70%,
    #cfcfd7 100%
  );
}

.card-art {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 2.5cqw;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
  background: #ddd;
}

.card-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.card-plate {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.2cqw;
  height: 24cqw;
  margin: 0 -4cqw;
  padding: 0 34cqw 0 7cqw;
  background: linear-gradient(180deg, #1d1b26, #0d0c12);
  color: #fff;
  line-height: 1.05;
  white-space: nowrap;
}

.plate-name {
  font-size: 7.4cqw;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.plate-role {
  font-size: 3.6cqw;
  color: #a7a3b8;
}

/* Gold foil lettering: a metallic gradient clipped to the text, the gradient
   slides with the tilt, and a light/dark edge pair fakes the emboss */
.foil-text {
  width: fit-content;
  font-size: 4.6cqw;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(
    115deg,
    #8a6514 0%,
    #f7e08a 22%,
    #b8892b 40%,
    #fff6cf 52%,
    #a87b22 68%,
    #f0d27a 100%
  );
  background-size: 250% 100%;
  background-position: var(--bgx) 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 -1px 0 rgba(0, 0, 0, 0.6)) drop-shadow(0 1px 0 rgba(255, 240, 190, 0.35));
}

/* "1/1" stamp: pressed gold disc on the nameplate, just lipping onto the
   photo, clear of the real signature */
.card-stamp {
  position: absolute;
  right: 5cqw;
  bottom: 3.5cqw;
  width: 27cqw;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: rotate(-12deg);
  background: linear-gradient(
    115deg,
    #7a5a12 0%,
    #f7e08a 24%,
    #b8892b 44%,
    #fff3c4 54%,
    #a87b22 74%,
    #f0d27a 100%
  );
  background-size: 250% 250%;
  background-position: var(--bgx) var(--bgy);
  box-shadow:
    inset 0 0.6cqw 0.4cqw rgba(255, 255, 255, 0.75),
    inset 0 -0.8cqw 0.8cqw rgba(0, 0, 0, 0.45),
    0 1.2cqw 2.5cqw rgba(0, 0, 0, 0.55);
}

.card-stamp svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  /* white edge below, dark edge above: reads as letters pressed into foil */
  filter: drop-shadow(0 0.6px 0 rgba(255, 248, 220, 0.8)) drop-shadow(0 -0.4px 0 rgba(60, 40, 0, 0.5));
}

.stamp-edge {
  fill: none;
  stroke: rgba(74, 51, 6, 0.55);
  stroke-width: 1.2;
}

.stamp-ring {
  fill: #4a3306;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 8.6px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.stamp-num {
  fill: #4a3306;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 23px;
  font-weight: 800;
  text-anchor: middle;
  letter-spacing: -0.04em;
}

/* Back */
.card-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3cqw;
  padding: 10cqw;
  text-align: center;
  color: #e9e4ff;
  line-height: 1.15;
  background:
    repeating-radial-gradient(circle at 50% 42%, rgba(163, 92, 255, 0.16) 0 0.5cqw, transparent 0.5cqw 4.5cqw),
    radial-gradient(circle at 50% 42%, #2d2253 0%, #0f0d1c 70%);
  box-shadow:
    inset 0 0 0 4cqw #b9b9c4,
    inset 0 0 0 4.6cqw #6d6d78,
    0 30px 50px -20px rgba(0, 0, 0, 0.8);
}

.back-kicker,
.back-meta,
.back-site {
  font-size: 3.8cqw;
  color: #a7a3b8;
}

.back-kicker {
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.back-logo {
  font-size: 11cqw;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(110deg, #5b2a86 0%, #a35cff 35%, #fff 45%, #a35cff 55%, #5b2a86 100%);
  background-size: 250% 100%;
  background-position: var(--bgx) 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.back-rule {
  width: 30cqw;
  height: 1px;
  margin: 2cqw 0;
  background: linear-gradient(90deg, transparent, #a35cff, transparent);
}

.back-title {
  font-size: 7cqw;
  font-weight: 700;
}

.back-serial {
  margin-top: 4cqw;
  padding: 1.5cqw 4cqw;
  border: 1px solid rgba(240, 210, 122, 0.6);
  border-radius: 999px;
  font-size: 4.2cqw;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #f0d27a;
}

.back-site {
  position: absolute;
  bottom: 9cqw;
}

/* Holo foil: rainbow bands crossed with a fine diagonal sheen, both sliding
   with the tilt, dodged into the art so the brights light up like a holo */
.card-foil,
.card-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.card-foil {
  background-image:
    repeating-linear-gradient(
      0deg,
      #ff7773 0%,
      #ffed5f 7%,
      #a8ff5f 14%,
      #83fff7 21%,
      #7894ff 28%,
      #d875ff 35%,
      #ff7773 42%
    ),
    repeating-linear-gradient(
      133deg,
      #0e152e 0%,
      #8fa3a3 3.8%,
      #9fc4c4 4.5%,
      #8fa3a3 5.2%,
      #0e152e 10%,
      #0e152e 12%
    );
  background-blend-mode: hue;
  background-size: 200% 700%, 300% 100%;
  background-position: 0% var(--bgy), var(--bgx) var(--bgy);
  mix-blend-mode: color-dodge;
  filter: brightness(0.55) contrast(1.4) saturate(1.3);
  opacity: calc(0.2 + var(--hyp) * 0.5);
}

/* Specular highlight that follows the light angle */
.card-glare {
  background: radial-gradient(
    farthest-corner circle at var(--mx) var(--my),
    rgba(255, 255, 255, 0.8) 6%,
    rgba(255, 255, 255, 0.35) 24%,
    rgba(0, 0, 0, 0.35) 90%
  );
  mix-blend-mode: overlay;
  opacity: calc(0.3 + var(--hyp) * 0.55);
}

/* Reduced motion: no spin or tilt, just a fixed, faint sheen */
.card.is-static .card-foil {
  opacity: 0.12;
}

.card.is-static .card-glare {
  opacity: 0.35;
}

/* Zoom view */
.zoom {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  overflow: hidden;
}

.zoom::backdrop {
  background: rgba(8, 6, 16, 0.92);
}

.zoom-viewport {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
}

.zoom-viewport.is-zoomed {
  cursor: grab;
}

.zoom-viewport.is-panning {
  cursor: grabbing;
}

.zoom-content {
  will-change: transform;
}

.zoom .card {
  --card-w: min(84vw, calc(80dvh * 31 / 60));
  cursor: inherit;
  touch-action: none;
}

.zoom-close,
.zoom-toolbar button {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.zoom-close:hover,
.zoom-toolbar button:hover {
  background: rgba(255, 255, 255, 0.24);
}

.zoom-close:focus-visible,
.zoom-toolbar button:focus-visible {
  outline: 2px solid #a35cff;
  outline-offset: 2px;
}

.zoom-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  font-size: 18px;
}

.zoom-toolbar {
  position: absolute;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 2;
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(20, 18, 30, 0.85);
  transform: translateX(-50%);
}

.zoom-toolbar button {
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  font-size: 20px;
}

.zoom-toolbar .zoom-level {
  min-width: 72px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
