/* ==========================================================================
   VM Pitture — foglio di stile unico
   Palette e font ripresi dal sito originale (rosso #e53935, antracite, Roboto)
   ========================================================================== */

/* --- Font self-hosted: nessuna richiesta a Google, nessun problema GDPR --- */
@font-face {
  font-family: 'Roboto';
  src: url('../fonts/roboto-latin-var.woff2') format('woff2-variations');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------- reset --------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
img, picture, svg { display: block; max-width: 100%; }
/* Le foto stanno dentro un <picture> per poter offrire il WebP con il JPEG di
   riserva. display:contents fa sparire il contenitore dal calcolo del layout:
   l'immagine si comporta come se fosse rimasta figlia diretta del suo posto,
   e nessuna regola scritta prima va riadattata. */
picture { display: contents; }
/* Gli attributi width/height nell'HTML servono a riservare lo spazio prima
   che l'immagine arrivi, ma restano validi anche dopo: senza height:auto il
   CSS cambia solo la larghezza e la foto esce schiacciata. Chi ha bisogno di
   un'altezza propria la dichiara nella sua regola (.gallery__item img,
   .logo img, .marquee img...) e vince per specificità. */
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }

/* --------------------------------- token -------------------------------- */
:root {
  /* colori marchio */
  --red: #e53935;
  --red-dark: #c62828;
  --red-soft: #ffebee;
  --ink: #1a1a1a;
  --ink-2: #222222;
  --ink-3: #3a3a3a;

  /* neutri */
  --grey-1: #6b6b6b;
  --grey-2: #9a9a9a;
  --grey-3: #d8d8d8;
  --grey-4: #eeeeee;
  --grey-5: #f6f6f6;
  --white: #ffffff;

  /* semantica */
  --bg: var(--white);
  --bg-alt: var(--grey-5);
  --text: var(--ink-2);
  --text-muted: var(--grey-1);
  --border: var(--grey-3);

  /* misure */
  --wrap: 1200px;
  --wrap-narrow: 860px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 9vw, 7.5rem);
  --radius: 4px;
  --radius-lg: 10px;

  /* ombre */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .07);
  --shadow: 0 8px 30px rgba(0, 0, 0, .10);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, .18);

  /* movimento */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --header-h: 84px;
  --header-h-small: 66px;
}

/* --------------------------------- base --------------------------------- */
html { scroll-behavior: smooth; }

body {
  font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: clamp(1rem, .35vw + .94rem, 1.0625rem);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.nav-open { overflow: hidden; }

h1, h2, h3, h4, h5 {
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--ink);
  text-wrap: balance;
  /* nessuna parola lunga può sfondare il contenitore su schermi stretti */
  overflow-wrap: break-word;
}

h1 { font-size: clamp(2.05rem, 5.4vw, 4.25rem); }
h2 { font-size: clamp(1.7rem, 4vw, 3rem); }
h3 { font-size: clamp(1.2rem, 1.6vw, 1.5rem); }
h4 { font-size: 1.0625rem; letter-spacing: 0; }

p { text-wrap: pretty; }

::selection { background: var(--red); color: var(--white); }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}

/* salta al contenuto (accessibilità tastiera) */
.skip {
  position: absolute;
  left: 50%;
  top: -100px;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--ink);
  color: var(--white);
  padding: .8rem 1.4rem;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top .2s var(--ease);
}
.skip:focus { top: 0; }

/* ------------------------------- layout -------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: var(--wrap-narrow); }

.section { padding-block: var(--section-y); }
.section--alt { background: var(--bg-alt); }
.section--dark {
  background: var(--ink);
  color: #d6d6d6;
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--white); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

/* ----------------------------- intestazioni ---------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: '';
  width: 30px;
  height: 3px;
  background: var(--red);
  border-radius: 2px;
}
.section--dark .eyebrow { color: #ff7a75; }
.section--dark .eyebrow::before { background: #ff7a75; }

.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head--center { text-align: center; }
.section-head--center .eyebrow::before { display: none; }
.section-head p {
  color: var(--text-muted);
  font-size: 1.0625rem;
  max-width: 58ch;
  margin-top: 1rem;
}
.section-head--center p { margin-inline: auto; }
.section--dark .section-head p { color: #a8a8a8; }

/* pennellata che si "dipinge" sotto il titolo — richiamo al mestiere */
.brush {
  position: relative;
  display: inline;
  background-image: linear-gradient(var(--red), var(--red));
  background-repeat: no-repeat;
  background-position: 0 88%;
  background-size: 0% .28em;
  transition: background-size 1s var(--ease-out) .25s;
  padding-bottom: .06em;
}
.is-visible .brush { background-size: 100% .28em; }

/* ------------------------------- pulsanti ------------------------------ */
.btn {
  --btn-bg: var(--red);
  --btn-fg: var(--white);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: 1rem 1.9rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .02em;
  border: 2px solid var(--btn-bg);
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), color .3s var(--ease);
}
/* riempimento "a vernice" che sale dal basso */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform .45s var(--ease-out);
}
.btn:hover, .btn:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--ink);
}
.btn:hover::after, .btn:focus-visible::after { transform: translateY(0); }
.btn:active { transform: translateY(-1px); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--ink);
}
.btn--ghost::after { background: var(--ink); }
.btn--ghost:hover, .btn--ghost:focus-visible { color: var(--white); }

