:root {
  --fondo: #fafafa;
  --card: #ffffff;
  --binario: #f0f0f2;
  --bordo: rgba(10, 10, 20, 0.07);
  --testo: #0b0b0f;
  --testo-2: #71717a;
  --testo-3: #a1a1aa;
  --accento: #4f46e5;
  --accento-tenue: rgba(79, 70, 229, 0.1);
  --barra: #e4e4e9;
}

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

html, body { height: 100%; }

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

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(12px, 4vmin, 40px);
}

.card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: 20px;
  padding: clamp(14px, 3.6vh, 22px) clamp(14px, 4vw, 22px) clamp(12px, 3vh, 18px);
  box-shadow: 0 1px 2px rgba(10, 10, 20, 0.04), 0 18px 40px -18px rgba(10, 10, 20, 0.16);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2.6vh, 18px);
}

.card__head { display: flex; align-items: center; justify-content: space-between; }

.brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 640; font-size: 14px; letter-spacing: -0.01em; }
.brand__mark { width: 18px; height: 18px; fill: none; stroke: var(--accento); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card__site { font-size: 12px; color: var(--testo-3); font-variant-numeric: tabular-nums; }

/* the segmented control */
.seg {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--binario);
  border-radius: 12px;
  padding: 3px;
  box-shadow: inset 0 1px 1px rgba(10, 10, 20, 0.04);
  touch-action: manipulation;
}

.seg__pill, .seg__hover {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 10px;
  border-radius: 9px;
  pointer-events: none;
}

.seg__hover { background: rgba(255, 255, 255, 0.55); opacity: 0; }

.seg__pill {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(10, 10, 20, 0.08), 0 3px 10px -2px rgba(10, 10, 20, 0.12), 0 0 0 0.5px rgba(10, 10, 20, 0.05);
  overflow: hidden;
}

.seg__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 40%, rgba(10, 10, 20, 0.025));
}

.seg__opt {
  --w: 500;
  position: relative;
  z-index: 1;
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: clamp(12.5px, 3.4vw, 13.5px);
  font-variation-settings: "wght" var(--w);
  color: var(--testo-2);
  height: clamp(30px, 8vh, 34px);
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.seg__opt[aria-checked="true"] { color: var(--testo); }
@media (hover: hover) { .seg__opt:hover { color: var(--testo); } }
.seg__opt:focus { outline: none; }
.seg__opt:focus-visible { outline: 2px solid var(--accento); outline-offset: 1px; }

/* the number */
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__label { font-size: 13px; color: var(--testo-2); }
.stat__row { display: flex; align-items: center; gap: 10px; }

.stat__num {
  display: flex;
  font-size: clamp(32px, 9vh, 44px);
  font-weight: 640;
  letter-spacing: -0.03em;
  line-height: 1.16;
  font-variant-numeric: tabular-nums;
  height: 1.16em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 9%, #000 91%, transparent);
}

.slot { position: relative; display: inline-block; height: 1.16em; overflow: hidden; }
.slot__col { display: flex; flex-direction: column; }
.slot__col span { height: 1.16em; line-height: 1.16; display: block; }
.sep { display: inline-block; line-height: 1.16; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px 3px 5px;
  border-radius: 999px;
  background: var(--accento-tenue);
  color: var(--accento);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.badge__arrow { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.stat__note { font-size: 12px; color: var(--testo-3); }

/* the chart */
.chart { position: relative; height: clamp(54px, 17vh, 96px); }
.chart__grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; }
.chart__grid span { height: 1px; background: repeating-linear-gradient(90deg, var(--bordo) 0 3px, transparent 3px 6px); }
.chart__bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: clamp(3px, 1.2vw, 6px); }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar__fill {
  width: 100%;
  height: 100%;
  border-radius: 4px 4px 2px 2px;
  background: var(--barra);
  transform-origin: 50% 100%;
  transition: background-color 0.2s;
}
.bar.is-now .bar__fill { background: var(--accento); }
@media (hover: hover) { .bar:hover .bar__fill { background: #c9c9d2; } .bar.is-now:hover .bar__fill { background: var(--accento); } }
.chart__axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--testo-3); font-variant-numeric: tabular-nums; margin-top: calc(clamp(10px, 2.6vh, 18px) * -0.6); }

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