/* The order confirmation card of Ostra Ceramics, a made-up pottery shop: one card alone on white, a single green accent. */
:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --bordo: #ebeae6;
  --tinta: #f5f4f1;          /* the thumbnails, the copy button, the track of the steps */
  --testo: #15140f;
  --testo-2: #5f5d55;
  --testo-3: #9d9a90;
  --accento: #0f8a5f;        /* the single accent: the check, the steps, the copied state */
  --accento-chiaro: #e6f4ee;
  --argilla: #e9dccb;        /* the clay of the drawn pieces, a neutral */
  --ombra: 30, 26, 18;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { font-size: clamp(8px, min(3.7vw, 2.32vh), 17px); }
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; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

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

/* the card: a body, a 1px edge that catches light at the top, three soft shadows */
.card {
  position: relative;
  width: min(23em, 92vw);
  padding: 1.4em 1.35em 1.3em;
  border-radius: 1.5em;
  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), .24);
  display: grid;
  gap: .9em;
  isolation: isolate;
  overflow: clip;
}
.card__edge {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  padding: 1px;
  background: linear-gradient(180deg, rgba(15, 138, 95, .28), var(--bordo) 22%, var(--bordo) 80%, #e3e1dc);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.card__glow {
  position: absolute; top: 0; left: 0; width: 38%; height: 1px; z-index: 3; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(15, 138, 95, .9), transparent);
  opacity: 0;
}

/* the top: the seal with the check, then the thanks */
.top { display: grid; justify-items: center; text-align: center; gap: .7em; }
.seal { position: relative; width: 3.3em; height: 3.3em; display: block; }
.seal__halo {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--accento-chiaro);
}
.seal__svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.seal__ring { stroke: var(--accento); stroke-width: 1.6; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.seal__tick { stroke: var(--accento); stroke-width: 2.6; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.top__txt { display: grid; gap: .3em; }
.title { font-size: 1.32em; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; font-stretch: 96%; }
.sub { font-size: .76em; color: var(--testo-2); line-height: 1.4; max-width: 22em; }

.lab { font-size: .7em; color: var(--testo-3); font-weight: 560; line-height: 1.3; }

/* the order number with the copy button */
.order {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .6em;
  padding: .6em .6em .6em .85em; border-radius: .95em; border: 1px solid var(--bordo);
}
.num { font-family: "JetBrains Mono Variable", ui-monospace, monospace; font-size: .92em; font-weight: 560; letter-spacing: .02em; line-height: 1.35; }
.copy {
  position: relative; width: 5.9em; height: 2.3em; border-radius: .7em;
  font-size: .76em; font-weight: 600; color: var(--testo-2);
  background: var(--tinta);
  transition: background-color .25s, color .25s;
}
.copy.is-done { background: var(--accento-chiaro); color: var(--accento); }
@media (hover: hover) { .copy:hover { color: var(--testo); } .copy.is-done:hover { color: var(--accento); } }
.copy__face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .38em; white-space: nowrap; }
.copy__face--done { opacity: 0; }
.ico { width: 1.15em; height: 1.15em; display: block; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ico--tick { stroke-width: 1.8; }
.ico--tick path { stroke-dasharray: 1 1; stroke-dashoffset: 1; }

/* the pieces */
.items { display: grid; gap: .5em; }
.item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75em; }
.thumb {
  width: 2.5em; height: 2.5em; border-radius: .75em; display: grid; place-items: center;
  background: var(--tinta);
  box-shadow: inset 0 0 0 1px rgba(var(--ombra), .04);
  overflow: hidden;
}
.thumb svg { width: 2em; height: 2em; display: block; overflow: visible; }
.thumb .ware { fill: var(--argilla); stroke: #b8a68f; stroke-width: .9; stroke-linejoin: round; }
.thumb .glaze { fill: #cfe5da; stroke: none; }
.thumb--bowl .glaze { fill: #b9d9cb; }
.thumb--vase .ware { fill: #f1ece4; }
.thumb--vase .glaze { fill: #e2ddd3; }
.thumb .line { fill: none; stroke: #b8a68f; stroke-width: .9; stroke-linecap: round; }
.thumb .speck { fill: #8f7d66; }
.item__txt { display: grid; gap: .08em; min-width: 0; }
.item__name { font-size: .84em; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__meta { font-size: .7em; color: var(--testo-3); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__price { font-size: .82em; font-weight: 560; font-variant-numeric: tabular-nums; color: var(--testo-2); }

/* the sum */
.sum { display: grid; gap: .35em; padding-top: .85em; border-top: 1px dashed #e2e0da; }
.sum__row { display: flex; justify-content: space-between; align-items: baseline; }
.sum__val { font-size: .76em; color: var(--testo-2); font-variant-numeric: tabular-nums; }
.tot__lab { font-size: .86em; font-weight: 600; }
.tot__val { font-size: 1.2em; font-weight: 650; letter-spacing: -.02em; }

/* the rolling digits: each digit is a window over a column 0-9 */
.roll { display: inline-flex; font-variant-numeric: tabular-nums; white-space: nowrap; }
.roll .ch { display: inline-block; position: relative; height: 1.15em; line-height: 1.15em; overflow: hidden; vertical-align: bottom;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent); }
.roll .col { display: block; will-change: transform; }
.roll .col span { display: block; height: 1.15em; text-align: center; }
.roll .fix { display: inline-block; height: 1.15em; line-height: 1.15em; vertical-align: bottom; }

/* the delivery and the steps */
.ship { display: grid; gap: .7em; }
.ship__head { display: flex; justify-content: space-between; align-items: baseline; gap: .6em; }
.ship__date { font-size: .8em; font-weight: 600; white-space: nowrap; }
.steps { position: relative; }
.steps__track {
  position: absolute; left: 0; right: 0; top: .5em; height: .2em; margin-top: -.1em; border-radius: 999px;
  background: var(--tinta);
}
.steps__fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #6cc4a2, var(--accento));
  transform-origin: 0 50%;
}
.steps__head {
  position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, var(--accento), rgba(15, 138, 95, .22));
  opacity: 0;
}
.steps__list { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.step { display: grid; justify-items: center; gap: .4em; }
.step__node {
  width: 1em; height: 1em; border-radius: 50%; display: grid; place-items: center;
  background: var(--carta); box-shadow: inset 0 0 0 1.5px #dcdad3;
}
.step.is-on .step__node { background: var(--accento); box-shadow: none; }
.step__node svg { width: .8em; height: .8em; display: block; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.step__node svg path { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.step__lab { font-size: .64em; color: var(--testo-3); font-weight: 560; white-space: nowrap; }
.step.is-on .step__lab { color: var(--testo); }

/* the button: dark pill, the arrow travels on hover and a sheen crosses */
.track {
  position: relative; display: flex; align-items: center; justify-content: center; gap: .45em;
  height: 2.9em; border-radius: 999px; overflow: hidden;
  background: var(--testo); color: #fff;
  font-size: .9em; font-weight: 620;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 8px 18px -10px rgba(var(--ombra), .7);
}
.track::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), transparent 55%);
}
.track__sheen {
  position: absolute; top: 0; bottom: 0; left: 0; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .16), transparent);
  opacity: 0;
}
.track__lab { position: relative; }
.track__arrow { position: relative; width: 1.1em; height: 1.1em; display: block; }
.track__arrow svg { width: 100%; height: 100%; display: block; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.copy:focus-visible, .track:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

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

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