.btn--light {
  --btn-bg: transparent;
  --btn-fg: var(--white);
  border-color: rgba(255, 255, 255, .55);
}
.btn--light::after { background: var(--white); }
.btn--light:hover, .btn--light:focus-visible {
  color: var(--ink);
  border-color: var(--white);
}

.btn--wa { --btn-bg: #25d366; --btn-fg: #fff; border-color: #25d366; }
.btn--wa::after { background: #128c7e; }
.btn--wa:hover { border-color: #128c7e; }

.btn--lg { padding: 1.15rem 2.4rem; font-size: 1rem; }
.btn svg { width: 20px; height: 20px; flex: none; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  margin-top: 2rem;
}
/* Due pulsanti affiancati con testi di lunghezza diversa: da soli ognuno
   prende la larghezza del proprio testo e la coppia sembra sbilenca.
   Qui prendono entrambi la stessa larghezza fissa (--btn-w, tarata sul testo
   più lungo della riga) e non crescono: se non ci stanno affiancati vanno a
   capo restando comunque uguali fra loro, invece di stringersi e mandare le
   etichette su due righe. */
.btn-row--even { --btn-w: 17rem; }
.btn-row--even .btn { flex: 0 1 var(--btn-w); }
.hero .btn-row--even { --btn-w: 18.75rem; }
/* il margine automatico serve alle righe --even, che non sono larghe quanto
   il contenitore: su quelle in flex basterebbe justify-content */
.btn-row--center { justify-content: center; margin-inline: auto; }

/* link testuale con freccia animata */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  color: var(--red);
  border-bottom: 2px solid transparent;
  transition: border-color .25s var(--ease), gap .25s var(--ease);
}
.link-arrow:hover { border-color: var(--red); gap: .85rem; }
.link-arrow svg { width: 18px; height: 18px; }

/* -------------------------------- header ------------------------------- */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: height .35s var(--ease), background .35s var(--ease),
              border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.header.is-stuck {
  height: var(--header-h-small);
  background: rgba(255, 255, 255, .96);
  border-bottom-color: var(--grey-4);
  box-shadow: var(--shadow-sm);
}

/* barra di avanzamento lettura */
.header__progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 3px;
  width: 100%;
  transform: scaleX(var(--progress, 0));
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--red), #ff7a75);
  transition: transform .1s linear;
}

.header__inner {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo { display: flex; align-items: center; flex: none; }
.logo img {
  height: 46px;
  width: auto;
  transition: height .35s var(--ease);
}
.is-stuck .logo img { height: 38px; }

/* navigazione desktop */
.nav { display: flex; align-items: center; gap: clamp(.5rem, 2vw, 1.75rem); }
.nav__list { display: flex; align-items: center; gap: clamp(.5rem, 1.8vw, 1.6rem); }

.nav__link {
  position: relative;
  display: block;
  padding: .5rem .2rem;
  font-weight: 500;
  font-size: .95rem;
  color: var(--ink-3);
  transition: color .25s var(--ease);
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: .15rem;
  width: 100%;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .3s var(--ease);
}
.nav__link:hover { color: var(--ink); }
.nav__link:hover::after { transform: scaleX(1); }
.nav__link[aria-current='page'] { color: var(--ink); font-weight: 700; }
.nav__link[aria-current='page']::after { transform: scaleX(1); }

/* telefono nell'header */
.header__tel {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  font-size: .95rem;
  white-space: nowrap;
  transition: color .25s var(--ease);
}
.header__tel:hover { color: var(--red); }
.header__tel svg { width: 18px; height: 18px; color: var(--red); flex: none; }

/* hamburger */
/* Colonna flex, non griglia: con `display: grid` le tre righe implicite si
   allungavano a riempire i 46px del pulsante, quindi le barre stavano a ~17px
   l'una dall'altra invece che a 8px. Ruotandole la X non si chiudeva e a menu
   aperto compariva una specie di ">". In colonna la distanza e' quella vera
   dei margini (2px di barra + 6px), che e' l'offset usato dalle rotazioni. */
.burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.burger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .35s var(--ease), opacity .2s var(--ease);
}
.burger span + span { margin-top: 6px; }
.burger[aria-expanded='true'] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded='true'] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------------------------------- hero -------------------------------- */
.hero {
  position: relative;
  min-height: min(92vh, 860px);
  display: grid;
  align-items: center;
  padding-top: var(--header-h);
  overflow: hidden;
  background: var(--ink);
  isolation: isolate;
}

.hero__bg { position: absolute; inset: 0; z-index: -2; }
.hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.6s var(--ease);
}
.hero__slide.is-active { opacity: 1; }
.hero__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Ken Burns: zoom lentissimo mentre la slide è visibile */
.hero__slide.is-active img { animation: kenburns 12s var(--ease) forwards; }
@keyframes kenburns {
  from { transform: scale(1.02); }
  to   { transform: scale(1.14); }
}

/* velo scuro per leggibilità del testo */
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(15, 15, 15, .86) 0%, rgba(20, 20, 20, .62) 45%, rgba(25, 25, 25, .22) 100%),
    linear-gradient(to top, rgba(0, 0, 0, .5), transparent 45%);
}

