/* The Add wine pairing button that fills with wine. The glass is a stack of layers inside one rounded box: a dark
   smoked base (.wp__base), the wine drawn in SVG and redrawn every frame while it moves (.wp__wine), a frosted pane
   with grain and a wet highlight over it (.wp__frost), a light that follows the pointer (.wp__shine) and the
   reflection that crosses it at the end (.wp__sweep). The words sit on top. The box (.wp__glass) is moved only by
   GSAP; its children only by CSS or by GSAP, never both. */
:root {
  --page: #0b0809;            /* the page */
  --room: #3a0d1a;            /* the warm light of the room behind the button */
  --wine-1: #d8b25a;          /* Franciacorta, with the raw bar */
  --wine-2: #c9bf6e;          /* Vermentino, with the risotto */
  --wine-3: #e0806e;          /* Rosato, with the sea bass */
  --wine-4: #8c1c2e;          /* Nebbiolo, with the lamb */
  --wine-5: #6c1232;          /* Recioto, with the dessert, and the wine at rest */
  --ink: #f6efe9;             /* the words */
  --muted: rgba(246, 239, 233, 0.8); /* the small words in the chip */
  --edge: rgba(255, 236, 228, 0.13); /* the edge of the glass */
  --success: #f3d79a;         /* the check */
}

* {
  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 room: a low warm light behind the button and a fine grain, never a flat black */
.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(min(70vw, 520px) min(42vh, 300px) at 50% 54%, color-mix(in srgb, var(--room) 85%, transparent), transparent 70%),
    radial-gradient(min(40vw, 280px) min(20vh, 140px) at 50% 60%, color-mix(in srgb, var(--wine-1) 9%, 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='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.08 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.wp {
  --wc: 108, 18, 50;
  position: relative;
  display: grid;
  place-items: center;
}

/* the light the wine throws on the table under the button */
.wp__spill {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 118%;
  height: 46px;
  margin: -14px 0 0 -59%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--wc), 0.75), rgba(var(--wc), 0.2) 60%, transparent);
  filter: blur(14px);
  opacity: 0.42;
  pointer-events: none;
}

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

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

.wp__glass {
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: block;
  width: min(84vw, 292px);
  height: 60px;
  border-radius: 999px;
  isolation: isolate;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.75),
    0 12px 26px -14px rgba(var(--wc), 0.9),
    0 30px 60px -30px rgba(0, 0, 0, 1);
}

.wp__base,
.wp__frost,
.wp__shine,
.wp__sweep {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

.wp__base {
  background: linear-gradient(180deg, #171113, #0f0a0c 60%, #0b0809);
}

.wp__wine {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.wp__surf {
  fill: none;
  stroke: rgba(255, 240, 232, 0.62);
  stroke-width: 1.1;
}

.wp__stream {
  fill: none;
  stroke-linecap: round;
  stroke-width: 2.2;
  opacity: 0;
}

.wp__fizz circle {
  fill: rgba(255, 246, 220, 0.55);
}

/* the frosted pane over the wine: lighter at the top, a 1px edge that catches the light above, a darker one below,
   a fine grain and a curved reflection like the shoulder of a glass */
.wp__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.07 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) 46%, 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(255, 240, 232, 0.32),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    inset 0 -12px 18px -14px rgba(0, 0, 0, 0.7);
}

.wp__frost::after {
  content: '';
  position: absolute;
  left: 5%;
  right: 5%;
  top: 2px;
  height: 40%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 246, 240, 0.09), rgba(255, 255, 255, 0) 90%);
  filter: blur(1px);
}

.wp__shine {
  background: radial-gradient(90px 60px at var(--mx) var(--my), rgba(255, 238, 226, 0.18), rgba(255, 238, 226, 0.04) 50%, transparent 72%);
  opacity: 0;
}

.wp__sweep-band {
  position: absolute;
  top: -30%;
  left: 0;
  width: 36%;
  height: 160%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 240, 225, 0.05) 30%, rgba(255, 244, 232, 0.32) 50%, rgba(255, 240, 225, 0.05) 70%, transparent 100%);
}

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

.wp__icon {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
}

.wp__icon svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

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

.wp__bowl-wine {
  fill: rgb(var(--wc));
}

.wp__check {
  fill: none;
  stroke: var(--success);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
}

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

.wp__label {
  grid-area: 1 / 1;
  font-size: 16px;
  font-weight: 560;
  font-variation-settings: 'wdth' 100;
  letter-spacing: 0.003em;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.wp__chip {
  flex: none;
  display: grid;
  place-items: center;
  width: 74px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 0 0 1px rgba(255, 240, 232, 0.11), inset 0 1px 0 rgba(255, 240, 232, 0.17), 0 1px 2px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
}

.wp__chip-face {
  grid-area: 1 / 1;
  font-size: 12px;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  font-variation-settings: 'wdth' 92;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.wp__label + .wp__label,
.wp__chip-face + .wp__chip-face {
  opacity: 0;
}
