:root {
  --bg: #000000;
  --ink: #f4f5f7;
  --soft: rgba(244, 245, 247, 0.62);
  --idle: #1b1d23;
  --accent: #4f7dff;
  --on-accent: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 14px;
}

/* --fill, --edge and --glow are tweened by the script: dark at rest, the accent once it is casting */
.cast {
  --fill: var(--idle);
  --edge: 0.12;
  --glow: 0;
  --mx: 50%;
  position: relative;
  width: 116px;
  max-width: 100%;
  height: 58px;
  border: 0;
  border-radius: 29px;
  background: var(--fill);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, var(--edge)), inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 18px 36px -16px color-mix(in srgb, var(--accent) calc(var(--glow) * 90%), transparent);
}
.cast:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
/* a soft light that follows the pointer along the pill */
.cast::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(90px 58px at var(--mx) 0%, rgba(255, 255, 255, 0.2), transparent 70%); opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
@media (hover: hover) { .cast:hover::after { opacity: 1; } }

/* the ring that leaves the pill once, when the TV answers */
.cast__ring { position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 2px var(--accent); opacity: 0; pointer-events: none; }

.cast__in { position: absolute; inset: 0; display: flex; align-items: center; gap: 11px; padding: 0 20px 0 17px; border-radius: inherit; overflow: hidden; }
.cast__icon { flex: none; width: 26px; height: 26px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.800; stroke-linecap: round; stroke-linejoin: round; }
.cast__glass { fill: currentColor; stroke: none; opacity: 0; }
.cast__dot { fill: currentColor; stroke: none; }

.cast__text { position: relative; flex: 1; min-width: 0; height: 40px; }
.cast__roll { position: absolute; left: 0; display: block; overflow: hidden; }
.cast__roll > span { display: block; white-space: nowrap; }
.cast__label { top: 9px; height: 22px; line-height: 22px; font-size: 15.500px; font-weight: 720; font-stretch: 104%; letter-spacing: -0.005em; }
.cast__sub { top: 23px; height: 16px; line-height: 16px; font-size: 11.500px; font-weight: 620; color: color-mix(in srgb, currentColor 72%, transparent); opacity: 0; }
.cast__measure { position: absolute; left: -9999px; top: 0; white-space: nowrap; font-size: 15.500px; font-weight: 720; font-stretch: 104%; letter-spacing: -0.005em; visibility: hidden; }
.cast__say { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; pointer-events: none; opacity: 0; fill: #ffffff; stroke: #000000; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); z-index: 5; }
.ghost path { transform-box: fill-box; transform-origin: 20% 10%; }

@media (prefers-reduced-motion: reduce) {
  .cast::after { transition: none; }
}