.hero__inner { max-width: 800px; padding-block: clamp(3rem, 8vw, 6rem); }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem 1.1rem .5rem .65rem;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 100px;
  color: var(--white);
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .04em;
  backdrop-filter: blur(6px);
  margin-bottom: 1.75rem;
}
.hero__badge b { font-weight: 900; }
.hero__badge-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red);
  display: grid;
  place-items: center;
  flex: none;
}
.hero__badge-dot svg { width: 15px; height: 15px; }

.hero h1 { color: var(--white); }
.hero h1 em {
  font-style: normal;
  color: var(--red);
  position: relative;
}

.hero__lead {
  margin-top: 1.5rem;
  font-size: clamp(1.0625rem, 1.3vw, 1.3rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, .82);
  max-width: 56ch;
  font-weight: 300;
}

/* pillole servizi sotto l'hero */
.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 2.25rem;
}
.hero__tag {
  padding: .45rem 1rem;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 100px;
  font-size: .85rem;
  color: rgba(255, 255, 255, .9);
  transition: background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.hero__tag:hover {
  background: var(--red);
  border-color: var(--red);
  transform: translateY(-2px);
}

/* indicatori slide */
.hero__dots {
  position: absolute;
  left: var(--gutter);
  bottom: 2.5rem;
  display: flex;
  gap: .5rem;
  z-index: 3;
}
/* Il pulsante è alto 24px (il minimo WCAG per un bersaglio da dito), ma il
   trattino che si vede resta di 4px: lo disegna ::after, centrato. Allargare
   con un pseudo-elemento in negativo non basterebbe — l'area sensibile
   crescerebbe davvero, ma gli strumenti di verifica misurano il riquadro
   dell'elemento e continuerebbero a segnalarlo. */
.hero__dot {
  width: 34px;
  height: 24px;
  border: 0;
  padding: 0;
  background: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: width .3s var(--ease);
}
.hero__dot::after {
  content: '';
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .3);
  transition: background .3s var(--ease);
}
.hero__dot.is-active { width: 52px; }
.hero__dot.is-active::after { background: var(--red); }

/* freccia "scorri" */
.hero__scroll {
  position: absolute;
  right: var(--gutter);
  bottom: 2.25rem;
  z-index: 3;
  display: grid;
  place-items: center;
  gap: .5rem;
  color: rgba(255, 255, 255, .6);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transition: color .25s var(--ease);
}
.hero__scroll:hover { color: var(--white); }
.hero__scroll::after {
  content: '';
  width: 1px;
  height: 46px;
  background: linear-gradient(to bottom, var(--red), transparent);
  animation: scrollLine 2s var(--ease) infinite;
}
@keyframes scrollLine {
  0%   { transform: scaleY(0); transform-origin: 0 0; }
  50%  { transform: scaleY(1); transform-origin: 0 0; }
  51%  { transform: scaleY(1); transform-origin: 0 100%; }
  100% { transform: scaleY(0); transform-origin: 0 100%; }
}

/* hero interno (pagine secondarie) */
.pagehero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(3rem, 7vw, 5.5rem));
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
  background: var(--ink);
  overflow: hidden;
  isolation: isolate;
}
.pagehero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.pagehero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  animation: kenburns 22s var(--ease) forwards;
}
.pagehero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(15, 15, 15, .92), rgba(25, 25, 25, .62));
}
.pagehero h1 { color: var(--white); }
.pagehero p {
  margin-top: 1.15rem;
  color: rgba(255, 255, 255, .8);
  font-size: 1.125rem;
  font-weight: 300;
  max-width: 58ch;
}

/* briciole di pane */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: rgba(255, 255, 255, .55);
  margin-bottom: 1.25rem;
}
.crumbs a { transition: color .2s var(--ease); }
.crumbs a:hover { color: var(--white); }
.crumbs li { display: flex; align-items: center; gap: .5rem; }
.crumbs li + li::before { content: '/'; color: rgba(255, 255, 255, .3); }
.crumbs [aria-current] { color: var(--red); }

/* ------------------------------- vantaggi ------------------------------- */
.why {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.why__item { position: relative; padding-top: 2rem; }
.why__item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 46px;
  height: 4px;
  background: var(--red);
  border-radius: 2px;
  transition: width .6s var(--ease-out);
}
.why__item.is-visible::before { width: 88px; }
.why__num {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--grey-2);
  display: block;
  margin-bottom: .6rem;
}
.why__item h3 { margin-bottom: .65rem; }
.why__item p { color: var(--text-muted); font-size: .98rem; }

/* -------------------------------- servizi ------------------------------- */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(1.25rem, 2.5vw, 1.75rem);
}

.service {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  background: var(--white);
  border: 1px solid var(--grey-4);
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
/* la "vernice" che sale al passaggio del mouse */
.service::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(160deg, var(--ink), #2c2c2c);
  transform: translateY(100%);
  transition: transform .5s var(--ease-out);
}
.service:hover, .service:focus-within {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.service:hover::before, .service:focus-within::before { transform: translateY(0); }

.service__icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--red-soft);
  color: var(--red);
  flex: none;
  transition: background .4s var(--ease), color .4s var(--ease), transform .5s var(--ease-out);
}
.service__icon svg { width: 28px; height: 28px; }
.service:hover .service__icon {
  background: var(--red);
  color: var(--white);
  transform: rotate(-6deg) scale(1.06);
}

