/* Studio Musci – foglio di stile unico
   Colori presi dal logo della cartellina: blu #033057, oro #C6A66A */
:root {
  --blu: #033057;
  --blu-scuro: #021f3a;
  --oro: #c6a66a;
  --oro-testo: #7d6229;      /* oro scurito: leggibile su fondo chiaro */
  --carta: #fbfaf7;
  --bianco: #ffffff;
  --testo: #1d2733;
  --testo-tenue: #4f5b68;
  --linea: #e4dccb;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", "TeX Gyre Pagella", Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --largo: 72rem;
  --raggio: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--testo);
  background: var(--carta);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blu); text-underline-offset: 3px; }
a:hover { color: var(--oro-testo); }
:focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--serif); color: var(--blu); line-height: 1.2; font-weight: 600; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); margin: 0 0 .6em; }
h3 { font-size: 1.3rem; margin: 0 0 .5em; }
p { margin: 0 0 1em; }

.salta {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--blu); color: #fff; padding: .6rem 1rem;
}
.salta:focus { left: 1rem; top: 1rem; }

.contenitore { width: 100%; max-width: var(--largo); margin: 0 auto; padding: 0 1.25rem; }

/* Etichetta maiuscola spaziata, come sulla cartellina */
.etichetta {
  display: inline-block;
  font-size: .78rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--oro-testo); font-weight: 600; margin-bottom: .8rem;
}
.filetto { width: 64px; height: 2px; background: var(--oro); border: 0; margin: 1.2rem 0 1.6rem; }
.centrato { text-align: center; }
.centrato .filetto { margin-left: auto; margin-right: auto; }

/* ---------- Testata ---------- */
.testata {
  background: var(--bianco);
  border-top: 4px solid var(--blu);
  border-bottom: 1px solid var(--linea);
  position: sticky; top: 0; z-index: 50;
}
.testata .contenitore {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding-top: .7rem; padding-bottom: .7rem;
}
.marchio { display: flex; align-items: center; gap: .8rem; text-decoration: none; }
.marchio img { width: 52px; height: auto; }
.marchio-testo { display: flex; flex-direction: column; line-height: 1.1; }
.marchio-nome { font-family: var(--serif); font-size: 1.35rem; color: var(--blu); font-variant: small-caps; letter-spacing: .02em; }
.marchio-ruolo { font-size: .68rem; letter-spacing: .3em; text-transform: uppercase; color: var(--blu); margin-top: .2rem; }

.menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; }
.menu a {
  text-decoration: none; color: var(--blu); font-size: .92rem; letter-spacing: .08em;
  text-transform: uppercase; padding: .35rem 0; border-bottom: 2px solid transparent;
}
.menu a:hover { color: var(--blu); border-bottom-color: var(--oro); }
.menu a[aria-current="page"] { border-bottom-color: var(--oro); font-weight: 600; }

