:root {
  --fondo: #fafafa;
  --inchiostro: #111113;
  --grigio: #6d6c72;
  --grigio-chiaro: #a4a3a9;
  --linea: #d9d9df;
  --bordo: rgba(17, 17, 19, 0.08);
  --tinta: #4f46e5;
  --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;
}

.sec {
  width: min(100%, 640px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.6vh, 12px);
  text-align: center;
}

.eyebrow {
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0.02em;
  color: var(--tinta);
  background: rgba(79, 70, 229, 0.08);
  border-radius: 999px;
  padding: 4px 10px;
}

.title {
  font-size: clamp(20px, min(4.4vw, 5.4vh), 32px);
  font-weight: 640;
  letter-spacing: -0.025em;
  line-height: 1.1;
  max-width: 18ch;
}

/* the map: the hub in the middle, three apps on each side, sized on width and height */
.map {
  --app: clamp(38px, min(9vw, 11vh), 56px);
  --hub: clamp(64px, min(15vw, 18vh), 96px);
  position: relative;
  width: min(100%, 600px);
  height: clamp(170px, 46vh, 300px);
  margin-top: clamp(4px, 1.4vh, 12px);
}

.wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.wire { fill: none; stroke: var(--linea); stroke-width: 1.25; stroke-linecap: round; }
.pulse { fill: none; stroke: var(--tinta); stroke-width: 1.75; stroke-linecap: round; }

.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--hub);
  height: var(--hub);
  margin: calc(var(--hub) / -2) 0 0 calc(var(--hub) / -2);
  border-radius: 24%;
  background: var(--inchiostro);
  color: var(--bianco);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 12px 32px -10px rgba(17, 17, 19, 0.45), 0 2px 6px rgba(17, 17, 19, 0.12);
  z-index: 2;
}
.hub__mark { width: calc(var(--hub) * 0.34); height: calc(var(--hub) * 0.34); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hub__name { font-size: clamp(9px, calc(var(--hub) * 0.14), 13px); font-weight: 600; letter-spacing: 0.01em; opacity: 0.8; }
/* a thin ring that opens out when a piece of data arrives */
.hub__ring {
  position: absolute;
  inset: -1px;
  border-radius: 24%;
  border: 1px solid var(--tinta);
  opacity: 0;
  pointer-events: none;
}

.app {
  position: absolute;
  width: var(--app);
  height: var(--app);
  margin: calc(var(--app) / -2) 0 0 calc(var(--app) / -2);
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  z-index: 2;
  font: inherit;
  color: var(--inchiostro);
  -webkit-tap-highlight-color: transparent;
}
.app__face {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 28%;
  background: var(--bianco);
  border: 1px solid var(--bordo);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.05), 0 6px 16px -10px rgba(17, 17, 19, 0.25);
}
.app__face svg { width: 50%; height: 50%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.app:focus-visible { outline: none; }
.app:focus-visible .app__face { box-shadow: 0 0 0 2px var(--fondo), 0 0 0 4px var(--tinta); }

.tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--bianco);
  border: 1px solid var(--bordo);
  box-shadow: 0 10px 24px -12px rgba(17, 17, 19, 0.3);
  font-size: 11.5px;
  line-height: 1.25;
  white-space: nowrap;
  text-align: left;
  opacity: 0;
  pointer-events: none;
}
.tip b { font-weight: 620; }
.tip span { color: var(--grigio); }

.count {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: var(--grigio);
  margin-top: clamp(2px, 1vh, 8px);
}
.count__num {
  display: inline-flex;
  color: var(--inchiostro);
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}
/* each digit is a column of 0-9 that rolls */
.dig { display: inline-block; height: 1.25em; line-height: 1.25em; overflow: hidden; }
.dig__col { display: block; }
.dig__col i { display: block; font-style: normal; }
.sep { display: inline-block; }

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

@media (max-width: 420px) {
  .map { height: clamp(160px, 44vh, 240px); }
  .tip { font-size: 10.5px; padding: 6px 8px; }
}