.service h3 { transition: color .4s var(--ease); }
.service p {
  color: var(--text-muted);
  font-size: .97rem;
  transition: color .4s var(--ease);
}
.service:hover h3 { color: var(--white); }
.service:hover p { color: #b4b4b4; }

.service__more {
  margin-top: auto;
  padding-top: .5rem;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--red);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.service:hover .service__more { opacity: 1; transform: translateY(0); }
/* Dove non esiste il passaggio del mouse la scritta non comparirebbe mai, ma
   il suo spazio resta occupato: le schede si ritrovavano con una fascia vuota
   in fondo. Su quei dispositivi si mostra e basta. */
@media (hover: none) {
  .service__more { opacity: 1; transform: none; }
}

/* -------------------------------- numeri -------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: clamp(1.5rem, 3vw, 2rem);
  text-align: center;
}
.stat { padding: 1rem .5rem; }
.stat__num {
  display: block;
  font-size: clamp(2.75rem, 6vw, 4.25rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.stat__num span { color: var(--red); }
.stat__label {
  display: block;
  margin-top: .75rem;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #9a9a9a;
}

/* ------------------------------ testo+foto ------------------------------ */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.split--reverse .split__media { order: 2; }

.split__media { position: relative; }
.split__media img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
/* cornice sfalsata dietro la foto */
.split__media::before {
  content: '';
  position: absolute;
  inset: 18px -18px -18px 18px;
  border: 3px solid var(--red);
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0;
  transform: translate(-14px, -14px);
  transition: opacity .7s var(--ease-out) .2s, transform .7s var(--ease-out) .2s;
}
.split__media.is-visible::before { opacity: 1; transform: translate(0, 0); }

/* due foto sovrapposte */
.stack { position: relative; padding-bottom: 22%; padding-right: 18%; }
.stack .stack__back {
  width: 82%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.stack .stack__front {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 55%;
  border: 8px solid var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* elenco con spunta */
.ticks { display: grid; gap: .85rem; margin-top: 1.75rem; }
.ticks li {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  font-weight: 500;
}
.ticks svg {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: .2rem;
  color: var(--red);
}
.ticks b { display: block; }
.ticks span {
  display: block;
  font-weight: 400;
  font-size: .93rem;
  color: var(--text-muted);
}

/* -------------------------------- galleria ------------------------------ */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}
.filter {
  padding: .6rem 1.35rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease),
              border-color .25s var(--ease), transform .25s var(--ease);
}
.filter:hover { border-color: var(--ink); transform: translateY(-2px); }
.filter[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(.75rem, 1.5vw, 1.15rem);
}
/* alcune celle più alte: griglia più viva */
.gallery__item--tall { grid-row: span 2; }

.gallery__item {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--grey-4);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
  transition: opacity .4s var(--ease), transform .4s var(--ease), box-shadow .4s var(--ease);
}
.gallery__item--tall { aspect-ratio: 4 / 5; }
.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s var(--ease-out), filter .5s var(--ease);
}
/* Ad aprire la foto è un vero <button> steso sopra alla cella. Prima il ruolo
   di pulsante era appiccicato alla <figure>, che l'HTML non consente — e con
   la tastiera non si apriva niente, perché il JS ascolta solo il clic. */
.gallery__zoom {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.gallery__item:hover img { transform: scale(1.07); }
.gallery__item:hover { box-shadow: var(--shadow-lg); }

.gallery__item figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 2.5rem 1.15rem 1.1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, .82), transparent);
  color: var(--white);
  font-size: .92rem;
  font-weight: 500;
  text-align: left;
  transform: translateY(12px);
  opacity: 0;
  transition: transform .4s var(--ease), opacity .4s var(--ease);
}
.gallery__item:hover figcaption,
.gallery__item:focus-within figcaption { transform: translateY(0); opacity: 1; }

.gallery__item::after {
  content: '';
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--red) center / 17px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E");
  opacity: 0;
  transform: scale(.5);
  transition: opacity .35s var(--ease), transform .35s var(--ease-out);
}
.gallery__item:hover::after,
.gallery__item:focus-within::after { opacity: 1; transform: scale(1); }

.gallery__item.is-hidden {
  display: none;
}

/* -------------------------------- lightbox ------------------------------ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(10, 10, 10, .95);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s var(--ease), visibility .35s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox__img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  border-radius: var(--radius);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
  transform: scale(.94);
  transition: transform .4s var(--ease-out);
}
.lightbox.is-open .lightbox__img { transform: scale(1); }

.lightbox__cap {
  margin-top: 1.15rem;
  text-align: center;
  color: rgba(255, 255, 255, .75);
  font-size: .95rem;
}
.lightbox__cap b { color: var(--white); display: block; font-size: 1.05rem; margin-bottom: .2rem; }

.lightbox__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  color: var(--white);
  cursor: pointer;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.lightbox__btn:hover { background: var(--red); border-color: var(--red); }
.lightbox__btn--prev { left: clamp(.5rem, 2vw, 2rem); }
.lightbox__btn--next { right: clamp(.5rem, 2vw, 2rem); }
.lightbox__btn--prev:hover { transform: translateY(-50%) translateX(-3px); }
.lightbox__btn--next:hover { transform: translateY(-50%) translateX(3px); }
.lightbox__btn svg { width: 24px; height: 24px; }

.lightbox__close {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  color: var(--white);
  cursor: pointer;
  transition: background .25s var(--ease), transform .3s var(--ease);
}
.lightbox__close:hover { background: var(--red); border-color: var(--red); transform: rotate(90deg); }
.lightbox__close svg { width: 22px; height: 22px; }

.lightbox__count {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  left: clamp(1rem, 3vw, 2rem);
  color: rgba(255, 255, 255, .7);
  font-size: .9rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ----------------------------- testimonianze ---------------------------- */
