:root {
  --carta: #f3f1ec;          /* the warm paper of the page */
  --card: #ffffff;           /* the card */
  --bib: #fbfaf6;            /* the bib's paper */
  --inchiostro: #15171a;     /* the text */
  --testo-2: #67645e;        /* the secondary text */
  --testo-3: #a9a49b;        /* the small labels and the checkpoints still ahead */
  --linea: #e6e2d9;          /* hairlines and the empty track */
  --accento: #2b5cff;        /* the one accent: cobalt, the run so far */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stage {
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 12px;
  /* everything inside is in em: the text size follows the width and the height of the window together */
  font-size: clamp(10.5px, min(2.75vw, 2.6vh), 22px);
}

.card {
  position: relative;
  width: min(30em, 94vw);
  padding: 1.35em 1.45em 1.3em;
  background: var(--card);
  border-radius: 1.4em;
  box-shadow:
    0 0 0 1px rgba(21, 23, 26, .06),
    0 1px 2px rgba(21, 23, 26, .05),
    0 .6em 1.4em -.4em rgba(21, 23, 26, .12),
    0 2.4em 4em -1.6em rgba(21, 23, 26, .16);
}
.card__sheen {
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,0) 30%);
  pointer-events: none;
}

.head { position: relative; display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1em; }
.brand { display: inline-flex; align-items: center; gap: .45em; font-weight: 640; font-size: 1em; letter-spacing: -.01em; }
.brand__mark { width: 1.15em; height: 1.15em; color: var(--accento); }
.state { font-size: .72em; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accento); }

/* a window one line tall: the old line slides up, the new one comes in from below */
.roll { position: relative; display: inline-block; overflow: hidden; vertical-align: bottom; height: 1.25em; line-height: 1.25em; }
.roll__row { display: block; white-space: nowrap; }
.roll__row--new { position: absolute; left: 0; top: 0; }

.top { position: relative; display: grid; grid-template-columns: 9.6em 1fr; gap: 1.3em; align-items: center; }

