:root {
  --fondo: #ffffff;
  --schermo: #ffffff;
  --bordo: #ececef;
  --riga: #f1f1f4;
  --riga-2: #e6e6ea;
  --inchiostro: #131316;     /* the floating button */
  --inchiostro-su: #2a2a31;  /* the button, a touch darker-lighter when open */
  --testo: #16161a;
  --testo-2: #5f5d68;
  --testo-3: #a3a1ab;
  --piccolo: #ffffff;        /* the small action circles */
  --accento: #2f5bff;        /* the single accent: the action under the pointer */
  --velo: rgba(255, 255, 255, .78);
  --ombra: 20, 20, 32;
  --k: 3.5em;                /* the floating button */
  --s: 2.6em;                /* the small action circles */
  --gap: 1.1em;              /* the button’s distance from the corner */
  --passo: .72em;            /* space between one action and the next */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { font-size: clamp(12px, min(3.4vw, 3vh), 16px); }
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; }
ul { list-style: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stage { height: 100vh; display: grid; place-items: center; padding: 3vh 3vw; }

/* the screen of the app: a frame with a few notes in thin grey, just enough to read where we are */
.screen {
  position: relative;
  width: min(22em, 94vw);
  height: min(32em, 92vh);
  background: var(--schermo);
  border: 1px solid var(--bordo);
  border-radius: 1.4em;
  overflow: hidden;
}
.screen__head { display: flex; align-items: baseline; justify-content: space-between; padding: 1.4em 1.4em .9em; }
.title { font-size: 1.5em; font-weight: 640; font-variation-settings: "wdth" 92; letter-spacing: -.01em; }
.count { font-size: .78em; color: var(--testo-3); }
.notes { display: grid; gap: .65em; padding: 0 1.1em; }
.note { display: grid; gap: .45em; padding: .85em .9em; border: 1px solid var(--bordo); border-radius: .9em; }
.note__t { font-size: .86em; font-weight: 560; color: var(--testo-2); }
.l { display: block; height: .38em; border-radius: 1em; background: var(--riga); width: 86%; }
.l--s { width: 48%; }
.l--m { width: 64%; }

/* the veil over the screen while the dial is open (a click on it closes) */
.scrim { position: absolute; inset: 0; background: var(--velo); opacity: 0; pointer-events: none; }
.screen.is-open .scrim { pointer-events: auto; }

/* the little confirmation after an action: a snackbar on the left, level with the button */
.toast {
  position: absolute; left: var(--gap);
  bottom: calc(var(--gap) + (var(--k) - 2.4em) / 2);
  height: 2.4em; padding: 0 1.05em;
  display: flex; align-items: center;
  border-radius: 2em;
  background: var(--inchiostro); color: #fff;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  box-shadow: 0 8px 20px rgba(var(--ombra), .18);
}
.toast span { font-size: .8em; font-weight: 560; }

/* ---- the dial: the floating button and, above it, the actions on the same vertical axis ---- */
.dial { position: absolute; right: var(--gap); bottom: var(--gap); width: var(--k); height: var(--k); }

.fab {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--inchiostro);
  color: #fff;
  box-shadow: 0 1px 1px rgba(var(--ombra), .12), 0 6px 14px rgba(var(--ombra), .18);
  outline: none;
}
.fab:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accento); }
.fab__shine {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(120% 90% at 30% 18%, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 55%);
}
/* the plus: the whole svg turns, around 50% 50% */
.plus { width: 46%; height: 46%; display: block; }
.plus path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.actions {
  position: absolute;
  bottom: calc(var(--k) + var(--passo) * 1.3);
  /* each small circle sits on the axis of the big one */
  right: calc((var(--k) - var(--s)) / 2);
  width: var(--s);
  display: grid; gap: var(--passo);
  pointer-events: none;
}
.screen.is-open .actions { pointer-events: auto; }
.action { position: relative; width: var(--s); height: var(--s); }
.action__btn {
  position: absolute; inset: 0;
  display: block; outline: none;
}
.dot {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--piccolo);
  color: var(--testo);
  box-shadow: 0 0 0 1px var(--bordo), 0 1px 1px rgba(var(--ombra), .06), 0 6px 14px rgba(var(--ombra), .1);
  transition: background-color .2s, color .2s;
}
.ico { width: 52%; height: 52%; display: block; }
.ico path, .ico rect { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* the label: out of the circle’s cell, to its left, centred on its height without a transform */
.pill {
  position: absolute; right: calc(100% + .7em); top: 0; bottom: 0; margin: auto 0;
  height: 2.1em; display: grid; place-items: center;
  padding: 0 .95em;
  white-space: nowrap;
}
.pill__bg {
  position: absolute; inset: 0; border-radius: 2em;
  background: var(--piccolo);
  box-shadow: 0 0 0 1px var(--bordo), 0 4px 10px rgba(var(--ombra), .08);
}
.pill__t { position: relative; font-size: .84em; font-weight: 560; font-variation-settings: "wdth" 96; color: var(--testo); }

.action__btn.is-on .dot,
.action__btn:focus-visible .dot { background: var(--accento); color: #fff; box-shadow: 0 0 0 1px var(--accento), 0 8px 18px rgba(47, 91, 255, .28); }
