/* Premium foil: the wrapper's look (foil.js builds it). Colors come from --f0 (lightest) to --f4 (darkest), the card's ink. */
@property --sweep { syntax: "<percentage>"; inherits: false; initial-value: -30%; }
@property --hue { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.foil {
  --mx: 32%; --my: 18%; --rx: 0deg; --ry: 0deg;
  position: relative; isolation: isolate; overflow: hidden; display: block;
  clip-path: var(--clip);
  /* Satin metal: broad diagonal bands, light to dark and back, the way a brushed foil catches light. */
  background:
    repeating-linear-gradient(90deg, #ffffff12 0 1px, #00000010 1px 3px),
    linear-gradient(112deg, var(--f3) 0%, var(--f2) 13%, var(--f1) 24%, var(--f0) 29%, var(--f2) 38%, var(--f4) 54%, var(--f2) 66%, var(--f1) 76%, var(--f0) 80%, var(--f2) 90%, var(--f3) 100%);
  animation: foil-drift 9s linear infinite;
}
.foil > span { position: absolute; pointer-events: none; }
/* The crinkled surface of real foil: a lit noise, laid over the metal. */
.foil-crinkle { inset: 0; z-index: 1; mix-blend-mode: soft-light; opacity: 0.8; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='380'%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.045 0.06' numOctaves='2' seed='11' result='n'/%3E%3CfeDiffuseLighting in='n' lighting-color='%23fff' surfaceScale='3.2'%3E%3CfeDistantLight azimuth='225' elevation='52'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E") 0 0 / 100% 100%; }
/* The holographic shimmer: a rainbow that shifts with the angle, strongest in a diagonal band. */
.foil-holo { inset: 0; z-index: 2; mix-blend-mode: color-dodge; opacity: 0.4;
  background: conic-gradient(from var(--hue) at var(--mx) var(--my), #ff5f6d, #ffc371, #f9f871, #62e8a3, #5ec8ff, #a86bff, #ff5f6d);
  -webkit-mask-image: linear-gradient(112deg, transparent 18%, #000 42%, #000 58%, transparent 82%); mask-image: linear-gradient(112deg, transparent 18%, #000 42%, #000 58%, transparent 82%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%; -webkit-mask-position: var(--sweep) 0; mask-position: var(--sweep) 0; }
/* The glint: a soft hot spot under the pointer, and a thin bright edge that sweeps across. */
.foil-sheen { inset: 0; z-index: 3; mix-blend-mode: soft-light;
  background: radial-gradient(circle at var(--mx) var(--my), #ffffff99 0, #ffffff00 40%), linear-gradient(105deg, #fff0 calc(var(--sweep) + 30%), #ffffffa0 calc(var(--sweep) + 36%), #fff0 calc(var(--sweep) + 42%)); }
/* Crimped seals: fine ridges, darker, top and bottom. */
.foil-crimp { left: 0; right: 0; height: 9%; z-index: 4;
  background: repeating-linear-gradient(90deg, #00000038 0 2px, #ffffff40 2px 3px, #0000 3px 6px), linear-gradient(var(--f4), #0000); opacity: 0.8; }
.foil-crimp.top { top: 0; } .foil-crimp.bottom { bottom: 0; transform: scaleY(-1); }
.foil-perf { left: 5%; right: 5%; top: 16%; z-index: 4; border-top: 2px dashed #ffffffb3; filter: drop-shadow(0 1px 0 #0006); }
.foil-print { inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 4px; padding: 22% 8% 24%; text-align: center; color: #fff; }
.foil-logo { display: block; filter: drop-shadow(0 1.5px 0 #ffffff99) drop-shadow(0 -1px 0 #0000008c) drop-shadow(0 6px 6px #0006); }
.foil-name { font: 400 clamp(15px, 4.6vw, 22px)/1 var(--anton, system-ui); letter-spacing: 0.18em; text-transform: uppercase; margin-top: 6px;
  color: #fff; text-shadow: 0 1px 0 #ffffffaa, 0 -1px 0 #0008; }
.foil-label { font: 700 10px/1 var(--mono2, ui-monospace, monospace); letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.85; margin-top: 8px; text-shadow: 0 1px 0 #0007; }
.foil-from { font: 400 clamp(22px, 7vw, 34px)/1.05 var(--anton, system-ui); overflow-wrap: anywhere; text-shadow: 0 1px 0 #ffffff99, 0 -1px 0 #0009, 0 3px 6px #0005; }
.foil.lit { animation: none; }
@keyframes foil-drift { 0% { --sweep: -30%; --hue: 0deg; } 50% { --sweep: 70%; --hue: 180deg; } 100% { --sweep: -30%; --hue: 360deg; } }
.foil.lit { --sweep: 28%; --hue: calc(var(--mx) * 3.6); }
@media (prefers-reduced-motion: reduce) { .foil { animation: none; --sweep: 22%; } }
@media (forced-colors: active) { .foil { forced-color-adjust: none; } }
/* The inbox: foil packs, two across, each tilting toward the finger. */
.packs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 18px; }
.pack { position: relative; aspect-ratio: 5 / 8; width: 100%; min-height: 0; padding: 0; border: 0; background: none; display: block; cursor: pointer; filter: drop-shadow(0 12px 14px #000a) drop-shadow(0 0 1.5px #fff8); clip-path: none; transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 160ms ease-out; border-radius: 0; }
.pack::before { display: none; }
.pack:nth-child(even) { transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.pack .foil { position: absolute; inset: 0; }
.pack:not(.lit) .foil { }
@media (hover: hover) { .pack:hover { transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px) scale(1.03); } }
.pack:focus-visible { outline: 3px solid #ffd23f; outline-offset: 6px; }
.pack .tearcue { position: absolute; left: 0; right: 0; bottom: 12%; z-index: 6; font: 700 11px/1 var(--mono2, ui-monospace, monospace); letter-spacing: 0.1em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 0 #0008; }
/* The flat pack (no 3D): the same foil, full size, tearing at the strip. */
.flat-pack.foil { border: 0; border-radius: 0; box-shadow: none; }
.flat-pack .flat-pack-strip { top: 0; height: 16%; z-index: 7; background: linear-gradient(112deg, var(--f3), var(--f1) 30%, var(--f0) 45%, var(--f2) 70%, var(--f3)); border-bottom: 2px dashed #ffffffb3; }

/* The print is a card back, full bleed; the foil's light plays over it. */
.foil-art { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.foil[data-kind="daily"] { --f0: #ffffff; --f1: #dfe3ea; --f2: #aeb4c2; --f3: #6d7385; --f4: #2a2d38; }
.foil .foil-holo { opacity: 0.6; }
.foil .foil-sheen { mix-blend-mode: screen; opacity: 0.5; }
.foil[data-kind="daily"] .foil-holo { opacity: 0.75; }
.foil { box-shadow: inset 0 0 0 2px #ffffff55; }
.foil-perf { display: none; }
.pack .tearcue { left: 50%; right: auto; bottom: 11%; transform: translateX(-50%); padding: 6px 10px; border-radius: 99px; background: #000000b3; white-space: nowrap; box-shadow: 0 0 0 1.5px #ffffff66; }
