/* The Add to Wallet button with the concert ticket that folds into its pocket. A dark velvet stage (a violet haze
   behind, a warm light from below, a fine grain) and in the middle one component, 300 by 332 pixels, scaled down on
   small screens as a whole: at the bottom the pill, in the middle the wallet pocket, above it the room where the
   ticket comes out, shows its foil, folds and drops in. The ticket lives in a window (.aw__clip) that ends at the
   middle of the pill, so it really comes out of the pill and never shows underneath. */
:root {
  --page: #09070d;            /* the stage */
  --haze: #2a1b43;            /* the violet light behind */
  --rose: #ff5c9e;            /* the festival colour: disc, ticket glow, light */
  --amber: #ffb35e;           /* the warm second colour of the ticket */
  --violet: #8d6bff;          /* the cold third colour, in the foil and the edges */
  --lacquer: #141019;         /* the pill */
  --leather: #221a28;         /* the wallet pocket */
  --ink: #f7f1ea;             /* the words */
  --muted: rgba(247, 241, 234, 0.56); /* the small lines */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* the stage: a violet haze behind, a warm light rising from the floor and a fine grain */
.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 12px 16px;
  overflow: hidden;
  background:
    radial-gradient(min(80vw, 560px) min(56vh, 400px) at 50% 36%, color-mix(in srgb, var(--haze) 88%, transparent), transparent 70%),
    radial-gradient(min(110vw, 820px) min(60vh, 460px) at 50% 118%, color-mix(in srgb, var(--rose) 13%, transparent), transparent 70%),
    var(--page);
}

.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.92 0 0 0 0 0.95 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* the box that keeps the layout at the scaled size (JS sets --k from the window) */
.fit {
  --k: 1;
  position: relative;
  z-index: 1;
  width: calc(300px * var(--k));
  height: calc(332px * var(--k));
}

.aw {
  position: absolute;
  left: 0;
  top: 0;
  width: 300px;
  height: 332px;
  transform: scale(var(--k));
  transform-origin: 0 0;
}

/* the warm light the pill throws on the floor */
.aw__spill {
  position: absolute;
  left: 50%;
  top: 316px;
  width: 300px;
  height: 40px;
  margin-left: -150px;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rose) 55%, transparent), color-mix(in srgb, var(--amber) 16%, transparent) 55%, transparent);
  filter: blur(14px);
  opacity: 0.18;
  pointer-events: none;
}

/* the window everything above the middle of the pill lives in */
.aw__clip {
  position: absolute;
  left: -60px;
  right: -60px;
  top: -60px;
  bottom: 32px;
  overflow: hidden;
  pointer-events: none;
}

.aw__space {
  position: absolute;
  left: 60px;
  top: 60px;
  width: 300px;
  height: 332px;
}

/* ------------------------------------------------------------ the wallet pocket */
.pk {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.pk__back {
  position: absolute;
  left: 72px;
  top: 140px;
  width: 156px;
  height: 98px;
  border-radius: 16px 16px 15px 15px;
  background:
    linear-gradient(180deg, rgba(255, 236, 230, 0.07), rgba(255, 236, 230, 0) 40%),
    #120e16;
  box-shadow:
    inset 0 0 0 1px rgba(255, 236, 230, 0.06),
    inset 0 1px 0 rgba(255, 236, 230, 0.1),
    0 22px 40px -22px rgba(0, 0, 0, 0.95);
}

/* the two passes already in the wallet: a ferry and a museum, only their tops peek out */
.pk__pass {
  position: absolute;
  height: 100px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.12) inset, 0 4px 10px rgba(0, 0, 0, 0.5);
}

