/* The price that breaks into its costs: the transparent pricing card of a clothing brand, on a soft warm page with
   a fine grain. The card has layered shadows and a 1px edge that catches the light from above; the bar is a track
   with segments of olive, sand and clay that lift and catch a glint when they are cut. */
:root {
  --page: #ebe6dc;          /* the page */
  --page-light: #f7f4ee;    /* the light pool behind the card */
  --card: #fbfaf7;          /* the body of the card */
  --card-low: #f3f0ea;      /* the bottom of the card's gradient */
  --ink: #1b1c17;           /* the words */
  --muted: #8d8a80;         /* the small words */
  --rule: rgba(27, 28, 23, 0.07); /* the hairlines between the rows */
  --track: #e8e4db;         /* the empty track of the bar */
  --olive: #3f4c2c;         /* materials */
  --sage: #74825a;          /* labour */
  --sand: #c4ad7c;          /* duties */
  --sand-light: #ddcca4;    /* transport */
  --clay: #c65a36;          /* our margin, the one accent */
}

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

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

.corsa {
  position: relative;
  height: 560vh;
}

/* the stage: a soft pool of light behind the card and a fine grain over everything */
.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(60% 55% at 50% 42%, var(--page-light), transparent 70%),
    radial-gradient(90% 70% at 50% 120%, rgba(63, 76, 44, 0.08), transparent 70%),
    var(--page);
}
.palco::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.42 0 0 0 0 0.36 0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.card {
  position: relative;
  z-index: 1;
  width: min(88vw, 420px);
  padding: clamp(12px, 3.6vh, 24px) clamp(14px, 4.4vw, 24px) clamp(10px, 3vh, 20px);
  border-radius: clamp(16px, 4vh, 22px);
  background: linear-gradient(180deg, var(--card), var(--card-low));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 0 0 1px rgba(27, 28, 23, 0.06),
    0 1px 2px rgba(27, 28, 23, 0.05),
    0 6px 12px -4px rgba(27, 28, 23, 0.06),
    0 24px 48px -16px rgba(40, 36, 24, 0.16),
    0 48px 90px -40px rgba(40, 36, 24, 0.22);
  overflow: hidden;
}
/* a soft light that follows the pointer over the card */
.card__luce {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, -20%), rgba(255, 255, 255, 0.75), transparent 65%);
  opacity: var(--mo, 0);
}

