:root {
  --fondo: #fafafa;
  --carta: #ffffff;
  --bordo: rgba(17, 17, 19, 0.08);
  --riga: rgba(17, 17, 19, 0.06);
  --testo: #18181b;
  --testo-2: #71717a;
  --testo-3: #a1a1aa;
  --nero: #111113;
  --accento: #4f46e5;
  --verde: #15803d;
  --verde-tenue: #ecfdf3;
  --verde-bordo: rgba(21, 128, 61, 0.22);
}

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

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

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

/* the card */
.card {
  position: relative;
  width: min(372px, 100%);
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 22px 44px -26px rgba(17, 17, 19, 0.32);
  overflow: hidden;
  transition: border-color 0.4s ease, background-color 0.4s ease;
}
.card.is-done { border-color: var(--verde-bordo); background: var(--verde-tenue); }

.head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(12px, 3.4vmin, 16px) clamp(14px, 3.6vmin, 18px);
}

.ring { position: relative; flex: none; width: 40px; height: 40px; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring__track { fill: none; stroke: rgba(17, 17, 19, 0.08); stroke-width: 4; }
.ring__bar {
  fill: none;
  stroke: var(--accento);
  stroke-width: 4;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}
.ring__check { inset: 8px !important; width: 24px !important; height: 24px !important; }
.ring__check path { fill: none; stroke: var(--verde); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.head__text { display: grid; gap: 2px; min-width: 0; }
.head__title { font-size: 15px; font-weight: 640; letter-spacing: -0.01em; }
.head__sub { font-size: 12.5px; color: var(--testo-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head__all {
  position: absolute;
  left: 66px;
  top: 50%;
  translate: 0 -50%;
  font-size: 15px;
  font-weight: 640;
  color: var(--verde);
  opacity: 0;
  pointer-events: none;
}

/* rolling digit */
.roll {
  display: inline-block;
  height: 1.25em;
  line-height: 1.25em;
  overflow: hidden;
  vertical-align: bottom;
  font-variant-numeric: tabular-nums;
  color: var(--testo);
  font-weight: 600;
}
.roll__col { display: block; }
.roll__col span { display: block; height: 1.25em; }

/* the tasks */
.tasks { list-style: none; border-top: 1px solid var(--riga); }
.task { position: relative; border-bottom: 1px solid var(--riga); background: var(--carta); }
.task:last-child { border-bottom: 0; }

.task__row {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: clamp(9px, 2.6vmin, 12px) clamp(14px, 3.6vmin, 18px);
  cursor: pointer;
  font-size: 14px;
}
.task__row:focus-visible { outline: 2px solid var(--accento); outline-offset: -3px; border-radius: 10px; }

.box {
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid rgba(17, 17, 19, 0.22);
  background: var(--carta);
  display: grid;
  place-items: center;
}
.box svg { width: 16px; height: 16px; }
.box path { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.task__label { position: relative; flex: 1; min-width: 0; color: var(--testo); }
.task__text { display: inline-block; white-space: nowrap; }
.strike {
  position: absolute;
  left: 0;
  top: 52%;
  height: 1.5px;
  background: var(--testo-3);
  border-radius: 1px;
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.task.is-done .task__text { color: var(--testo-3); }

.chev { flex: none; width: 16px; height: 16px; }
.chev path { fill: none; stroke: var(--testo-3); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.task__body { height: 0; overflow: hidden; }
.task__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 clamp(14px, 3.6vmin, 18px) clamp(11px, 2.8vmin, 14px) calc(clamp(14px, 3.6vmin, 18px) + 31px);
}
.task__hint { flex: 1; font-size: 12.5px; line-height: 1.45; color: var(--testo-2); }
.task__cta {
  flex: none;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--nero);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 6px 14px -8px rgba(17, 17, 19, 0.6);
  user-select: none;
}

@media (hover: hover) {
  .task__row { transition: background-color 0.2s ease; }
  .task__row:hover { background: rgba(17, 17, 19, 0.022); }
  .task__row:hover .chev path { stroke: var(--testo-2); }
  .task__cta { transition: background-color 0.2s ease, box-shadow 0.2s ease; }
  .task__cta:hover { background: #26262b; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 8px 18px -8px rgba(17, 17, 19, 0.7); }
}

/* 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: 380px) {
  .head__sub { font-size: 11.5px; }
  .task__row { font-size: 13px; }
  .task__hint { font-size: 11.5px; }
}
