/* Loyalty card: copy of shared-storefront/loyalty-card.css (without the colour picker) for the landing. Keep in sync by hand. */
/*
 * Loyalty card as a frosted glass pane in card proportions
 * (85.6 x 54). Colour blobs live inside the pane and are clipped by it.
 * The customer picks the palette; VENUE follows the storefront --primary.
 */
.ylc {
  --ylc-radius: 22px;
  --ylc-accent: var(--primary, #2f6b4f);
  --ylc-a: color-mix(in srgb, var(--ylc-accent) 78%, #fff);
  --ylc-b: color-mix(in srgb, var(--ylc-accent) 35%, #ffb27a);
  --ylc-c: color-mix(in srgb, var(--ylc-accent) 20%, #ffe08a);
  --ylc-base: color-mix(in srgb, var(--ylc-accent) 14%, #f6f4f0);
  --ylc-frost: rgb(255 255 255 / 34%);
  --ylc-ink: var(--text, #171717);
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 6px 0 18px;
  perspective: 1100px;
}

.ylc[data-card-style="ice"] {
  --ylc-a: #dfe9f3;
  --ylc-b: #c7d3e2;
  --ylc-c: #f4e6ff;
  --ylc-base: #eef2f6;
  --ylc-frost: rgb(255 255 255 / 40%);
  --ylc-ink: #1d2733;
}

.ylc[data-card-style="sunset"] {
  --ylc-a: #ff9a6b;
  --ylc-b: #ff5e7e;
  --ylc-c: #ffd36b;
  --ylc-base: #ffe3d2;
  --ylc-ink: #34140c;
}

.ylc[data-card-style="berry"] {
  --ylc-a: #b46bff;
  --ylc-b: #ff6bb5;
  --ylc-c: #6b8bff;
  --ylc-base: #efe1ff;
  --ylc-ink: #26103a;
}

.ylc[data-card-style="night"] {
  --ylc-a: #2f5bff;
  --ylc-b: #8fb2ff;
  --ylc-c: #0b1a66;
  --ylc-base: #05070f;
  --ylc-frost: rgb(8 12 30 / 34%);
  --ylc-ink: #f4f6ff;
}

.ylcCard {
  --ylc-rx: 0deg;
  --ylc-ry: 0deg;
  --ylc-gx: 30%;
  --ylc-gy: 0%;
  position: relative;
  display: block;
  width: min(100%, 380px);
  aspect-ratio: 85.6 / 54;
  padding: 0;
  border: 0;
  border-radius: var(--ylc-radius);
  background: var(--ylc-base);
  box-shadow:
    0 20px 38px -20px color-mix(in srgb, var(--ylc-a) 70%, rgb(0 0 0 / 45%)),
    0 2px 8px rgb(0 0 0 / 8%);
  color: var(--ylc-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transform: rotateX(var(--ylc-rx)) rotateY(var(--ylc-ry));
  transition: transform 420ms cubic-bezier(.2, .8, .2, 1);
  -webkit-tap-highlight-color: transparent;
}

.ylcCard[data-tilting="true"] { transition: transform 90ms linear; }

.ylcCard:focus-visible {
  outline: 2px solid var(--text, #171717);
  outline-offset: 4px;
}

.ylcGlass {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: inherit;
  /* Explicitly clip filtered/composited layers, including in iOS WebKit. */
  clip-path: inset(0 round var(--ylc-radius));
  background: var(--ylc-base);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 70%);
  isolation: isolate;
  transition: background-color 400ms ease;
}

/* Colour lives inside the card and is clipped by its edges. */
.ylcBlobs {
  position: absolute;
  inset: 0;
  filter: blur(26px) saturate(140%);
}

.ylcBlobs i {
  position: absolute;
  border-radius: 50%;
  transition: background-color 400ms ease;
  will-change: transform;
}

.ylcBlobs i:nth-child(1) {
  top: -30%;
  left: -12%;
  width: 62%;
  aspect-ratio: 1;
  background: var(--ylc-a);
  animation: ylc-orbit-a 14s ease-in-out infinite alternate;
}

.ylcBlobs i:nth-child(2) {
  right: -16%;
  bottom: -46%;
  width: 70%;
  aspect-ratio: 1;
  background: var(--ylc-b);
  animation: ylc-orbit-b 17s ease-in-out infinite alternate;
}

.ylcBlobs i:nth-child(3) {
  top: 20%;
  left: 38%;
  width: 38%;
  aspect-ratio: 1;
  background: var(--ylc-c);
  animation: ylc-orbit-c 11s ease-in-out infinite alternate;
}

/* Frosted pane */
.ylcFrost {
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, var(--ylc-frost), transparent 60%);
}

/* Prism refraction: drifts on its own and follows the pointer */
.ylcPrism {
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    115deg,
    transparent 38%,
    rgb(255 120 120 / 45%) 44%,
    rgb(255 220 120 / 45%) 47%,
    rgb(120 255 180 / 45%) 50%,
    rgb(120 180 255 / 45%) 53%,
    rgb(200 130 255 / 45%) 56%,
    transparent 62%
  );
  opacity: .5;
  mix-blend-mode: overlay;
  translate: calc((var(--ylc-gx) - 30%) * .6) 0;
  animation: ylc-prism 9s ease-in-out infinite alternate;
  pointer-events: none;
}

/* Soft light that follows the pointer */
.ylcGlare {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ylc-gx) var(--ylc-gy), rgb(255 255 255 / 40%), rgb(255 255 255 / 0%) 50%);
  pointer-events: none;
}

/* One sweep on arrival and after every tap */
.ylcSheen {
  position: absolute;
  inset: -20% -60%;
  background: linear-gradient(105deg, transparent 40%, rgb(255 255 255 / 50%) 48%, rgb(255 255 255 / 8%) 54%, transparent 60%);
  transform: translateX(-60%);
  animation: ylc-sheen 1100ms 260ms cubic-bezier(.4, 0, .2, 1) both;
  pointer-events: none;
}

.ylcTop {
  position: absolute;
  top: 9%;
  left: 7%;
  right: 7%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ylcLogo {
  max-width: 50%;
  max-height: 34px;
  object-fit: contain;
  object-position: left center;
}

.ylcWordmark {
  min-width: 0;
  overflow: hidden;
  font-family: var(--storefront-font-heading, inherit);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ylcKind {
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--ylc-ink) 66%, transparent);
  font-size: 12px;
  font-weight: 600;
}

.ylcSide {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 10%;
  transition: opacity 260ms ease, transform 360ms cubic-bezier(.2, .8, .2, 1);
}

.ylcFront { display: grid; gap: 4px; }

.ylcBack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  opacity: 0;
  transform: translateY(10px);
}

.ylcCard.is-flipped .ylcFront { opacity: 0; transform: translateY(-10px); }
.ylcCard.is-flipped .ylcBack { opacity: 1; transform: none; }

.ylcBalance { display: flex; align-items: baseline; gap: 6px; }

.ylcBalance strong {
  font-size: clamp(28px, 9vw, 38px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}

.ylcBalance small {
  color: color-mix(in srgb, var(--ylc-ink) 66%, transparent);
  font-size: 14px;
  font-weight: 600;
}

.ylcMeta {
  overflow: hidden;
  color: color-mix(in srgb, var(--ylc-ink) 72%, transparent);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ylcBack > span { display: grid; gap: 2px; min-width: 0; }

.ylcBack small {
  color: color-mix(in srgb, var(--ylc-ink) 66%, transparent);
  font-size: 11px;
}

.ylcBack b {
  overflow: hidden;
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes ylc-sheen {
  from { transform: translateX(-60%); }
  to { transform: translateX(60%); }
}

@keyframes ylc-orbit-a {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(38%, 22%) scale(1.15); }
  100% { transform: translate(12%, 46%) scale(.92); }
}

@keyframes ylc-orbit-b {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-34%, -20%) scale(.9); }
  100% { transform: translate(-12%, -38%) scale(1.12); }
}

@keyframes ylc-orbit-c {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-60%, 30%) scale(1.25); }
  100% { transform: translate(40%, -20%) scale(.85); }
}

@keyframes ylc-prism {
  from { transform: translateX(-12%); }
  to { transform: translateX(12%); }
}

@media (max-width: 380px) {
  .ylcLogo { max-height: 28px; }
  .ylcWordmark { font-size: 15px; }
  .ylcBack b { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .ylcCard,
  .ylcSide { transition: none; animation: none; }
  .ylcBlobs i,
  .ylcPrism { animation: none; }
  .ylcSheen { display: none; }
}
