:root {
  --carta: #ecebea;
  --inchiostro: #0c1114;
  --grigio: #6b737b;
  --pulsante: #bdc4d4;
  --notte-alto: #202020;
  --notte-basso: #060606;
  --lume: #8ff0cf;
  --morbida: cubic-bezier(.215, .61, .355, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: "Manrope Variable", "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* the night ground: a gradient that fades in over the warm paper */
.notte {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, var(--notte-alto), var(--notte-basso));
  opacity: 0;
  pointer-events: none;
}

.palco {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: clamp(12px, 3.4vh, 30px) clamp(16px, 4.5vw, 44px);
}

.testa {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.marca {
  font-weight: 600;
  font-size: clamp(14px, 2.4vh, 17px);
  letter-spacing: .02em;
  transition: color .75s var(--morbida);
}
.stato, .nota {
  font-family: "Red Hat Mono Variable", "Red Hat Mono", ui-monospace, monospace;
  font-size: clamp(10px, 1.7vh, 12px);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--grigio);
  transition: color .75s var(--morbida);
}
.stato { display: inline-flex; align-items: baseline; gap: .35em; }
.rullo {
  position: relative;
  display: inline-block;
  overflow: hidden;
  height: 1.3em;
  line-height: 1.3em;
  vertical-align: bottom;
}
.voce { display: block; }
.par { opacity: .55; }

.centro {
  display: grid;
  place-items: center;
  min-height: 0;
}
.quadrante {
  /* measured on width and height: the box on a phone is short */
  width: min(78vw, calc(62vh * 428 / 400), 460px);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 18px 26px rgba(12, 17, 20, .18)) drop-shadow(0 2px 3px rgba(12, 17, 20, .16));
}
.sq-marca { font: 600 15px "Manrope Variable", "Manrope", sans-serif; letter-spacing: 4px; fill: #e7e9eb; }
.sq-modello { font: 500 7.4px "Red Hat Mono Variable", "Red Hat Mono", monospace; letter-spacing: 2.4px; fill: #98a3ad; }
.sq-svizzera { font: 500 5.6px "Red Hat Mono Variable", "Red Hat Mono", monospace; letter-spacing: 1.8px; fill: #7f8a94; }
.sq-data { font: 600 11.5px "Red Hat Mono Variable", "Red Hat Mono", monospace; fill: #111619; }
.sq-cifra { font: 500 6.4px "Red Hat Mono Variable", "Red Hat Mono", monospace; fill: #9aa5af; }

.piede {
  display: grid;
  justify-items: center;
  gap: clamp(8px, 1.6vh, 12px);
}

.pillola {
  position: relative;
  width: 128px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--pulsante);
  color: var(--inchiostro);
  font: 500 14px "Manrope Variable", "Manrope", sans-serif;
  letter-spacing: .01em;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 1px 2px rgba(12, 17, 20, .12), 0 6px 14px -6px rgba(12, 17, 20, .25);
  transition: background-color .75s var(--morbida), color .75s var(--morbida), box-shadow .75s var(--morbida), transform .5s cubic-bezier(.34, 1.56, .64, 1);
  -webkit-tap-highlight-color: transparent;
}
.pillola:active { transform: scale(.955); transition-duration: .12s; }
.pillola:focus-visible { outline: 2px solid var(--lume); outline-offset: 3px; }
.facce { position: absolute; inset: 0; }
/* every face sits on the whole pill, so a hidden word never widens it */
.faccia {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.icona {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform .45s cubic-bezier(.34, 1.56, .64, 1);
}
.luna path { fill: currentColor; }
.sole circle { fill: currentColor; }
.sole path { stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; fill: none; }

@media (hover: hover) {
  .pillola:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 2px rgba(12, 17, 20, .12), 0 10px 20px -8px rgba(12, 17, 20, .32); }
  .pillola:hover .luna { transform: rotate(-18deg); }
  .pillola:hover .sole { transform: rotate(45deg); }
}

/* night */
.is-notte .marca { color: #e9e9e7; }
.is-notte .stato, .is-notte .nota { color: #8b949c; }
.is-notte .pillola {
  background: #1b1f22;
  color: #ecebea;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 0 1px rgba(255, 255, 255, .06), 0 8px 18px -8px rgba(0, 0, 0, .8);
}
.is-notte .quadrante { filter: drop-shadow(0 18px 26px rgba(0, 0, 0, .5)) drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); }
.quadrante { transition: filter .75s var(--morbida); }
