/* Wallet landing — flat pocket + stacked cards; brand gradient on AI surfaces */

@keyframes wallet-slot-cycle {
  0%,
  15% {
    height: 96px;
  }
  25%,
  55% {
    height: var(--wallet-slot-expanded);
  }
  70%,
  100% {
    height: 96px;
  }
}

@keyframes wallet-card-loyalty-cycle {
  0%,
  15%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(-2deg);
  }
  25%,
  55% {
    transform: translateX(-50%) translateY(88px) rotate(-11deg);
  }
  70% {
    transform: translateX(-50%) translateY(0) rotate(-2deg);
  }
}

@keyframes wallet-card-pass-cycle {
  0%,
  15%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(2.5deg);
  }
  25%,
  55% {
    transform: translateX(-50%) translateY(52px) rotate(9deg);
  }
  70% {
    transform: translateX(-50%) translateY(0) rotate(2.5deg);
  }
}

@keyframes wallet-card-ai-cycle {
  0%,
  15%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(-1.5deg);
  }
  25%,
  55% {
    transform: translateX(-50%) translateY(22px) rotate(-8deg);
  }
  70% {
    transform: translateX(-50%) translateY(0) rotate(-1.5deg);
  }
}

.hero--wallet {
  min-height: min(92vh, 920px);
}

.hero--wallet .hero__bg {
  opacity: 1;
}

.hero--wallet .hero__orb {
  display: none;
}

.hero--wallet .hero__grid {
  opacity: 0.2;
  mask-image: none;
}

.hero-wallet-deck {
  position: relative;
  perspective: 1100px;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4) 0;
}

/* Pocket frame — theme-aware slate (not pure black) */
.wallet-pocket {
  /* Taller slot when fanned so staggered cards + labels stay inside the clip */
  --wallet-slot-expanded: 420px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  border-radius: 32px;
  background: var(--wallet-shell-bg);
  border: 1px solid var(--wallet-shell-border);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: border-color 0.25s ease;
  outline: none;
}

.wallet-pocket:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--wallet-shell-border));
}

/* Top slot: cards peek from the opening; cycles open/closed via animation */
.wallet-pocket__slot {
  position: relative;
  height: 96px;
  overflow: hidden;
  flex-shrink: 0;
  animation: wallet-slot-cycle 10s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.wallet-pocket:focus-within .wallet-pocket__slot {
  animation: none;
  height: var(--wallet-slot-expanded);
}

.wallet-pocket__well {
  flex: 0 0 auto;
  height: 56px;
  min-height: 0;
  background: var(--wallet-shell-bg);
}

.wallet-pocket__footer {
  padding: var(--space-5) var(--space-5) var(--space-6);
  border-top: 1px solid var(--wallet-shell-divider);
  text-align: center;
}

/* Visual aid: icon + balance (mirrors demo-visual-aid step pattern) */
.wallet-pocket__aid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  text-align: left;
}

.wallet-pocket__aid-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--wallet-shell-border));
}

.wallet-pocket__aid-copy {
  min-width: 0;
}

.wallet-pocket__total {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.125rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--wallet-shell-text);
  font-variant-numeric: tabular-nums;
}

.wallet-pocket__label {
  margin: var(--space-1) 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--wallet-shell-text-muted);
}

/* Individual cards — flat fills, no shadows */
.wallet-card {
  position: absolute;
  left: 50%;
  width: min(300px, calc(100% - 28px));
  height: 188px;
  box-sizing: border-box;
  border-radius: 18px;
  transform-origin: 50% 100%;
  transition: border-color 0.25s ease;
}

.wallet-card--loyalty {
  top: 62px;
  z-index: 1;
  background: #2563eb;
  color: #fff;
  transform: translateX(-50%) translateY(0) rotate(-2deg);
  animation: wallet-card-loyalty-cycle 10s cubic-bezier(0.45, 0, 0.55, 1)
    infinite;
}

