:root {
  --fondo: #f2f2f2;
  --carta: #ffffff;
  --bordo: rgba(17, 17, 19, 0.08);
  --testo: #18181b;
  --testo-2: #71717a;
  --testo-3: #a1a1aa;
  --rosso: #e5484d;
  --rosso-tenue: #fdeeee;
  --blu: #3e63dd;
  --ambra: #f2a417;
  --arancio: #f2681b;
  --accento: #e5484d;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

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

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vmin, 40px);
}

/* the post */
.post {
  width: min(360px, 100%);
  padding: 18px 18px 14px;
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 18px 40px -24px rgba(17, 17, 19, 0.3);
}

.post__top { display: flex; align-items: center; gap: 11px; }

.avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.55), transparent 55%), linear-gradient(140deg, #9fb7ff, #c7a6ff);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}
.avatar__letters { font-weight: 650; font-size: 12.5px; color: #fff; letter-spacing: 0.02em; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }

.who { display: grid; gap: 1px; min-width: 0; }
.who__name { font-weight: 640; font-size: 14.5px; letter-spacing: -0.005em; }
.who__meta { font-size: 12px; color: var(--testo-2); }

.post__text {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #3f3f46;
}

/* the row of actions */
.actions {
  position: relative;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--bordo);
  display: flex;
  align-items: center;
  gap: 8px;
}

.likewrap { position: relative; flex: none; }

/* the like pill: GSAP moves .like (scale), the fill and the icon are children */
.like {
  position: relative;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  color: var(--testo);
  cursor: pointer;
  outline: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.like__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--carta);
  box-shadow: inset 0 0 0 1px rgba(17, 17, 19, 0.12), 0 1px 2px rgba(17, 17, 19, 0.05);
}
.like__inner {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px 0 10px;
}
.like__icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: none;
}
.glyph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  overflow: visible;
  pointer-events: none;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.like__count {
  display: inline-flex;
  font-weight: 600;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.digit {
  position: relative;
  display: inline-block;
  height: 1.3em;
  line-height: 1.3em;
  overflow: hidden;
  vertical-align: bottom;
}
.digit__col { display: block; }
.digit__col span { display: block; height: 1.3em; }
.like:focus-visible .like__fill { box-shadow: 0 0 0 3px var(--fondo), 0 0 0 5px var(--accento); }

/* the other actions, quiet */
.pill {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--testo-2);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.pill svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pill--icon { padding: 0 9px; }
@media (hover: hover) {
  .pill:hover { background: #f4f4f5; color: var(--testo); }
}
.pill:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--carta), 0 0 0 4px var(--testo-3); }

.hint {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--testo-3);
  white-space: nowrap;
}

/* the tray of reactions, above the pill */
.tray {
  position: absolute;
  left: -6px;
  bottom: calc(100% + 10px);
  display: flex;
  gap: 2px;
  padding: 5px;
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: 999px;
  box-shadow: 0 2px 4px rgba(17, 17, 19, 0.05), 0 16px 32px -14px rgba(17, 17, 19, 0.35);
  transform-origin: 22px 100%;
  visibility: hidden;
  z-index: 3;
}
.react {
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--c, var(--testo));
}
.react[data-react="love"] { --c: var(--rosso); }
.react[data-react="like"] { --c: var(--blu); }
.react[data-react="star"] { --c: var(--ambra); }
.react[data-react="fire"] { --c: var(--arancio); }
.react svg {
  width: 22px;
  height: 22px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.react__tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 3px 7px;
  border-radius: 6px;
  background: #18181b;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.react:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--c); }

/* the drawn pointer of the autopilot */
.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #111113;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  opacity: 0;
  z-index: 5;
}

@media (max-width: 360px) {
  .post { padding: 16px 14px 12px; }
  .hint { display: none; }
}
