:root {
  --fondo: #f3f2ee;
  --carta: #ffffff;
  --inchiostro: #17171b;
  --grigio: #8b8a92;
  --grigio-chiaro: #b9b8bf;
  --linea: rgba(23, 23, 27, 0.09);
  --zona: #faf9f6;
  --accento: #3d5afe;
  --accento-tenue: #eef1ff;
  --file-w: clamp(114px, 36vw, 142px);
  --file-h: clamp(38px, 6.2vh, 46px);
}

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

html, body { height: 100%; }

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

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

.card {
  position: relative;
  width: min(430px, 100%);
  background: var(--carta);
  border-radius: 22px;
  padding: clamp(12px, 2.4vh, 18px) clamp(12px, 3.4vw, 18px) clamp(12px, 2.4vh, 16px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 0 0 1px var(--linea), 0 18px 40px -18px rgba(23, 23, 27, 0.22), 0 4px 10px -6px rgba(23, 23, 27, 0.12);
}

/* ---------- head ---------- */
.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: clamp(8px, 1.8vh, 14px);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand__mark {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 5px;
  border-radius: 9px;
  background: var(--inchiostro);
  fill: none;
  stroke: #fff;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand__txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__name { font-size: 11.5px; font-weight: 550; color: var(--grigio); }
.brand__folder { font-size: 15px; font-weight: 650; font-stretch: 105%; letter-spacing: -0.01em; white-space: nowrap; }

.count {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 10px 5px 11px;
  border-radius: 999px;
  background: var(--fondo);
  font-size: 11.5px;
  font-weight: 550;
  color: var(--grigio);
}
.count__n {
  position: relative;
  display: inline-block;
  height: 1.2em;
  overflow: hidden;
  vertical-align: bottom;
  color: var(--inchiostro);
  font-weight: 650;
}
.count__roll { display: inline-block; }

/* ---------- the drop zone ---------- */
.zone {
  position: relative;
  height: clamp(128px, 32vh, 190px);
  border-radius: 16px;
  background: var(--zona);
  transition: background-color 0.3s;
}
.zone.is-over { background: var(--accento-tenue); }

/* the dashed edge is an svg-like border made with a gradient, so the dashes can join into a line */
.zone__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1.5px dashed rgba(23, 23, 27, 0.17);
  transition: border-color 0.3s, border-style 0s 0.15s;
  pointer-events: none;
}
.zone.is-over .zone__edge { border-color: var(--accento); border-style: solid; }
.zone.is-full .zone__edge { border-color: rgba(23, 23, 27, 0.07); border-style: solid; }

/* a thin shadow line on the floor: it dips by a pixel when a file lands */
.zone__floor {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 7px;
  height: 1px;
  border-radius: 1px;
  background: rgba(23, 23, 27, 0.06);
  opacity: 0;
  transition: opacity 0.4s;
}
.zone.is-full .zone__floor { opacity: 1; }

.zone__hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 0 14px;
  pointer-events: none;
}
.zone__ico {
  width: 30px;
  height: 30px;
  margin-bottom: 4px;
  padding: 5px;
  border-radius: 10px;
  background: var(--carta);
  box-shadow: 0 0 0 1px var(--linea), 0 4px 10px -4px rgba(23, 23, 27, 0.18);
  fill: none;
  stroke: var(--inchiostro);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s;
}
.zone.is-over .zone__ico { stroke: var(--accento); }
.zone__ico .ico-ok { opacity: 0; }
.zone.is-done .zone__ico .ico-up,
.zone.is-done .zone__ico .ico-tray { opacity: 0; }
.zone.is-done .zone__ico .ico-ok { opacity: 1; }
.zone.is-done .zone__ico { stroke: var(--accento); }
.zone__t { font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em; }
.zone__s { font-size: 11.5px; color: var(--grigio); }
.zone__s u { text-decoration: none; color: var(--accento); font-weight: 550; }

/* ---------- foot ---------- */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: clamp(8px, 1.8vh, 14px);
}
.foot__info {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--grigio);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.go {
  flex: none;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
}
.go__in {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 15px 0 12px;
  border-radius: 999px;
  background: var(--inchiostro);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 6px 14px -8px rgba(23, 23, 27, 0.6);
  transition: background-color 0.25s, opacity 0.25s;
}
.go:disabled { cursor: default; }
.go:disabled .go__in { opacity: 0.28; }
.go__ico { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.go__ok { opacity: 0; }
.go.is-done .go__in { background: var(--accento); }
.go.is-done .go__up { opacity: 0; }
.go.is-done .go__ok { opacity: 1; }
.go__t { display: inline-block; }
@media (hover: hover) {
  .go:not(:disabled):hover .go__in { background: #2a2a31; }
  .go.is-done:not(:disabled):hover .go__in { background: #3350f0; }
}

/* ---------- the files ---------- */
.files {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.file {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--file-w);
  height: var(--file-h);
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  will-change: transform;
  visibility: hidden;
}
.file.is-held { cursor: grabbing; }

.file__in {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 9px 0 7px;
  border-radius: 12px;
  background: var(--carta);
  box-shadow: 0 0 0 1px rgba(23, 23, 27, 0.08), 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 6px 14px -8px rgba(23, 23, 27, 0.3), 0 2px 3px -2px rgba(23, 23, 27, 0.14);
  overflow: hidden;
  transition: box-shadow 0.25s;
}
.file.is-lift .file__in {
  box-shadow: 0 0 0 1px rgba(23, 23, 27, 0.1), 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 14px 22px -10px rgba(23, 23, 27, 0.34), 0 3px 6px -3px rgba(23, 23, 27, 0.16);
}

.file__doc {
  position: relative;
  flex: none;
  width: calc(var(--file-h) * 0.58);
  height: calc(var(--file-h) * 0.7);
}
.file__doc svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--fondo); stroke: rgba(23, 23, 27, 0.22); stroke-width: 1.1; stroke-linejoin: round; }
.file__ext {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  font-size: 7px;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.02em;
  color: var(--inchiostro);
}
.file--video .file__ext { color: var(--accento); }

.file__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.file__name { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.005em; }
.file__size { font-size: 10px; font-weight: 500; color: var(--grigio); font-variant-numeric: tabular-nums; }

/* the upload bar runs along the bottom edge of the file */
.file__bar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accento);
  transform: scaleX(0);
  transform-origin: left center;
}

.file__ok {
  position: absolute;
  right: 7px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--accento);
  opacity: 0;
}
.file__ok svg { width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- the drawn pointer ---------- */
.cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: #fff;
  stroke: var(--inchiostro);
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(23, 23, 27, 0.25));
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  transform-origin: 5px 3px;
}

/* the press of the drawn pointer (and of a real one) */
.go__in { transition: background-color 0.25s, opacity 0.25s, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.go.is-press .go__in,
.go:active .go__in { transform: scale(0.95); transition-duration: 0.25s, 0.25s, 0.08s; }