.quotes { position: relative; }

/* Tutte le citazioni nella stessa cella di griglia: la traccia prende
   automaticamente l'altezza della più lunga, senza min-height a occhio
   (che faceva sbordare le citazioni lunghe sopra gli indicatori). */
.quotes__track { display: grid; }

.quote {
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity .6s var(--ease), transform .6s var(--ease-out), visibility .6s;
}
.quote.is-active { opacity: 1; visibility: visible; transform: translateY(0); }

.quote blockquote {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 300;
  line-height: 1.6;
  max-width: 62ch;
  color: var(--ink);
}
.section--dark .quote blockquote { color: var(--white); }

.quote__mark {
  font-size: 4.5rem;
  line-height: .8;
  font-weight: 900;
  color: var(--red);
  margin-bottom: .5rem;
  display: block;
}
.quote__who {
  margin-top: 1.75rem;
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.section--dark .quote__who { color: var(--grey-2); }
.quote__stars { display: flex; gap: .2rem; justify-content: center; margin-top: 1rem; color: #ffb300; }
.quote__stars svg { width: 18px; height: 18px; }

/* gap .9rem e non .55: serve a far stare le aree sensibili da 24px una
   accanto all'altra senza sovrapporsi (vedi .dot::before) */
.dots { display: flex; gap: .9rem; justify-content: center; margin-top: 2.25rem; }
.dot {
  position: relative;
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--grey-3);
  cursor: pointer;
  transition: background .3s var(--ease), transform .3s var(--ease), width .3s var(--ease);
}
/* come per .hero__dot: area sensibile a 24×24, aspetto invariato */
.dot::before {
  content: '';
  position: absolute;
  inset: -7px;
}
.section--dark .dot { background: rgba(255, 255, 255, .25); }
.dot.is-active { background: var(--red); width: 30px; border-radius: 5px; }

/* -------------------------------- partner ------------------------------- */
.marquee {
  position: relative;
  overflow: hidden;
  /* dissolvenza ai bordi */
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  width: max-content;
  gap: clamp(2.5rem, 6vw, 5rem);
  animation: marquee 32s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee img {
  height: clamp(38px, 5vw, 54px);
  width: auto;
  flex: none;
  /* .75 e non .5: alcuni loghi partner sono chiari e a .5 sparivano sul bianco */
  opacity: .75;
  filter: grayscale(1) contrast(1.15);
  transition: opacity .35s var(--ease), filter .35s var(--ease), transform .35s var(--ease);
}
.marquee img:hover { opacity: 1; filter: grayscale(0); transform: scale(1.08); }

/* ------------------------------- richiamo -------------------------------- */
.cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--red);
  color: var(--white);
}
/* macchie di colore decorative */
.cta::before,
.cta::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  z-index: -1;
  background: rgba(255, 255, 255, .07);
}
.cta::before { width: 420px; height: 420px; top: -180px; right: -100px; }
.cta::after  { width: 300px; height: 300px; bottom: -160px; left: -60px; }

.cta h2 { color: var(--white); }
.cta p {
  margin-top: 1rem;
  font-size: 1.125rem;
  color: rgba(255, 255, 255, .9);
  font-weight: 300;
  max-width: 55ch;
}
.cta .btn-row { justify-content: flex-start; }
.cta .btn--light::after { background: var(--ink); }
.cta .btn--light:hover { color: var(--white); border-color: var(--ink); }
.cta .btn--solid {
  --btn-bg: var(--white);
  --btn-fg: var(--red);
  border-color: var(--white);
}
.cta .btn--solid::after { background: var(--ink); }
.cta .btn--solid:hover { color: var(--white); border-color: var(--ink); }

/* -------------------------------- contatti ------------------------------ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(1.25rem, 2.5vw, 1.75rem);
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: clamp(1.75rem, 3vw, 2.25rem);
  background: var(--white);
  border: 1px solid var(--grey-4);
  border-radius: var(--radius-lg);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.contact-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--grey-3);
}
.contact-card__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--red-soft);
  color: var(--red);
  margin-bottom: .75rem;
  transition: background .35s var(--ease), color .35s var(--ease);
}
.contact-card:hover .contact-card__icon { background: var(--red); color: var(--white); }
.contact-card__icon svg { width: 26px; height: 26px; }
.contact-card h3 { font-size: 1rem; letter-spacing: 0; }
.contact-card__value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
  transition: color .25s var(--ease);
}
a.contact-card__value:hover { color: var(--red); }
.contact-card small { color: var(--text-muted); font-size: .88rem; }

/* mappa statica (mosaico di tile OpenStreetMap ospitate in locale) */
.staticmap {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(260px, 34vw, 440px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  isolation: isolate;
}
.staticmap__svg {
  width: 100%;
  height: 100%;
  display: block;
  /* smorzata a riposo, a colori pieni al passaggio del mouse */
  filter: grayscale(.4) contrast(1.05);
  transition: filter .5s var(--ease), transform .6s var(--ease);
}
.staticmap:hover .staticmap__svg,
.staticmap:focus-visible .staticmap__svg {
  filter: grayscale(0) contrast(1);
  transform: scale(1.02);
}

.staticmap__badge {
  position: absolute;
  right: 1rem;
  top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  background: var(--white);
  color: var(--ink);
  font-size: .85rem;
  font-weight: 700;
  border-radius: 100px;
  box-shadow: var(--shadow-sm);
  transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.staticmap__badge::after { content: '↗'; }
.staticmap:hover .staticmap__badge {
  background: var(--red);
  color: var(--white);
  transform: translateY(-2px);
}

/* attribuzione: obbligatoria per la licenza dei dati OpenStreetMap */
.staticmap__attrib {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: .25rem .6rem;
  background: rgba(255, 255, 255, .82);
  color: #444;
  font-size: .7rem;
  border-top-left-radius: var(--radius);
}

/* orari */
.hours { display: grid; gap: .1rem; margin-top: 1rem; }
.hours li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--grey-4);
  font-size: .96rem;
}
.hours li:last-child { border-bottom: 0; }
.hours b { font-weight: 500; }
.hours span { color: var(--text-muted); }
.hours .is-closed { color: var(--red); }

