:root {
  --carta: #f2f1ed;          /* the warm paper of the page */
  --card: #ffffff;           /* the card */
  --terra: #fbfaf7;          /* the land on the map */
  --mare: #eaf1f4;           /* the sea */
  --inchiostro: #14171b;     /* the text */
  --testo-2: #66635d;        /* the secondary text */
  --testo-3: #a8a49c;        /* the small labels */
  --linea: #e7e3da;          /* hairlines, roads and the empty track */
  --fiume: #c5d9e3;          /* the river and the coast */
  --pioggia-1: #a7d0f2;      /* light rain */
  --pioggia-2: #4c97e6;      /* moderate rain */
  --pioggia-3: #1b4cb5;      /* heavy rain, the one deep accent */
  --accento: #1f5fd6;        /* the accent of the controls */
}

* { 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(9.5px, min(2.7vw, 2.2vh), 20px);
}

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

.head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 1em; }
.brand { display: inline-flex; align-items: center; gap: .4em; font-size: .78em; font-weight: 620; color: var(--testo-2); }
.brand__mark { width: 1.25em; height: 1.25em; color: var(--accento); }
.title { margin-top: .2em; font-size: 1.55em; font-weight: 720; font-stretch: 108%; letter-spacing: -.02em; line-height: 1.05; }
.head__r { text-align: right; display: grid; justify-items: end; gap: .1em; }
.when { font-size: 1.3em; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.rel { font-size: .76em; font-weight: 600; color: var(--accento); font-variant-numeric: tabular-nums; }

/* 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.3em; line-height: 1.3em; }
.roll__row { display: block; white-space: nowrap; }
.roll__row--new { position: absolute; right: 0; top: 0; }
.forecast .roll__row--new { left: 0; right: auto; }

.forecast {
  position: relative; display: flex; align-items: center; gap: .45em;
  margin: .75em 0 .8em; font-size: .86em; font-weight: 560; color: var(--testo-2);
}
.forecast__ico { width: 1.15em; height: 1.15em; color: var(--pioggia-2); flex: none; }

.map {
  position: relative;
  aspect-ratio: 1000 / 620;
  border-radius: .9em;
  overflow: hidden;
  background: var(--terra);
  box-shadow: inset 0 0 0 1px rgba(20, 23, 27, .07);
  cursor: crosshair;
  touch-action: none;
}
.map__lines, .map__rain { position: absolute; inset: 0; width: 100%; height: 100%; }
.map__lines { fill: none; }
.sea { fill: var(--mare); }
.coast { stroke: var(--fiume); stroke-width: 2; }
.river { stroke: var(--fiume); stroke-width: 3.2; stroke-linecap: round; }
.road { stroke: var(--linea); stroke-width: 2.2; stroke-linecap: round; }
.road--main { stroke-width: 3.4; }
.ring { stroke: rgba(31, 95, 214, .14); stroke-width: 1.4; stroke-dasharray: 3 7; }

.towns { position: absolute; inset: 0; pointer-events: none; }
.town {
  position: absolute; display: inline-flex; align-items: center; gap: .35em;
  transform: translate(-.3em, -50%);
  font-size: .7em; font-weight: 600; color: var(--testo-2); letter-spacing: .01em;
  text-shadow: 0 0 .3em #fff, 0 0 .3em #fff, 0 0 .15em #fff;
}
.town i { width: .5em; height: .5em; border-radius: 1px; background: var(--testo-2); flex: none; }
.town--you { color: var(--inchiostro); font-weight: 680; transform: translate(-.6em, -50%); }
.town i.you {
  position: relative; width: 1em; height: 1em; border-radius: 50%; background: none;
  border: 1px solid rgba(31, 95, 214, .35);
  display: grid; place-items: center;
}
.town i.you b { width: .55em; height: .55em; border-radius: 50%; background: var(--accento); box-shadow: 0 0 0 .14em #fff, 0 .1em .3em rgba(20,23,27,.3); }

.probe {
  position: absolute; left: 0; top: 0; width: 1.3em; height: 1.3em; margin: -.65em 0 0 -.65em;
  border-radius: 50%; border: 1.5px solid var(--inchiostro); opacity: 0; pointer-events: none;
}
.tip {
  position: absolute; left: 0; top: 0;
  padding: .45em .65em .5em; border-radius: .6em;
  background: rgba(20, 23, 27, .92); color: #fff;
  font-size: .74em; line-height: 1.25; white-space: nowrap;
  box-shadow: 0 .5em 1.2em -.4em rgba(20, 23, 27, .45);
  opacity: 0; pointer-events: none;
}
.tip__k { display: block; font-weight: 650; }
.tip__v { display: block; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }

.map__north {
  position: absolute; right: .7em; top: .6em; display: grid; justify-items: center;
  font-size: .6em; font-weight: 700; color: var(--testo-3); letter-spacing: .06em;
}
.map__north svg { width: 1.4em; height: 1.4em; }

.time { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .9em; margin-top: .95em; }
.play {
  position: relative; width: 2.5em; height: 2.5em; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--inchiostro); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 .35em .8em -.3em rgba(20, 23, 27, .45);
}
.play__i { grid-area: 1 / 1; width: 1.05em; height: 1.05em; }
.play__i--stop { opacity: 0; transform: scale(.6); }
.play:focus-visible, .bar:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }

.bar { position: relative; padding: .65em 0 0; cursor: pointer; touch-action: none; border-radius: .4em; }
.bar__track { position: relative; height: .36em; border-radius: 1em; background: var(--linea); }
.bar__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; border-radius: inherit; background: var(--accento); transform-origin: left center; }
.bar__ticks { position: absolute; inset: 0; }
.bar__ticks i { position: absolute; top: -.2em; width: 1px; height: .76em; background: rgba(20, 23, 27, .16); }
.bar__ticks i.now { width: 2px; top: -.35em; height: 1.06em; background: var(--inchiostro); margin-left: -.5px; }
.knob {
  position: absolute; left: 50%; top: calc(.65em + .18em); width: 1.25em; height: 1.25em; margin: -.625em 0 0 -.625em;
  border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 1px rgba(20, 23, 27, .12), 0 .2em .5em rgba(20, 23, 27, .22);
}
.knob::after { content: ""; position: absolute; inset: .36em; border-radius: 50%; background: var(--accento); }
.bar__labels { display: flex; justify-content: space-between; margin-top: .55em; font-size: .68em; font-weight: 600; color: var(--testo-3); }

.legend { display: flex; align-items: center; gap: 1.05em; margin-top: .85em; padding-top: .75em; border-top: 1px solid var(--linea); font-size: .7em; font-weight: 600; color: var(--testo-2); }
.legend span { display: inline-flex; align-items: center; gap: .4em; }
.legend i { width: 1.6em; height: .55em; border-radius: 1em; }
.legend .l1 { background: var(--pioggia-1); }
.legend .l2 { background: var(--pioggia-2); }
.legend .l3 { background: var(--pioggia-3); }
.legend__src { margin-left: auto; color: var(--testo-3); }

@media (hover: hover) {
  .play:hover { background: #262a30; }
}
