:root {
  --fondo: #ffffff;              /* the page */
  --inchiostro: #191a1f;         /* the type */
  --grigio: #7a7c86;             /* quiet text */
  --filo: rgba(25, 26, 31, .09); /* hairlines */
  --accento: #3446c8;            /* the one accent: the band, the knob, the verdict */
  --accento-velo: rgba(52, 70, 200, .08); /* the band */
  --sans: "Instrument Sans Variable", system-ui, sans-serif;
  --serif: "Fraunces Variable", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--fondo); color: var(--inchiostro); font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

.stage { height: 100vh; height: 100dvh; display: grid; place-items: center; padding: 12px; }

.guide {
  width: min(520px, calc(100vw - 24px));
  padding: clamp(14px, 3.4vh, 24px) clamp(14px, 4vw, 26px) clamp(12px, 3vh, 22px);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(25, 26, 31, .07), 0 30px 60px -30px rgba(25, 26, 31, .28), 0 8px 18px -12px rgba(25, 26, 31, .14);
}

.guide__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.guide__title { font-family: var(--serif); font-weight: 470; font-size: clamp(19px, 4.2vh, 24px); letter-spacing: -.015em; line-height: 1.1; font-variation-settings: "opsz" 48; }
.guide__sub { margin-top: 3px; font-size: 12.5px; color: var(--grigio); }

/* the unit switch: a thumb that slides on a spring */
.unit { position: relative; flex: none; display: flex; padding: 3px; border-radius: 999px; background: #f2f2f5; box-shadow: 0 0 0 1px rgba(25, 26, 31, .05) inset; }
.unit__thumb { position: absolute; top: 3px; left: 3px; height: calc(100% - 6px); width: 44px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(25, 26, 31, .14), 0 3px 8px -3px rgba(25, 26, 31, .18); }
.unit__opt { position: relative; width: 44px; height: 30px; border-radius: 999px; font-size: 13px; font-weight: 560; color: var(--grigio); transition: color .25s; }
.unit__opt.is-on { color: var(--inchiostro); }
.unit__opt:focus-visible { outline: 2px solid var(--accento); outline-offset: 1px; }

/* the table */
.table { margin-top: clamp(10px, 2.6vh, 18px); font-variant-numeric: tabular-nums; }
.row { position: relative; display: grid; grid-template-columns: 1fr 1.25fr 1.25fr 1.25fr; align-items: center; height: clamp(28px, 6.6vh, 42px); padding: 0 12px; font-size: clamp(13px, 2.2vw + 6px, 15px); }
.row--head { height: clamp(24px, 5vh, 32px); font-size: 11.5px; font-weight: 560; letter-spacing: .03em; text-transform: uppercase; color: var(--grigio); border-bottom: 1px solid var(--filo); }
.row span:not(:first-child), .row .cell:not(:first-child) { text-align: right; }
.rows { position: relative; }
.rows .row { border-bottom: 1px solid var(--filo); }
.rows .row:last-child { border-bottom: 0; }
.cell { display: block; overflow: hidden; height: 1.3em; line-height: 1.3em; }
.cell__in { display: block; }
.size { font-weight: 560; letter-spacing: .01em; transition: color .3s; }
.row.is-on .size { color: var(--accento); }
.row .cell { transition: color .3s; }
.row.is-dim .cell { color: rgba(25, 26, 31, .42); }

.band { position: absolute; left: 0; right: 0; top: 0; height: 40px; border-radius: 10px; background: var(--accento-velo); box-shadow: 0 0 0 1px rgba(52, 70, 200, .16) inset; pointer-events: none; }
.band__edge { position: absolute; left: 0; top: 8px; bottom: 8px; width: 2.5px; border-radius: 2px; background: var(--accento); }

/* the chest slider */
.fit { margin-top: clamp(10px, 2.8vh, 20px); }
.fit__top { display: flex; align-items: baseline; justify-content: space-between; }
.fit__label { font-size: 13px; font-weight: 560; }
.fit__value { display: inline-flex; align-items: baseline; gap: 3px; font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; }
.fit__unit { font-size: 12px; font-weight: 500; color: var(--grigio); }
.roll { display: inline-block; overflow: hidden; height: 1.25em; line-height: 1.25em; vertical-align: bottom; }
.roll > span { display: block; }

.slider { position: relative; height: 34px; margin-top: 2px; }
.slider__track { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: #ececf1; }
.slider__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; background: var(--accento); }
.slider__ticks { position: absolute; inset: -5px 0; }
.slider__ticks i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(25, 26, 31, .16); }
.slider__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: grab; margin: 0; }
.slider__input:active { cursor: grabbing; }
.slider__knob { position: absolute; top: 50%; left: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(25, 26, 31, .12), 0 2px 6px rgba(25, 26, 31, .18), 0 0 0 0 rgba(52, 70, 200, .18); pointer-events: none; }
.slider__knob::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--accento); }
.slider.is-focus .slider__knob { box-shadow: 0 0 0 1px rgba(25, 26, 31, .12), 0 2px 6px rgba(25, 26, 31, .18), 0 0 0 5px rgba(52, 70, 200, .18); }

.verdict { margin-top: 4px; min-height: 1.4em; font-size: 13.5px; color: var(--grigio); }
.verdict b { color: var(--accento); font-weight: 600; }
.verdict__in { display: inline-block; }

@media (max-width: 420px) {
  .row { padding: 0 8px; }
  .guide__sub { font-size: 11.5px; }
}