/* ------------------------------- in breve ------------------------------- */
.facts { display: grid; gap: 0; }
.facts__row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 1rem 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--grey-3);
}
.facts__row:first-child { border-top: 1px solid var(--grey-3); }
.facts dt {
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
  padding-top: .15rem;
}
.facts dd { margin: 0; color: var(--text); }
.facts dd a {
  font-weight: 700;
  color: var(--ink);
  border-bottom: 2px solid var(--red);
  transition: color .2s var(--ease);
}
.facts dd a:hover { color: var(--red); }

@media (max-width: 620px) {
  .facts__row { grid-template-columns: 1fr; gap: .35rem; }
}

/* --------------------------------- FAQ ---------------------------------- */
.faq { display: grid; gap: .75rem; }
.faq details {
  background: var(--white);
  border: 1px solid var(--grey-4);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.faq details[open] { border-color: var(--grey-3); box-shadow: var(--shadow-sm); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  transition: color .25s var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--red); }
.faq summary::after {
  content: '';
  width: 24px;
  height: 24px;
  flex: none;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e53935' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  transition: transform .35s var(--ease);
}
.faq details[open] summary::after { transform: rotate(135deg); }
.faq__body {
  padding: 0 clamp(1.25rem, 2.5vw, 1.75rem) 1.4rem;
  color: var(--text-muted);
}

/* -------------------------------- footer -------------------------------- */
.footer {
  position: relative;
  background: var(--ink);
  color: #a8a8a8;
  padding-top: clamp(3.5rem, 7vw, 5.5rem);
  font-size: .95rem;
  overflow: hidden;
  isolation: isolate;
}
/* rulli colorati sul lato destro: decorativi, sfumano nel fondo scuro */
.footer::before {
  content: '';
  position: absolute;
  inset: 0 0 0 auto;
  width: min(760px, 68%);
  z-index: -1;
  background: url('../img/brand/rulli-colorati-sfondo.jpg') right center / cover no-repeat;
  opacity: .55;
  mask-image: linear-gradient(90deg, transparent, #000 55%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 55%);
  pointer-events: none;
}
@media (max-width: 880px) {
  /* su schermi piccoli i rulli finirebbero dietro al testo */
  .footer::before { opacity: .22; }
}
.footer h3 {
  color: var(--white);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 1.35rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
.footer__logo img { height: 46px; width: auto; margin-bottom: 1.25rem; filter: brightness(0) invert(1); }
.footer__about { max-width: 34ch; }
.footer__links { display: grid; gap: .7rem; }
.footer__links a {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: color .25s var(--ease), gap .25s var(--ease);
}
.footer__links a::before {
  content: '';
  width: 0;
  height: 1px;
  background: var(--red);
  transition: width .25s var(--ease);
}
.footer__links a:hover { color: var(--white); }
.footer__links a:hover::before { width: 14px; }

.footer__contact { display: grid; gap: 1rem; }
.footer__contact li { display: flex; gap: .8rem; align-items: flex-start; }
.footer__contact svg { width: 19px; height: 19px; color: var(--red); flex: none; margin-top: .25rem; }
.footer__contact a:hover { color: var(--white); }

.socials { display: flex; gap: .6rem; margin-top: 1.5rem; }
.socials a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  color: #c4c4c4;
  transition: background .28s var(--ease), color .28s var(--ease),
              border-color .28s var(--ease), transform .28s var(--ease);
}
.socials a:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
  transform: translateY(-3px);
}
.socials svg { width: 19px; height: 19px; }

/* Tre colonne con le laterali uguali: è l'unico modo perché la firma al
   centro ci stia davvero al centro della barra. Con flex e space-between lo
   spazio libero si divide in due parti uguali, e con il copyright più lungo
   dei link legali la firma finisce spostata a destra. */
.footer__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  padding-block: 1.65rem;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: .875rem;
  color: #8a8a8a;
}
.footer__bar nav { display: flex; flex-wrap: wrap; gap: 1.25rem; justify-self: end; }
.footer__bar a:hover { color: var(--white); }

/* firma dello studio che ha fatto il sito */
.footer__by {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  transition: color .25s var(--ease);
}
.footer__by img {
  /* Nessun filtro: il logo è a due colori (crema e verde) e sul fondo
     antracite si legge da solo — portarlo a bianco lo appiattiva e tirava
     fuori l'ombra "cotta" nel file come un alone. L'altezza sta appena sotto
     ai 60px naturali del PNG: rimpicciolire non sgrana, ingrandire sì. */
  height: 50px;
  width: auto;
}

