/* The get tickets button with the stage lights behind the glass. One rounded box of frosted glass (.tk__glass, moved
   only by GSAP): a dark base, two stage beams that pivot from just under the bottom edge (.tk__beam, turned only by the
   script), a soft spot for the held seats, a drifting haze, the light under the pointer and a frosted pane with grain
   and a 1px edge on top. Behind the glass the same two beams come out of its top edge as faint rays (.tk__rays). */
:root {
  --page: #09080c;            /* the page */
  --glass: #15131b;           /* the body of the button */
  --ink: #f4f1fb;             /* the words */
  --muted: rgba(244, 241, 251, 0.56); /* the small words */
  --lilac: #a897ff;           /* the first stage light */
  --rose: #ff7aae;            /* the second stage light */
  --edge: rgba(255, 255, 255, 0.1);   /* the edge of the glass at rest */
}

* {
  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 page: near black with a violet haze behind the button and a fine grain, like a dark hall before the show */
.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(min(64vw, 480px) min(30vh, 220px) at 50% 46%, rgba(168, 151, 255, 0.07), transparent 70%),
    radial-gradient(min(90vw, 700px) min(50vh, 380px) at 50% 100%, rgba(255, 122, 174, 0.035), transparent 70%),
    var(--page);
}

.stage::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  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 1 0 0 0 0 1 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.tk {
  position: relative;
  display: grid;
  place-items: center;
}

/* the rays above the glass: the same two beams, much fainter, fading a short way up */
.tk__rays {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100% + min(96px, 14vh));
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(0deg, transparent 0, transparent 52px, #000 62px, rgba(0, 0, 0, 0.35) 72%, transparent 100%);
  mask-image: linear-gradient(0deg, transparent 0, transparent 52px, #000 62px, rgba(0, 0, 0, 0.35) 72%, transparent 100%);
  opacity: 0.3;
}

.tk__beam,
.tk__ray {
  position: absolute;
  bottom: -14px;
  width: 200px;
  height: 240px;
  margin-left: -100px;
  transform-origin: 50% 100%;
  mix-blend-mode: screen;
  pointer-events: none;
}

/* the cone itself: two conic gradients from the pivot, so its sides are soft without any blur filter, a white core
   inside a coloured cone, and a mask that fades it towards the top */
.tk__beam::before,
.tk__ray::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    conic-gradient(from -9deg at 50% 100%, transparent 0deg, color-mix(in srgb, white 45%, var(--c)) 7deg, color-mix(in srgb, white 45%, var(--c)) 11deg, transparent 18deg, transparent 360deg),
    conic-gradient(from -19deg at 50% 100%, transparent 0deg, var(--c) 10deg, var(--c) 28deg, transparent 38deg, transparent 360deg);
  -webkit-mask-image: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.55) 30%, transparent 80%);
  mask-image: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.55) 30%, transparent 80%);
}

.tk__beam--a,
.tk__ray--a {
  --c: var(--lilac);
  left: 28%;
}

.tk__beam--b,
.tk__ray--b {
  --c: var(--rose);
  left: 72%;
}

.tk__ray {
  height: 300px;
}

/* the light the button throws on the floor, tinted by the two beams */
.tk__spill {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 108%;
  height: 42px;
  margin: -16px 0 0 -54%;
  border-radius: 50%;
  background:
    radial-gradient(closest-side at 32% 50%, color-mix(in srgb, var(--lilac) 50%, transparent), transparent),
    radial-gradient(closest-side at 68% 50%, color-mix(in srgb, var(--rose) 45%, transparent), transparent);
  filter: blur(14px);
  opacity: 0.18;
  pointer-events: none;
}

.tk__btn {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}

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

.tk__glass {
  --mx: 70%;
  --my: 50%;
  --h1: 34%;
  --h2: 66%;
  --hi: 0.5;
  position: relative;
  display: block;
  width: min(88vw, 320px);
  height: 60px;
  border-radius: 999px;
  isolation: isolate;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.8),
    0 8px 18px -10px rgba(0, 0, 0, 0.9),
    0 26px 50px -26px rgba(0, 0, 0, 1),
    0 0 0 0.5px rgba(0, 0, 0, 0.6);
}

.tk__base,
.tk__lights,
.tk__shine,
.tk__frost,
.tk__rim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

