/* The Watch live button with the rising audience. A dark studio (a cold light behind, a fine grain), and in the
   middle one pill of graphite lacquer with a steel edge. Inside, layered in one rounded box (.wl__body, moved only by
   GSAP): the lacquer fill, the red light of the broadcast that spreads from the disc when the stream opens, the light
   under the pointer, the reflection that crosses at the end and the edges on top. Then the row: the disc (play,
   buffering arc, waveform), two lines of words with the LIVE meter, and the chip with the audience. */
:root {
  --page: #08090c;            /* the studio */
  --haze: #1b2030;            /* the cold light behind the button */
  --red: #ff3d4f;             /* the broadcast red: disc, LIVE, light */
  --red-deep: #b3132b;        /* the red in shadow */
  --steel: #c7d0de;           /* the steel edge and the arc */
  --lacquer: #13151a;         /* the button's graphite lacquer */
  --ink: #f2f4f8;             /* the words */
  --muted: rgba(242, 244, 248, 0.56); /* the small line under the words */
}

* {
  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 studio: a cold light behind, a faint red from below and a fine grain */
.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(min(72vw, 540px) min(44vh, 300px) at 50% 44%, color-mix(in srgb, var(--haze) 90%, transparent), transparent 72%),
    radial-gradient(min(110vw, 860px) min(70vh, 520px) at 50% 125%, color-mix(in srgb, var(--red-deep) 16%, transparent), transparent 70%),
    var(--page);
}

.stage::after {
  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 0.85 0 0 0 0 0.9 0 0 0 0 1 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;
}

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

/* the red the button throws on the floor under it */
.wl__spill {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 104%;
  height: 40px;
  margin: -15px 0 0 -52%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--red) 50%, transparent), color-mix(in srgb, var(--red-deep) 18%, transparent) 55%, transparent);
  filter: blur(14px);
  opacity: 0.16;
  pointer-events: none;
}

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

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

.wl__body {
  --mx: 30%;
  --my: 50%;
  position: relative;
  display: block;
  width: min(86vw, 318px);
  height: 60px;
  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(--red) 34%, transparent);
}

.wl__fill,
.wl__glow,
.wl__shine,
.wl__sweep,
.wl__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

/* graphite lacquer: a deep fill, lighter at the top, with a faint brushed grain */
.wl__fill {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(225, 235, 255, 0.085), rgba(225, 235, 255, 0.012) 50%, rgba(0, 0, 0, 0.28)),
    var(--lacquer);
}

/* the red light of the broadcast, anchored to the disc (GSAP scales it) */
.wl__glow-light {
  position: absolute;
  left: -34px;
  top: -40%;
  width: 150px;
  height: 180%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--red) 40%, transparent), color-mix(in srgb, var(--red) 12%, transparent) 55%, transparent);
  transform-origin: 34px 50%;
  opacity: 0;
}

/* the light under the pointer */
.wl__shine {
  background: radial-gradient(100px 64px at var(--mx) var(--my), rgba(220, 232, 255, 0.15), rgba(220, 232, 255, 0.04) 50%, transparent 72%);
  opacity: 0;
}

/* the reflection that crosses the lacquer when the stream opens */
.wl__sweep-band {
  position: absolute;
  top: -30%;
  left: 0;
  width: 34%;
  height: 160%;
  background: linear-gradient(100deg, transparent 0%, rgba(235, 242, 255, 0.05) 30%, rgba(235, 242, 255, 0.28) 50%, rgba(235, 242, 255, 0.05) 70%, transparent 100%);
  transform: translateX(-140%) skewX(-16deg);
}

/* the edges: a steel hairline that catches the light at the top and goes dark at the bottom, and a wet highlight */
.wl__edge {
  z-index: 3;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--steel) 16%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--steel) 55%, transparent),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    inset 0 -12px 18px -12px rgba(0, 0, 0, 0.7);
}

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

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

