:root {
  --fondo: #ffffff;
  --inchiostro: #121317;
  --grigio: #7c7e86;
  --tenue: #b4b6bc;
  --linea: rgba(18, 19, 23, 0.08);
  --barra: #1b1c21;
  --accento: #f2610c;
  --accento-tenue: color-mix(in srgb, var(--accento) 42%, #ffffff);
}

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

html, body { height: 100%; }

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

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

.uptime {
  position: relative;
  width: min(90vw, 440px);
  border: 1px solid var(--linea);
  border-radius: 18px;
  padding: clamp(14px, 3.4vh, 22px) clamp(16px, 4.4vw, 24px) clamp(12px, 3vh, 18px);
  box-shadow: 0 1px 2px rgba(18, 19, 23, 0.04), 0 12px 32px -18px rgba(18, 19, 23, 0.18);
}

.head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.name {
  font-size: clamp(14px, 3.8vw, 15px);
  font-weight: 580;
  font-stretch: 104%;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.sub, .when, .note, .axis {
  font-size: clamp(11px, 3vw, 12px);
  color: var(--grigio);
  font-weight: 440;
  white-space: nowrap;
}

.sub { margin-top: 3px; }

.head__read { text-align: right; }

.when { margin-top: 3px; justify-content: end; }

/* a cell where the old line and the new one sit on top of each other while they swap */
.swap {
  display: grid;
  justify-items: start;
}
.when.swap { justify-items: end; }
.swap > span { grid-area: 1 / 1; display: block; }

/* the percentage: every digit is a column 0-9 that rolls into place */
.pct {
  display: inline-flex;
  align-items: baseline;
  font-size: clamp(22px, 6.2vw, 26px);
  font-weight: 620;
  font-stretch: 92%;
  letter-spacing: -0.02em;
  line-height: 1;
}
.roll {
  display: inline-block;
  height: 1em;
  overflow: hidden;
  position: relative;
}
.roll__col { display: flex; flex-direction: column; width: max-content; }
.roll__col span { display: block; height: 1em; line-height: 1; text-align: center; }
.roll--lead { width: 0; }
.pct__sep { display: inline-block; }
.pct__unit { font-size: 0.62em; font-weight: 520; color: var(--grigio); margin-left: 2px; }

.bars {
  position: relative;
  margin-top: clamp(12px, 3.2vh, 18px);
  outline: none;
  touch-action: pan-y;
  cursor: default;
  border-radius: 6px;
}
.bars:focus-visible { box-shadow: 0 0 0 2px var(--fondo), 0 0 0 4px var(--accento); }

.bars__row {
  display: flex;
  align-items: flex-end;
  gap: clamp(1.5px, 0.5vw, 2.5px);
  height: clamp(30px, 8vh, 40px);
  padding-top: 8px;
  box-sizing: content-box;
}

.bar {
  flex: 1 1 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
/* the visible bar: GSAP scales it from the bottom, the span above is only the hit area */
.bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 1.5px;
  background: var(--barra);
  transform-origin: 50% 100%;
}
.bar.is-down i { background: var(--accento); }
.bar.is-slow i { background: var(--accento-tenue); }

.bars__base {
  position: relative;
  height: 1px;
  margin-top: 6px;
  background: var(--linea);
}
.tick {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 5px;
  background: var(--inchiostro);
  opacity: 0;
}

.foot { margin-top: 8px; }

.note {
  color: var(--inchiostro);
  font-weight: 500;
  min-height: 1.3em;
}
.note .is-accent { color: var(--accento); }

.axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--tenue);
}

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