/* Pass is front layer; AI is middle (2nd slot) */
.wallet-card--pass {
  top: 12px;
  z-index: 3;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  transform: translateX(-50%) translateY(0) rotate(-1.5deg);
  animation: wallet-card-ai-cycle 10s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.wallet-card--ai {
  display: flex;
  flex-direction: column;
  top: 38px;
  z-index: 2;
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, #333);
  transform: translateX(-50%) translateY(0) rotate(2.5deg);
  animation: wallet-card-pass-cycle 10s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.wallet-card__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.wallet-card__row--top {
  padding: var(--space-5) var(--space-5) var(--space-2);
}

.wallet-card__row--bottom {
  align-items: flex-end;
  padding: 0 var(--space-5) var(--space-5);
  margin-top: auto;
}

.wallet-card--loyalty,
.wallet-card--pass {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.wallet-card__issuer {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.wallet-card--pass .wallet-card__issuer {
  color: #64748b;
  opacity: 1;
}

.wallet-card__logo {
  height: 22px;
  width: auto;
  flex-shrink: 0;
}

.wallet-card__logo--dark {
  opacity: 0.92;
}

.wallet-card__amount {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.wallet-card__amount--dark {
  color: #0f172a;
}

.wallet-card__caption {
  margin: var(--space-2) 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.85;
}

.wallet-card__caption--muted {
  color: #64748b;
  opacity: 1;
}

/* AI-only gradient surfaces */
.wallet-card__ai-strip {
  height: 44px;
  background: var(--ai-gradient);
  flex-shrink: 0;
}

.wallet-card__ai-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-5) var(--space-5);
  background: color-mix(in srgb, #121018 82%, var(--accent) 18%);
  min-height: 0;
  justify-content: flex-start;
  gap: var(--space-2);
}

.wallet-card__row--ai-top {
  padding: 0;
  margin-bottom: 0;
}

.wallet-card__label-ai {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--ai-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wallet-card__spark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.wallet-card__ai-line {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(241, 245, 249, 0.88);
}

.wallet-card__ai-line strong {
  color: #fafafa;
  font-weight: 700;
}

.wallet-card__chip {
  width: 100%;
  height: auto;
  display: block;
}

/* Keyboard / focus: hold fanned layout without motion */
.wallet-pocket:focus-within .wallet-card--loyalty {
  animation: none;
  transform: translateX(-50%) translateY(88px) rotate(-11deg);
}

.wallet-pocket:focus-within .wallet-card--pass {
  animation: none;
  transform: translateX(-50%) translateY(22px) rotate(-8deg);
}

.wallet-pocket:focus-within .wallet-card--ai {
  animation: none;
  transform: translateX(-50%) translateY(52px) rotate(9deg);
}

@media (prefers-reduced-motion: reduce) {
  .wallet-pocket__slot {
    animation: none;
    height: var(--wallet-slot-expanded);
  }

  .wallet-card--loyalty,
  .wallet-card--pass,
  .wallet-card--ai {
    animation: none;
  }

  .wallet-card--loyalty {
    transform: translateX(-50%) translateY(88px) rotate(-11deg);
  }

  .wallet-card--pass {
    transform: translateX(-50%) translateY(22px) rotate(-8deg);
  }

  .wallet-card--ai {
    transform: translateX(-50%) translateY(52px) rotate(9deg);
  }
}

/* Mini stat chips under hero copy (flat) */
.wallet-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.wallet-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  font-size: 0.8125rem;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.wallet-chip:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--text) 15%, var(--border));
}

.wallet-chip svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.wallet-chip strong {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.wallet-chip span {
  font-weight: 600;
  color: var(--text);
}

/* SVG illustration wrappers (demo / misc) */
.wallet-svg-frame {
  margin: var(--space-3) 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  padding: var(--space-3);
}

.wallet-svg-frame svg {
  display: block;
  width: 100%;
  height: auto;
}
