:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --testo: #121419;
  --testo-2: #5c6270;
  --testo-3: #9da2ad;
  --linea: #eceef2;
  --traccia: #edeff3;
  --accento: #4f46e5;        /* the single accent: the ring, the gains, the badge */
  --accento-velo: #eef0ff;
  --ombra-1: rgba(18, 20, 25, 0.05);
  --ombra-2: rgba(18, 20, 25, 0.16);
}

* { box-sizing: border-box; margin: 0; padding: 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;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 12px;
  /* everything is measured in em: the card grows with both the width and the height of the window */
  font-size: clamp(10.5px, min(3.7vw, 2.75vh), 18px);
}

.card {
  position: relative;
  width: min(26em, calc(100vw - 24px));
  padding: 1.25em 1.35em 1.3em;
  border-radius: 1.3em;
  background: var(--carta);
  border: 1px solid var(--linea);
  box-shadow:
    0 1px 2px var(--ombra-1),
    0 0.9em 2.4em -0.9em var(--ombra-2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* ---- the header: what this is and how far you are ---- */
.card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: 1.1em;
}
.kicker {
  font-size: 0.8em;
  font-weight: 560;
  color: var(--testo-2);
  letter-spacing: 0.005em;
}
.kicker.is-done { color: var(--accento); }
.pct {
  display: inline-flex;
  align-items: baseline;
  font-size: 1.05em;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
  font-stretch: 92%;
}
.pct__sign { color: var(--testo-3); font-weight: 520; margin-left: 0.06em; }

/* a window one line tall: the new line rises from below, the old one leaves upwards */
.roll {
  display: inline-grid;
  overflow: hidden;
  vertical-align: bottom;
  line-height: 1.25;
}
.roll__line { grid-area: 1 / 1; white-space: nowrap; }

/* ---- who: the avatar inside its ring, the name, the bio ---- */
.who {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.05em;
  align-items: start;
}
.ava {
  position: relative;
  width: 5.2em;
  height: 5.2em;
}
.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.ring circle { fill: none; stroke-width: 3.2; stroke-linecap: round; }
.ring__track { stroke: var(--traccia); }
.ring__fill { stroke: var(--accento); stroke-dasharray: 1 1; stroke-dashoffset: 0.6; }
.ring__glint {
  stroke: #ffffff;
  stroke-width: 2.2;
  stroke-dasharray: 0.06 1;
  stroke-dashoffset: 0.06;
  opacity: 0;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.9));
}
.ava__face {
  position: absolute;
  inset: 0.62em;
  border-radius: 50%;
  overflow: hidden;
  background: #f2f3f6;
  box-shadow: inset 0 0 0 1px rgba(18, 20, 25, 0.06);
  display: grid;
  place-items: center;
}
.ava__ini {
  grid-area: 1 / 1;
  font-weight: 620;
  font-size: 1.15em;
  color: var(--testo-2);
  letter-spacing: 0.02em;
}
.ava__pic {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  opacity: 0;
}
.ava__pic svg { width: 100%; height: 100%; display: block; }

.who__txt { min-width: 0; padding-top: 0.25em; }
.name {
  display: flex;
  align-items: center;
  gap: 0.3em;
  font-size: 1.22em;
  font-weight: 640;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.badge { width: 1em; height: 1em; flex: none; opacity: 0; transform-origin: 50% 50%; }
.badge__shape { fill: var(--accento); }
.badge__tick {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}
.role { margin-top: 0.15em; font-size: 0.84em; color: var(--testo-2); }

.bio {
  position: relative;
  margin-top: 0.7em;
  min-height: 2.6em;
}
.skel {
  display: block;
  height: 0.58em;
  margin-bottom: 0.48em;
  border-radius: 0.3em;
  background: linear-gradient(90deg, #f1f2f5, #f6f7f9 50%, #f1f2f5);
  border: 1px dashed #e1e4ea;
}
.skel--short { width: 62%; }
.bio__txt {
  position: absolute;
  inset: 0 0 auto 0;
  font-size: 0.84em;
  line-height: 1.45;
  color: var(--testo);
}
.bio__txt .w { display: inline-block; opacity: 0; }

.cal {
  display: flex;
  align-items: center;
  gap: 0.45em;
  margin-top: 0.55em;
  font-size: 0.78em;
  color: var(--testo-2);
  opacity: 0;
}
.cal svg { width: 1.15em; height: 1.15em; fill: none; stroke: var(--accento); stroke-width: 1.4; stroke-linecap: round; }

/* ---- next steps: chips that leave once done ---- */
.next {
  position: relative;
  margin-top: 1.15em;
  padding-top: 1em;
  border-top: 1px solid var(--linea);
}
.next__label {
  font-size: 0.72em;
  font-weight: 560;
  color: var(--testo-3);
  margin-bottom: 0.6em;
  letter-spacing: 0.01em;
}
.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45em;
  min-height: 2.2em;
}
.chips li { display: block; }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.42em;
  height: 2.2em;
  padding: 0 0.75em 0 0.55em;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #e3e6eb;
  box-shadow: 0 1px 1.5px rgba(18, 20, 25, 0.05);
  font-size: 0.8em;
  font-weight: 540;
  white-space: nowrap;
  transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
}
.chip:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.chip__ic { position: relative; width: 1.2em; height: 1.2em; display: grid; }
.chip__ic svg {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--testo-2);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chip__ok path {
  stroke: var(--accento);
  stroke-width: 1.9;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}
.chip__g { color: var(--accento); font-weight: 620; font-variant-numeric: tabular-nums; }
.chip.is-on { background: var(--accento-velo); border-color: #d6d9ff; }

@media (hover: hover) {
  .chip:hover { border-color: #c9cdf7; box-shadow: 0 0.25em 0.7em -0.3em rgba(79, 70, 229, 0.35); }
  .cta:hover { box-shadow: 0 0.5em 1.2em -0.45em rgba(79, 70, 229, 0.7); }
}

.done {
  position: absolute;
  left: 0;
  right: 0;
  top: 1em;
  bottom: 0;
  display: grid;
  align-items: end;
  visibility: hidden;
}
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  width: 100%;
  height: 2.75em;
  border-radius: 999px;
  background: var(--testo);
  color: #ffffff;
  font-size: 0.86em;
  font-weight: 600;
  box-shadow: 0 0.35em 0.9em -0.45em rgba(18, 20, 25, 0.6);
  transition: box-shadow 0.3s;
}
.cta svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cta:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }

@media (max-width: 380px) {
  .role { font-size: 0.8em; }
}

/* on a big screen the card grows: measured on both the width and the height */
@media (min-width: 900px) and (min-height: 620px) {
  .stage { font-size: clamp(15px, min(1.6vw, 2.5vh), 22px); }
}
