/* TOQUIA Cinematic — Scene 04 · Apple Wallet y Google Wallet (commercial priority).
   Two layouts:
   • default  → static composition (no JS, no GSAP, reduced motion, low-power devices): everything visible, in order.
   • .is-animated (set by the scene engine when the pinned timeline runs) → 3D stage driven by js/scene-wallet.mjs. */

.scene#wallet .scene-inner { display: grid; gap: var(--space-sm); }
.is-animated#wallet .scene-inner { padding-top: calc(72px + var(--space-sm)); }
.scene#wallet .scene-copy { max-width: 46rem; }

/* ── Static composition ─────────────────────────────── */
.wallet-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--space-lg);
  padding-bottom: 2rem;
  aspect-ratio: auto;
  perspective: 1600px;
}
.wallet-stage .phone { --phone-w: min(240px, 40vw); }
.wallet-stage > .phone-ios,
.wallet-stage > .phone-android { grid-row: 1; }
.wallet-stage { grid-template-columns: repeat(2, auto); justify-content: center; column-gap: clamp(1rem, 4vw, 3.5rem); }
.wallet-fan {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}
.fan-card { width: min(220px, 42vw); }
.wallet-captions {
  grid-column: 1 / -1;
  display: grid;
  gap: .4rem;
  counter-reset: cap;
  max-width: 34rem;
  font-size: var(--fs-small);
  color: var(--ink-muted);
}
.wallet-captions li { counter-increment: cap; display: flex; gap: .6rem; }
.wallet-captions li::before { content: counter(cap); color: var(--accent); font-weight: 600; min-width: 1rem; }
.wallet-light { display: none; }
.phone-notice.is-on { opacity: 1; }

.wallet-outro {
  display: grid;
  gap: var(--space-md);
  justify-items: center;
  padding-top: var(--space-md);
}
.wallet-benefits {
  display: grid;
  gap: var(--space-sm);
  width: 100%;
  max-width: 64rem;
}
@media (min-width: 760px) { .wallet-benefits { grid-template-columns: repeat(3, 1fr); } }
.wallet-benefits li {
  display: grid;
  gap: .35rem;
  padding: var(--space-sm);
  border-radius: 18px;
  border: 1px solid rgba(255,253,246,.08);
  background: linear-gradient(160deg, rgba(var(--accent-rgb),.07), rgba(255,253,246,.015));
}
.wallet-benefits b { font-weight: 600; font-size: var(--fs-body); }
.wallet-benefits span { font-size: var(--fs-small); color: var(--ink-muted); }
/* Plain-text compatibility line. The official "Add to … Wallet" badges are reserved for places
   where a real pass can be added (Apple guidelines; Google requires a Wallet API flow), so a
   marketing page names the wallets in text instead. */
.wallet-compat { text-align: center; font-size: var(--fs-small); color: var(--ink-muted); margin: 0; }
.wallet-compat b { color: var(--tq-warm-white); font-weight: 600; }

/* Goal chip: hidden in the static layout (the captions list already tells the story). */
.wallet-goal { display: none; }