/* ------------------- pulsanti fluttuanti in basso a destra --------------- */
/* Il contenitore li tiene in fila e allineati: prima erano due elementi fissi
   posizionati a mano, e la larghezza del pulsante WhatsApp cambia col testo
   (su telefono resta solo l'icona), quindi non c'era un offset buono per
   entrambi i casi. */
.floaters {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: .65rem;
}

.fab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  height: 58px;
  padding-inline: 18px;
  background: #25d366;
  color: var(--white);
  font-weight: 700;
  font-size: .95rem;
  border-radius: 100px;
  box-shadow: 0 10px 30px rgba(37, 211, 102, .4);
  opacity: 0;
  transform: translateY(24px) scale(.9);
  pointer-events: none;
  transition: opacity .45s var(--ease), transform .45s var(--ease-out), box-shadow .3s var(--ease);
}
.fab.is-in { opacity: 1; transform: none; pointer-events: auto; }
.fab:hover { box-shadow: 0 14px 38px rgba(37, 211, 102, .55); }
.fab svg { width: 28px; height: 28px; flex: none; }
.fab__text { white-space: nowrap; }

/* alone pulsante, discreto */
.fab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid #25d366;
  animation: halo 2.8s var(--ease) infinite;
}
@keyframes halo {
  0%   { transform: scale(1); opacity: .7; }
  70%  { transform: scale(1.22); opacity: 0; }
  100% { transform: scale(1.22); opacity: 0; }
}

/* Stessa forma, stessa altezza e stessa entrata del pulsante WhatsApp: cambia
   solo il colore. Rosso di marchio, come il "back to top" del vecchio sito —
   il verde è di WhatsApp e usarlo per un'altra azione direbbe la cosa
   sbagliata. */
.to-top {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: var(--white);
  border: 0;
  border-radius: 100px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(229, 57, 53, .4);
  opacity: 0;
  transform: translateY(24px) scale(.9);
  pointer-events: none;
  transition: opacity .45s var(--ease), transform .45s var(--ease-out), box-shadow .3s var(--ease);
}
.to-top.is-in { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { box-shadow: 0 14px 38px rgba(229, 57, 53, .55); }
.to-top svg { width: 26px; height: 26px; }

/* ----------------------- rivelazione allo scroll ------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease), transform .8s var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }

.reveal--left  { transform: translateX(-32px); }
.reveal--right { transform: translateX(32px); }
.reveal--zoom  { transform: scale(.94); }

/* ritardo a cascata per gruppi di card */
.stagger > * {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease), transform .7s var(--ease-out);
}
.stagger.is-visible > * { opacity: 1; transform: none; }
.stagger.is-visible > *:nth-child(1) { transition-delay: 0s; }
.stagger.is-visible > *:nth-child(2) { transition-delay: .09s; }
.stagger.is-visible > *:nth-child(3) { transition-delay: .18s; }
.stagger.is-visible > *:nth-child(4) { transition-delay: .27s; }
.stagger.is-visible > *:nth-child(5) { transition-delay: .36s; }
.stagger.is-visible > *:nth-child(6) { transition-delay: .45s; }
.stagger.is-visible > *:nth-child(7) { transition-delay: .54s; }
.stagger.is-visible > *:nth-child(8) { transition-delay: .63s; }

