/* The Find seats button with the hall that lights up. The button is one rounded box of dark glass (.fs__glass, moved
   only by GSAP) with its layers inside: the body with its grain, the light under the pointer, a 1px rim that catches
   that light, and the reflection that crosses it at the end. In front, the row: the hall in miniature (an SVG drawn by
   the script), the two lines of words and the chip. */
:root {
  --page: #08070a;            /* the page */
  --amber: #ffb24d;           /* the light of the screen and the chosen seats */
  --velvet: #b8324a;          /* the warm red under the button */
  --ink: #f7f1e8;             /* the words */
  --muted: rgba(247, 241, 232, 0.6); /* the small line */
  --seat: #f7f1e8;            /* a free seat */
  --taken: rgba(247, 241, 232, 0.13); /* a taken seat */
}

* {
  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;
}

/* a warm black, lit softly from above like a foyer, with a fine grain */
.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(60% 46% at 50% 44%, color-mix(in srgb, var(--amber) 7%, transparent), transparent 70%),
    radial-gradient(90% 60% at 50% 110%, color-mix(in srgb, var(--velvet) 12%, transparent), transparent 70%),
    var(--page);
}

.stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%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.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

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

/* the warm light the button throws on the floor */
.fs__spill {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 110%;
  height: 44px;
  margin: -16px 0 0 -55%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--amber) 42%, transparent), color-mix(in srgb, var(--velvet) 30%, transparent) 55%, transparent);
  filter: blur(16px);
  opacity: 0.3;
  pointer-events: none;
}

.fs__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;
}

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

.fs__glass {
  --mx: 30%;
  --my: 40%;
  position: relative;
  display: block;
  width: min(88vw, 332px);
  height: 60px;
  border-radius: 999px;
  isolation: isolate;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.8),
    0 6px 14px -6px rgba(0, 0, 0, 0.9),
    0 16px 30px -16px color-mix(in srgb, var(--velvet) 60%, transparent),
    0 34px 60px -30px rgba(0, 0, 0, 1);
}

.fs__body,
.fs__shine,
.fs__rim,
.fs__sweep {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

/* the body: a dark warm glass, lighter at the top, a wet highlight and grain */
.fs__body {
  overflow: hidden;
  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.16 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(70% 140% at 16% 50%, color-mix(in srgb, var(--amber) 9%, transparent), transparent 70%),
    linear-gradient(180deg, #24201f, #141214 54%, #0d0c0e);
  background-size: 120px 120px, 100% 100%, 100% 100%;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    inset 0 -12px 20px -14px rgba(0, 0, 0, 0.8);
}

.fs__body::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.08), rgba(255, 255, 255, 0));
}

/* the light under the pointer */
.fs__shine {
  overflow: hidden;
  background: radial-gradient(110px 70px at var(--mx) var(--my), color-mix(in srgb, var(--amber) 16%, transparent), color-mix(in srgb, var(--amber) 4%, transparent) 50%, transparent 72%);
  opacity: 0;
}

/* the rim: a 1px ring that is bright only near the pointer (a mask keeps just the border) */
.fs__rim {
  padding: 1px;
  background: radial-gradient(120px 80px at var(--mx) var(--my), color-mix(in srgb, var(--amber) 85%, white), color-mix(in srgb, var(--amber) 20%, transparent) 45%, transparent 70%);
  -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.35;
}

/* the reflection that crosses the glass when the seats are found */
.fs__sweep {
  overflow: hidden;
}

.fs__sweep-band {
  position: absolute;
  top: -30%;
  left: 0;
  width: 34%;
  height: 160%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 236, 205, 0.04) 30%, rgba(255, 236, 205, 0.22) 50%, rgba(255, 236, 205, 0.04) 70%, transparent 100%);
  transform: translateX(-140%) skewX(-16deg);
}

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

/* the hall in miniature: a sunken window */
.fs__hall {
  flex: none;
  width: 76px;
  height: 46px;
  border-radius: 23px 12px 12px 23px;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #1b1714, #0a090b 70%);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.9),
    inset 0 0 0 1px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.07);
}

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

.fs__screen,
.fs__screen-glow {
  fill: none;
  stroke-linecap: round;
}

.fs__screen {
  stroke: color-mix(in srgb, var(--amber) 55%, white);
  stroke-width: 1.1;
}

.fs__screen-glow {
  stroke: var(--amber);
  stroke-width: 3;
  opacity: 0.8;
}

.fs__cone {
  opacity: 0.32;
}

.fs__seat {
  fill: var(--seat);
}

.fs__seat--taken {
  fill: var(--taken);
}

.fs__seatglow {
  fill: var(--amber);
}

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

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

.fs__stack > * {
  grid-area: 1 / 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.fs__title {
  font-size: 15px;
  line-height: 20px;
  font-weight: 580;
  font-variation-settings: 'wdth' 96;
  letter-spacing: 0.002em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

/* Finding seats shimmers: a warm band slides through the letters (GSAP moves background-position) */
.fs__title--busy {
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 38%, #ffffff 46%, var(--amber) 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;
}

.fs__sub {
  font-size: 11.5px;
  line-height: 15px;
  font-weight: 460;
  font-variation-settings: 'wdth' 94;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.fs__chip {
  flex: none;
  display: grid;
  place-items: center;
  width: 60px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.fs__chip-face {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-variation-settings: 'wdth' 92;
  color: var(--ink);
  white-space: nowrap;
}

.fs__chip-face--ok {
  color: var(--amber);
}

.fs__spin,
.fs__ok {
  width: 18px;
  height: 18px;
  overflow: visible;
}

.fs__ok {
  width: 15px;
  height: 15px;
  margin-left: -3px;
}

.fs__spin circle {
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-dasharray: 0.3 0.7;
}

.fs__ok path {
  fill: none;
  stroke: var(--amber);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

/* before the script runs, only the rest state shows */
.fs__stack > * + *,
.fs__chip-face + .fs__chip-face {
  opacity: 0;
}

@media (hover: hover) {
  .fs__btn:hover .fs__chip {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.5);
  }
}
