/* ============================================================
   SIGNATURE ANIMATION — tovaglia sporca → ciclo → pulita
   Sezione dedicata sotto la hero. Scroll-scrubbed (JS imposta --p 0..1).
   ============================================================ */
.signature { position: relative; background: var(--bg-deep); color: var(--on-deep); }
.signature__track { height: 340vh; }              /* spazio di scroll per lo scrub */
.signature__sticky { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* intestazione sezione */
.signature__head { text-align: center; padding-top: clamp(2.2rem, 6vh, 4.5rem); z-index: 3; }
.signature__head .eyebrow { color: var(--accent); justify-content: center; }
.signature__head h2 { color: #fff; margin-top: .7rem; }

/* palco */
.sig-stage { flex: 1; position: relative; display: grid; place-items: center; }
.sig-scene { position: relative; width: min(960px, 92vw); height: min(48vh, 420px); }

/* --- tovaglia (un solo elemento che attraversa la scena) --- */
.cloth {
  position: absolute; top: 50%; left: 50%;
  width: 230px; height: 168px; border-radius: 10px;
  transform: translate(-50%, -50%);
  background: #fff;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  will-change: transform, opacity;
}
.cloth__inner { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }
/* trama tessuto */
.cloth__weave { position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(15,46,49,.05) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(90deg, rgba(15,46,49,.05) 0 1px, transparent 1px 9px);
}
/* pieghe / stiratura (appaiono da pulita) */
.cloth__folds { position: absolute; inset: 0; opacity: var(--clean, 0);
  background:
    linear-gradient(90deg, transparent 0 32%, rgba(15,46,49,.08) 33%, transparent 34% 66%, rgba(15,46,49,.08) 67%, transparent 68%),
    linear-gradient(0deg, transparent 0 47%, rgba(15,46,49,.07) 48% 49%, transparent 50%);
  transition: opacity .2s linear;
}
/* macchie di sporco */
.cloth__stain { position: absolute; border-radius: 50%; filter: blur(2px); opacity: var(--dirt, 1); }
.cloth__stain.s1 { width: 58px; height: 46px; top: 26px; left: 34px; background: radial-gradient(circle at 40% 40%, #9a8b5e, #6f6033 70%, transparent); }
.cloth__stain.s2 { width: 40px; height: 36px; bottom: 22px; right: 40px; background: radial-gradient(circle at 50% 40%, #b58e6b, #7d5536 72%, transparent); }
.cloth__stain.s3 { width: 30px; height: 26px; top: 60px; right: 70px; background: radial-gradient(circle, #8a7a55, transparent 72%); }
.cloth__sheen { position: absolute; inset: 0; opacity: var(--clean, 0);
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.85) 50%, transparent 62%); }

/* --- lavatrice --- */
.machine { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 300px; height: 320px; z-index: 2; }
.machine__body { position: absolute; inset: 0; border-radius: 30px; background: linear-gradient(180deg, #fbfdfc, #e7edea); box-shadow: 0 30px 70px rgba(0,0,0,.4), inset 0 2px 0 rgba(255,255,255,.9); }
.machine__panel { position: absolute; top: 18px; left: 24px; right: 24px; height: 40px; border-radius: 12px; background: #0f2e31; display: flex; align-items: center; padding: 0 16px; gap: 10px; }
.machine__panel i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.25); }
.machine__panel i.live { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.machine__panel .knob { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); }
.door { position: absolute; left: 50%; top: 56%; transform: translate(-50%, -50%); width: 196px; height: 196px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, #d9e2df 0 60%, #c3cecb 61% 100%); box-shadow: inset 0 6px 20px rgba(0,0,0,.18); display: grid; place-items: center; }
.drum { position: relative; width: 150px; height: 150px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 38%, #2a5d60, #0c2426 78%); box-shadow: inset 0 0 30px rgba(0,0,0,.6); }
.drum__spin { position: absolute; inset: 0; will-change: transform; }
.drum__spin::before, .drum__spin::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; border: 2px dashed rgba(255,255,255,.18); }
.drum__spin::after { inset: 38px; border-style: dotted; }
.drum__holes { position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.14) 1.6px, transparent 2px); background-size: 18px 18px; }
/* acqua nel cestello */
.drum__water { position: absolute; left: 0; right: 0; bottom: 0; height: 0%; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 65%, #2a5d60), #0c4a48); opacity: .92; transition: none; }
.drum__water::before { content: ""; position: absolute; top: -8px; left: -10%; width: 120%; height: 16px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 80%, #fff); opacity: .5; }
.bubble { position: absolute; bottom: 6%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.95), rgba(255,255,255,.25) 70%); opacity: 0; }
.door__glass { position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(135deg, rgba(255,255,255,.5), transparent 40%); pointer-events: none; }
.door__ring { position: absolute; inset: -10px; border-radius: 50%; border: 8px solid #f3f6f5; box-shadow: 0 6px 16px rgba(0,0,0,.12); }

/* sparkles puliti */
.sparkle { position: absolute; width: 18px; height: 18px; opacity: 0; color: var(--accent); }
.sparkle svg { width: 100%; height: 100%; fill: currentColor; }

/* --- didascalie fasi --- */
.sig-captions { position: relative; z-index: 3; padding-bottom: clamp(2rem, 6vh, 4rem); display: grid; }
.sig-cap { grid-area: 1/1; text-align: center; opacity: 0; transition: opacity .3s linear; }
.sig-cap b { font-family: var(--font-head); font-size: 1.25rem; color: #fff; display: block; }
.sig-cap span { color: var(--on-deep-soft); font-size: .95rem; }

/* barra di avanzamento fasi */
.sig-progress { width: min(420px, 80vw); margin: 1rem auto 0; }
.sig-progress__track { height: 4px; border-radius: 4px; background: rgba(255,255,255,.16); overflow: hidden; }
.sig-progress__bar { height: 100%; width: 0%; background: var(--accent); border-radius: 4px; }
.sig-progress__labels { display: flex; justify-content: space-between; margin-top: .6rem; font-family: var(--font-head); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--on-deep-soft); }
.sig-progress__labels span.on { color: var(--accent); }

/* hint scroll */
.sig-hint { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); font-size: .78rem; color: var(--on-deep-soft); display: flex; flex-direction: column; align-items: center; gap: .4rem; opacity: .8; }
.sig-hint .m { width: 22px; height: 34px; border: 1.5px solid var(--on-deep-soft); border-radius: 12px; position: relative; }
.sig-hint .m::after { content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 4px; height: 7px; border-radius: 2px; background: var(--accent); animation: scrolly 1.6s var(--ease) infinite; }
@keyframes scrolly { 0%{opacity:0; top:6px} 30%{opacity:1} 70%{opacity:1; top:16px} 100%{opacity:0; top:18px} }

/* fallback statico: no-JS o reduced-motion → mostra prima/dopo */
@media (prefers-reduced-motion: reduce) {
  .signature__track { height: auto; }
  .signature__sticky { position: relative; height: auto; padding-bottom: 4rem; }
  .sig-scene { transform: none !important; }
  .sig-hint { display: none; }
}
.no-js .signature__track { height: auto; }
.no-js .signature__sticky { position: relative; height: auto; padding-bottom: 4rem; }

@media (max-width: 680px) {
  .machine { width: 208px; height: 226px; }
  .door { width: 140px; height: 140px; } .drum { width: 108px; height: 108px; }
  .cloth { width: 188px; height: 136px; }
  .sig-scene { height: 400px; }
  .signature__head h2 { font-size: clamp(1.5rem, 7vw, 2rem); }
}