/* animazione d'ingresso dell'hero, senza JS */
.hero__inner > * { animation: heroIn .95s var(--ease-out) backwards; }
.hero__inner > *:nth-child(1) { animation-delay: .15s; }
.hero__inner > *:nth-child(2) { animation-delay: .28s; }
.hero__inner > *:nth-child(3) { animation-delay: .41s; }
.hero__inner > *:nth-child(4) { animation-delay: .54s; }
.hero__inner > *:nth-child(5) { animation-delay: .67s; }
@keyframes heroIn {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------ responsive ------------------------------ */
@media (max-width: 1040px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  /* le tre colonne non ci stanno più senza mandare a capo il copyright:
     una sotto l'altra, tutte centrate */
  .footer__bar { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer__bar nav { justify-self: center; }
}

@media (max-width: 880px) {
  :root { --header-h: 70px; --header-h-small: 62px; }

  .burger { display: flex; }
  .header__tel span { display: none; }
  /* senza il numero scritto restano tre elementi distribuiti a distanza
     uguale, e l'icona del telefono finiva sospesa a metà testata */
  .header__inner { gap: 1.25rem; }
  .header__tel { margin-left: auto; }

  /* A schermo largo il velo sulla foto scurisce da sinistra, dove sta il
     testo. Qui il testo occupa tutta la larghezza, quindi il velo va
     dall'alto in basso: altrimenti le righe finali cadono sulla parte
     chiara della foto e si leggono male. */
  .hero__bg::after {
    background: linear-gradient(180deg,
      rgba(15, 15, 15, .74) 0%,
      rgba(18, 18, 18, .66) 55%,
      rgba(0, 0, 0, .74) 100%);
  }

  /* Menu a tutto schermo.
     Il pannello NON puo' usare `inset: 0`: l'header ha un backdrop-filter, e
     un elemento filtrato diventa il blocco contenitore dei discendenti
     `position: fixed`. Con `inset: 0` il menu si ritagliava dentro la barra
     alta 70px — lo sfondo bianco copriva solo quella striscia e le voci
     finivano fuori, sopra la pagina, sembrando senza fondo.
     Misure esplicite: l'header parte da (0,0) ed e' largo quanto il viewport,
     quindi top/left 0 del suo blocco contenitore coincidono con lo schermo. */
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 1;
    flex-direction: column;
    justify-content: center;
    gap: 2.5rem;
    padding: calc(var(--header-h) + 1.5rem) var(--gutter) calc(var(--gutter) + 1.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s var(--ease), visibility .4s;
  }
  .nav.is-open { opacity: 1; visibility: visible; }

  /* Il pannello e' posizionato, quindi si dipinge sopra logo, telefono e
     hamburger, che sono statici: senza questo la X per chiudere finiva
     coperta dal velo bianco e non era piu' cliccabile. */
  .logo,
  .header__tel,
  .burger { position: relative; z-index: 2; }

  .nav__list { flex-direction: column; gap: .5rem; text-align: center; }
  .nav__link { font-size: 1.6rem; font-weight: 700; padding: .6rem 1rem; }
  .nav__link::after { left: 50%; width: 40%; transform: translateX(-50%) scaleX(0); }
  .nav__link:hover::after,
  .nav__link[aria-current='page']::after { transform: translateX(-50%) scaleX(1); }

  /* voci del menu che entrano una dopo l'altra */
  .nav.is-open .nav__list li { animation: navIn .5s var(--ease-out) backwards; }
  .nav.is-open .nav__list li:nth-child(1) { animation-delay: .08s; }
  .nav.is-open .nav__list li:nth-child(2) { animation-delay: .14s; }
  .nav.is-open .nav__list li:nth-child(3) { animation-delay: .20s; }
  .nav.is-open .nav__list li:nth-child(4) { animation-delay: .26s; }
  .nav.is-open .nav__list li:nth-child(5) { animation-delay: .32s; }
  @keyframes navIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
  }

  .split--reverse .split__media { order: 0; }
  .split__media::before { inset: 12px -12px -12px 12px; }
  /* Sulla coppia di foto sovrapposte la cornice sfalsata, che a schermo largo
     incornicia il gruppo, qui restava a delimitare l'area vuota sotto la foto
     grande: sembrava un rettangolo rosso capitato lì per sbaglio. */
  .stack::before { display: none; }
  .hero__scroll { display: none; }

  /* Le rivelazioni laterali partono spostate di 32px in orizzontale: su
     schermi stretti quello spostamento sporge dal viewport e viene tagliato
     (o fa comparire lo scroll orizzontale). Qui entrano solo dal basso. */
  .reveal--left, .reveal--right { transform: translateY(26px); }

  /* l'interruzione di riga forzata nel titolo non sta in larghezza:
     meglio lasciar andare il testo a capo da solo */
  .hero h1 br { display: none; }
}

@media (max-width: 620px) {
  /* Pagine e Servizi sono liste corte: ci stanno affiancate anche sul
     telefono, una a sinistra e una a destra. Impilate allungavano il footer
     di due schermate senza aggiungere niente. Il blocco del marchio e quello
     dei contatti restano a piena larghezza. */
  .footer__grid {
    grid-template-columns: 1fr auto;
    gap: 2.5rem clamp(1rem, 6vw, 2.5rem);
  }
  .footer__grid > :first-child,
  .footer__grid > :last-child { grid-column: 1 / -1; }
  .footer__grid > :nth-child(3) { justify-self: end; }
  /* I contatti occupano la riga da soli: centrati come blocco unico, non riga
     per riga, cosi' le icone restano incolonnate e l'indirizzo su due righe
     non si sfrangia. Il titolo va al centro sopra il gruppo. */
  .footer__grid > :last-child { justify-self: center; }
  .footer__grid > :last-child h3 { text-align: center; }
  .footer__about { max-width: none; }
  .stack { padding-bottom: 18%; padding-right: 0; }
  .stack .stack__back { width: 100%; }
  .stack .stack__front { width: 48%; border-width: 6px; }
  .fab__text { display: none; }
  .fab { width: 58px; padding-inline: 0; justify-content: center; }
  .floaters { gap: .5rem; }
  .lightbox__btn { width: 44px; height: 44px; }
  .gallery__item--tall { grid-row: span 1; aspect-ratio: 4 / 3; }
  .btn { width: 100%; }
  .btn-row { flex-direction: column; }
  /* in colonna l'asse principale è verticale: lasciando --btn-w come base
     diventerebbe l'altezza dei pulsanti, non la larghezza */
  .btn-row--even .btn { flex-basis: auto; }
}

/* ------------------------ rispetto delle preferenze --------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .stagger > * { opacity: 1 !important; transform: none !important; }
  .brush { background-size: 100% .28em !important; }
  .hero__slide.is-active img { transform: scale(1.06); }
  .marquee__track { animation: none; }
  .fab, .to-top { opacity: 1; transform: none; pointer-events: auto; }
}

/* --------------------------------- stampa ------------------------------- */
@media print {
  .header, .floaters, .hero__dots, .hero__scroll, .lightbox, .marquee { display: none !important; }
  body { color: #000; }
  .section--dark, .cta { background: #fff !important; color: #000 !important; }
  .section--dark h2, .cta h2 { color: #000 !important; }
}