.testa {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}
/* the fabric swatch: an olive cloth with a fine twill and a fold of light */
.campione {
  position: relative;
  flex: none;
  width: clamp(30px, 8.6vh, 40px);
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 45%, rgba(0, 0, 0, 0.18)),
    radial-gradient(120% 90% at 20% 10%, #8a9a68, var(--olive) 70%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 2px 6px -2px rgba(40, 36, 24, 0.35);
}
.campione__trama {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.25) 0 1px, transparent 1px 3px);
}
.testa__testi { min-width: 0; flex: 1; }
.testa__nome {
  font-size: clamp(12px, min(3.4vw, 3.6vh), 14px);
  font-variation-settings: 'wght' 600, 'wdth' 100;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.testa__sotto {
  margin-top: 2px;
  font-size: clamp(10px, min(2.9vw, 3vh), 12px);
  font-variation-settings: 'wght' 450, 'wdth' 100;
  color: var(--muted);
  white-space: nowrap;
}
/* the chip: its words swap at the last stage */
.chip {
  position: relative;
  flex: none;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  overflow: hidden;
  font-size: 10.5px;
  line-height: 22px;
  font-variation-settings: 'wght' 540, 'wdth' 100;
  color: var(--olive);
  background: linear-gradient(180deg, rgba(116, 130, 90, 0.12), rgba(116, 130, 90, 0.2));
  box-shadow: inset 0 0 0 1px rgba(63, 76, 44, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}
.chip > span { display: block; }
.chip__b { position: absolute; left: 9px; top: 0; }

.prezzo {
  margin-top: clamp(8px, 3vh, 20px);
  font-size: clamp(36px, min(12vw, 12vh), 60px);
  font-variation-settings: 'wght' 620, 'wdth' 100;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
  user-select: none;
  background: linear-gradient(180deg, #2a2b24, #0f100c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.prezzo__valuta {
  font-size: 0.48em;
  vertical-align: 0.7em;
  margin-right: 0.05em;
  font-variation-settings: 'wght' 480, 'wdth' 100;
}

/* the bar: a sunken track, the segments placed by the script every frame */
.barra {
  position: relative;
  height: 34px;
  margin: clamp(8px, 2.6vh, 18px) 0 clamp(4px, 1.4vh, 10px);
}
.barra__binario {
  position: absolute;
  left: 0;
  right: 0;
  top: 18px;
  height: 12px;
  border-radius: 6px;
  background: var(--track);
  box-shadow: inset 0 1px 2px rgba(27, 28, 23, 0.12), inset 0 -1px 0 rgba(255, 255, 255, 0.7);
}
.seg {
  position: absolute;
  left: 0;
  top: 18px;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  cursor: default;
}
.seg__fondo {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}
.seg__riflesso {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.75) 50%, transparent);
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.seg__ombra {
  position: absolute;
  left: 0;
  top: 18px;
  height: 12px;
  border-radius: 6px;
  pointer-events: none;
  box-shadow: 0 6px 10px -4px rgba(40, 36, 24, 0.4);
}
.barra__fuori {
  position: absolute;
  top: 18px;
  height: 12px;
  border-radius: 6px;
  background: repeating-linear-gradient(-45deg, rgba(27, 28, 23, 0.10) 0 1px, transparent 1px 5px);
  box-shadow: inset 0 0 0 1px rgba(27, 28, 23, 0.08);
}
.barra__capo {
  position: absolute;
  left: 0;
  top: 0;
  font-style: normal;
  font-size: 10.5px;
  line-height: 12px;
  font-variation-settings: 'wght' 600, 'wdth' 100;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0;
}
.barra__capo--negozio { color: var(--muted); font-variation-settings: 'wght' 480, 'wdth' 100; }

.righe { list-style: none; }
.riga {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: clamp(22px, 6.4vh, 32px);
  padding: 0 8px;
  margin: 0 -8px;
  border-radius: 8px;
  font-size: clamp(11.5px, min(3.4vw, 3.4vh), 13.5px);
  font-variation-settings: 'wght' 440, 'wdth' 100;
  font-variant-numeric: tabular-nums;
  user-select: none;
  cursor: default;
}
.riga::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 1px;
  background: var(--rule);
}
.riga__lume {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
}
.riga__nome { position: relative; flex: 1; }
.riga__parte {
  position: relative;
  font-size: 0.82em;
  color: var(--muted);
  font-variation-settings: 'wght' 460, 'wdth' 100;
  min-width: 2.6em;
  text-align: right;
}
.riga__cifra {
  position: relative;
  display: inline-flex;
  min-width: 3.2em;
  justify-content: flex-end;
  align-items: flex-start;
  line-height: 1.15em;
  font-variation-settings: 'wght' 560, 'wdth' 100;
}
/* the rolling digits: each a column of 0 to 9 behind a one-line window */
.rullo {
  display: inline-block;
  height: 1.15em;
  line-height: 1.15em;
  overflow: hidden;
  vertical-align: top;
}
.rullo > span { display: block; will-change: transform; }
.rullo > span > span { display: block; height: 1.15em; }

.riga--negozio { color: var(--muted); }
.riga--negozio::after { display: none; }
.riga--negozio .riga__cifra { color: var(--muted); font-variation-settings: 'wght' 480, 'wdth' 100; }
.riga__taglio {
  position: absolute;
  left: -2px;
  right: -2px;
  top: 52%;
  height: 1.5px;
  border-radius: 1px;
  background: var(--clay);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.scendi {
  position: absolute;
  left: 50%;
  bottom: clamp(8px, 3vh, 30px);
  transform: translateX(-50%);
  font-size: 12px;
  font-variation-settings: 'wght' 480, 'wdth' 110;
  letter-spacing: 0.04em;
  color: var(--muted);
  user-select: none;
}