.pk__pass--a {
  left: 86px;
  top: 128px;
  width: 128px;
  background: linear-gradient(180deg, #3d6b78, #1f3a44);
}

.pk__pass--b {
  left: 92px;
  top: 136px;
  width: 116px;
  background: linear-gradient(180deg, #d9cbb4, #9d8e78);
}

.pk__pass-band {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 6px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
}

.pk__pass--b .pk__pass-band {
  background: rgba(40, 30, 20, 0.28);
}

/* the front of the pocket: soft leather, a stitch, a thumb cut at the top */
.pk__front {
  position: absolute;
  z-index: 4;
  left: 72px;
  top: 150px;
  width: 156px;
  height: 88px;
  border-radius: 10px 10px 16px 16px;
  background:
    repeating-linear-gradient(35deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 50% 0%, rgba(255, 220, 230, 0.1), transparent 60%),
    linear-gradient(180deg, #2b2231, var(--leather) 45%, #15111a);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 230, 0.16),
    inset 0 0 0 1px rgba(255, 236, 230, 0.05),
    inset 0 -10px 16px -10px rgba(0, 0, 0, 0.7),
    0 -6px 14px -8px rgba(0, 0, 0, 0.9);
  -webkit-mask: radial-gradient(circle 17px at 50% -4px, #0000 96%, #000 100%);
  mask: radial-gradient(circle 17px at 50% -4px, #0000 96%, #000 100%);
  overflow: hidden;
}

.pk__stitch {
  position: absolute;
  inset: 6px;
  border-radius: 7px 7px 11px 11px;
  border: 1px dashed rgba(255, 228, 214, 0.17);
}

.pk__glint {
  position: absolute;
  top: -20%;
  left: 0;
  width: 40%;
  height: 140%;
  background: linear-gradient(100deg, transparent, rgba(255, 236, 230, 0.16) 50%, transparent);
  transform: translateX(-160%) skewX(-18deg);
}

.pk__label,
.pk__count {
  position: absolute;
  bottom: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 560;
  font-variation-settings: 'wdth' 104;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--muted);
}

.pk__label {
  left: 14px;
}

.pk__label svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
}

.pk__count {
  right: 14px;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}

.pk__digit {
  display: inline-flex;
  flex-direction: column;
  height: 1.2em;
  overflow: hidden;
  color: var(--ink);
  font-weight: 680;
}

.pk__digit > span {
  display: block;
  height: 1.2em;
}

/* ------------------------------------------------------------ the ticket */
.tk {
  --hp: 30%;
  --sx: 30%;
  --sy: 30%;
  position: absolute;
  z-index: 5;
  left: 34px;
  top: 0;
  width: 232px;
  height: 124px;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.55)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
  will-change: transform;
}

.tk__half {
  position: absolute;
  top: 0;
  width: 116px;
  height: 124px;
  overflow: hidden;
  /* one background for the two halves: 200% wide, the left half shows its left side and the stub its right */
  background:
    radial-gradient(70% 70% at 6% 0%, color-mix(in srgb, var(--rose) 62%, transparent), transparent 70%),
    radial-gradient(60% 80% at 100% 100%, color-mix(in srgb, var(--amber) 44%, transparent), transparent 70%),
    radial-gradient(50% 60% at 62% 30%, color-mix(in srgb, var(--violet) 30%, transparent), transparent 70%),
    linear-gradient(160deg, #2c1838, #150c21 60%, #1d1020);
  background-size: 200% 100%;
  box-shadow: inset 0 1px 0 rgba(255, 236, 246, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

.tk__main {
  left: 0;
  border-radius: 13px 0 0 13px;
  background-position: 0 0;
  -webkit-mask:
    radial-gradient(circle 6.5px at 100% 0, #0000 95%, #000 100%) top / 100% 51% no-repeat,
    radial-gradient(circle 6.5px at 100% 100%, #0000 95%, #000 100%) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle 6.5px at 100% 0, #0000 95%, #000 100%) top / 100% 51% no-repeat,
    radial-gradient(circle 6.5px at 100% 100%, #0000 95%, #000 100%) bottom / 100% 51% no-repeat;
}

.tk__stub {
  left: 116px;
  border-radius: 0 13px 13px 0;
  background-position: 100% 0;
  -webkit-mask:
    radial-gradient(circle 6.5px at 0 0, #0000 95%, #000 100%) top / 100% 51% no-repeat,
    radial-gradient(circle 6.5px at 0 100%, #0000 95%, #000 100%) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle 6.5px at 0 0, #0000 95%, #000 100%) top / 100% 51% no-repeat,
    radial-gradient(circle 6.5px at 0 100%, #0000 95%, #000 100%) bottom / 100% 51% no-repeat;
}

/* the back of the stub: it lands on the left half when the ticket folds */
.tk__back {
  left: 0;
  border-radius: 13px 0 0 13px;
  background:
    radial-gradient(80% 70% at 30% 20%, color-mix(in srgb, var(--violet) 36%, transparent), transparent 70%),
    radial-gradient(70% 70% at 90% 100%, color-mix(in srgb, var(--rose) 40%, transparent), transparent 70%),
    linear-gradient(200deg, #24143a, #120a1d);
  box-shadow: inset -1.5px 0 0 rgba(255, 236, 246, 0.24), inset 0 1px 0 rgba(255, 236, 246, 0.18);
  -webkit-mask:
    radial-gradient(circle 6.5px at 100% 0, #0000 95%, #000 100%) top / 100% 51% no-repeat,
    radial-gradient(circle 6.5px at 100% 100%, #0000 95%, #000 100%) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle 6.5px at 100% 0, #0000 95%, #000 100%) top / 100% 51% no-repeat,
    radial-gradient(circle 6.5px at 100% 100%, #0000 95%, #000 100%) bottom / 100% 51% no-repeat;
  visibility: hidden;
}

/* the holographic foil: fine diffraction lines, a rainbow band and a highlight, all moved by the pointer */
.tk__foil {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.5;
  background:
    radial-gradient(circle at var(--sx) var(--sy), rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.05) 22%, transparent 42%),
    linear-gradient(112deg, transparent 32%, rgba(255, 120, 200, 0.42) 41%, rgba(140, 220, 255, 0.4) 49%, rgba(255, 236, 150, 0.36) 56%, rgba(190, 150, 255, 0.3) 62%, transparent 70%) var(--hp) 50% / 260% 100% no-repeat,
    repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 4px);
}

.tk__stub .tk__foil {
  left: -100%;
}

.tk__back .tk__foil {
  width: 100%;
}

.tk__foil--strong {
  opacity: 0.7;
}

/* the shadow that grows on the left half while the stub folds over it */
.tk__crease {
  position: absolute;
  inset: 0;
  background: linear-gradient(270deg, rgba(8, 4, 14, 0.75), rgba(8, 4, 14, 0.2) 55%, transparent);
  opacity: 0;
  z-index: 2;
}

.tk__brand {
  position: absolute;
  left: 13px;
  top: 13px;
  font-size: 12.5px;
  font-weight: 780;
  font-variation-settings: 'wdth' 125;
  letter-spacing: 0.15em;
  line-height: 1;
  color: var(--ink);
}

.tk__event {
  position: absolute;
  left: 13px;
  top: 30px;
  font-size: 9px;
  font-weight: 480;
  font-variation-settings: 'wdth' 96;
  letter-spacing: 0.02em;
  color: rgba(247, 241, 234, 0.66);
  white-space: nowrap;
}

.tk__date {
  position: absolute;
  left: 12px;
  top: 58px;
  font-size: 21px;
  font-weight: 640;
  font-variation-settings: 'wdth' 88;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}

.tk__date b {
  font-weight: 480;
  font-variation-settings: 'wdth' 100;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: color-mix(in srgb, var(--amber) 80%, white);
  vertical-align: 5px;
  margin-right: 2px;
}

.tk__meta {
  position: absolute;
  left: 13px;
  top: 84px;
  font-size: 9px;
  font-weight: 520;
  letter-spacing: 0.02em;
  color: rgba(247, 241, 234, 0.7);
  white-space: nowrap;
}

.tk__wave {
  position: absolute;
  left: 13px;
  bottom: 9px;
  width: 64px;
  height: 10px;
  overflow: visible;
}

.tk__wave path {
  fill: none;
  stroke: color-mix(in srgb, var(--rose) 70%, white);
  stroke-width: 1.3;
  stroke-linecap: round;
  opacity: 0.7;
}

.tk__perf {
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  border-left: 1.4px dashed rgba(247, 241, 234, 0.26);
}

.tk__qr {
  position: absolute;
  left: 50%;
  top: 12px;
  width: 58px;
  height: 58px;
  margin-left: -29px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.tk__qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tk__qr-bg {
  fill: #f7f1ea;
}

.tk__qr path {
  fill: #160d1f;
}

.tk__seat {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 13px;
  display: flex;
  justify-content: space-between;
}

.tk__seat > span {
  display: grid;
  gap: 2px;
}

.tk__seat i {
  font-style: normal;
  font-size: 8px;
  font-weight: 560;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(247, 241, 234, 0.6);
}

.tk__seat b {
  font-size: 17px;
  font-weight: 660;
  font-variation-settings: 'wdth' 90;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.tk__back-mark {
  position: absolute;
  left: 0;
  right: 0;
  top: 14px;
  text-align: center;
  font-size: 10px;
  font-weight: 780;
  font-variation-settings: 'wdth' 125;
  letter-spacing: 0.2em;
  color: rgba(247, 241, 234, 0.85);
}

.tk__back-moon {
  position: absolute;
  left: 50%;
  top: 38px;
  width: 44px;
  height: 44px;
  margin-left: -22px;
}

.tk__back-moon circle {
  fill: none;
  stroke: rgba(247, 241, 234, 0.5);
  stroke-width: 1;
}

.tk__back-moon circle:first-child {
  fill: color-mix(in srgb, var(--rose) 30%, transparent);
  stroke: rgba(247, 241, 234, 0.7);
}

.tk__back-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  text-align: center;
  font-size: 8.5px;
  font-weight: 520;
  letter-spacing: 0.06em;
  color: rgba(247, 241, 234, 0.62);
}

/* ------------------------------------------------------------ the pill */
.aw__btn {
  position: absolute;
  z-index: 10;
  left: 0;
  top: 270px;
  width: 300px;
  height: 60px;
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}

.aw__btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--rose) 70%, white);
  outline-offset: 5px;
}

.aw__body {
  --mx: 30%;
  --my: 50%;
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  isolation: isolate;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.85),
    0 8px 18px -10px rgba(0, 0, 0, 0.9),
    0 26px 50px -24px rgba(0, 0, 0, 1),
    0 14px 30px -20px color-mix(in srgb, var(--rose) 36%, transparent);
}

.aw__fill,
.aw__shine,
.aw__sweep,
.aw__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

.aw__fill {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(255, 228, 240, 0.085), rgba(255, 228, 240, 0.012) 50%, rgba(0, 0, 0, 0.3)),
    var(--lacquer);
}

.aw__shine {
  background: radial-gradient(100px 64px at var(--mx) var(--my), rgba(255, 220, 236, 0.15), rgba(255, 220, 236, 0.04) 50%, transparent 72%);
  opacity: 0;
}

.aw__sweep-band {
  position: absolute;
  top: -30%;
  left: 0;
  width: 34%;
  height: 160%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 238, 244, 0.05) 30%, rgba(255, 238, 244, 0.26) 50%, rgba(255, 238, 244, 0.05) 70%, transparent 100%);
  transform: translateX(-140%) skewX(-16deg);
}

.aw__edge {
  z-index: 3;
  box-shadow:
    inset 0 0 0 1px rgba(255, 210, 230, 0.12),
    inset 0 1px 0 rgba(255, 220, 236, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    inset 0 -12px 18px -12px rgba(0, 0, 0, 0.7);
}

.aw__edge::after {
  content: '';
  position: absolute;
  left: 9%;
  right: 9%;
  top: 1px;
  height: 44%;
  border-radius: 999px 999px 40% 40%;
  background: linear-gradient(180deg, rgba(255, 230, 240, 0.08), rgba(255, 230, 240, 0));
}

/* the slit on the top edge the ticket comes out of: it lights up while the ticket passes */
.aw__slit {
  position: absolute;
  z-index: 4;
  left: 40px;
  right: 40px;
  top: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--rose) 70%, white) 30%, #fff4f8 50%, color-mix(in srgb, var(--amber) 70%, white) 70%, transparent);
  box-shadow: 0 0 10px 1px color-mix(in srgb, var(--rose) 50%, transparent);
  opacity: 0;
  transform: scaleX(0.4);
}

.aw__row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px 0 8px;
  gap: 12px;
}

.aw__disc {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.aw__disc > * {
  grid-area: 1 / 1;
  position: relative;
}

.aw__plate {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 232, 240, 0.55), transparent 52%),
    linear-gradient(150deg, var(--rose), #c2307a 55%, #6b2fb8);
  box-shadow:
    inset 0 0 0 1px rgba(255, 210, 230, 0.22),
    inset 0 1px 0 rgba(255, 236, 244, 0.55),
    inset 0 -3px 6px rgba(60, 0, 40, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.55),
    0 4px 14px -4px color-mix(in srgb, var(--rose) 55%, transparent);
}

.aw__icon,
.aw__tick {
  width: 22px;
  height: 22px;
  overflow: visible;
}

.aw__icon path {
  fill: none;
  stroke: #fff6f9;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.aw__icon .aw__icon-perf {
  stroke-dasharray: 1.4 1.6;
  stroke-width: 1.3;
}

.aw__tick {
  opacity: 0;
}

.aw__tick path {
  fill: none;
  stroke: #fff6f9;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.aw__text {
  flex: 1;
  display: grid;
  min-width: 0;
  text-align: left;
}

.aw__state {
  grid-area: 1 / 1;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.aw__state + .aw__state {
  opacity: 0;
}

.aw__title {
  font-size: 15.5px;
  font-weight: 600;
  font-variation-settings: 'wdth' 102;
  letter-spacing: 0.002em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

.aw__title-soft {
  font-weight: 480;
  font-variation-settings: 'wdth' 96;
  color: rgba(247, 241, 234, 0.78);
}

.aw__title--busy {
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 38%, #ffffff 46%, color-mix(in srgb, var(--rose) 60%, white) 50%, #ffffff 54%, var(--ink) 62%, var(--ink) 100%);
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

.aw__sub {
  font-size: 11.5px;
  font-weight: 460;
  font-variation-settings: 'wdth' 96;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
