/* The truck that drives into the yard on scroll: a dusk scene in three.js, a dark glass bar, type that writes itself. */
:root {
  --notte: #0b0d0c;        /* the page under the scene */
  --carta: #f3efe7;        /* the light lines and the closing section */
  --inchiostro: #0f1512;   /* text on light */
  --accento: #c7f03a;      /* the one accent: the caret, the scan light, the button */
  --vetro: rgba(24, 26, 24, 0.46);
  --filo: rgba(243, 239, 231, 0.16);
  --tenue: rgba(243, 239, 231, 0.62);
}

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

html { background: var(--notte); }

body {
  background: var(--notte);
  color: var(--carta);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* the bar of the home page, dark glass over the scene */
.barra {
  position: fixed;
  z-index: 5;
  top: clamp(10px, 2.4vh, 22px);
  left: 50%;
  translate: -50% 0;
  width: min(1120px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 28px);
  padding: 8px 8px 8px clamp(12px, 1.6vw, 18px);
  border-radius: 14px;
  background: var(--vetro);
  border: 1px solid var(--filo);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 10px 40px -18px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.marchio { display: flex; align-items: center; gap: 8px; font-weight: 640; font-stretch: 108%; font-size: 17px; letter-spacing: -0.01em; }
.marchio svg { width: 22px; height: 22px; fill: var(--carta); }
.voci { display: flex; gap: clamp(10px, 1.6vw, 22px); font-size: 14px; color: var(--tenue); }
.voci a { transition: color 0.25s; }
@media (hover: hover) { .voci a:hover { color: var(--carta); } }
.azioni { margin-left: auto; display: flex; gap: 6px; }
.pulsante {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s;
}
.pulsante--chiaro { background: var(--carta); color: var(--inchiostro); }
.pulsante--accento { background: var(--accento); color: var(--inchiostro); }
@media (hover: hover) { .pulsante:hover { transform: translateY(-1px) scale(1.03); } }
.pulsante:active { transform: scale(0.97); }

/* the long run of the scroll and the sticky stage inside it */
.corsa { position: relative; height: 1400vh; }
.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  background: #1a1410;
}
.scena { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.velo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 110%, rgba(8, 9, 8, 0.55), transparent 60%),
    linear-gradient(to bottom, rgba(8, 9, 8, 0.25), transparent 22%);
}

/* the lines of the page: one at a time, typed over the scene with a lime caret */
.righe {
  position: absolute;
  left: 50%;
  bottom: clamp(56px, 13vh, 150px);
  translate: -50% 0;
  width: min(980px, calc(100% - 32px));
  text-align: center;
  pointer-events: none;
}
.riga {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: clamp(22px, min(4.6vw, 6.4vh), 64px);
  font-weight: 560;
  font-stretch: 104%;
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--carta);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.45);
  text-wrap: balance;
}
.riga--grande { font-size: clamp(26px, min(5.8vw, 8vh), 84px); font-weight: 600; }
.riga .l { opacity: 0; }
.riga .l.su { opacity: 1; }
.riga .l.ultima { color: var(--accento); }