/* the disc on the left: play at rest, the buffering arc while connecting, the waveform when live */
.wl__disc {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

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

.wl__plate {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 14%, rgba(255, 220, 224, 0.5), transparent 52%),
    linear-gradient(180deg, var(--red), var(--red-deep));
  box-shadow:
    inset 0 0 0 1px rgba(255, 200, 206, 0.22),
    inset 0 1px 0 rgba(255, 230, 233, 0.55),
    inset 0 -3px 6px rgba(90, 0, 16, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.55),
    0 4px 14px -4px color-mix(in srgb, var(--red) 55%, transparent);
}

.wl__ring {
  width: 44px;
  height: 44px;
  overflow: visible;
}

.wl__ring circle {
  fill: none;
  stroke-width: 1.8;
}

.wl__ring-track {
  stroke: color-mix(in srgb, var(--steel) 20%, transparent);
  opacity: 0;
}

.wl__ring-arc {
  stroke: color-mix(in srgb, var(--steel) 70%, white);
  filter: drop-shadow(0 0 2px rgba(220, 232, 255, 0.45));
  stroke-linecap: round;
  stroke-dasharray: 0.22 1;
  opacity: 0;
}

.wl__play {
  width: 20px;
  height: 20px;
  overflow: visible;
}

.wl__play path {
  fill: #fff7f8;
  filter: drop-shadow(0 1px 1px rgba(110, 0, 20, 0.45));
}

.wl__wave {
  width: 22px;
  height: 22px;
  overflow: visible;
  opacity: 0;
}

.wl__wave rect {
  fill: #fff7f8;
}

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

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

.wl__state + .wl__state {
  opacity: 0;
}

.wl__title {
  font-size: 15.5px;
  font-weight: 580;
  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);
}

/* Connecting shimmers: a cold band runs through the letters (GSAP moves background-position) */
.wl__title--busy {
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 38%, #ffffff 46%, var(--steel) 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;
}

.wl__sub {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.wl__sub-text {
  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;
}

/* the LIVE sign: a small level meter and the word, in a red hairline frame */
.wl__tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 15px;
  padding: 0 5px 0 4px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  font-variation-settings: 'wdth' 112;
  letter-spacing: 0.08em;
  line-height: 1;
  color: color-mix(in srgb, var(--red) 88%, white);
  background: color-mix(in srgb, var(--red) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 38%, transparent);
}

.wl__tag--on {
  color: #fff4f5;
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  box-shadow: inset 0 1px 0 rgba(255, 220, 224, 0.45), 0 1px 4px -1px color-mix(in srgb, var(--red) 70%, transparent);
}

.wl__meter {
  width: 11px;
  height: 10px;
  overflow: visible;
}

.wl__meter rect {
  fill: currentColor;
}

/* the chip: the audience, rolling up like an odometer */
.wl__chip {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px 0 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(225, 235, 255, 0.08), rgba(225, 235, 255, 0.02));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--steel) 15%, transparent),
    inset 0 1px 0 rgba(225, 235, 255, 0.14),
    0 1px 2px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.wl__chip-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, color-mix(in srgb, var(--red) 34%, transparent), color-mix(in srgb, var(--red-deep) 18%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 50%, transparent);
  opacity: 0;
}

.wl__eye {
  position: relative;
  width: 14px;
  height: 14px;
  overflow: visible;
}

.wl__eye-lid {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.3;
  stroke-linejoin: round;
}

.wl__eye-iris {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.3;
}

.wl__count {
  position: relative;
  display: inline-flex;
  font-size: 12px;
  font-weight: 580;
  font-variation-settings: 'wdth' 96;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: var(--ink);
  white-space: nowrap;
}

/* each digit is a window over a column 0 to 9 twice, so the roll always goes up */
.wl__dig {
  position: relative;
  display: inline-block;
  width: 0.62em;
  height: 1.25em;
  overflow: hidden;
  text-align: center;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}

.wl__col {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  flex-direction: column;
}

.wl__col > span {
  display: block;
  height: 1.25em;
}

.wl__sep {
  display: inline-block;
  width: 0.26em;
  text-align: center;
}

/* narrow phones: the same button, a little tighter so the small line keeps its words */
@media (max-width: 360px) {
  .wl__row {
    gap: 9px;
  }

  .wl__chip {
    padding: 0 8px 0 7px;
    gap: 4px;
  }
}
