:root {
  --fondo: #f5f3ee;
  --inchiostro: #141414;
  --grigio: #77746e;
  --grigio-chiaro: #b9b5ad;
  --linea: rgba(20, 20, 20, 0.1);
  --tinta: #ff5b22;
  --tinta-tenue: rgba(255, 91, 34, 0.12);
  --bianco: #ffffff;
}

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

html, body { height: 100%; overflow: hidden; }

body {
  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;
  width: 100%;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 16px;
}

.count {
  --cifra: clamp(34px, min(12.5vw, 15.5vh), 108px);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 640px);
  text-align: center;
}

.eyebrow {
  font-size: clamp(11px, min(2.9vw, 3.2vh), 14px);
  font-weight: 600;
  font-variation-settings: "wdth" 112;
  letter-spacing: 0.01em;
  color: var(--inchiostro);
}
.eyebrow__soft { color: var(--grigio); font-weight: 450; }

.title {
  margin-top: clamp(4px, 1.2vh, 10px);
  font-size: clamp(18px, min(5.4vw, 6.4vh), 34px);
  font-weight: 560;
  font-variation-settings: "wdth" 88;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.units {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: calc(var(--cifra) * 0.16);
  margin-top: clamp(6px, 2.4vh, 22px);
}

.unit { display: flex; flex-direction: column; align-items: center; }

.pair {
  display: flex;
  height: calc(var(--cifra) * 1.3);
  /* soft top and bottom edges: the falling digits melt instead of being cut */
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 17%, #000 83%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 17%, #000 83%, transparent 100%);
}

.slot {
  position: relative;
  display: block;
  width: calc(var(--cifra) * 0.6);
  height: 100%;
  overflow: hidden;
}

.digit {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: var(--cifra);
  line-height: 1;
  font-weight: 640;
  font-variation-settings: "wdth" 84, "wght" 640;
  letter-spacing: -0.03em;
  will-change: transform;
}

.label {
  margin-top: calc(var(--cifra) * -0.06);
  font-size: clamp(9px, min(2.5vw, 2.8vh), 12px);
  font-weight: 500;
  font-variation-settings: "wdth" 110;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grigio);
}

.sep {
  display: block;
  width: 1px;
  height: calc(var(--cifra) * 0.62);
  margin-top: calc(var(--cifra) * 0.34);
  background: var(--linea);
}

/* sixty hairlines, one per second */
.ruler {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: min(100%, calc(var(--cifra) * 5.6));
  height: clamp(14px, 3.4vh, 22px);
  margin-top: clamp(12px, 3vh, 24px);
}
.ruler i {
  display: block;
  width: 1px;
  height: 36%;
  background: var(--grigio-chiaro);
  transform-origin: 50% 100%;
}
.ruler i.five { height: 58%; background: var(--grigio); }

.when {
  margin-top: clamp(10px, 2.6vh, 20px);
  font-size: clamp(11px, min(3vw, 3.4vh), 14px);
  font-weight: 450;
  font-variation-settings: "wdth" 100;
  color: var(--grigio);
}

.remind {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: clamp(38px, 9vh, 46px);
  margin-top: clamp(14px, 3.4vh, 26px);
  padding: 0 20px 0 16px;
  border: 0;
  background: none;
  color: var(--bianco);
  font: inherit;
  font-size: clamp(13px, min(3.6vw, 3.8vh), 15px);
  font-weight: 560;
  font-variation-settings: "wdth" 100;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}
.remind__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 999px;
  background: var(--inchiostro);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 6px 16px -8px rgba(20, 20, 20, 0.5);
}
.remind:focus-visible { outline: none; }
.remind:focus-visible .remind__bg { box-shadow: 0 0 0 3px var(--fondo), 0 0 0 5px var(--tinta); }

.remind__icon { position: relative; width: 18px; height: 18px; }
.remind__icon svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bell { transform-origin: 50% 12%; }
.remind__icon .tick { stroke: var(--tinta); stroke-width: 2.1; opacity: 0; }

.remind__words { position: relative; display: block; height: 1.2em; line-height: 1.2em; overflow: hidden; }
.remind__word { display: block; white-space: nowrap; }
.remind__word[data-word="on"] { position: absolute; left: 0; top: 0; }

.cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  z-index: 10;
  fill: var(--inchiostro);
  stroke: var(--bianco);
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
  pointer-events: none;
  opacity: 0;
}

@media (hover: hover) {
  .remind:hover .bell { animation: suona 0.7s ease; }
}
@keyframes suona {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(12deg); }
  45% { transform: rotate(-9deg); }
  70% { transform: rotate(4deg); }
}

@media (prefers-reduced-motion: reduce) {
  .remind:hover .bell { animation: none; }
}
