:root {
  --fondo: #ffffff;
  --inchiostro: #121318;
  --testo: #eef0f6;
  --errore: #ff7a62;
  --fatto: #7fe0b4;
  --grigio: #8b8e99;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
}

.frame {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(340px, 92vw);
}

/* the pill: the button for GSAP (scale), the layers inside for CSS */
.f {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  height: 60px;
  padding: 0 26px 0 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--testo);
  font: inherit;
  font-size: 16px;
  font-weight: 580;
  font-variation-settings: "wdth" 100;
  letter-spacing: -0.005em;
  cursor: pointer;
  isolation: isolate;
  max-width: 92vw;
  -webkit-tap-highlight-color: transparent;
}
.f:focus-visible { outline: 2px solid #9aa6ff; outline-offset: 4px; }

.f__skin, .f__grain, .f__glow, .f__metal {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.f__skin {
  z-index: -4;
  background:
    radial-gradient(90% 120% at 50% -30%, rgba(160, 172, 210, 0.16), transparent 60%),
    linear-gradient(180deg, #23252d 0%, var(--inchiostro) 55%, #0a0b0e 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 1px 1px rgba(18, 19, 24, 0.18),
    0 6px 14px -6px rgba(18, 19, 24, 0.32),
    0 24px 44px -22px rgba(30, 36, 70, 0.5);
}
.f__grain {
  z-index: -3;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.7'/></svg>");
}
.f__glow {
  z-index: -2;
  overflow: hidden;
  opacity: 0;
  background: radial-gradient(110px 70px at var(--gx, 50%) var(--gy, 50%), rgba(200, 208, 255, 0.14), transparent 70%);
}
/* the liquid metal: an SVG drawn again on every frame while the wave runs */
.f__metal {
  z-index: -1;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.f__band { mix-blend-mode: screen; opacity: 0; }
.f__halo { mix-blend-mode: screen; opacity: 0; }
.f__crest { stroke-width: 1; opacity: 0; mix-blend-mode: screen; }
.f__drain { opacity: 0; mix-blend-mode: screen; }
.f__rim { stroke-width: 1; opacity: 0; }

/* the issue chip: a warning triangle and a rolling count, then a tick */
.f__chip {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 9px 0 7px;
  border-radius: 999px;
  color: var(--errore);
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 600;
}
.f__chip-bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: color-mix(in srgb, currentColor 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 26%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.f__warn, .f__tick {
  position: relative;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.f__tick {
  position: absolute;
  left: 7px;
  top: 7.5px;
  opacity: 0;
  stroke-width: 1.8;
}
.f__count {
  position: relative;
  display: block;
  width: 1ch;
  height: 16px;
  overflow: hidden;
}
.f__roll {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  line-height: 16px;
}

.f__labels {
  position: relative;
  display: block;
  height: 22px;
  overflow: hidden;
}
.f__label {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  width: max-content;
  height: 22px;
  line-height: 22px;
  white-space: nowrap;
  opacity: 0;
}
.f__label[data-l="idle"] { opacity: 1; }
/* the label thinks: a light runs through the letters while the wave works */
.f__label--wait {
  background: linear-gradient(100deg, rgba(238, 240, 246, 0.74) 0%, rgba(238, 240, 246, 0.74) 38%, #ffffff 50%, rgba(238, 240, 246, 0.74) 62%, rgba(238, 240, 246, 0.74) 100%);
  background-size: 250% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.f__dots span { display: inline-block; color: rgba(238, 240, 246, 0.7); }

.note {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 450;
  color: var(--grigio);
  white-space: nowrap;
}
.note__file { color: #4b4e58; }
.note__sep { opacity: 0.6; }
.note__state { display: inline-block; }
.note .add { color: #1f9e6a; }
.note .del { color: #d4543d; }

@media (max-width: 400px) {
  .f { height: 56px; font-size: 15px; padding: 0 22px 0 12px; gap: 10px; }
  .f__chip { height: 28px; }
  .f__tick { top: 6.5px; }
  .note { font-size: 11px; }
}
