/* La fabbrica di caramelle */
:root {
  --fondo: #FBF0E4;
  --alone: #FFF9F2;
  --testo: #2B1B30;
  --tenue: #6E5A6B;
  --accento: #E2446C;
  --accento-chiaro: #F06E8F;
  --rame: #D9824B;
  --rame-chiaro: #F2B07E;
  --rame-scuro: #A9582A;
  --acciaio: #A3ABBC;
  --acciaio-chiaro: #DCE1EA;
  --scuro: #3B3049;
  --nastro: #4A3F59;
  --nastro-riga: #8E83A0;
  --stampo: #C9D0DC;
  --incavo: #8D96AB;
  --vetro: #DDEFF5;
  --pavimento: #EAD7C3;
  --contatore: #2B1B30;
  --cifre: #FFE3A3;
  --margine: clamp(18px, 4vw, 64px);
  --alto: 100vh;
}
@supports (height: 100svh) {
  :root { --alto: 100svh; }
}

* { box-sizing: border-box; }
html,
body {
  margin: 0;
  height: 100%;
}
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  overflow: hidden;
}

.banco {
  position: relative;
  height: var(--alto);
  display: grid;
  grid-template-columns: minmax(280px, 30%) 1fr;
  align-items: center;
  overflow: hidden;
  background: radial-gradient(ellipse 60% 70% at 64% 50%, var(--alone), transparent 70%), var(--fondo);
}

/* ---- il testo della fabbrica ---- */
.testo {
  position: relative;
  z-index: 2;
  padding: 0 0 0 var(--margine);
  max-width: 420px;
}
.marchio {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 650;
  font-stretch: 112%;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accento);
}
.titolo {
  margin: 0;
  font-size: clamp(32px, 4.1vw, 60px);
  line-height: 1.02;
  font-weight: 750;
  font-stretch: 92%;
  letter-spacing: -0.02em;
}
.frase {
  margin: 20px 0 30px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--tenue);
  max-width: 34ch;
}
.ora {
  margin: 18px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--tenue);
}
.ora__etichetta {
  font-weight: 600;
  font-stretch: 110%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
  margin-right: 6px;
}
.ora__nome {
  display: inline-block;
  color: var(--testo);
  font-weight: 650;
}

/* il pulsante: la pillola elastica (la scritta si allarga, il fondo si gonfia col rimbalzo) */
.gusto {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 14px 26px;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  font-stretch: 100%;
  cursor: pointer;
  transition: font-stretch 0.5s cubic-bezier(0.34, 1.8, 0.5, 1);
  -webkit-tap-highlight-color: transparent;
}
.gusto__fondo {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--accento);
  transition: transform 0.6s cubic-bezier(0.34, 1.8, 0.5, 1), background-color 0.3s;
}
.gusto__scritta { position: relative; }
.gusto:active .gusto__fondo { transform: scale(0.94); transition-duration: 0.12s; }
.gusto:focus-visible { outline: none; }
.gusto:focus-visible .gusto__fondo { box-shadow: 0 0 0 3px var(--fondo), 0 0 0 5px var(--testo); }
@media (hover: hover) {
  .gusto:hover { font-stretch: 116%; }
  .gusto:hover .gusto__fondo { transform: scale(1.06, 1.12); background-color: var(--accento-chiaro); }
}

