:root {
  --fondo: #ffffff;
  --inchiostro: #111318;      /* the pill */
  --inchiostro-2: #2a2e37;    /* the pill under the pointer */
  --testo-2: #7a808c;         /* the line under the button */
  --linea: #e7e9ee;
  --accento: #2f62ff;         /* the only colour: the trail, the Sent pill */
  --bianco: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

.wrap {
  position: relative;
  display: grid;
  justify-items: center;
  gap: clamp(12px, 2.6vh, 18px);
}

/* ---- the flight layer: the plane that leaves and the trail, over the button, never clipped ---- */
.fly { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 0; }
.trail { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; }
.trail__path {
  fill: none;
  stroke: var(--accento);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  opacity: 0;
}

.plane { display: block; width: 20px; height: 20px; }
.plane svg { display: block; width: 100%; height: 100%; overflow: visible; }
.plane__body, .plane__fold { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.plane--fly { position: absolute; left: 0; top: 0; color: var(--inchiostro); opacity: 0; will-change: transform; }
.plane--fly .plane__body { fill: var(--fondo); }

/* ---- the pill: GSAP moves .pill__lift, the button keeps its focus ring ---- */
.pill {
  position: relative;
  z-index: 1;
  display: block;
  height: 60px;
  border-radius: 999px;
  outline: none;
}
.pill:focus-visible { box-shadow: 0 0 0 3px var(--fondo), 0 0 0 5px var(--accento); }
.pill__lift {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  display: block;
}
.pill__bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--inchiostro);
  box-shadow:
    0 1px 1px rgba(17, 19, 24, 0.10),
    0 6px 14px -6px rgba(17, 19, 24, 0.38),
    0 18px 32px -18px rgba(17, 19, 24, 0.40),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.pill__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
}

.face {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 26px;
  color: var(--bianco);
  font-size: 18px;
  font-weight: 560;
  font-stretch: 104%;
  letter-spacing: 0.005em;
  white-space: nowrap;
}
.face--send { padding-right: 23px; }
.face--undo { padding-left: 21px; gap: 9px; opacity: 0; visibility: hidden; }
.face--sent { padding-left: 21px; gap: 8px; opacity: 0; visibility: hidden; }
.plane--home { color: var(--bianco); }

.ring { width: 22px; height: 22px; display: block; }
.ring__track { fill: none; stroke: rgba(255, 255, 255, 0.18); stroke-width: 1.6; }
.ring__left { fill: none; stroke: var(--bianco); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 0; }

.count {
  position: relative;
  display: inline-block;
  width: 0.7em;
  height: 1.25em;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.62);
  font-variant-numeric: tabular-nums;
  font-weight: 520;
}
.count__n { position: absolute; left: 0; top: 0; line-height: 1.25em; }

.tick { width: 22px; height: 22px; display: block; }
.tick path { fill: none; stroke: var(--bianco); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; }

/* ---- the line under the button ---- */
.note {
  position: relative;
  height: 1.3em;
  overflow: hidden;
  font-size: 14px;
  color: var(--testo-2);
  font-stretch: 100%;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.note__line { display: block; line-height: 1.3em; text-align: center; }

@media (hover: hover) {
  .pill:hover .pill__bg { background: var(--inchiostro-2); }
}

@media (max-width: 420px) {
  .pill { height: 52px; }
  .face { font-size: 16px; padding: 0 22px; }
  .face--undo, .face--sent { padding-left: 18px; }
  .face--send { padding-right: 20px; }
}
