:root {
  --fondo: #000000;
  --pillola: #131315;
  --pillola-basso: #0a0a0b;
  --testo: #f3f1ee;
  --tenue: #86837e;
  --disco: #f1eee8;
  --segno: #0c0c0d;
  --accento: #e2bf7e;
  --ottone-chiaro: #fff1d6;
  --ottone-scuro: #a8783a;
  --tacca: rgba(255, 255, 255, 0.16);
}

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

html, body { height: 100%; background: var(--fondo); }

body {
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  color: var(--testo);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.btn {
  position: relative;
  display: block;
  width: min(88vw, 320px);
  height: 60px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 30px;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.btn:focus-visible { box-shadow: 0 0 0 2px var(--fondo), 0 0 0 4px var(--accento); }

.btn__body {
  position: relative;
  display: block;
  width: 100%;
  height: 60px;
  border-radius: 30px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--pillola), var(--pillola-basso));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    0 1px 1px rgba(0, 0, 0, 0.6),
    0 14px 30px -14px rgba(0, 0, 0, 1);
  will-change: transform;
}

/* the 1px edge that catches light where the pointer is */
.btn__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background:
    radial-gradient(120px 60px at var(--mx, 30%) 0%, rgba(255, 245, 225, 0.34), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

/* warm light that travels with the reconciled days */
.btn__glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(28% 110% at var(--gx, 20%) 100%, rgba(226, 191, 126, 0.24), transparent 72%);
  opacity: 0;
  pointer-events: none;
}

.btn__sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 46%;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 238, 210, 0.15) 50%, transparent 80%);
  opacity: 0;
  pointer-events: none;
}

.icon {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 40px;
  height: 40px;
}
.icon__disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 20%, #ffffff, var(--disco) 55%, #d6d0c6);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.18), 0 2px 6px -2px rgba(0, 0, 0, 0.7);
}
.icon__disc--done {
  background:
    radial-gradient(120% 120% at 30% 18%, var(--ottone-chiaro), var(--accento) 52%, var(--ottone-scuro)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 3px);
  background-blend-mode: overlay;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -1px 0 rgba(0, 0, 0, 0.25), 0 0 18px -4px rgba(226, 191, 126, 0.5);
  opacity: 0;
}
.icon__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.icon__line {
  fill: none;
  stroke: var(--segno);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon__dot { fill: none; stroke: var(--segno); stroke-width: 1.8; stroke-linecap: round; }
.icon__check { stroke-width: 2.1; }
.ring__track, .ring__fill { fill: none; stroke-width: 1.5; }
.ring__track { stroke: rgba(255, 255, 255, 0.1); opacity: 0; }
.ring__fill { stroke: var(--accento); stroke-linecap: round; opacity: 0; transform: rotate(-90deg); transform-origin: 20px 20px; }

/* the labels sit a little above the middle, the ruler of days below them */
.txt {
  position: absolute;
  left: 62px;
  right: 24px;
  top: 8px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  white-space: nowrap;
  pointer-events: none;
}
.txt__main {
  font-size: 15px;
  font-weight: 560;
  font-variation-settings: "wdth" 100;
  letter-spacing: 0.005em;
}
.txt__meta {
  font-size: 12px;
  font-weight: 500;
  color: var(--tenue);
  font-variant-numeric: tabular-nums;
}
.count { display: inline-block; min-width: 2ch; text-align: right; color: var(--accento); }
.txt--done { right: auto; justify-content: flex-start; }

.lockrow { display: inline-flex; align-items: center; gap: 5px; }
.lock { width: 13px; height: 13px; overflow: visible; }
.lock__shackle, .lock__body { fill: none; stroke: var(--accento); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.lock__shackle { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); transform-origin: 10.8px 7.2px; }
.swap { position: relative; display: inline-grid; height: 15px; overflow: hidden; }
.swap__a, .swap__b { grid-area: 1 / 1; display: block; line-height: 15px; transition: transform 0.38s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.25s; }
.swap__b { transform: translateY(110%); opacity: 0; color: var(--testo); }

/* the ruler: one tick per day of the month */
.ticks {
  position: absolute;
  left: 62px;
  right: 24px;
  top: 38px;
  height: 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
}
.tick {
  position: relative;
  width: 1.5px;
  height: 8px;
  border-radius: 1px;
  background: var(--tacca);
  transform-origin: 50% 100%;
}
.tick--we { height: 5px; }
.tick__lit {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--ottone-chiaro), var(--accento) 55%, var(--ottone-scuro));
  box-shadow: 0 0 5px rgba(226, 191, 126, 0.45);
  opacity: 0;
}

/* the accountant's double rule under the closed total */
.rule {
  position: absolute;
  left: 62px;
  top: 39px;
  width: 0;
  height: 5px;
  pointer-events: none;
}
.rule__line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--ottone-scuro), var(--ottone-chiaro) 40%, var(--accento) 70%, var(--ottone-scuro));
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.rule__line + .rule__line { top: 3px; }

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

.pointer {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #0b0b0d;
  stroke-width: 1.2;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
  opacity: 0;
}

/* closed: hovering offers to reopen, the shackle lifts */
@media (hover: hover) {
  .btn.is-done:hover .swap__a, .btn.is-done.is-near .swap__a { transform: translateY(-110%); opacity: 0; }
  .btn.is-done:hover .swap__b, .btn.is-done.is-near .swap__b { transform: translateY(0); opacity: 1; }
  .btn.is-done:hover .lock__shackle, .btn.is-done.is-near .lock__shackle { transform: translateY(-1.6px) rotate(-14deg); }
}
.btn.is-done:focus-visible .swap__a, .btn.is-done.is-near .swap__a { transform: translateY(-110%); opacity: 0; }
.btn.is-done:focus-visible .swap__b, .btn.is-done.is-near .swap__b { transform: translateY(0); opacity: 1; }
.btn.is-done.is-near .lock__shackle { transform: translateY(-1.6px) rotate(-14deg); }

@media (prefers-reduced-motion: reduce) {
  .lock__shackle, .swap__a, .swap__b { transition: opacity 0.25s; }
  .btn.is-done:hover .swap__a, .btn.is-done.is-near .swap__a, .btn.is-done:focus-visible .swap__a { transform: none; }
  .btn.is-done:hover .swap__b, .btn.is-done.is-near .swap__b, .btn.is-done:focus-visible .swap__b { transform: none; }
  .btn.is-done:hover .lock__shackle, .btn.is-done.is-near .lock__shackle { transform: none; }
}