/* ── Animated 3D stage ──────────────────────────────── */
.is-animated .wallet-stage {
  --stage-h: clamp(300px, calc(100svh - 440px), 620px);   /* copy + header above; phones and captions stay on screen */
  display: block;
  width: 100%;
  height: var(--stage-h);
  padding: 0;
  perspective: 1500px;
  perspective-origin: 50% 35%;
}
.is-animated .wallet-light {
  display: block;
  position: absolute;
  left: 50%;
  bottom: -18%;
  width: 90%;
  height: 80%;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--accent-rgb),.42), rgba(var(--accent-rgb),.14) 45%, rgba(var(--accent-rgb),.04) 70%, transparent 100%);
  transition: opacity .6s var(--ease-out);
  pointer-events: none;
}
.is-animated .wallet-light::after {
  /* Brighter pool for the reward moment: an extra layer that fades in (opacity is compositor-only) */
  content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0;
  background: radial-gradient(closest-side, rgba(52,224,170,.45), rgba(var(--accent-rgb),.12) 50%, transparent 100%);
  transition: opacity .5s var(--ease-out);
}
.is-animated .wallet-light.is-gold::after { opacity: 1; }
.is-animated .wallet-stage .phone {
  --phone-w: min(20vw, calc(var(--stage-h) * .42));
  position: absolute;
  top: 50%;
  margin-top: calc(var(--phone-w) * -1.083);   /* half of 19.5/9 */
}
.is-animated .phone-ios     { left: 31%; margin-left: calc(var(--phone-w) * -.5); }
.is-animated .phone-android { left: 69%; margin-left: calc(var(--phone-w) * -.5); }

.is-animated .wallet-fan {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
  transform-style: preserve-3d;
}
.is-animated .fan-card {
  --card-w: min(17vw, calc(var(--stage-h) * .42));
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--card-w);
  margin-left: calc(var(--card-w) * -.5);
  margin-top: calc(var(--card-w) * -.66);
}

.is-animated .wallet-captions {
  position: absolute;
  left: 50%;
  bottom: .25rem;
  translate: -50% 0;
  width: min(96%, 46rem);
  display: block;
  text-align: center;
  font-size: var(--fs-body);
  color: var(--tq-warm-white);
}
.is-animated .wallet-captions li {
  position: absolute;
  inset: auto 0 0;
  display: block;
  padding: .55em 1.1em;
  width: fit-content;
  margin-inline: auto;
  border-radius: 99px;
  background: rgba(17,20,18,.86);
  border: 1px solid rgba(var(--accent-rgb),.25);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .35s var(--ease-out), transform .45s var(--ease-out);
}
.is-animated .wallet-captions li::before { content: none; }
.is-animated .wallet-captions li.is-on { opacity: 1; transform: none; }
.is-animated .wallet-goal {
  position: absolute;
  left: 50%;
  top: .25rem;
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: .15rem;
  padding: .6em 1.3em .65em;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(228,182,60,.22), rgba(17,20,18,.9) 60%);
  border: 1px solid rgba(228,182,60,.6);
  color: var(--tq-warm-white);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -12px) scale(.94);
  transition: opacity .35s var(--ease-out), transform .5s var(--ease-out);
  pointer-events: none;
}
.is-animated .wallet-goal b { font-size: var(--fs-h3, 1.25rem); font-weight: 650; color: #f2cf6b; }
.is-animated .wallet-goal span { font-size: var(--fs-small); color: var(--tq-warm-white); opacity: .9; }
.is-animated .wallet-goal.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.is-animated .wallet-goal.is-reward b { font-size: var(--fs-body); }
.is-animated .phone-notice { opacity: 0; }
.is-animated .phone-notice.is-on { opacity: 1; }

/* Mobile: phones side by side, businesses in a 2×2 grid */
@media (max-width: 767px) {
  .is-animated .wallet-stage { --stage-h: clamp(260px, calc(100svh - 380px), 480px); }
  .is-animated .wallet-stage .phone { --phone-w: min(40vw, calc(var(--stage-h) * .45)); }
  .is-animated .phone-ios     { left: 27%; }
  .is-animated .phone-android { left: 73%; }
  .is-animated .fan-card { --card-w: min(41vw, calc(var(--stage-h) * .36)); margin-top: calc(var(--card-w) * -.62); }
  .is-animated .wallet-captions { font-size: var(--fs-small); bottom: -.5rem; }
  .is-animated .wallet-goal { top: -.25rem; width: max-content; max-width: 92vw; padding: .45em 1em; }
  .scene#wallet .scene-copy .lead { font-size: var(--fs-small); }
}
.wallet-outro .scene-cta { width: 100%; max-width: 920px; }
