:root {
  --fondo: #f3f1ec;
  --area: #e9e6df;
  --carta: #ffffff;
  --inchiostro: #141414;
  --grigio: #7a776f;
  --filo: rgba(20, 20, 20, 0.09);
  --accento: #3355ff;
}

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

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

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

/* the builder window */
.banco {
  width: min(94vw, 780px);
  background: var(--carta);
  border: 1px solid var(--filo);
  border-radius: clamp(12px, 2vmin, 18px);
  box-shadow: 0 1px 0 rgba(20, 20, 20, 0.03), 0 24px 60px -28px rgba(20, 20, 20, 0.28);
  overflow: hidden;
}

.barra {
  display: flex;
  align-items: center;
  gap: 12px;
  height: clamp(34px, 6.4vh, 44px);
  padding: 0 clamp(10px, 2vmin, 16px);
  border-bottom: 1px solid var(--filo);
  font-size: clamp(11px, 1.9vmin, 13px);
  font-variation-settings: "wdth" 100, "wght" 480;
}
.marchio { display: inline-flex; align-items: center; gap: 7px; font-variation-settings: "wdth" 100, "wght" 640; }
.marchio svg { width: 15px; height: 15px; fill: none; stroke: var(--accento); stroke-width: 1.4; stroke-linecap: round; }
.barra__pagina { color: var(--grigio); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra__sep { opacity: 0.45; margin: 0 2px; }
.barra__px {
  font-feature-settings: "tnum" 1;
  color: var(--grigio);
  white-space: nowrap;
}
.barra__px .rullo { color: var(--inchiostro); display: inline-block; min-width: 4ch; text-align: right; }

/* the canvas the preview sits on */
.area {
  position: relative;
  height: min(52vh, 330px);
  background: var(--area);
  padding: clamp(8px, 1.8vmin, 14px);
  display: flex;
  justify-content: center;
}

.cornice {
  position: relative;
  height: 100%;
  width: 100%;
  background: var(--carta);
  border-radius: clamp(8px, 1.4vmin, 12px);
  box-shadow: 0 0 0 1px var(--filo), 0 10px 26px -18px rgba(20, 20, 20, 0.35);
  will-change: width;
}

.hero {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--pad, 24px);
}

.occhiello {
  font-size: clamp(9px, 1.6vmin, 12px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accento);
  font-variation-settings: "wdth" 100, "wght" 600;
  margin-bottom: clamp(4px, 1.2vmin, 10px);
  white-space: nowrap;
}

.titolo {
  font-weight: normal;
  font-size: 64px;
  line-height: 0.96;
  letter-spacing: -0.02em;
  --wdth: 125;
  --wght: 560;
  font-variation-settings: "wdth" var(--wdth), "wght" var(--wght);
}
.riga { display: block; white-space: nowrap; }

.misura {
  position: absolute;
  left: -9999px;
  top: 0;
  font-size: 100px;
  white-space: nowrap;
  visibility: hidden;
}

/* the fit guide: as wide as the longest line, caps at both ends */
.guida {
  position: relative;
  display: block;
  height: 1px;
  width: 0;
  margin-top: clamp(5px, 1.2vmin, 10px);
  background: var(--accento);
  opacity: 0.55;
  transform-origin: left center;
}
.guida i {
  position: absolute;
  top: -3px;
  width: 1px;
  height: 7px;
  background: var(--accento);
}
.guida i:first-child { left: 0; }
.guida i:last-child { right: 0; }

.sotto {
  margin-top: clamp(6px, 1.4vmin, 12px);
  font-size: clamp(10px, 1.8vmin, 13px);
  line-height: 1.35;
  color: var(--grigio);
  font-variation-settings: "wdth" 100, "wght" 430;
  max-width: 26em;
}

.cta {
  align-self: flex-start;
  margin-top: clamp(8px, 1.8vmin, 16px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: clamp(26px, 4.6vh, 34px);
  padding: 0 clamp(10px, 1.8vmin, 14px);
  border-radius: 999px;
  background: var(--inchiostro);
  color: #fff;
  font-size: clamp(10px, 1.7vmin, 12.5px);
  font-variation-settings: "wdth" var(--cta-wdth, 100), "wght" 560;
  white-space: nowrap;
}
.cta svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* the handle on the right edge */
.maniglia {
  position: absolute;
  top: 50%;
  right: -7px;
  width: 14px;
  height: clamp(40px, 12vh, 64px);
  margin-top: calc(clamp(40px, 12vh, 64px) / -2);
  cursor: ew-resize;
  touch-action: none;
  display: grid;
  place-items: center;
  outline: none;
}
.maniglia__presa {
  display: block;
  width: 6px;
  height: 100%;
  border-radius: 999px;
  background: var(--carta);
  box-shadow: 0 0 0 1px rgba(20, 20, 20, 0.16), 0 3px 8px -3px rgba(20, 20, 20, 0.35);
  background-image: linear-gradient(var(--grigio), var(--grigio));
  background-size: 1px 38%;
  background-repeat: no-repeat;
  background-position: center;
}
.maniglia.is-giu .maniglia__presa,
.maniglia:focus-visible .maniglia__presa {
  background-color: var(--accento);
  background-image: linear-gradient(#fff, #fff);
  box-shadow: 0 0 0 1px var(--accento), 0 4px 12px -3px rgba(51, 85, 255, 0.55);
}
@media (hover: hover) {
  .maniglia:hover .maniglia__presa { box-shadow: 0 0 0 1px rgba(20, 20, 20, 0.3), 0 4px 10px -3px rgba(20, 20, 20, 0.4); }
}

/* the footer: breakpoints and the axis readout */
.piede {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: clamp(42px, 8vh, 54px);
  padding: 0 clamp(8px, 1.8vmin, 14px);
  border-top: 1px solid var(--filo);
}

.scelte {
  position: relative;
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--fondo);
  box-shadow: inset 0 0 0 1px var(--filo);
}
.scelte__fondo {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--carta);
  box-shadow: 0 0 0 1px var(--filo), 0 2px 6px -2px rgba(20, 20, 20, 0.25);
}
.scelta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: clamp(24px, 4.6vh, 30px);
  padding: 0 clamp(7px, 1.6vmin, 12px);
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--grigio);
  font: inherit;
  font-size: clamp(10px, 1.7vmin, 12.5px);
  font-variation-settings: "wdth" 100, "wght" 520;
  cursor: pointer;
  transition: color 0.25s ease;
}
.scelta svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.scelta.is-attiva { color: var(--inchiostro); }
.scelta.is-attiva svg { stroke: var(--accento); }
.scelta:focus-visible { outline: 2px solid var(--accento); outline-offset: 1px; }
@media (hover: hover) {
  .scelta:hover { color: var(--inchiostro); }
}

.assi {
  display: flex;
  gap: clamp(8px, 1.6vmin, 14px);
  font-size: clamp(10px, 1.6vmin, 12px);
  color: var(--grigio);
  font-feature-settings: "tnum" 1;
  font-variation-settings: "wdth" 100, "wght" 450;
  white-space: nowrap;
}
.assi b { color: var(--inchiostro); font-weight: normal; font-variation-settings: "wdth" 100, "wght" 620; display: inline-block; min-width: 3ch; text-align: right; }

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

@media (max-width: 560px) {
  .barra__pagina { display: none; }
  .barra { justify-content: space-between; }
  .assi span:nth-child(2) { display: none; }
  .scelta span { display: none; }
  .scelta { padding: 0 9px; }
}
