/* The order status card of Pell & Co, a made-up lighting shop: one small card alone on white, a single green accent. */
:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --bordo: #ebeae6;
  --tinta: #f4f2ee;          /* the thumbnail and the empty track */
  --testo: #15140f;
  --testo-2: #5c5952;
  --testo-3: #9c978d;
  --accento: #157a52;        /* the single accent: the done stages, the bar, the van stripe, Delivered */
  --accento-chiaro: #e7f3ec; /* a pale wash of the accent behind the current stage */
  --ombra: 26, 24, 18;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { font-size: clamp(9px, min(4.2vw, 3.1vh), 19px); }
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; }
.mono { font-family: "JetBrains Mono Variable", ui-monospace, monospace; font-size: .95em; letter-spacing: -.01em; }

.stage { height: 100vh; display: grid; place-items: center; padding: 2vh 4vw; }

/* the card */
.card {
  position: relative;
  width: min(19.5em, 92vw);
  padding: 1.15em 1.15em 1.05em;
  border-radius: 1.4em;
  background: var(--carta);
  box-shadow:
    0 1px 1px rgba(var(--ombra), .05),
    0 6px 14px -6px rgba(var(--ombra), .10),
    0 26px 50px -26px rgba(var(--ombra), .26);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1em;
  isolation: isolate;
  cursor: pointer;
}
.card__edge {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  padding: 1px;
  background: linear-gradient(180deg, #f1f0ec, var(--bordo) 30%, #e2e0da);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* the order */
.head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .8em; align-items: center; }
.thumb {
  width: 3.3em; height: 3.3em; border-radius: .95em; display: grid; place-items: center;
  background: var(--tinta);
  box-shadow: inset 0 0 0 1px rgba(var(--ombra), .04);
}
.thumb svg { width: 2.6em; height: 2.6em; display: block; overflow: visible; }
.lamp__base { fill: #d8cdbb; stroke: #a89a83; stroke-width: .7; }
.lamp__arm { fill: none; stroke: #8d8270; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.lamp__joint { fill: #f4f2ee; stroke: #8d8270; stroke-width: .8; }
.lamp__shade { fill: #e9e1d2; stroke: #a89a83; stroke-width: .7; stroke-linejoin: round; }
.lamp__glow { stroke: #e3c88c; stroke-width: 1.4; stroke-linecap: round; opacity: .8; }
.head__txt { display: grid; gap: .14em; min-width: 0; }
.order { font-size: .66em; color: var(--testo-3); font-weight: 600; letter-spacing: .02em; }
.name { font-size: 1em; font-weight: 650; letter-spacing: -.015em; line-height: 1.15; }
.when { font-size: .7em; color: var(--testo-2); }

/* a line of text that rolls: the old words go up, the new ones come from below */
.roller { position: relative; display: block; overflow: hidden; height: 1.3em; line-height: 1.3em; }
.roller > span { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; }

/* the big status */
.status { display: grid; gap: .2em; }
.status__big { font-size: 1.5em; font-weight: 700; letter-spacing: -.025em; font-stretch: 92%; }
.status__big .roller { height: 1.2em; line-height: 1.2em; }
.status__eta { font-size: .8em; color: var(--testo-2); font-variation-settings: "wdth" 100; }
.status__eta b { color: var(--testo); font-weight: 650; }
.status--done .status__big { color: var(--accento); }

/* the four stages: four equal columns, the track runs from the first centre to the last */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-top: 1.55em; /* room for the van over the track */
}
.track {
  position: absolute;
  left: 12.5%; right: 12.5%;
  top: calc(1.55em + .9em); /* the centre of the nodes */
  height: 0;
}
.track__line, .track__fill {
  position: absolute; left: 0; right: 0; top: -.11em; height: .22em; border-radius: .2em;
}
.track__line { background: var(--tinta); box-shadow: inset 0 0 0 1px rgba(var(--ombra), .04); }
.track__fill { background: var(--accento); transform-origin: 0 50%; transform: scaleX(0); }

.van { position: absolute; left: 0; top: -2.35em; width: 0; height: 0; z-index: 2; }
.van__body { position: absolute; left: -.95em; top: -.12em; width: 1.9em; height: 1.22em; display: block; }
.van__body svg { width: 100%; height: 100%; display: block; overflow: visible; }
.van__shell { fill: #ffffff; stroke: var(--testo); stroke-width: 1.1; stroke-linejoin: round; }
.van__cab { fill: #ffffff; stroke: var(--testo); stroke-width: 1.1; stroke-linejoin: round; }
.van__win { fill: #dfe9e4; }
.van__stripe { stroke: var(--accento); stroke-width: 1.6; stroke-linecap: round; }
.van__wheel { fill: var(--testo); stroke: #ffffff; stroke-width: .8; }
.van__shadow {
  position: absolute; left: -.7em; top: 1.18em; width: 1.4em; height: .22em; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--ombra), .22), rgba(var(--ombra), 0));
}

.step { position: relative; z-index: 1; display: grid; justify-items: center; gap: .45em; min-width: 0; }
.node {
  position: relative;
  width: 1.8em; height: 1.8em; border-radius: 50%;
  display: grid; place-items: center;
  background: #ffffff;
  box-shadow: inset 0 0 0 1.5px #dcd9d2;
  color: var(--testo-3);
}
.node::before { /* the soft halo of the current stage, still (no pulsing) */
  content: ""; position: absolute; inset: -.32em; border-radius: 50%;
  background: var(--accento-chiaro); opacity: 0; z-index: -1;
}
.ico { position: absolute; left: 50%; top: 50%; width: .95em; height: .95em; margin: -.475em 0 0 -.475em; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.ico--tick { stroke-width: 1.8; opacity: 0; }
.ico--tick path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.step__lab {
  font-size: .6em; font-weight: 600; color: var(--testo-3); text-align: center; line-height: 1.2;
  max-width: 100%; padding: 0 .2em;
}
.step.is-done .node { background: var(--accento); box-shadow: none; color: #ffffff; }
.step.is-done .step__lab { color: var(--testo-2); }
.step.is-now .node { background: #ffffff; box-shadow: inset 0 0 0 1.5px var(--accento); color: var(--accento); }
.step.is-now .node::before { opacity: 1; }
.step.is-now .step__lab { color: var(--testo); }

/* the note under the stages */
.note {
  display: flex; align-items: center; gap: .5em;
  font-size: .72em; color: var(--testo-2);
  padding: .65em .85em; border-radius: .85em; border: 1px solid var(--bordo);
  transition: background-color .5s ease, border-color .5s ease;
}
.note .roller { flex: 1; min-width: 0; }
.note__ico { position: relative; width: 1.15em; height: 1.15em; flex: none; }
.note__ico svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--testo-3); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.status--done .note { background: var(--accento-chiaro); border-color: transparent; color: var(--testo); }
.status--done .note__ico svg { stroke: var(--accento); }

/* the elastic pill of the site, quiet: outline */
.pill { position: relative; height: 2.6em; border-radius: 99em; display: grid; place-items: center; isolation: isolate; }
.pill__bg { position: absolute; inset: 0; border-radius: inherit; background: var(--testo); z-index: -1; }
.pill__face { position: absolute; inset: 0; display: grid; place-items: center; }
.pill__txt { color: #ffffff; font-size: .82em; font-weight: 600; font-variation-settings: "wdth" 100; transition: font-variation-settings .45s cubic-bezier(.3, 1.6, .5, 1); }
@media (hover: hover) {
  .pill:hover .pill__txt { font-variation-settings: "wdth" 112; }
}

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

@media (prefers-reduced-motion: reduce) {
  .pill__txt { transition: none; }
}
