:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --testo: #14151a;
  --testo-2: #5d606b;
  --testo-3: #a4a7b0;
  --linea: #ebecf0;
  --traccia: #f3f4f7;
  --accento: #2f55ff;        /* the single accent: Loop's electric blue, in the fill, the reach and the ring */
  --accento-scuro: #1f3fe0;
  --accento-velo: #eef1ff;
  --ombra: 20, 22, 40;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { font-size: clamp(12px, min(3.5vw, 3.3vh), 17px); }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", 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; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
ul { list-style: none; }

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1em;
}

/* ---- the post ---- */
.post {
  width: min(25em, 92vw);
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 1.25em;
  padding: 1.15em 1.15em 1em;
  box-shadow: 0 1px 2px rgba(var(--ombra), .04), 0 18px 40px -26px rgba(var(--ombra), .28);
}
.post__head { display: flex; align-items: center; gap: .65em; }
.post__avatar {
  flex: none;
  width: 2.3em; height: 2.3em;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--traccia);
  color: var(--testo-2);
  font-size: .78em;
  font-weight: 650;
  font-stretch: 110%;
  letter-spacing: .02em;
  box-shadow: inset 0 0 0 1px var(--linea);
}
.post__who { display: grid; line-height: 1.2; min-width: 0; }
.post__name { font-weight: 650; font-size: .95em; }
.post__meta { color: var(--testo-3); font-size: .8em; }
.post__chip {
  margin-left: auto;
  font-size: .72em;
  color: var(--testo-2);
  padding: .3em .7em;
  border-radius: 999px;
  background: var(--traccia);
  white-space: nowrap;
}
.post__text { margin-top: .8em; font-size: .95em; line-height: 1.45; color: var(--testo); text-wrap: pretty; }
.post__stats { display: flex; gap: 1.2em; margin-top: .85em; color: var(--testo-3); font-size: .8em; font-variant-numeric: tabular-nums; }
.post__stats li { display: flex; align-items: center; gap: .35em; }
.post__stats svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---- the boost strip ---- */
.boost { margin-top: 1em; padding-top: .95em; border-top: 1px solid var(--linea); }
.boost__row { display: flex; align-items: baseline; gap: .5em; font-size: .82em; }
.boost__label { color: var(--testo-2); }
.boost__reach { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--testo); display: inline-flex; gap: .3em; }
.boost__reach [data-reach] { display: inline-block; min-width: 2.5em; color: var(--accento); }
.boost__people { color: var(--testo-3); font-weight: 450; }
.boost__budget {
  margin-left: auto;
  display: inline-flex; align-items: baseline;
  padding: .25em .6em;
  border-radius: 999px;
  background: var(--traccia);
  font-weight: 600;
}
.boost__per { color: var(--testo-3); font-weight: 450; margin-left: .1em; }

.roll { display: inline-grid; overflow: hidden; vertical-align: -.28em; height: 1.3em; line-height: 1.3em; }
.roll__line { grid-area: 1 / 1; display: block; white-space: nowrap; }

/* ---- the pill ---- */
.pill-wrap { position: relative; margin-top: .8em; }
.ring {
  position: absolute; inset: 0;
  border-radius: 999px;
  border: 1.5px solid var(--accento);
  opacity: 0;
  pointer-events: none;
}
.pill {
  --p: 0;
  position: relative;
  display: block;
  width: 100%;
  height: 3em;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  outline: none;
}
.pill__face {
  position: absolute; inset: 0;
  display: grid;
  border-radius: 999px;
  overflow: hidden;
  background: var(--accento-velo);
  box-shadow: inset 0 0 0 1px rgba(47, 85, 255, .16), 0 1px 0 rgba(255,255,255,.8) inset;
  transition: box-shadow .25s ease;
}
.pill:focus-visible .pill__face { box-shadow: inset 0 0 0 1px rgba(47, 85, 255, .16), 0 0 0 3px rgba(47, 85, 255, .28); }
.pill__fill {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #4a6bff, var(--accento) 55%, var(--accento-scuro));
  transform-origin: 0 50%;
  transform: scaleX(var(--p));
  border-radius: inherit;
}
/* a soft light on the leading edge of the fill */
.pill__fill::after {
  content: "";
  position: absolute; top: 0; bottom: 0; right: 0;
  width: 1.6em;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.35));
  opacity: min(1, calc(var(--p) * 6), calc((1 - var(--p)) * 10));
}
.pill__label, .pill__done {
  grid-area: 1 / 1;
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: .45em;
  font-weight: 650;
  font-stretch: 106%;
  font-size: .98em;
  letter-spacing: -.005em;
  pointer-events: none;
}
.pill__label { color: var(--accento); }
.pill__label--on { color: #fff; clip-path: inset(0 calc((1 - var(--p)) * 100%) 0 0); }
.pill__arrow { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pill__done { color: #fff; opacity: 0; }
.pill__bolt { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.pill__bolt path { stroke-dasharray: 1; stroke-dashoffset: 1; }

@media (hover: hover) {
  .pill:hover .pill__face { box-shadow: inset 0 0 0 1px rgba(47, 85, 255, .3), 0 6px 16px -10px rgba(47, 85, 255, .55); }
}

.boost__foot { display: flex; align-items: center; justify-content: space-between; margin-top: .55em; font-size: .76em; min-height: 1.6em; }
.hint { color: var(--testo-3); }
.undo {
  color: var(--testo-2);
  font-weight: 600;
  padding: .15em .1em;
  opacity: 0;
  pointer-events: none;
}
.undo.is-on { pointer-events: auto; }
@media (hover: hover) { .undo:hover { color: var(--accento); } }
