/* The washing machine product page with the drum that spins on scroll. Colours in :root (the Playground palette): a
   warm off-white page, the pearl of the machine, the chrome of the ring and one accent, the blue of the water and
   the display. GSAP writes only the transforms of the SVG groups and of the feature lines; the CSS does the rest. */
:root {
  --fondo: #f3f1ec;          /* the page */
  --fondo-alto: #fbfaf7;     /* the soft light behind the machine */
  --corpo: #e9e7e2;          /* the machine, in shadow */
  --corpo-alto: #fdfcfa;     /* the machine, where the light falls */
  --filo: rgba(30, 32, 36, 0.12); /* hairlines */
  --inchiostro: #17191c;     /* the words */
  --tenue: #7b7a75;          /* the small words */
  --schermo: #16191c;        /* the display */
  --accento: #4f8fd8;        /* the water, the display, the figures */
  --accento-fondo: #1f4f8a;  /* the deep of the water */
  --stoffa: #d8cbb6;         /* the towel */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--fondo); }
html, body { overflow-x: clip; }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.corsa { position: relative; height: 660vh; }
.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr;
}
@supports (height: 100lvh) { .palco { height: 100lvh; } }
.alone {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(46% 52% at 42% 48%, var(--fondo-alto), transparent 74%),
    linear-gradient(180deg, transparent 72%, rgba(30, 32, 36, 0.035));
}

.testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(12px, 3.2vh, 28px) clamp(14px, 4vw, 40px) 0;
  font-size: clamp(11px, 1.6vh, 14px);
}
.marchio { display: flex; align-items: center; gap: 7px; font-weight: 600; font-stretch: 108%; letter-spacing: -0.01em; }
.marchio__segno { width: 1.3em; height: 1.3em; fill: none; stroke: var(--inchiostro); stroke-width: 1.4; }
.modello { display: flex; gap: 10px; align-items: baseline; font-weight: 500; }
.modello__prezzo {
  font-family: 'Geist Mono Variable', ui-monospace, monospace;
  font-size: 0.86em;
  color: var(--tenue);
  padding-left: 10px;
  border-left: 1px solid var(--filo);
}

.scena {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 6vw, 96px);
  padding: 0 clamp(14px, 4vw, 40px) 2vh;
}
.macchina { flex: none; height: min(76vh, 52vw); aspect-ratio: 300 / 384; }
.lavatrice { display: block; width: 100%; height: 100%; overflow: visible; }

