/* The order receipt that prints as you scroll. Colours in :root (the Playground palette). */
:root {
  --fondo: #f5f3ee;
  --carta: #ffffff;
  --inchiostro: #1d1b18;
  --tenue: #8b867d;
  --taglio: rgba(29, 27, 24, 0.22);
  --accento: #e2552d;
  --stampante: #1e1e21;
  --stampante-luce: #34343a;
  --stampante-testo: #8d8d96;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--fondo); }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.corsa { position: relative; height: 360vh; }
.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(12px, 4vh, 44px) 16px;
  overflow: hidden;
}

/* the receipt and its printer are drawn at a fixed size and scaled to fit (scale on .cornice, room on .spazio) */
.spazio { position: relative; flex: none; }
.cornice {
  position: absolute;
  left: 0;
  top: 0;
  width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: 0 0;
}

/* where the paper comes out: clipped only at the bottom, at the slot */
.uscita {
  position: relative;
  width: 280px;
  clip-path: inset(-80px -80px 0 -80px);
}
.gruppo {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 280px;
  transform-origin: 50% 100%;
  will-change: transform;
}
.ombra {
  position: absolute;
  inset: 10px 8px 0;
  border-radius: 6px;
  background: rgba(40, 30, 20, 0.22);
  filter: blur(14px);
  opacity: 0;
  transform: translateY(8px);
}
.carta {
  position: relative;
  background: var(--carta);
  padding: 22px 20px 26px;
  font-variant-numeric: tabular-nums;
  font-stretch: 88%;
  font-size: 12px;
  line-height: 19px;
  font-weight: 460;
  /* the paper texture: a very faint vertical grain */
  background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.012) 0 1px, transparent 1px 3px);
  background-size: 3px 100%;
}

.riga { display: flex; justify-content: space-between; gap: 10px; min-height: 19px; white-space: pre; }
.riga span:empty::after { content: ' '; }
.riga--centro { justify-content: center; }
.riga--marchio {
  justify-content: center;
  font-size: 20px;
  line-height: 30px;
  font-weight: 760;
  font-stretch: 125%;
  letter-spacing: 0.06em;
}
.riga--extra { padding-left: 12px; }
.riga--totale { font-size: 17px; line-height: 30px; font-weight: 700; font-stretch: 100%; }
.riga--totale .prezzo { display: inline-block; transform-origin: 100% 60%; }
.riga--piccola { font-size: 11px; }
.prezzo { text-align: right; }
.tenue { color: var(--tenue); }

/* the dashed rules, drawn while they come out */
.taglio {
  height: 14px;
  background: linear-gradient(90deg, var(--taglio) 0 5px, transparent 5px 9px) left 50% / 9px 1px repeat-x;
  transform-origin: 0 50%;
}

.codice { padding-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.codice svg { width: 200px; height: 34px; display: block; }
.codice svg rect { fill: var(--inchiostro); }
.codice span { font-size: 10px; line-height: 14px; letter-spacing: 0.18em; color: var(--tenue); }

/* the curl: a faint shade along the free edge */
.arriccio { position: absolute; left: 0; right: 0; height: 30px; pointer-events: none; opacity: 0; }
.arriccio--su { top: 0; background: linear-gradient(180deg, rgba(60, 45, 30, 0.07), rgba(255, 255, 255, 0.5) 30%, transparent); }
.arriccio--giu { bottom: 0; background: linear-gradient(0deg, rgba(60, 45, 30, 0.08), rgba(255, 255, 255, 0.4) 30%, transparent); }

/* the stamp */
.timbro {
  position: absolute;
  left: 104px;
  top: 300px;
  padding: 4px 10px 3px;
  border: 2px solid var(--accento);
  border-radius: 6px;
  color: var(--accento);
  font-size: 18px;
  font-weight: 760;
  font-stretch: 120%;
  letter-spacing: 0.12em;
  opacity: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* the printer: a slim slab with the slot on top */
.stampante { position: relative; width: 340px; height: 54px; margin-top: -1px; }
.stampante__bocca {
  position: absolute;
  inset: 0 0 auto 0;
  height: 16px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, var(--stampante-luce), var(--stampante));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.stampante__bocca::before {
  /* the slot */
  content: '';
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 3px;
  border-radius: 0 0 2px 2px;
  background: #0b0b0c;
}
.stampante__denti { position: absolute; left: 20px; width: 300px; top: 3px; height: 6px; }
.stampante__denti path { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 1; }
.stampante__fronte {
  position: absolute;
  inset: 14px 0 0 0;
  border-radius: 4px 4px 14px 14px;
  background: linear-gradient(180deg, #26262a, #19191c);
  box-shadow: 0 18px 30px -16px rgba(20, 15, 10, 0.45), 0 2px 3px rgba(20, 15, 10, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--stampante-testo);
}
.stampante__nome { font-weight: 700; font-stretch: 120%; }
.stampante__stato { display: inline-block; font-stretch: 90%; letter-spacing: 0.08em; min-width: 60px; text-align: right; }