.tk__base {
  background: linear-gradient(180deg, #1c1923, var(--glass) 55%, #0f0d13);
}

.tk__lights {
  isolation: isolate;
  opacity: 0.62;
}

/* the held seats: a soft spot in the middle where the two beams cross */
.tk__spot {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120px 46px at 50% 78%, color-mix(in srgb, white 30%, var(--lilac)), transparent 72%),
    radial-gradient(220px 70px at 50% 100%, color-mix(in srgb, var(--rose) 50%, transparent), transparent 75%);
  mix-blend-mode: screen;
  opacity: 0;
}

/* the haze: a slow drifting grain that the beams light up */
.tk__haze {
  position: absolute;
  inset: -40px -90px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='160'%3E%3Cfilter id='h'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.022' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.9 -0.15'/%3E%3C/filter%3E%3Crect width='520' height='160' filter='url(%23h)'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  opacity: 0.38;
}

.tk__shine {
  background: radial-gradient(96px 64px at var(--mx) var(--my), rgba(246, 240, 255, 0.13), rgba(246, 240, 255, 0.03) 50%, transparent 72%);
  opacity: 0;
}

/* the frosted pane: grain, a 1px edge, the top edge catching the light and a darker one below */
.tk__frost {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.15 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.16));
  background-size: 120px 120px, 100% 100%;
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(246, 240, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    inset 0 -12px 18px -14px rgba(0, 0, 0, 0.7);
}

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

/* where each beam leaves the glass the top edge catches its colour */
.tk__rim {
  background:
    radial-gradient(54px 2.4px at var(--h1) 0.6px, color-mix(in srgb, white 35%, var(--lilac)), transparent),
    radial-gradient(54px 2.4px at var(--h2) 0.6px, color-mix(in srgb, white 35%, var(--rose)), transparent);
  opacity: var(--hi);
}

/* the stage edge: a 1px line along the bottom that fills while the seats are found */
.tk__floor {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 0;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.tk__floor-fill {
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
  background: linear-gradient(90deg, transparent, var(--lilac) 20%, var(--rose) 80%, transparent);
  box-shadow: 0 0 6px var(--lilac);
}

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

/* the ticket well: a dark face inside a 1px edge that takes the colour of the two lights */
.tk__well {
  position: relative;
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(28px 20px at 50% 16%, rgba(255, 255, 255, 0.08), transparent 70%),
    radial-gradient(circle at 50% 60%, #211e28, #0e0c12 75%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 1px 3px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 4px 10px -3px rgba(0, 0, 0, 0.8);
}

.tk__well::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  padding: 1px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--lilac) 70%, white), transparent 42%, transparent 62%, color-mix(in srgb, var(--rose) 70%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0.55;
}

/* the well lit by the held seats: the two colours pool inside it */
.tk__lit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(26px 18px at 50% 14%, rgba(255, 255, 255, 0.35), transparent 70%),
    linear-gradient(150deg, color-mix(in srgb, var(--lilac) 92%, white), color-mix(in srgb, var(--rose) 88%, black 6%));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    inset 0 -3px 6px rgba(80, 20, 60, 0.35),
    0 0 18px -2px color-mix(in srgb, var(--lilac) 70%, transparent);
  opacity: 0;
}

.tk__icon {
  position: relative;
  width: 22px;
  height: 22px;
  overflow: visible;
}

.tk__ticket {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.tk__perf {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 0.1 2.15;
  opacity: 0.8;
}

.tk__lines {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.55;
}

.tk__check {
  fill: none;
  stroke: #1a1124;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}


.tk__words {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: left;
}

.tk__stack {
  display: grid;
  min-width: 0;
}

.tk__label,
.tk__sub {
  grid-area: 1 / 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tk__label {
  font-size: 15.5px;
  font-weight: 590;
  font-variation-settings: 'wdth' 102;
  letter-spacing: 0.004em;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.tk__label--done {
  color: #fff;
}

.tk__sub {
  font-size: 11.5px;
  font-weight: 480;
  font-variation-settings: 'wdth' 96;
  letter-spacing: 0.012em;
  line-height: 1.25;
  color: var(--muted);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* the price: a small chip of clearer glass, the digits roll when the total changes */
.tk__chip {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  min-width: 52px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  line-height: 32px;
  font-size: 14px;
  font-weight: 620;
  font-variation-settings: 'wdth' 100;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 2px 6px -2px rgba(0, 0, 0, 0.7);
}

.tk__cur {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 520;
}

.tk__num {
  position: relative;
  display: inline-grid;
  height: 32px;
  overflow: hidden;
}

.tk__val {
  grid-area: 1 / 1;
}

/* before the script runs, only the rest state shows */
.tk__label + .tk__label,
.tk__sub + .tk__sub {
  opacity: 0;
}