/* ---------- Pulsanti ---------- */
.pulsanti { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.pulsante {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .8rem 1.4rem; border-radius: var(--raggio);
  font-weight: 600; font-size: .98rem; text-decoration: none; line-height: 1.2;
  border: 2px solid var(--blu); background: var(--blu); color: #fff; cursor: pointer;
  font-family: var(--sans);
}
.pulsante:hover { background: var(--blu-scuro); border-color: var(--blu-scuro); color: #fff; }
.pulsante.chiaro { background: transparent; color: var(--blu); }
.pulsante.chiaro:hover { background: var(--blu); color: #fff; }
.pulsante.whatsapp { background: #0b6b3a; border-color: #0b6b3a; }
.pulsante.whatsapp:hover { background: #084f2b; border-color: #084f2b; }
.pulsante svg { width: 1.15em; height: 1.15em; flex: none; fill: currentColor; }

/* ---------- Apertura (home) ---------- */
.apertura { background: var(--bianco); border-bottom: 1px solid var(--linea); }
.apertura .contenitore {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center;
  padding-top: 4.5rem; padding-bottom: 4.5rem;
}
.apertura .logo-grande { width: 100%; max-width: min(420px, 100%); margin: 0 auto; position: relative; }
.apertura p.lead { font-size: 1.2rem; color: var(--testo-tenue); max-width: 34rem; }
.cornice {
  border: 1px solid var(--oro); padding: 2.2rem; position: relative; background: var(--bianco);
}
.cornice::after {
  content: ""; position: absolute; inset: 6px; border: 1px solid var(--oro); pointer-events: none; opacity: .55;
}

/* Testata delle pagine interne */
.intestazione-pagina { background: var(--blu); color: #fff; border-bottom: 3px solid var(--oro); }
.intestazione-pagina .contenitore { padding-top: 3rem; padding-bottom: 2.6rem; }
.intestazione-pagina h1 { color: #fff; margin-bottom: .3em; }
.intestazione-pagina p { color: #dfe6ee; max-width: 44rem; font-size: 1.1rem; margin: 0; }
.intestazione-pagina .etichetta { color: var(--oro); }

/* ---------- Sezioni ---------- */
.sezione { padding: 4.5rem 0; }
.sezione.bianca { background: var(--bianco); border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); }
.introduzione { max-width: 44rem; }
.centrato .introduzione { margin: 0 auto; }

.griglia-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.5rem; }
.griglia-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem; }

.scheda {
  background: var(--bianco); border: 1px solid var(--linea); border-top: 3px solid var(--oro);
  padding: 1.8rem 1.6rem; border-radius: 0 0 var(--raggio) var(--raggio);
  display: flex; flex-direction: column;
}
.scheda p { color: var(--testo-tenue); }
.scheda .vai { margin-top: auto; font-weight: 600; text-decoration: none; }
.scheda .vai::after { content: " \2192"; }
.icona { width: 44px; height: 44px; color: var(--blu); margin-bottom: 1rem; }

.elenco-punti { list-style: none; padding: 0; margin: 0 0 1em; }
.elenco-punti li { padding-left: 1.6rem; position: relative; margin-bottom: .45rem; }
.elenco-punti li::before {
  content: ""; position: absolute; left: 0; top: .68em; width: .55rem; height: .55rem;
  background: var(--oro); transform: rotate(45deg);
}

.punti-forza { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-top: 2.5rem; }
.punto { border-left: 2px solid var(--oro); padding: .2rem 0 .2rem 1.1rem; }
.punto strong { display: block; font-family: var(--serif); color: var(--blu); font-size: 1.15rem; margin-bottom: .3rem; }
.punto span { color: var(--testo-tenue); font-size: .97rem; }

/* Servizi: blocchi con ancore */
.servizio { padding: 3.5rem 0; border-bottom: 1px solid var(--linea); scroll-margin-top: 90px; }
.servizio:last-of-type { border-bottom: 0; }
.servizio .griglia-2 { align-items: start; }

/* Fascia di invito al contatto */
.invito { background: var(--blu); color: #fff; padding: 3.5rem 0; border-top: 3px solid var(--oro); }
.invito h2 { color: #fff; }
.invito p { color: #dfe6ee; }
.invito .pulsante { background: var(--oro); border-color: var(--oro); color: var(--blu-scuro); }
.invito .pulsante:hover { background: #fff; border-color: #fff; color: var(--blu); }
.invito .pulsante.chiaro { background: transparent; border-color: #fff; color: #fff; }
.invito .pulsante.chiaro:hover { background: #fff; color: var(--blu); }

/* Profilo */
.profilo-titoli { list-style: none; padding: 0; margin: 1.5rem 0; }
.profilo-titoli li { padding: .8rem 0; border-bottom: 1px solid var(--linea); }
.profilo-titoli li:first-child { border-top: 1px solid var(--linea); }
.profilo-titoli strong { color: var(--blu); }

/* Ricordo di un collaboratore */
.ricordo {
  margin: 1.8rem 0 0; padding: 1.2rem 1.4rem;
  border-left: 3px solid var(--oro); background: var(--carta);
  font-family: var(--serif); font-style: italic; color: var(--testo);
}
.ricordo p { margin: 0; }
.ricordo strong { font-style: normal; color: var(--blu); }

/* ---------- Contatti ---------- */
.dati-contatto { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.dati-contatto li { display: flex; gap: .9rem; padding: .85rem 0; border-bottom: 1px solid var(--linea); }
.dati-contatto svg { width: 22px; height: 22px; flex: none; fill: var(--oro-testo); margin-top: .2rem; }
.dati-contatto .voce { display: block; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--testo-tenue); }

.mappa {
  margin-top: 1.5rem; border: 1px solid var(--linea); background: #eef1f4;
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 1.5rem; position: relative;
}
.mappa iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mappa p { font-size: .92rem; color: var(--testo-tenue); max-width: 24rem; margin: .8rem auto 0; }

form.modulo { background: var(--bianco); border: 1px solid var(--linea); border-top: 3px solid var(--oro); padding: 2rem 1.8rem; }
.campo { margin-bottom: 1.1rem; }
.campo label { display: block; font-weight: 600; margin-bottom: .35rem; color: var(--blu); font-size: .95rem; }
.campo input, .campo textarea, .campo select {
  width: 100%; font: inherit; color: var(--testo); padding: .7rem .8rem;
  border: 1px solid #b9c2cc; border-radius: var(--raggio); background: #fff;
}
.campo input:focus, .campo textarea:focus, .campo select:focus { border-color: var(--blu); outline: 2px solid var(--oro); outline-offset: 1px; }
.campo textarea { min-height: 9rem; resize: vertical; }
.campo .aiuto { font-size: .85rem; color: var(--testo-tenue); margin-top: .25rem; }
.campo-spunta { display: flex; gap: .7rem; align-items: flex-start; margin: 1.2rem 0; font-size: .95rem; }
.campo-spunta input { width: 1.2rem; height: 1.2rem; margin-top: .2rem; flex: none; accent-color: var(--blu); }
.obbligatorio { color: #a3261b; }
.nascosto { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.avviso { padding: 1rem 1.2rem; border-radius: var(--raggio); margin-bottom: 1.2rem; border-left: 4px solid; }
.avviso.errore { background: #fbecea; border-color: #a3261b; color: #5c140e; }
.avviso[hidden] { display: none; }

/* Testi legali */
.testo-legale { max-width: 48rem; }
.testo-legale h2 { font-size: 1.4rem; margin-top: 2.2rem; }
.testo-legale table { border-collapse: collapse; width: 100%; margin: 1rem 0 1.5rem; font-size: .95rem; }
.testo-legale th, .testo-legale td { border: 1px solid var(--linea); padding: .6rem .7rem; text-align: left; vertical-align: top; }
.testo-legale th { background: #f1ede4; color: var(--blu); }

/* ---------- Piè di pagina ---------- */
.piede { background: var(--blu-scuro); color: #c9d3de; font-size: .93rem; border-top: 3px solid var(--oro); }
.piede .contenitore { padding-top: 3rem; padding-bottom: 1.5rem; }
.piede-griglia { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; }
.piede h2 { color: #fff; font-size: 1.15rem; margin-bottom: .8rem; }
.piede a { color: #fff; }
.piede a:hover { color: var(--oro); }
.piede ul { list-style: none; padding: 0; margin: 0; }
.piede li { margin-bottom: .35rem; }
.piede .nome { font-family: var(--serif); color: #fff; font-size: 1.2rem; font-variant: small-caps; }
.piede-fondo {
  margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.15);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; font-size: .85rem; color: #a9b6c4;
}

/* ---------- Schermi piccoli ---------- */
@media (max-width: 900px) {
  .apertura .contenitore, .griglia-2 { grid-template-columns: 1fr; gap: 2rem; }
  .apertura .contenitore { padding-top: 2.5rem; padding-bottom: 3rem; }
  .apertura .cornice { order: -1; padding: 1.4rem; }
  .apertura .logo-grande { max-width: min(280px, 100%); }
  .griglia-3 { grid-template-columns: 1fr; }
  .punti-forza { grid-template-columns: 1fr 1fr; }
  .piede-griglia { grid-template-columns: 1fr; }
  .sezione { padding: 3rem 0; }
}
@media (max-width: 560px) {
  .testata { position: static; }
  .testata .contenitore { justify-content: center; }
  .menu ul { justify-content: center; gap: .2rem 1rem; }
  .menu a { font-size: .82rem; }
  .punti-forza { grid-template-columns: 1fr; }
  form.modulo { padding: 1.4rem 1.1rem; }
  .pulsante { width: 100%; justify-content: center; }
}

/* ---------- Movimento ---------- */
.testata { transition: box-shadow .3s ease; }
.testata.scorsa { box-shadow: 0 6px 18px rgba(3, 48, 87, .10); }

/* Comparsa allo scorrimento (attiva solo se il JS è caricato: classe js-mov) */
.js-mov .anima {
  opacity: 0; transform: translateY(26px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--ritardo, 0ms);
}
.js-mov .anima.visibile { opacity: 1; transform: none; }
.js-mov .filetto.anima { opacity: 1; transform: none; width: 0; transition: width .9s ease .15s; }
.js-mov .filetto.anima.visibile { width: 64px; }

/* Apertura della Home: entrata in sequenza */
@keyframes sali { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes appari { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes cornice { from { opacity: 0; inset: 22px; } to { opacity: .55; inset: 6px; } }
.apertura .etichetta, .apertura h1, .apertura .lead, .apertura .pulsanti { animation: sali .8s cubic-bezier(.2, .7, .2, 1) both; }
.apertura h1 { animation-delay: .12s; }
.apertura .lead { animation-delay: .26s; }
.apertura .pulsanti { animation-delay: .4s; }
.apertura .cornice { animation: appari 1s ease .2s both; }
.apertura .cornice::after { animation: cornice 1.2s ease .6s both; }
.intestazione-pagina .etichetta, .intestazione-pagina h1, .intestazione-pagina p { animation: sali .7s ease both; }
.intestazione-pagina h1 { animation-delay: .1s; }
.intestazione-pagina p { animation-delay: .2s; }

/* Riflesso dorato che attraversa il logo una volta */
.cornice { overflow: hidden; }
.cornice::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(198, 166, 106, .28), transparent);
  transform: skewX(-18deg); animation: riflesso 1.6s ease 1.2s both;
}
@keyframes riflesso { from { left: -60%; } to { left: 130%; } }

/* Schede e pulsanti che reagiscono al passaggio del mouse */
.scheda { transition: transform .3s ease, box-shadow .3s ease, border-top-color .3s ease; }
.scheda:hover { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(3, 48, 87, .12); border-top-color: var(--blu); }
.scheda .icona { transition: transform .4s ease; }
.scheda:hover .icona { transform: translateY(-3px) rotate(-4deg); }
.scheda .vai::after { display: inline-block; transition: transform .25s ease; }
.scheda:hover .vai::after { transform: translateX(5px); }
.pulsante { transition: background-color .25s ease, border-color .25s ease, color .25s ease, transform .2s ease, box-shadow .25s ease; }
.pulsante:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(3, 48, 87, .18); }
.punto { transition: border-left-color .3s ease, padding-left .3s ease; }
.punto:hover { border-left-color: var(--blu); padding-left: 1.4rem; }
.menu a { transition: border-color .25s ease, color .25s ease; }

/* Fascia dei numeri in Home */
.numeri { background: var(--bianco); border-bottom: 1px solid var(--linea); }
.numeri .contenitore { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding-top: 2.4rem; padding-bottom: 2.4rem; text-align: center; }
.numero strong { display: block; font-family: var(--serif); font-size: clamp(2rem, 4vw, 2.8rem); color: var(--blu); line-height: 1.1; }
.numero strong b { font-weight: inherit; }
.numero span { font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--oro-testo); }
@media (max-width: 700px) { .numeri .contenitore { grid-template-columns: 1fr 1fr; row-gap: 1.8rem; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js-mov .anima { opacity: 1 !important; transform: none !important; }
  .js-mov .filetto.anima { width: 64px !important; }
}

@media print {
  .testata, .piede, .invito, .menu, .pulsanti, form.modulo, .mappa { display: none !important; }
  body { background: #fff; }
}
