/* Il carillon */
:root {
  --fondo: #1E1524;
  --alone: #3A2433;
  --testo: #F6EBDD;
  --tenue: #BBA7B4;
  --legno: #8C4A2C;
  --legno-scuro: #5A2C1A;
  --legno-alto: #A85B34;
  --ottone: #DDAE55;
  --ottone-chiaro: #F6DB97;
  --ottone-scuro: #9C6E2A;
  --acciaio: #D3D8DE;
  --vassoio: #2B1B22;
  --velluto: #9B2E4E;
  --velluto-scuro: #6E1D37;
  --specchio: #8FA9BF;
  --specchio-chiaro: #DCE8F0;
  --pelle: #F7E9E1;
  --tutu: #F3A9BC;
  --nota-grave: #F6D9A2;
  --nota-media: #F3A9BC;
  --nota-acuta: #B9DCEB;
  --guanto: #EFE6D6;
  --manica: #3F6E8C;
  --manica-scura: #2C4F66;
  --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, 34%) 1fr;
  align-items: center;
  overflow: hidden;
  background: radial-gradient(ellipse 60% 70% at 66% 52%, var(--alone), transparent 70%), var(--fondo);
}

/* ---- il testo del negozio ---- */
.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: 600;
  font-stretch: 112%;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ottone);
}
.titolo {
  margin: 0;
  font-size: clamp(32px, 4.2vw, 60px);
  line-height: 1.02;
  font-weight: 700;
  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;
}

/* il pulsante: la pillola si gonfia con un rimbalzo e la chiavetta fa un giro */
.carica {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px 14px 18px;
  border: 0;
  background: none;
  color: var(--fondo);
  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;
}
.carica__fondo {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--ottone);
  transition: transform 0.6s cubic-bezier(0.34, 1.8, 0.5, 1), background-color 0.3s;
}
.carica__chiave,
.carica__scritta { position: relative; }
.carica__chiave {
  width: 20px;
  height: 20px;
  transition: transform 0.8s cubic-bezier(0.34, 1.5, 0.5, 1);
}
.carica:active .carica__fondo { transform: scale(0.94); transition-duration: 0.12s; }
.carica:focus-visible { outline: none; }
.carica:focus-visible .carica__fondo { box-shadow: 0 0 0 3px var(--fondo), 0 0 0 5px var(--ottone-chiaro); }
.carica--gira .carica__chiave { transform: rotate(360deg); }
@media (hover: hover) {
  .carica:hover { font-stretch: 112%; }
  .carica:hover .carica__fondo { transform: scale(1.06, 1.12); background-color: var(--ottone-chiaro); }
  .carica:hover .carica__chiave { transform: rotate(180deg); }
}

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

.ombra { fill: rgba(0, 0, 0, 0.38); }
.legno { fill: var(--legno); }
.legno-alto { fill: var(--legno-alto); }
.cornicione { fill: var(--legno-alto); }
.zoccolo { fill: var(--legno-scuro); }
.venatura { fill: none; stroke: var(--legno-scuro); stroke-width: 1.4; opacity: 0.45; }
.intarsio { fill: none; stroke: var(--ottone-scuro); stroke-width: 1.6; opacity: 0.7; }
.ottone { fill: var(--ottone); }
.ottone-scuro { fill: var(--ottone-scuro); }
.incisione { fill: none; stroke: var(--ottone-scuro); stroke-width: 1.2; }
.targa {
  fill: var(--legno-scuro);
  font-size: 13px;
  font-weight: 700;
  font-stretch: 115%;
  letter-spacing: 0.2em;
  text-anchor: middle;
}
.pomello { fill: var(--guanto); stroke: var(--legno-scuro); stroke-width: 2; }
.cucito { fill: none; stroke: var(--ottone); stroke-width: 1.2; stroke-dasharray: 4 5; opacity: 0.5; }
.cornice { fill: var(--ottone); }
.luce-specchio { fill: #fff; opacity: 0.22; }
.riflesso { opacity: 0.5; }

.vassoio { fill: var(--vassoio); }
.piastra { fill: var(--ottone-scuro); opacity: 0.32; }
.bordo-vassoio { fill: none; stroke: var(--legno-scuro); stroke-width: 3; }
.vetro { fill: #fff; opacity: 0.04; }
.dentatura { fill: var(--ottone-scuro); stroke: var(--ottone); stroke-width: 4; stroke-dasharray: 3 2.4; }
.dentatura--piccola { stroke-width: 3; stroke-dasharray: 2.4 2; }
.tamburo { fill: var(--vassoio); }
.molla { fill: none; stroke: var(--acciaio); stroke-width: 1.3; }
.asse { stroke: var(--acciaio); stroke-width: 3; stroke-linecap: round; }
.punta { stroke: var(--legno-scuro); stroke-width: 3.2; stroke-linecap: round; }
.pettine { fill: var(--acciaio); opacity: 0.85; }
.dente { fill: var(--acciaio); }
.dente__luce { stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }
.vite { fill: var(--ottone-scuro); }
.staffa { fill: none; stroke: var(--ottone-scuro); stroke-width: 3; }
.ventola { fill: var(--acciaio); }

/* la ballerina: niente faccia, solo la sagoma */
.b-pelle { fill: var(--pelle); }
.b-linea { fill: none; stroke: var(--pelle); stroke-linecap: round; stroke-linejoin: round; }
.b-tutu { fill: var(--tutu); }
.b-tutu-sotto { fill: var(--velluto); opacity: 0.55; }
.b-piega { stroke: var(--velluto); stroke-width: 1.2; opacity: 0.6; }
.b-perno { fill: var(--ottone); }
.b-segno { stroke: var(--ottone-scuro); stroke-width: 2; stroke-linecap: round; }

.nota--grave { fill: var(--nota-grave); stroke: var(--nota-grave); }
.nota--media { fill: var(--nota-media); stroke: var(--nota-media); }
.nota--acuta { fill: var(--nota-acuta); stroke: var(--nota-acuta); }
.nota .gambo { fill: none; stroke-width: 2.6; stroke-linecap: round; }
.nota .testa,
.nota .coda { stroke: none; }

.manica { fill: var(--manica); }
.polsino { fill: var(--manica-scura); }
.guanto { fill: var(--guanto); stroke: var(--legno-scuro); stroke-width: 1.4; }
.guanto-segno { fill: none; stroke: var(--legno-scuro); stroke-width: 1.3; stroke-linecap: round; opacity: 0.55; }

/* ---- telefono e finestre strette: il testo sopra, la scatola 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; }
  .scena { inset: 2% 0 4%; width: 100%; height: 94%; }
}

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