/* The call the showroom button with the number that rolls in. Pure white around, and in the middle one graphite pill
   60 pixels tall. Inside, layered in one rounded box (.cs__body, moved only by GSAP): the graphite fill lighter at the
   top, a very fine grain, the light under the pointer, the reflection that crosses when the number lands and the 1px
   edges on top. Over them the row (the disc with the handset, two lines of words, the number on reels) and the Copy
   number chip on the right. The thin rings of the ring leave the disc and go out over the white. */
:root {
  --page: #ffffff;            /* the white around the button */
  --graphite: #17191d;        /* the button */
  --well: #23262c;            /* the disc around the handset */
  --signal: #ff5a36;          /* the one accent: ringing, the live ring, Copied */
  --ink: #f5f6f8;             /* the words */
  --muted: rgba(245, 246, 248, 0.56); /* the small line under the words */
  --chip: rgba(255, 255, 255, 0.08);  /* the Copy number chip at rest */
}

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

.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
}

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

/* the soft shadow the pill throws on the white, a little warmer while it rings */
.cs__floor {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 84%;
  height: 26px;
  margin: -14px 0 0 -42%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(23, 25, 29, 0.32), rgba(23, 25, 29, 0.08) 60%, transparent);
  filter: blur(10px);
  pointer-events: none;
}

/* the thin rings that leave the handset (GSAP scales them from the disc's centre) */
.cs__rings {
  position: absolute;
  left: calc(8px + 22px - 60px);
  top: calc(50% - 60px);
  width: 120px;
  height: 120px;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.cs__rings circle {
  fill: none;
  stroke: var(--signal);
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
  opacity: 0;
}

.cs__body {
  --mx: 30%;
  --my: 50%;
  position: relative;
  z-index: 1;
  display: block;
  width: min(92vw, 336px);
  height: 60px;
  border-radius: 999px;
  isolation: isolate;
  container-type: inline-size;
  box-shadow:
    0 0 0 1px rgba(23, 25, 29, 0.9),
    0 1px 2px rgba(23, 25, 29, 0.28),
    0 6px 14px -6px rgba(23, 25, 29, 0.38),
    0 22px 40px -22px rgba(23, 25, 29, 0.55);
}

.cs__fill,
.cs__grain,
.cs__shine,
.cs__sweep,
.cs__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

/* graphite, lighter at the top like a satin finish */
.cs__fill {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.02) 48%, rgba(0, 0, 0, 0.22)),
    var(--graphite);
}

.cs__grain {
  opacity: 0.5;
  mix-blend-mode: overlay;
  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");
  background-size: 120px 120px;
}

/* the light under the pointer (two variables moved by gsap.quickTo) */
.cs__shine {
  opacity: 0;
  background: radial-gradient(120px 70px at var(--mx) var(--my), rgba(255, 255, 255, 0.13), transparent 70%);
}

.cs__sweep-band {
  position: absolute;
  top: -20%;
  left: 0;
  width: 34%;
  height: 140%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16) 45%, rgba(255, 255, 255, 0.24) 50%, rgba(255, 255, 255, 0.16) 55%, transparent);
}

/* the edges: a hairline that catches the light at the top and sinks at the bottom */
.cs__edge {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.cs__main {
  appearance: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}

.cs__main:focus-visible,
.cs__copy:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 4px;
}

.cs__row {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 0 8px;
  pointer-events: none;
}

/* the disc: a dark well, the hot well that glows while it rings, the live ring and the handset, one grid cell */
.cs__disc {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

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

.cs__well,
.cs__well-hot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.cs__well {
  background: radial-gradient(circle at 50% 30%, #2f333a, var(--well) 62%, #1b1d22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 2px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.04);
}

.cs__well-hot {
  opacity: 0;
  background: radial-gradient(circle at 50% 32%, color-mix(in srgb, var(--signal) 80%, white), var(--signal) 58%, color-mix(in srgb, var(--signal) 70%, black));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 0 18px -2px color-mix(in srgb, var(--signal) 60%, transparent);
}

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

.cs__live circle {
  fill: none;
  stroke: var(--signal);
  stroke-width: 1.2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
}

.cs__phone {
  width: 22px;
  height: 22px;
  overflow: visible;
}

.cs__handset {
  fill: var(--ink);
}

.cs__waves path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0;
}

.cs__text {
  position: relative;
  flex: 1;
  min-width: 0;
  margin-left: 12px;
  display: grid;
  align-items: center;
}

.cs__state {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cs__title {
  font-size: 15.5px;
  line-height: 1.15;
  font-weight: 620;
  font-stretch: 104%;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* while it connects a band of light runs through the words */
.cs__title--busy {
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 38%, color-mix(in srgb, var(--signal) 55%, white) 50%, var(--ink) 62%, var(--ink) 100%);
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cs__sub {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 450;
  font-stretch: 96%;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the number leaves room for the chip on the right */
.cs__state--num {
  padding-right: var(--chip-room, 126px);
}

.cs__num {
  display: flex;
  height: 1.18em;
  font-size: 17px;
  font-weight: 640;
  font-stretch: 96%;
  letter-spacing: 0;
  line-height: 1.18;
  white-space: nowrap;
}

/* each digit is a little reel: a column of digits behind a window that fades at the top and bottom */
.cs__reel {
  position: relative;
  display: block;
  width: 0.6em;
  height: 1.18em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 26%, #000 74%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 26%, #000 74%, transparent);
}

.cs__strip {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.cs__strip span {
  display: block;
  height: 1.18em;
  text-align: center;
}

.cs__gap {
  display: block;
  width: 0.3em;
}

/* the Copy number chip: a soft glass pill, it turns signal orange when copied */
.cs__copy {
  appearance: none;
  position: absolute;
  z-index: 3;
  right: 10px;
  top: 50%;
  height: 34px;
  margin-top: -17px;
  padding: 0 13px 0 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.cs__copy.is-on {
  pointer-events: auto;
}

.cs__copy-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--chip);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 2px 6px -2px rgba(0, 0, 0, 0.5);
}

.cs__copy-icon {
  position: relative;
  flex: none;
  width: 15px;
  height: 15px;
  overflow: visible;
}

.cs__copy-icon g rect,
.cs__copy-icon g path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cs__copy-check {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
}

.cs__copy-labels {
  position: relative;
  display: grid;
  height: 16px;
  overflow: hidden;
}

.cs__copy-label {
  grid-area: 1 / 1;
  justify-self: start;
  font-size: 12.5px;
  line-height: 16px;
  font-weight: 580;
  font-stretch: 98%;
  white-space: nowrap;
}

@media (hover: hover) {
  .cs__copy.is-on:hover .cs__copy-fill {
    background: rgba(255, 255, 255, 0.13);
  }
}

/* a narrow pill keeps the chip short */
@container (max-width: 300px) {
  .cs__title {
    font-size: 15px;
  }
  .cs__num {
    font-size: 16px;
  }
}
