:root {
  --fondo: #ffffff;
  --inchiostro: #121318;
  --carta: #eef1f6;
  --cielo: #7cc4ff;
  --cielo-chiaro: #cfe8ff;
  --grigio: #868a94;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.frame {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 16px;
  width: min(340px, 94vw);
  height: min(150px, 40vh);
}

/* the pill: the button for GSAP (press), the skin inside for the swell */
.t {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  height: 60px;
  padding: 0 26px 0 19px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--carta);
  font: inherit;
  font-size: 16px;
  font-weight: 580;
  letter-spacing: -0.005em;
  cursor: pointer;
  isolation: isolate;
  max-width: 94vw;
  -webkit-tap-highlight-color: transparent;
}
.t:focus-visible { outline: 2px solid var(--cielo); outline-offset: 4px; }

.t__skin, .t__glow, .t__rim, .t__sheen {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  pointer-events: none;
}
.t__skin {
  z-index: -4;
  background:
    radial-gradient(120% 140% at 50% -40%, rgba(255, 255, 255, 0.09), transparent 55%),
    linear-gradient(180deg, #23252d 0%, var(--inchiostro) 56%, #0b0c10 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 1px 1px rgba(18, 19, 24, 0.16),
    0 6px 14px -6px rgba(18, 19, 24, 0.32),
    0 24px 40px -22px rgba(18, 30, 60, 0.55);
}
/* a fine grain on the skin, so the dark reads as a material and not a flat fill */
.t__skin::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: 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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
.t__glow {
  z-index: -3;
  opacity: 0;
  background: radial-gradient(110px 76px at var(--gx, 50%) var(--gy, 50%), rgba(170, 214, 255, 0.17), transparent 70%);
}
/* the rim: a sky-blue 1px edge that lights up once the fare is watched */
.t__rim {
  z-index: -2;
  opacity: 0;
  box-shadow:
    inset 0 0 0 1px rgba(124, 196, 255, 0.42),
    inset 0 1px 0 rgba(207, 232, 255, 0.4),
    0 10px 30px -14px rgba(124, 196, 255, 0.55);
}
.t__sheen {
  z-index: -1;
  opacity: 0;
  background: linear-gradient(100deg, transparent 32%, rgba(207, 232, 255, 0.22) 48%, transparent 64%);
  background-size: 260% 100%;
  background-position: 120% 0;
}

/* the window: a small chart icon at rest, the fare curve while it reads, the bell once it is done */
.t__win {
  position: relative;
  flex: none;
  width: 22px;
  height: 32px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4px, #000 calc(100% - 4px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 4px, #000 calc(100% - 4px), transparent);
}
.t__icon, .t__bell {
  position: absolute;
  left: 0;
  top: 5px;
  width: 22px;
  height: 22px;
}
.t__icon, .t__bell svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.t__bell svg { width: 22px; height: 22px; }
.i__base { opacity: 0.35; }
.t__bell { opacity: 0; color: var(--cielo-chiaro); }
.b__clap { opacity: 0.75; }

.t__chart {
  position: absolute;
  left: 0;
  top: 1px;
  width: 84px;
  height: 30px;
  overflow: visible;
  opacity: 0;
}
.t__chart stop { stop-color: var(--cielo); }
.c__grid { fill: none; stroke: rgba(238, 241, 246, 0.08); stroke-width: 1; }
.c__line {
  fill: none;
  stroke: var(--cielo);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.c__alert {
  stroke: var(--cielo-chiaro);
  stroke-width: 1;
  stroke-dasharray: 2 2.2;
  opacity: 0.7;
}
/* the reading line: a hairline that walks along the curve, with a short level tick where it meets it */
.t__head {
  position: absolute;
  left: 0;
  top: 1px;
  width: 1px;
  height: 30px;
  opacity: 0;
  background: linear-gradient(180deg, transparent, rgba(207, 232, 255, 0.75) 30%, rgba(207, 232, 255, 0.75) 70%, transparent);
}
.t__tick {
  position: absolute;
  left: -3px;
  top: 0;
  width: 7px;
  height: 1.5px;
  border-radius: 1px;
  background: #fff;
  box-shadow: 0 0 6px rgba(124, 196, 255, 0.9);
}

.t__labels {
  position: relative;
  display: block;
  height: 22px;
  overflow: hidden;
}
.t__label {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  width: max-content;
  height: 22px;
  line-height: 22px;
  white-space: nowrap;
  opacity: 0;
  font-variation-settings: "wdth" 100;
}
.t__label[data-l="idle"] { opacity: 1; }
.t__sep { margin: 0 0.42em; opacity: 0.45; }
.t__live { font-variant-numeric: tabular-nums; color: rgba(238, 241, 246, 0.72); font-weight: 520; }
.t__num { font-variant-numeric: tabular-nums; color: var(--cielo-chiaro); font-weight: 660; }

.note {
  position: relative;
  margin: 0;
  height: 18px;
  width: 100%;
  font-size: 13px;
  font-weight: 460;
  color: var(--grigio);
}
.note__line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
}
.note__line[data-n="idle"] { opacity: 1; }
.note .t__sep { opacity: 0.6; }

@media (max-width: 400px) {
  .t { height: 56px; font-size: 15px; padding: 0 22px 0 17px; gap: 10px; }
  .note { font-size: 12px; }
}
