:root {
  --fondo: #ffffff;
  --pillola: #17171a;
  --pillola-alta: #2a2a2f;
  --testo: #f4f3f1;
  --grigio: #8d8c93;
  --grigio-chiaro: #a9a8af;
  --accento: #ff6a3d;
  --card: #ffffff;
  --card-testo: #18181b;
  --card-grigio: #8a8990;
}

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

html, body { height: 100%; }

body {
  background: var(--fondo);
  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: 14px;
  overflow: hidden;
}

.ex {
  display: grid;
  justify-items: center;
  width: min(340px, 100%);
}

/* the place above the pill where the exported file lands */
.ex__slot {
  position: relative;
  width: min(268px, 100%);
  height: 64px;
  margin-bottom: min(16px, 3vh);
}

.ex__shadow {
  position: absolute;
  left: 12%; right: 12%; bottom: -6px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(20, 16, 12, 0.22), rgba(20, 16, 12, 0));
  opacity: 0;
  pointer-events: none;
}

.file {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px 8px 8px;
  background: linear-gradient(180deg, #ffffff, #fbfaf8);
  border-radius: 16px;
  border: 1px solid rgba(18, 16, 14, 0.07);
  box-shadow:
    0 1px 1px rgba(18, 16, 14, 0.04),
    0 4px 10px -2px rgba(18, 16, 14, 0.08),
    0 18px 34px -14px rgba(18, 16, 14, 0.24),
    inset 0 1px 0 #fff;
  opacity: 0;
  overflow: hidden;
  will-change: transform;
}

.file__thumb {
  position: relative;
  flex: none;
  width: 66px;
  height: 46px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.file__frame { flex: 1; }
.file__frame:nth-child(1) { background: linear-gradient(160deg, #f3b37a, #c45b3c 70%, #5a2c2a); }
.file__frame:nth-child(2) { background: linear-gradient(160deg, #9fd0cf, #3d7f86 65%, #1c3a45); }
.file__frame:nth-child(3) { background: linear-gradient(160deg, #e9d3a8, #8f7a5c 60%, #2f2a2a); }

.file__thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 40%, rgba(0, 0, 0, 0.28));
}

.file__play {
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  padding: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  fill: #18181b;
  z-index: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.file__time {
  position: absolute;
  right: 4px; bottom: 3px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.file__text { display: grid; gap: 3px; min-width: 0; flex: 1; }

.file__name {
  font-size: 14px;
  font-weight: 620;
  font-stretch: 96%;
  color: var(--card-testo);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file__meta {
  font-size: 11.5px;
  color: var(--card-grigio);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.file__open {
  flex: none;
  width: 16px; height: 16px;
  fill: none; stroke: #b5b4ba; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

.file__shine {
  position: absolute;
  top: -20%; bottom: -20%;
  left: 0;
  width: 46px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0));
  transform: translateX(-80px) skewX(-18deg);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

/* ---- the pill ---- */
.pill {
  position: relative;
  height: 60px;
  width: 212px;
  border: 0;
  padding: 0;
  border-radius: 30px;
  background: transparent;
  color: var(--testo);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  isolation: isolate;
  box-shadow:
    0 1px 2px rgba(10, 10, 12, 0.18),
    0 8px 18px -8px rgba(10, 10, 12, 0.35),
    0 22px 40px -22px rgba(10, 10, 12, 0.5);
}

.pill:focus-visible { outline: 2px solid var(--accento); outline-offset: 4px; }

.pill__body, .pill__grain, .pill__sheen, .pill__rim {
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.pill__body {
  background: linear-gradient(180deg, var(--pillola-alta), var(--pillola) 55%, #101012);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.pill__grain {
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.pill__sheen {
  --mx: 50%;
  --my: 0%;
  background: radial-gradient(120px 60px at var(--mx) var(--my), rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0));
  opacity: 0;
}

/* a one-pixel rim that takes the light on top */
.pill__rim {
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.03) 45%, rgba(255, 255, 255, 0.07));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.pill__layer {
  position: absolute; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.pill__word {
  font-size: 16px;
  font-weight: 600;
  font-stretch: 100%;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.pill__chip {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: var(--grigio-chiaro);
  padding: 4px 7px 3px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.ic {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  overflow: visible;
}

.ic--ok { stroke: var(--accento); stroke-width: 2.2; }

.pill__busy, .pill__done { opacity: 0; }

/* the strip of frames that runs into the file */
.strip {
  position: absolute;
  left: 16px; top: 50%;
  height: 30px;
  margin-top: -15px;
  right: 84px;
  overflow: hidden;
  -webkit-mask: linear-gradient(90deg, transparent, #000 22px, #000 calc(100% - 10px), transparent);
  mask: linear-gradient(90deg, transparent, #000 22px, #000 calc(100% - 10px), transparent);
}

.strip__band {
  position: absolute;
  left: -40px; right: -40px; top: 0; bottom: 0;
  background-color: #0c0c0e;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 3px, transparent 3px 7px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 3px, transparent 3px 7px);
  background-size: 100% 2px, 100% 2px;
  background-position: 0 3px, 0 calc(100% - 3px);
  background-repeat: no-repeat;
  border-radius: 4px;
}

.strip__frames { position: absolute; inset: 0; }

.frame {
  position: absolute;
  left: 0; top: 50%;
  width: 26px; height: 17px;
  margin-top: -8.5px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 6px 6px -4px rgba(255, 255, 255, 0.25);
  transform-origin: 100% 50%;
  will-change: transform;
}

.doc {
  position: absolute;
  right: 60px; top: 50%;
  width: 20px; height: 24px;
  margin-top: -12px;
}

.doc svg { width: 100%; height: 100%; overflow: visible; }
.doc__fill { fill: var(--accento); }
.doc__line, .doc__fold { fill: none; stroke: #e9e8e4; stroke-width: 1.4; stroke-linejoin: round; }
.doc__fold { stroke-width: 1.2; opacity: 0.8; }

.pill__pct {
  position: absolute;
  right: 18px; top: 50%;
  width: 38px;
  margin-top: -9px;
  line-height: 18px;
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--testo);
}

.pill__bar {
  position: absolute;
  left: 26px; right: 26px; bottom: 7px;
  height: 1.5px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.07);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.pill__bar-in {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(255, 106, 61, 0.4), var(--accento));
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ex__hint {
  margin-top: min(14px, 2.6vh);
  height: 18px;
  font-size: 12.5px;
  color: var(--grigio);
  font-variant-numeric: tabular-nums;
}

.roll { display: inline-block; overflow: hidden; height: 18px; line-height: 18px; vertical-align: top; }
.roll__in { display: inline-block; white-space: nowrap; }

.pointer {
  position: absolute; left: 0; top: 0;
  width: 20px; height: 20px;
  fill: #111; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}

@media (max-height: 300px) {
  .ex__hint { display: none; }
}