/* the machine */
.ombra { fill: rgba(20, 22, 26, 0.22); }
.piede { fill: #b9b8b3; }
.corpo { filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.9)); }
.corpo__filo { fill: none; stroke: rgba(30, 32, 36, 0.14); stroke-width: 1; }
.corpo__luce { stroke: #ffffff; stroke-width: 1; opacity: 0.9; }
.giunta { stroke: rgba(30, 32, 36, 0.12); stroke-width: 1; }
.giunta--chiara { stroke: rgba(255, 255, 255, 0.85); }
.cassetto { fill: rgba(255, 255, 255, 0.55); stroke: rgba(30, 32, 36, 0.12); stroke-width: 1; }
.cassetto__maniglia { stroke: rgba(30, 32, 36, 0.28); stroke-width: 2; stroke-linecap: round; }
.schermo { fill: var(--schermo); }
.schermo__riflesso { fill: rgba(255, 255, 255, 0.05); }
.schermo__testo {
  fill: #e9edf2;
  font-family: 'Geist Mono Variable', ui-monospace, monospace;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-anchor: middle;
  font-variant-numeric: tabular-nums;
  transition: fill 0.5s ease;
}
.schermo__testo.is-fatto { fill: var(--accento); }
.schermo__binario { stroke: rgba(255, 255, 255, 0.12); stroke-width: 1.4; stroke-linecap: round; }
.schermo__corsa { stroke: var(--accento); stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 70; stroke-dashoffset: 70; }
.tacca { stroke: rgba(30, 32, 36, 0.28); stroke-width: 1; stroke-linecap: round; }
.tacca--lunga { stroke: rgba(30, 32, 36, 0.5); }
.manopola { filter: drop-shadow(0 2px 2px rgba(20, 22, 26, 0.18)); }
.manopola__filo { fill: none; stroke: rgba(30, 32, 36, 0.18); stroke-width: 1; }
.manopola__dentro { fill: none; stroke: rgba(255, 255, 255, 0.8); stroke-width: 1; }
.manopola__segno { stroke: var(--accento); stroke-width: 2; stroke-linecap: round; }

/* the opening, the drum, the towel, the water */
.guarnizione { fill: #2d3034; }
.guarnizione__piega { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 1.5; }
.foro { fill: rgba(0, 0, 0, 0.45); stroke: rgba(255, 255, 255, 0.1); stroke-width: 0.5; }
.mozzo { fill: #4a4f55; stroke: rgba(255, 255, 255, 0.12); stroke-width: 0.8; }
.mozzo__filo { fill: none; stroke: rgba(0, 0, 0, 0.35); stroke-width: 0.8; }
.pala { fill: #6a7077; stroke: rgba(255, 255, 255, 0.14); stroke-width: 0.8; }
.capo__stoffa { fill: var(--stoffa); stroke: rgba(60, 46, 30, 0.25); stroke-width: 0.8; }
.capo__piega { stroke: rgba(60, 46, 30, 0.3); stroke-width: 0.8; }
.capo__bordo { stroke: rgba(255, 255, 255, 0.55); stroke-width: 1; stroke-dasharray: 2 2; }
.capo__ombra { fill: rgba(60, 46, 30, 0.12); }
.capo--fuori { filter: drop-shadow(0 6px 6px rgba(20, 22, 26, 0.22)); opacity: 0; }
.acqua__pelo { fill: none; stroke: rgba(220, 236, 255, 0.75); stroke-width: 1.2; }
.bolla { fill: none; stroke: rgba(230, 242, 255, 0.85); stroke-width: 0.7; opacity: 0; }

/* the door */
.porta { filter: drop-shadow(0 6px 10px rgba(20, 22, 26, 0.2)); }
.cerniera { stroke: #9a9ea2; stroke-width: 6; stroke-linecap: round; }
.cromo__filo { fill: none; stroke: rgba(30, 32, 36, 0.22); stroke-width: 1; }
.cromo__dentro { fill: none; stroke: rgba(30, 32, 36, 0.3); stroke-width: 1.4; }
.vetro__filo { fill: none; stroke: rgba(255, 255, 255, 0.35); stroke-width: 1; }
.riflesso { fill: none; stroke: rgba(255, 255, 255, 0.4); stroke-width: 5; stroke-linecap: round; }
.riflesso--fine { stroke-width: 2; stroke: rgba(255, 255, 255, 0.28); }
.maniglia { fill: #c9ccce; stroke: rgba(30, 32, 36, 0.2); stroke-width: 1; }

/* the feature lines */
.righe { position: relative; flex: none; width: clamp(220px, 30vw, 360px); display: grid; gap: clamp(18px, 4.5vh, 40px); }
.invito {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--tenue);
}
.invito svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.riga { --luce: 0; opacity: 0; padding-top: 12px; border-top: 1px solid var(--filo); }
.riga__nome {
  font-family: 'Geist Mono Variable', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tenue);
}
.riga__dato {
  margin-top: 6px;
  font-size: clamp(22px, 3.4vw, 34px);
  line-height: 1.08;
  font-weight: 480;
  font-stretch: 94%;
  letter-spacing: -0.03em;
}
.cifra {
  display: inline-block;
  min-width: 1.15em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-stretch: 112%;
  color: color-mix(in srgb, var(--accento) calc(var(--luce) * 100%), var(--inchiostro));
}

/* narrow: the machine in the middle, one line at a time under it */
.palco.is-stretto .scena { flex-direction: column; gap: clamp(10px, 2.6vh, 22px); padding-bottom: 3vh; }
.palco.is-stretto .macchina { height: min(58vh, 74vw); }
.palco.is-stretto .righe { width: min(100%, 360px); height: clamp(46px, 13vh, 76px); display: block; text-align: center; }
.palco.is-stretto .riga { position: absolute; left: 0; right: 0; top: 0; border-top: 0; padding-top: 0; }
.palco.is-stretto .riga__nome { font-size: 9.5px; }
.palco.is-stretto .riga__dato { margin-top: 4px; font-size: clamp(18px, 3.6vh, 26px); }
.palco.is-stretto .invito { left: 50%; top: 0; transform: translateX(-50%); white-space: nowrap; font-size: 12px; }

@media (hover: hover) {
  .manopola:hover { filter: drop-shadow(0 3px 4px rgba(20, 22, 26, 0.24)); }
}