/* ---- la scena ---- */
.palco {
  position: relative;
  height: 100%;
  min-height: 0;
}
.scena {
  position: absolute;
  inset: 5% 2% 5% 0;
  width: 98%;
  height: 90%;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pavimento { fill: var(--pavimento); }
.piastrelle { stroke: var(--fondo); stroke-width: 2; }
.ombra { fill: rgba(43, 27, 48, 0.14); }

.palo { fill: var(--acciaio); }
.trave { fill: url(#g-acciaio); stroke: var(--acciaio); stroke-width: 1.5; }
.bulloni { stroke: var(--acciaio); stroke-width: 5; stroke-linecap: round; }
.asta { fill: var(--acciaio); }
.ingranaggio { fill: var(--acciaio-chiaro); stroke: var(--scuro); stroke-width: 2; stroke-linejoin: round; }
.ingranaggio--scuro { fill: var(--acciaio); }
.mozzo { fill: var(--scuro); }

.catenella { stroke: var(--acciaio); stroke-width: 2; stroke-dasharray: 4 3; }
.contatore { fill: var(--contatore); }
.contatore__etichetta {
  fill: var(--cifre);
  font-size: 10px;
  font-weight: 700;
  font-stretch: 120%;
  letter-spacing: 0.18em;
  text-anchor: middle;
  opacity: 0.8;
}
.finestra { fill: #120B16; stroke: #4C3C52; stroke-width: 1.5; }
.cifra {
  fill: var(--cifre);
  font-size: 25px;
  font-weight: 700;
  font-stretch: 90%;
  text-anchor: middle;
  font-variant-numeric: tabular-nums;
}

.tubo { fill: none; stroke: var(--acciaio); stroke-width: 16; stroke-linejoin: round; }
.tubo-dentro { fill: none; stroke-width: 5; stroke-dasharray: 10 10; stroke-linecap: round; opacity: 0.85; }
.tubo-bocca { fill: var(--scuro); }
.valvola { fill: var(--accento); stroke: var(--scuro); stroke-width: 2; }
.valvola-raggi { stroke: var(--scuro); stroke-width: 3; stroke-linecap: round; }
.valvola-mozzo { fill: var(--scuro); }

.pentola { stroke: var(--rame-scuro); stroke-width: 2; }
.pentola-riga { fill: none; stroke: var(--rame-scuro); stroke-width: 2; opacity: 0.45; }
.pentola-orlo { fill: var(--rame-chiaro); stroke: var(--rame-scuro); stroke-width: 2; }
.pentola-becco { fill: var(--rame-chiaro); stroke: var(--rame-scuro); stroke-width: 2; stroke-linejoin: round; }
.pentola-manico { fill: none; stroke: var(--rame-scuro); stroke-width: 5; stroke-linecap: round; }
.perno { fill: var(--acciaio-chiaro); stroke: var(--scuro); stroke-width: 2; }
.perno-dentro { fill: var(--scuro); }
.vapore { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; }
.colata { fill: none; stroke-linecap: round; }
.colata-luce { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 5 11; opacity: 0.55; }

.guida { fill: var(--acciaio); }
.scatola { fill: var(--scuro); }
.stelo { fill: url(#g-acciaio); stroke: var(--acciaio); stroke-width: 1; }
.pistone { fill: var(--acciaio-chiaro); stroke: var(--scuro); stroke-width: 2; }
.biella { fill: none; stroke: var(--acciaio-chiaro); stroke-width: 10; stroke-linecap: round; }

.gamba { fill: var(--acciaio); }
.traverso { stroke: var(--acciaio); stroke-width: 4; }
.motore { fill: var(--scuro); }
.catena { fill: none; stroke: var(--nastro-riga); stroke-width: 3; stroke-dasharray: 4 4; }
.nastro { fill: var(--nastro); }
.nastro-righe { fill: none; stroke: var(--nastro-riga); stroke-width: 3; stroke-dasharray: 18 12; }
.rullo { fill: var(--scuro); stroke: var(--nastro-riga); stroke-width: 2; }
.rullo-raggi { stroke: var(--nastro-riga); stroke-width: 2; stroke-linecap: round; }
.cartellino-filo { stroke: var(--acciaio); stroke-width: 2; }
.cartellino { fill: var(--alone); stroke: var(--acciaio); stroke-width: 1.5; }
.cartellino-testo {
  fill: var(--tenue);
  font-size: 9.5px;
  font-weight: 700;
  font-stretch: 120%;
  letter-spacing: 0.14em;
  text-anchor: middle;
}

.stampo { fill: var(--stampo); stroke: var(--incavo); stroke-width: 1.5; }
.incavo { fill: var(--incavo); }

.manicotto { fill: var(--scuro); }
.mano { fill: var(--scuro); }
.dito { fill: var(--acciaio-chiaro); stroke: var(--scuro); stroke-width: 2; stroke-linejoin: round; }

.ugello { fill: var(--scuro); }
.aria { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.sbuffo { fill: #fff; stroke: var(--acciaio-chiaro); stroke-width: 1.5; }

.vetro-dietro { fill: var(--vetro); fill-opacity: 0.5; }
.vetro { fill: var(--vetro); fill-opacity: 0.22; stroke: var(--acciaio); stroke-width: 2.5; }
.vetro-luce { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; opacity: 0.7; }
.collo { fill: var(--vetro); stroke: var(--acciaio); stroke-width: 2.5; }
.etichetta { fill: var(--alone); stroke: var(--accento); stroke-width: 1.5; }
.etichetta-testo {
  fill: var(--accento);
  font-size: 9px;
  font-weight: 750;
  font-stretch: 115%;
  letter-spacing: 0.12em;
  text-anchor: middle;
}
.coperchio { fill: var(--accento); stroke: var(--scuro); stroke-width: 2; }
.coperchio-pomo { fill: var(--scuro); }

/* le caramelle */
.c-cupola { stroke: rgba(0, 0, 0, 0.12); stroke-width: 1; }
.c-luce { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; opacity: 0.6; }
.c-righe { fill: none; stroke-width: 3; stroke-linecap: round; }
.c-pieghe { fill: none; stroke-width: 1.5; stroke-linecap: round; opacity: 0.55; }
.c-carta, .c-coda { stroke-width: 1.5; stroke-linejoin: round; }

/* ---- telefono e finestre strette: il testo sopra, la scena sotto ---- */
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .banco {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    align-items: stretch;
    background: radial-gradient(ellipse 90% 50% at 50% 66%, var(--alone), transparent 70%), var(--fondo);
  }
  .testo {
    padding: calc(var(--margine) + 10px) var(--margine) 0;
    max-width: none;
  }
  .marchio { margin-bottom: 12px; }
  .titolo { font-size: clamp(30px, 8.6vw, 52px); }
  .frase { margin: 12px 0 18px; font-size: 15px; }
  .ora { margin-top: 12px; font-size: 13px; }
  .scena { inset: 2% 0 3%; width: 100%; height: 95%; }
}

/* movimento ridotto: il pulsante cambia solo colore */
@media (prefers-reduced-motion: reduce) {
  .gusto,
  .gusto__fondo { transition: background-color 0.3s; }
  .gusto:active .gusto__fondo { transform: none; }
  @media (hover: hover) {
    .gusto:hover .gusto__fondo { transform: none; }
  }
  @media (hover: hover) {
    .gusto:hover { font-stretch: 100%; }
  }
}
