:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --bordo: rgba(24, 22, 20, 0.09);
  --testo: #1a1917;
  --testo-2: #6f6b66;
  --testo-3: #aaa59f;
  --traccia: #eeece8;     /* the empty segments */
  --pieno: #1a1917;       /* in stock: the ink */
  --accento: #c4790f;     /* low stock: amber, the one accent */
  --esaurito: #948e87;    /* out of stock: grey */
  --oat: #dccfb8;
  --sage: #9aa891;
  --clay: #b8765a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
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, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* ---- the card ---- */
.card {
  --tono: var(--pieno);
  position: relative;
  width: min(380px, 100%);
  background: var(--carta);
  border-radius: 22px;
  padding: clamp(16px, 4.4vh, 24px) clamp(16px, 5vw, 24px) clamp(16px, 4.2vh, 22px);
  box-shadow:
    0 0 0 1px var(--bordo),
    0 1px 2px rgba(24, 22, 20, 0.04),
    0 12px 28px -10px rgba(24, 22, 20, 0.16),
    0 34px 60px -30px rgba(24, 22, 20, 0.18);
}

.maker { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--testo-3); font-weight: 560; }
.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 5px; }
.name { font-size: clamp(16px, 4.6vw, 19px); font-weight: 600; letter-spacing: -0.015em; font-stretch: 96%; line-height: 1.2; }
.price { font-size: clamp(16px, 4.6vw, 19px); font-weight: 560; letter-spacing: -0.01em; white-space: nowrap; }

/* rolling digits: each slot is a column 0-9 moved with yPercent */
.roller { display: inline-flex; height: 1.2em; line-height: 1.2em; overflow: hidden; vertical-align: bottom; font-variant-numeric: tabular-nums; }
.roller__fix { display: inline-block; }
.roller__slot { display: inline-block; height: 1.2em; overflow: hidden; }
.roller__col { display: flex; flex-direction: column; }
.roller__col span { display: block; height: 1.2em; text-align: center; }

.group { margin-top: clamp(12px, 3.2vh, 20px); }
.label { display: flex; justify-content: space-between; font-size: 12px; color: var(--testo-2); margin-bottom: clamp(6px, 1.4vh, 9px); }
.label > span:first-child { font-weight: 560; color: var(--testo); }
.label__val { display: inline-block; }

/* ---- swatches: rounded squares with a waffle weave ---- */
.swatches { display: flex; gap: 10px; }
.swatch {
  position: relative;
  width: clamp(30px, 8vh, 34px); height: clamp(30px, 8vh, 34px);
  border-radius: 10px;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.swatch__ring {
  position: absolute; inset: -4px; border-radius: 13px;
  box-shadow: inset 0 0 0 1.5px var(--testo);
  transform: scale(0.8); opacity: 0;
}
.swatch__face {
  position: absolute; inset: 0; border-radius: inherit;
  background:
    linear-gradient(160deg, rgba(255,255,255,.32), rgba(255,255,255,0) 45%, rgba(0,0,0,.08)),
    repeating-linear-gradient(0deg, rgba(0,0,0,.07) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.07) 0 1px, transparent 1px 4px),
    var(--c);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 1px 2px rgba(24,22,20,.12);
}
.swatch:active { transform: scale(.93); }
.swatch:focus-visible { outline: 2px solid var(--testo); outline-offset: 5px; }

/* ---- sizes: four pills and one mark that slides to the chosen one ---- */
.sizes { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.size {
  position: relative; z-index: 1;
  height: clamp(32px, 8.6vh, 38px);
  border-radius: 11px;
  font-size: 13px; font-weight: 520;
  box-shadow: inset 0 0 0 1px var(--bordo);
  transition: color .3s, transform .25s cubic-bezier(.34,1.56,.64,1);
  overflow: hidden;
}
.size::after {
  content: ""; position: absolute; left: 20%; right: 20%; top: 62%; height: 1px;
  background: var(--testo-3); transform: rotate(-11deg) scaleX(0); transform-origin: 0 50%;
  transition: transform .4s cubic-bezier(.65,0,.35,1);
}
.size.is-out { color: var(--testo-3); }
.size.is-out::after { transform: rotate(-11deg) scaleX(1); }
.size:active { transform: scale(.95); }
.size:focus-visible { outline: 2px solid var(--testo); outline-offset: 2px; }
.sizes__mark {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none;
  border-radius: 11px;
  box-shadow: inset 0 0 0 1.5px var(--testo), 0 4px 10px -6px rgba(24,22,20,.35);
}
@media (hover: hover) {
  .size:hover { box-shadow: inset 0 0 0 1px rgba(24,22,20,.22); }
  .swatch:hover { transform: translateY(-1px); }
}

/* ---- the stock meter ---- */
.stock { margin-top: clamp(14px, 3.6vh, 22px); padding-top: clamp(12px, 3vh, 18px); border-top: 1px solid var(--bordo); }
.meter { display: grid; grid-template-columns: repeat(var(--n, 10), 1fr); gap: 3px; height: 5px; }
.seg { position: relative; border-radius: 3px; background: var(--traccia); overflow: hidden; }
.seg__fill { position: absolute; inset: 0; border-radius: inherit; background: var(--tono); transform-origin: 0 50%; }
.seg__fill::after {
  content: ""; position: absolute; inset: 0 0 50% 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0));
}

.line, .sub { position: relative; display: grid; overflow: hidden; }
.line { margin-top: 10px; height: 1.4em; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.sub { margin-top: 3px; height: 1.5em; font-size: 12.5px; color: var(--testo-2); }
.line > *, .sub > * { grid-area: 1 / 1; display: flex; align-items: center; gap: 6px; white-space: nowrap; min-width: 0; }
.st__word { color: var(--tono); }
.st { white-space: nowrap; }
.st__sep { color: var(--testo-3); font-weight: 400; }
.sub svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* Notify me: ink text that widens on the width axis */
.notify {
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 600; color: var(--testo); padding: 3px 6px; margin: -3px -6px; border-radius: 7px;
  font-stretch: 100%; transition: font-stretch .45s cubic-bezier(.34,1.56,.64,1), background-color .2s;
}
.notify svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.notify:focus-visible { outline: 2px solid var(--testo); outline-offset: 1px; }
@media (hover: hover) { .notify:hover { font-stretch: 112%; background: #f5f4f2; } }

/* the email field inside the delivery line */
.sub > .form { gap: 6px; align-items: stretch; }
.form__input {
  flex: 1; min-width: 0; height: 100%;
  border: 1px solid rgba(24,22,20,.14); border-radius: 10px; background: #fbfbfa;
  padding: 0 11px; font-size: 13px; outline: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.form__input::placeholder { color: var(--testo-3); }
.form__input:focus { border-color: rgba(24,22,20,.3); background: #fff; box-shadow: 0 0 0 3px rgba(24,22,20,.05); }
.form__go {
  flex: none; width: 38px; border-radius: 10px; background: var(--testo); color: #fff;
  display: grid; place-items: center; box-shadow: 0 5px 12px -6px rgba(24,22,20,.5);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.form__go svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.form__go:active { transform: scale(.92); }
.form__go:focus-visible { outline: 2px solid var(--testo); outline-offset: 2px; }
.done { display: inline-flex; align-items: center; gap: 5px; color: var(--testo); font-weight: 560; }
.done svg { color: var(--testo); }
.done svg path { stroke-dasharray: 1; stroke-dashoffset: 1; stroke-width: 1.8; }
.done em { font-style: normal; color: var(--testo-2); font-weight: 400; }
