/* The watch the demo glass button with the preview that plays. A deep night page with a little grain; behind the
   button two slow lights, violet and cyan, that the glass blurs and bends. The button is one rounded box (.wd__body,
   moved only by GSAP) with absolute layers: the frosted glass, the light under the pointer, the reflection that
   crosses when the demo is ready, the hairline of the buffering at the bottom and the edge that catches the light on
   top. Then the row: the tiny screen of the product with the glass play button, two lines of words and the chip. */
:root {
  --page: #07070b;            /* the page */
  --violet: #8b6cff;          /* the first light, and the bottom of the chart bars */
  --cyan: #46d7ff;            /* the second light, and the top of the chart bars */
  --ink: #f3f3f7;             /* the words */
  --muted: rgba(243, 243, 247, 0.56); /* the small line under the words */
  --screen: #14131c;          /* the tiny screen of the product */
}

* {
  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: a faint violet light from above and a fine grain over everything */
.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(min(90vw, 640px) min(60vh, 420px) at 50% 30%, color-mix(in srgb, var(--violet) 12%, transparent), transparent 70%),
    radial-gradient(min(120vw, 900px) min(70vh, 520px) at 50% 115%, color-mix(in srgb, var(--cyan) 7%, 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 0.9 0 0 0 0 0.9 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");
  background-size: 160px 160px;
}

.wd {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

/* the two lights behind the glass */
.wd__aura {
  position: absolute;
  inset: -14px 4%;
  pointer-events: none;
}

.wd__blob {
  position: absolute;
  top: 0;
  width: 58%;
  height: 100%;
  border-radius: 50%;
  filter: blur(16px);
  opacity: 0.62;
}

.wd__blob--a {
  left: 0;
  background: radial-gradient(closest-side, var(--violet), color-mix(in srgb, var(--violet) 30%, transparent) 60%, transparent);
}

.wd__blob--b {
  right: 0;
  background: radial-gradient(closest-side, var(--cyan), color-mix(in srgb, var(--cyan) 24%, transparent) 60%, transparent);
  opacity: 0.4;
}

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

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

.wd__body {
  --mx: 30%;
  --my: 20%;
  position: relative;
  display: block;
  width: min(86vw, 320px);
  height: 60px;
  border-radius: 999px;
  isolation: isolate;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.55),
    0 10px 22px -12px rgba(0, 0, 0, 0.8),
    0 30px 60px -30px rgba(0, 0, 0, 1),
    0 16px 40px -22px color-mix(in srgb, var(--violet) 70%, transparent);
}

.wd__glass,
.wd__shine,
.wd__sweep,
.wd__track,
.wd__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

/* frosted glass: blurs and saturates the two lights behind */
.wd__glass {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.035) 52%, rgba(255, 255, 255, 0.06)),
    rgba(14, 13, 22, 0.42);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
}

/* the light under the pointer */
.wd__shine {
  opacity: 0;
  background: radial-gradient(120px 70px at var(--mx) var(--my), rgba(255, 255, 255, 0.16), transparent 70%);
}

.wd__sweep-band {
  position: absolute;
  top: -20%;
  left: 0;
  width: 40%;
  height: 140%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22) 45%, rgba(255, 255, 255, 0.36) 50%, rgba(255, 255, 255, 0.22) 55%, transparent);
  mix-blend-mode: screen;
}

/* the hairline at the bottom: buffering, then the chapter playing */
.wd__bar {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 0;
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  box-shadow: 0 0 8px 0 color-mix(in srgb, var(--cyan) 60%, transparent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* the edge: a 1px hairline brighter at the top, plus a brighter piece near the pointer */
.wd__edge {
  padding: 1px;
  background:
    radial-gradient(90px 60px at var(--mx) var(--my), rgba(255, 255, 255, var(--edge-hot, 0.35)), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08) 40%, rgba(255, 255, 255, 0.05) 70%, rgba(255, 255, 255, 0.14));
  -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);
}

.wd__edge::after {
  content: '';
  position: absolute;
  left: 18%;
  right: 18%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
}

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

/* the tiny screen of the product: concentric with the pill on the left */
.wd__thumb {
  position: relative;
  flex: none;
  width: 62px;
  height: 44px;
  border-radius: 22px 11px 11px 22px;
  overflow: hidden;
  background:
    radial-gradient(60px 40px at 70% 0%, color-mix(in srgb, var(--violet) 26%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--screen) 80%, white 6%), var(--screen));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 6px -2px rgba(0, 0, 0, 0.7);
  display: grid;
  place-items: center;
}

.wd__ui {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.wd__ui-line,
.wd__ui-side {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1;
  stroke-linecap: round;
}

.wd__ui-side {
  stroke: rgba(255, 255, 255, 0.22);
}

.wd__ui-bar {
  fill: url(#wd-bar);
  opacity: 0.85;
}

.wd__thumb-glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), transparent 40%);
  pointer-events: none;
}

/* the playhead of the preview, along the bottom of the tiny screen */
.wd__playhead {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 3px;
  height: 1px;
  background: rgba(255, 255, 255, 0.9);
  transform: scaleX(0);
  transform-origin: 0 50%;
  opacity: 0;
}

/* the glass play button over the screen: it blurs the bars behind it */
.wd__play {
  position: relative;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
}

.wd__play-plate {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
  -webkit-backdrop-filter: blur(5px) saturate(150%);
  backdrop-filter: blur(5px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 3px 8px -2px rgba(0, 0, 0, 0.6);
}

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

.wd__tri {
  fill: #ffffff;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.wd__pause {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.wd__spin-track,
.wd__spin {
  fill: none;
  stroke-width: 1.8;
}

.wd__spin-track {
  stroke: rgba(255, 255, 255, 0.18);
}

.wd__spin {
  stroke: #ffffff;
  stroke-linecap: round;
  stroke-dasharray: 0.3 0.7;
}

.wd__check {
  fill: none;
  stroke: #0b0b12;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.wd__text {
  position: relative;
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
}

.wd__state {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wd__title {
  font-size: 14.5px;
  font-weight: 600;
  font-variation-settings: 'wdth' 100;
  letter-spacing: 0.005em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: font-variation-settings 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* the busy words with a band of light passing through them */
.wd__title--busy {
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 35%, #ffffff 45%, color-mix(in srgb, var(--cyan) 70%, white) 50%, #ffffff 55%, var(--ink) 65%, var(--ink) 100%);
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: wd-busy 1.6s linear infinite;
}

@keyframes wd-busy {
  to {
    background-position: -60% 0;
  }
}

.wd__sub {
  font-size: 12px;
  line-height: 1.25;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wd__chip {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  height: 26px;
  min-width: 46px;
  padding: 0 9px;
  border-radius: 999px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  font-variation-settings: 'wdth' 96;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.wd__chip-face {
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
}

.wd__chip-face > span {
  grid-area: 1 / 1;
}

@media (hover: hover) {
  .wd__btn:hover .wd__title {
    font-variation-settings: 'wdth' 108;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wd__title--busy {
    animation: none;
    background: none;
    color: var(--ink);
  }

  .wd__title {
    transition: none;
  }
}
