:root {
  --fondo: #ffffff;
  --testo: #16161a;
  --testo-2: #5e5c66;
  --testo-3: #a4a2ab;
  --linea: #ecebef;
  --pillola: #16161a;        /* the ink pill */
  --pillola-su: #26262c;
  --fessura: #0b0b0e;        /* the slot the paper comes out of */
  --carta: #fdfcfa;          /* the paper */
  --inchiostro: #c9c7cf;     /* the printed lines */
  --accento: #e0562f;        /* the single accent: vermilion, on the letterhead and the tick */
  --ombra: 22, 22, 30;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { font-size: clamp(12px, min(4.2vw, 3.1vh), 18px); }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stage { min-height: 100vh; display: grid; place-items: center; padding: 1em; }

/* one column, everything centred on the same axis */
.rig { display: flex; flex-direction: column; align-items: center; }

.file { display: flex; flex-direction: column; align-items: center; gap: .15em; margin-bottom: 1.1em; white-space: nowrap; }
.file__name { font-size: .82em; font-weight: 600; letter-spacing: -.01em; }
.file__meta { font-size: .7em; color: var(--testo-3); }

/* the pill */
.pill {
  position: relative; z-index: 3;
  height: 2.8em; padding: 0 1.1em;
  border-radius: 999px;
  background: var(--pillola); color: #fff;
  box-shadow: 0 10px 22px -12px rgba(var(--ombra), .7), inset 0 1px 0 rgba(255,255,255,.14);
  outline: none;
}
.pill:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--pillola); }
.pill::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,0) 55%);
}
.pill__face { position: relative; display: flex; align-items: center; gap: .5em; height: 100%; }

/* the icon cell: printer and tick sit in the same square, out of the flow, so neither moves the other */
.icon { position: relative; width: 1.3em; height: 1.3em; flex: none; }
.printer, .done { position: absolute; inset: 0; width: 100%; height: 100%; }
.printer { overflow: visible; }
.printer path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.printer .printer__led { stroke: var(--accento); stroke-width: 2.2; }
.done { display: grid; place-items: center; border-radius: 50%; background: var(--accento); opacity: 0; transform: scale(.4); }
.done svg { width: 72%; height: 72%; }
.done__tick { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }

/* the words: stacked in one box whose width follows the visible word with a spring */
.pill__words { position: relative; display: block; height: 1.3em; clip-path: inset(0 -3em); font-size: .92em; font-weight: 580; letter-spacing: -.005em; }
.word { position: absolute; left: 0; top: 0; line-height: 1.3em; white-space: nowrap; }

/* the slot under the pill and the paper that comes out of it */
.feeder { position: relative; display: flex; flex-direction: column; align-items: center; margin-top: .45em; }
.slot {
  position: relative; z-index: 2;
  width: 7.4em; height: .34em; border-radius: 1em;
  background: var(--fessura);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.08), 0 1px 0 rgba(255,255,255,.9);
}
.out {
  position: relative; z-index: 1;
  width: 6.2em; height: 10.6em; margin-top: -.17em;
  /* only the part above the slot is hidden: the paper is born at the slot */
  clip-path: inset(0 -4em -4em -4em);
}
.sheet {
  position: absolute; left: 0; top: 0; width: 100%; height: 8.6em;
  border-radius: .18em;
  background: linear-gradient(170deg, #ffffff 0%, var(--carta) 55%, #f4f2ee 100%);
  box-shadow: 0 0 0 1px rgba(var(--ombra), .07), 0 2px 4px -2px rgba(var(--ombra), .18);
  padding: .7em .65em;
  overflow: hidden;
}
/* a faint sheen moving across the paper */
.sheet::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,0) 35%, rgba(255,255,255,.75) 48%, rgba(255,255,255,0) 60%);
  opacity: .5;
}
.ln { position: absolute; left: .65em; height: .22em; border-radius: .2em; background: var(--inchiostro); transform-origin: 0 50%; }
.ln.head { height: .32em; background: var(--accento); }
.ln.title { height: .36em; background: #8d8a95; }

/* the status line under the paper */
.status { position: relative; width: 16em; height: 1.3em; overflow: hidden; margin-top: .3em; font-size: .74em; color: var(--testo-3); text-align: center; }
.status__row { position: absolute; left: 0; right: 0; top: 0; line-height: 1.3em; white-space: nowrap; }
.sep { color: var(--testo-3); }
.num { display: inline-flex; color: var(--testo); font-weight: 600; font-variant-numeric: tabular-nums; vertical-align: top; }
.num i { position: relative; display: inline-block; font-style: normal; overflow: hidden; height: 1.3em; }
.num i b { display: block; font-weight: inherit; }

@media (hover: hover) {
  .pill:hover { background: var(--pillola-su); }
}