/* the bib: a sheet of paper pinned at the four corners */
.bib {
  position: relative;
  padding: 1.55em .9em .85em;
  background: var(--bib);
  border-radius: .45em;
  box-shadow:
    0 0 0 1px rgba(21, 23, 26, .07),
    0 .15em .3em rgba(21, 23, 26, .06),
    0 .9em 1.4em -.8em rgba(21, 23, 26, .22);
  transform: rotate(-2deg);
  text-align: center;
  overflow: hidden;
}
.bib::after {
  /* a crease of light across the paper */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(255,255,255,0) 40%, rgba(255,255,255,.75) 50%, rgba(255,255,255,0) 60%);
  opacity: .3; pointer-events: none;
}
.bib__band {
  position: absolute; left: 0; right: 0; top: 0;
  height: 1.05em; line-height: 1.05em;
  background: var(--accento); color: #fff;
  font-size: .62em; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
.bib__pin {
  position: absolute; width: .42em; height: .42em; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 18%, #c9c6bf 40%, #8e8a82 100%);
  box-shadow: 0 .06em .1em rgba(0,0,0,.25);
  z-index: 2;
}
.bib__pin--a { left: .4em; top: 1.3em; } .bib__pin--b { right: .4em; top: 1.3em; }
.bib__pin--c { left: .4em; bottom: .4em; } .bib__pin--d { right: .4em; bottom: .4em; }
.bib__num { display: block; font-size: 2.6em; font-weight: 760; font-variation-settings: "wdth" 85; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.bib__name { display: block; margin-top: .3em; font-size: .78em; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.bib__wave { display: block; margin-top: .15em; font-size: .68em; color: var(--testo-2); }

.stats { display: grid; gap: .55em; }
.stat dt { font-size: .66em; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--testo-3); }
.stat dd { font-size: 1.02em; font-weight: 560; font-variant-numeric: tabular-nums; }
.stat__big { font-size: 1.9em !important; font-weight: 640 !important; letter-spacing: -.02em; line-height: 1.1; font-variation-settings: "wdth" 92; }

/* the line of checkpoints */
.line { position: relative; margin-top: 1.5em; padding-top: .2em; }
.line__track { position: relative; height: 2px; margin: 0 .5em; background: var(--linea); border-radius: 2px; }
.line__fill { position: absolute; inset: 0; background: var(--accento); border-radius: 2px; transform-origin: 0 50%; transform: scaleX(0); }

.runner { position: absolute; top: .2em; left: .5em; width: 0; height: 2px; z-index: 3; pointer-events: none; }
.runner__dot {
  position: absolute; left: -.42em; top: -.34em;
  width: .84em; height: .84em; border-radius: 50%;
  background: #fff; border: 2px solid var(--accento);
  box-shadow: 0 .1em .25em rgba(43, 92, 255, .25);
}

.ghost { position: absolute; top: .2em; left: .5em; width: 0; height: 2px; z-index: 2; pointer-events: none; }
.ghost__dot { position: absolute; left: -.28em; top: -.22em; width: .56em; height: .56em; border-radius: 50%; border: 1.5px dashed var(--testo-3); background: var(--card); }
.delta { display: block; font-size: .72em; font-weight: 500; color: var(--testo-2); margin-top: .05em; }
.cps { list-style: none; position: absolute; left: .5em; right: .5em; top: .2em; height: 0; }
.cp { position: absolute; top: 0; width: 0; }
.cp__hit {
  position: absolute; left: -1.3em; top: -1em; width: 2.6em; height: 4.6em;
  background: none; border: 0; cursor: pointer; border-radius: .5em; z-index: 4;
}
.cp__hit:focus-visible { outline: 2px solid var(--inchiostro); outline-offset: 1px; }
.cp__tick {
  position: absolute; left: -.3em; top: -.27em; width: .6em; height: .6em; border-radius: 50%;
  background: var(--card); border: 1.5px solid var(--testo-3);
}
.cp__ring { position: absolute; left: -.62em; top: -.59em; width: 1.24em; height: 1.24em; overflow: visible; pointer-events: none; }
.cp__ring circle { fill: none; stroke: var(--accento); stroke-width: 1.4; stroke-dasharray: 1; stroke-dashoffset: 1; }
.cp__k { position: absolute; top: .85em; left: 0; transform: translateX(-50%); font-size: .7em; font-weight: 600; letter-spacing: .04em; color: var(--testo-3); white-space: nowrap; }
.cp__t { position: absolute; top: 2.35em; left: 0; transform: translateX(-50%); font-size: .74em; font-variant-numeric: tabular-nums; color: var(--testo-3); white-space: nowrap; }
.cp:first-child .cp__k, .cp:first-child .cp__t { transform: none; left: -.3em; }
.cp:last-child .cp__k, .cp:last-child .cp__t { transform: translateX(-100%); left: .3em; }
.cp.is-passed .cp__k { color: var(--inchiostro); }
.cp.is-passed .cp__t { color: var(--testo-2); }
.line { height: 3.9em; }

/* the detail of a checkpoint, over the line */
.tip {
  position: absolute; bottom: calc(100% + .55em); left: 0;
  padding: .5em .7em .55em;
  background: var(--inchiostro); color: #fff;
  border-radius: .6em;
  box-shadow: 0 .6em 1.2em -.4em rgba(21, 23, 26, .35);
  white-space: nowrap; pointer-events: none;
  opacity: 0; visibility: hidden;
  z-index: 5;
}
.tip::after { content: ""; position: absolute; left: var(--freccia, 50%); bottom: -.3em; width: .6em; height: .6em; margin-left: -.3em; background: inherit; transform: rotate(45deg); border-radius: .1em; }
.tip__k { display: block; font-size: .64em; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; opacity: .6; }
.tip__v { display: block; font-size: 1.05em; font-weight: 640; font-variant-numeric: tabular-nums; }
.tip__s { display: block; font-size: .72em; opacity: .7; font-variant-numeric: tabular-nums; }

@media (max-width: 420px) {
  .top { grid-template-columns: 8.4em 1fr; gap: 1em; }
  .stat__big { font-size: 1.6em !important; }
}