/* the card the gate camera writes when the truck goes under it */
.scheda-scan {
  position: absolute;
  top: clamp(70px, 15vh, 140px);
  right: clamp(12px, 4vw, 64px);
  width: clamp(170px, 22vw, 250px);
  padding: 14px 16px 12px;
  border-radius: 14px;
  background: rgba(14, 16, 14, 0.62);
  border: 1px solid var(--filo);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: clamp(9px, min(1vw, 1.4vh), 11.5px);
  letter-spacing: 0.04em;
  opacity: 0;
  translate: 0 10px;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
}
.scheda-scan__titolo { color: var(--accento); text-transform: uppercase; letter-spacing: 0.16em; margin-bottom: 10px; }
.scheda-scan dl div { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid var(--filo); }
.scheda-scan dt { color: var(--tenue); }
.scheda-scan__esito { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--carta); }
.scheda-scan__esito b { color: var(--accento); font-weight: 600; }
.spunta { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--accento); }
.spunta svg { width: 11px; height: 11px; fill: none; stroke: var(--inchiostro); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* the receiving list: it fills while the pallets come out and the gantry reads the labels */
.lista {
  position: absolute;
  top: clamp(76px, 12vh, 112px);
  right: clamp(12px, 2.4vw, 32px);
  width: clamp(220px, 21vw, 272px);
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: rgba(14, 16, 14, 0.6);
  border: 1px solid var(--filo);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: clamp(9px, min(0.85vw, 1.3vh), 10.5px);
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
}
.lista__titolo { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: var(--accento); text-transform: uppercase; letter-spacing: 0.16em; }
.lista__titolo span { color: var(--tenue); letter-spacing: 0.04em; text-transform: none; }
.lista__conte { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 10px; }
.lista__conte div { display: flex; flex-direction: column; gap: 2px; }
.lista__conte b { font-family: 'Mona Sans Variable', system-ui, sans-serif; font-size: clamp(17px, min(1.8vw, 2.8vh), 24px); font-weight: 600; font-stretch: 96%; letter-spacing: -0.02em; color: var(--carta); font-variant-numeric: tabular-nums; }
.lista__conte small { font-size: 0.55em; font-weight: 500; color: var(--tenue); margin-left: 1px; }
.lista__conte div > span { color: var(--tenue); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.9em; }
.lista__barra { height: 3px; border-radius: 2px; background: var(--filo); overflow: hidden; }
.lista__barra i { display: block; height: 100%; background: var(--accento); transform-origin: left center; scale: 0 1; transition: scale 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.lista__righe { list-style: none; margin-top: 10px; }
.lista__righe li { display: grid; grid-template-columns: 1fr auto 15px; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--filo); color: var(--tenue); transition: color 0.35s; }
.lista__righe li.fatta { color: var(--carta); }
.lista__sku { opacity: 0.55; font-size: 0.92em; }
.lista__spunta { width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--filo); display: grid; place-items: center; transition: background 0.3s, border-color 0.3s; }
.lista__spunta svg { width: 9px; height: 9px; fill: none; stroke: var(--inchiostro); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset 0.35s 0.1s ease-out; }
.fatta .lista__spunta { background: var(--accento); border-color: var(--accento); animation: spunta 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.fatta .lista__spunta svg { stroke-dashoffset: 0; }
@keyframes spunta { from { scale: 0.55; } to { scale: 1; } }
.lista__ultimo { margin-top: 10px; color: var(--tenue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the three numbers at the end, on the left, away from the box */
.numeri {
  position: absolute;
  top: clamp(76px, 12vh, 112px);
  left: clamp(12px, 2.4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2vh, 18px);
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(14, 16, 14, 0.5);
  border: 1px solid var(--filo);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
}
.numeri div { display: flex; flex-direction: column; gap: 2px; }
.numeri b { font-size: clamp(22px, min(3vw, 4.6vh), 44px); font-weight: 620; font-stretch: 96%; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.numeri span { font-family: 'JetBrains Mono Variable', ui-monospace, monospace; font-size: clamp(8.5px, min(0.9vw, 1.3vh), 10.5px); letter-spacing: 0.1em; text-transform: uppercase; color: var(--tenue); }

.scorri {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 3vh, 26px);
  translate: -50% 0;
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tenue);
}

.dopo {
  min-height: 60vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 24px;
  padding: 80px 16px;
  background: var(--carta);
  color: var(--inchiostro);
  text-align: center;
}
.dopo h2 { font-size: clamp(28px, 5vw, 64px); font-weight: 560; letter-spacing: -0.03em; line-height: 1.02; max-width: 14ch; }

/* small screens: the bar keeps the mark and one button */
@media (max-width: 720px) {
  .voci, .pulsante--chiaro { display: none; }
  .pulsante { height: 32px; padding: 0 10px; font-size: 10px; }
  .scheda-scan { top: auto; bottom: 34%; right: 12px; }
}
/* small or short screens: the list keeps only its counters and bar, the numbers sit in a row in the same place */
@media (max-width: 720px), (max-height: 560px) {
  .lista { top: 62px; left: 12px; right: 12px; width: auto; padding: 8px 12px 9px; border-radius: 12px; }
  .lista__titolo, .lista__righe, .lista__ultimo { display: none; }
  .lista__conte { margin: 0 0 7px; }
  .lista__conte b { font-size: 17px; }
  .numeri { top: 62px; left: 12px; right: 12px; flex-direction: row; justify-content: space-between; padding: 8px 12px; border-radius: 12px; }
  .numeri b { font-size: 19px; }
  .numeri span { font-size: 8px; letter-spacing: 0.06em; }
}
@media (prefers-reduced-motion: reduce) {
  .fatta .lista__spunta { animation: none; }
  .lista__barra i, .lista__spunta svg { transition: none; }
}
