/* ==========================================================================
   Pubblipro - stile di base
   Caratteri, colori, pulsanti, intestazione, menu per il telefono, piede.
   Gli stili delle singole pagine stanno in file separati (home.css, ecc.).
   ========================================================================== */

/* ---------- Caratteri (ospitati sul sito, licenza OFL) ---------- */
@font-face {
  font-family: 'Outfit';
  src: url('../fonts/outfit-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('../fonts/geist-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Variabili ---------- */
:root {
  --ink: #14141A;          /* nero inchiostro */
  --ink-2: #1E1E26;        /* nero più chiaro, per schede su fondo scuro */
  --paper: #ECE7DC;        /* fondo carta */
  --paper-2: #E0D9C8;      /* fondo carta più scuro */
  --paper-text: #F2EDE3;   /* testo su fondo scuro o rosso */
  --red: #C12026;          /* rosso del logo */
  --red-dark: #A5191F;
  --muted: #4F4C47;        /* testo secondario su carta */
  --muted-on-ink: #BDB8AE; /* testo secondario su nero */
  --blue: #2060B0;         /* colori del logo, solo per piccoli dettagli */
  --amber: #F0B030;

  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --radius: 14px;
  --header-h: 84px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.menu-open { overflow: hidden; }

body {
  margin: 0;
  position: relative;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--paper-text);
  outline-offset: 3px;
}
.on-paper a:focus-visible, .on-paper button:focus-visible, .on-paper input:focus-visible,
.on-paper textarea:focus-visible, .on-paper select:focus-visible {
  outline-color: var(--ink);
}

.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding-left: clamp(20px, 4vw, 48px);
  padding-right: clamp(20px, 4vw, 48px);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 14px 22px;
  border-radius: var(--radius);
  background: var(--paper-text);
  color: var(--ink);
  font-weight: 600;
  transition: top 160ms var(--ease);
}
.skip-link:focus { top: 16px; }

/* usato dal pulsante "torna su": sotto questo punto compare */
.top-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 700px;
  pointer-events: none;
}

/* ---------- Titoli ---------- */
.f-d { font-family: var(--font-display); }
.title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 5vw, 76px);
  line-height: 1;
  letter-spacing: -0.04em;
}

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 30px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 18px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease),
              border-color 160ms var(--ease), transform 140ms var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-red { background: var(--red); color: var(--paper-text); }
.btn-paper { background: var(--paper-text); color: var(--ink); }
.btn-line { background: transparent; color: var(--paper-text); border-color: var(--paper-text); }
.btn-line-ink { background: transparent; color: var(--ink); border-color: var(--ink); }

/* ---------- Intestazione ---------- */
.site-header {
  position: relative;
  z-index: 40;
  background: var(--ink);
  color: var(--paper-text);
}
.site-header__bar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-logo { display: block; line-height: 0; }
.site-logo img { display: block; height: 56px; width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 36px;
  font-weight: 500;
  font-size: 18px;
}
.site-nav a { transition: color 160ms var(--ease); }
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: var(--radius);
  border: 1.5px solid rgba(242, 237, 227, 0.3);
  background: transparent;
  color: var(--paper-text);
  cursor: pointer;
  transition: border-color 160ms var(--ease), transform 140ms var(--ease);
}
.nav-toggle:active { transform: scale(0.94); }

/* ---------- Menu per il telefono ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow-y: auto;
  background: var(--ink);
  color: var(--paper-text);
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms var(--ease), visibility 0s linear 240ms;
}
.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.mobile-menu__inner { min-height: 100%; display: flex; flex-direction: column; }
.mobile-menu__top {
  height: var(--header-h);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-menu__list { display: flex; flex-direction: column; gap: 4px; margin: 32px 0 40px; }
.mobile-menu__list a,
.mobile-menu__foot {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}
.mobile-menu__list a {
  display: block;
  padding: 8px 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 9vw, 52px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.mobile-menu.is-open .mobile-menu__list a,
.mobile-menu.is-open .mobile-menu__foot {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i, 0) * 55ms + 80ms);
}
.mobile-menu__foot {
  margin-top: auto;
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}
.mobile-menu__contact { margin: 0; color: var(--muted-on-ink); font-size: 19px; line-height: 1.7; }

/* ---------- Piede di pagina ---------- */
.site-footer {
  background: var(--ink);
  color: var(--paper-text);
  padding: 96px 0 0;
  overflow: hidden;
}
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 48px 72px; }
.footer-brand { flex: 1 1 320px; max-width: 560px; display: flex; flex-direction: column; gap: 22px; }
.footer-brand .site-logo { align-self: flex-start; }
.footer-brand .site-logo img { height: 68px; }
.footer-brand p {
  margin: 0;
  max-width: 54ch;
  color: var(--muted-on-ink);
  font-size: 19px;
  line-height: 1.65;
}
.footer-cols { display: flex; flex-wrap: wrap; gap: 48px 88px; }
.footer-links { display: flex; flex-direction: column; gap: 12px; font-size: 19px; }
.footer-links a, .footer-review, .footer-bottom a { transition: color 160ms var(--ease); }
.footer-social { display: flex; flex-direction: column; gap: 24px; font-size: 19px; }
/* sottovoci di "Servizi" nel piede: nomi brevi su due colonne (riempite dall'alto in basso), per non allungare il piede */
.footer-links__sub { display: grid; grid-auto-flow: column; grid-template-rows: repeat(5, auto); gap: 10px 28px; margin: 14px 0 4px; padding: 0 0 0 16px; border-left: 2px solid rgba(242, 237, 227, 0.22); list-style: none; font-size: 16px; color: var(--muted-on-ink); }
@media (max-width: 480px) { .footer-links__sub { gap: 8px 16px; font-size: 15px; } }
.social { display: flex; flex-wrap: wrap; gap: 12px; width: 204px; }
.social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  border: 1.5px solid rgba(242, 237, 227, 0.3);
  color: var(--paper-text);
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 140ms var(--ease);
}
.social a:active { transform: scale(0.94); }
.footer-bottom {
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid rgba(242, 237, 227, 0.16);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  color: var(--muted-on-ink);
  font-size: 16px;
}
.footer-bottom a { text-decoration: underline; }
.footer-wordmark {
  margin: 56px 0 -0.12em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(88px, 19vw, 300px);
  line-height: 0.8;
  letter-spacing: -0.05em;
  color: var(--ink-2);
  text-align: center;
  white-space: nowrap;
  user-select: none;
}

/* ---------- Pulsante "torna su" ---------- */
.to-top {
  position: fixed;
  right: clamp(16px, 2.5vw, 32px);
  bottom: clamp(16px, 2.5vw, 32px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper-text);
  box-shadow: 0 0 0 3px var(--paper);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease),
              background-color 160ms var(--ease), visibility 0s linear 220ms;
}
.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}
.to-top.show:active { transform: scale(0.94); }

/* ---------- Comparsa allo scroll ---------- */
/* La classe "pre" la aggiunge lo script solo agli elementi sotto il primo schermo */
.rv {
  transition: opacity 800ms var(--ease), transform 800ms var(--ease), clip-path 1100ms var(--ease);
}
.rv.pre { opacity: 0; transform: translateY(56px); }
.rv-img { clip-path: inset(0 0 0 0); }
.rv-img.pre { opacity: 1; transform: none; clip-path: inset(0 0 100% 0); }
.rv.d1 { transition-delay: 90ms; }
.rv.d2 { transition-delay: 180ms; }
.rv.d3 { transition-delay: 270ms; }

/* ---------- Effetti solo con il mouse ---------- */
@media (hover: hover) and (pointer: fine) {
  .btn-red:hover { background: var(--red-dark); }
  .btn-paper:hover { background: #FFFFFF; }
  .btn-line:hover { background: var(--paper-text); color: var(--ink); }
  .btn-line-ink:hover { background: var(--ink); color: var(--paper-text); }
  .site-nav a:hover, .footer-links a:hover, .footer-review:hover, .footer-bottom a:hover { color: #E8777C; }
  .nav-toggle:hover { border-color: var(--paper-text); }
  .social a:hover { background: var(--red); border-color: var(--red); }
  .to-top.show:hover { background: var(--red); }
}

/* ---------- Schermi medi e piccoli ---------- */
@media (max-width: 1180px) {
  .site-nav { display: none; }
  .site-header .nav-toggle { display: inline-flex; }
  .mobile-menu .nav-toggle { display: inline-flex; }
}
@media (max-width: 640px) {
  body { font-size: 18px; }
  .header-cta { display: none; }
  .site-logo img { height: 48px; }
  .footer-brand .site-logo img { height: 60px; }
  .site-footer { padding-top: 72px; }
}

/* ---------- Movimento ridotto ---------- */
@media (prefers-reduced-motion: reduce) {
  .rv, .btn, .nav-toggle, .social a, .to-top, .skip-link { transition: none; }
  .mobile-menu, .mobile-menu__list a, .mobile-menu__foot { transition: none; }
}


/* ---------- Fascia di puntini tra sezioni (retino) ---------- */
.dots { position: absolute; left: 0; right: 0; height: 144px; overflow: hidden; pointer-events: none; }
.dots--top { top: 0; }
.dots--bottom { bottom: 0; transform: scaleY(-1); }
.dots__svg { display: block; width: 100%; fill: var(--ink); }

/* ---------- Elementi comuni alle sezioni ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.kicker {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.kicker::before { content: ''; flex: none; width: 32px; height: 3px; background: var(--red); }
.sec-head { display: flex; flex-direction: column; gap: 18px; max-width: 900px; }
.sec-head__top { display: flex; flex-direction: column; gap: 24px; }
.sec-head p { margin: 0; max-width: 52ch; font-size: 22px; color: var(--muted-on-ink); }
.on-paper .sec-head p { color: var(--muted); }
.arrow { transition: transform 200ms var(--ease); }
@media (prefers-reduced-motion: reduce) { .arrow { transition: none; } }

/* ---------- Modulo di contatto (su fondo scuro) ---------- */
.field {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1.5px solid #8A8781;
  background: var(--ink-2);
  color: var(--paper-text);
  font-family: var(--font-body);
  font-size: 18px;
}
.field::placeholder { color: #A19D95; }
.field[aria-invalid="true"] { border-color: #FF9A9E; }
textarea.field { display: block; min-height: 132px; padding: 14px 18px; line-height: 1.5; resize: vertical; }
.cform__opt { font-weight: 400; color: var(--muted-on-ink); }
.cform { display: flex; flex-direction: column; gap: 28px; }
.cform__row { display: flex; flex-direction: column; gap: 10px; }
.cform label, .cform legend { font-weight: 600; font-size: 17px; }
.cform__err { color: #FF9A9E; font-size: 16px; font-weight: 500; }
.cform__topics { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.cform__topics legend { padding: 0; margin-bottom: 12px; }
.cform__chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; display: inline-flex; cursor: pointer; font-weight: 500; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: var(--radius);
  border: 1.5px solid #8A8781;
  font-size: 17px;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}
.chip input:checked + span { background: var(--paper-text); border-color: var(--paper-text); color: var(--ink); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--paper-text); outline-offset: 3px; }
.cform__consent { display: flex; align-items: flex-start; gap: 14px; }
.cform__consent input { flex: none; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--red); }
.cform__consent label { font-weight: 400; font-size: 17px; line-height: 1.5; color: var(--muted-on-ink); }
.cform__consent a { color: var(--paper-text); text-decoration: underline; }
.cform__status {
  margin: 0;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--amber);
  background: var(--ink-2);
  font-size: 17px;
}
.cform__status--ok { border-color: #7FD6A0; }
.cform__status--err { border-color: #FF9A9E; }
.cform .btn[disabled] { opacity: 0.6; cursor: progress; }
@media (hover: hover) and (pointer: fine) {
  .chip:hover span { border-color: var(--paper-text); }
}
@media (prefers-reduced-motion: reduce) { .chip span { transition: none; } }

/* ---------- Entrate animate (usate nelle intestazioni) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes wipe { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { to { background-position: 260px 130px; } }
.rise { animation: rise 560ms var(--ease) both; }
.rise.d1 { animation-delay: 200ms; }
.rise.d2 { animation-delay: 300ms; }
.rise.d3 { animation-delay: 400ms; }
.rise.d4 { animation-delay: 500ms; }
.halftone {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--red) 2.2px, transparent 2.8px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 60% 90% at 88% 15%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 60% 90% at 88% 15%, #000 0%, transparent 72%);
  animation: drift 40s linear infinite;
  pointer-events: none;
}
.link { color: var(--red-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- Intestazione delle pagine interne ---------- */
.page-hero { position: relative; overflow: hidden; background: var(--ink); color: var(--paper-text); }
.page-hero__inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 48px 64px;
  padding-top: 56px;
  padding-bottom: 112px;
}
.page-hero__text { flex: 1 1 520px; min-width: 0; max-width: 960px; display: flex; flex-direction: column; gap: 28px; }
.page-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 6.2vw, 92px);
  line-height: 1;
  letter-spacing: -0.04em;
}
.page-hero__lead { margin: 0; max-width: 52ch; font-size: 23px; line-height: 1.55; color: var(--muted-on-ink); }
.page-hero__deco { flex: 0 1 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.deco-year {
  font-weight: 700;
  font-size: clamp(120px, 16vw, 260px);
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 2px rgba(242, 237, 227, 0.55);
}
.deco-sub { font-size: 20px; color: var(--muted-on-ink); }

/* ---------- Fascia finale con il pulsante ---------- */
.cta-band { position: relative; overflow: hidden; padding: 120px 0; background: var(--red); color: var(--paper-text); }
.cta-band__mark {
  position: absolute;
  right: -60px;
  top: 50%;
  width: 420px;
  height: 420px;
  margin-top: -210px;
  opacity: 0.16;
  animation: spin 60s linear infinite;
  pointer-events: none;
}
.cta-band__inner { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 36px 48px; }
.cta-band__text { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.cta-band__text p { margin: 0; max-width: 46ch; font-size: 22px; }
.cta-band--short { padding: 72px 0; }
.cta-band--short h2 { margin: 0; font-weight: 600; font-size: clamp(30px, 3.4vw, 48px); letter-spacing: -0.03em; line-height: 1.1; }

@media (max-width: 640px) {
  .page-hero__inner { padding-bottom: 80px; }
  .page-hero__lead { font-size: 20px; }
  .cta-band { padding: 88px 0; }
  .cta-band__mark { width: 280px; height: 280px; margin-top: -140px; right: -90px; }
}
@media (prefers-reduced-motion: reduce) {
  .rise, .halftone, .cta-band__mark { animation: none; }
}

/* ---------- Movimento lento di forme decorative ---------- */
@keyframes float-a { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(34px, -26px, 0); } }
@keyframes float-b { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(-30px, 22px, 0); } }
@keyframes spin-slow { to { transform: rotate(360deg); } }

/* Intestazione interna: cerchi sfocati dietro il "1999" e un'etichetta di vetro */
.page-hero__deco { position: relative; isolation: isolate; }
.page-hero__deco::before, .page-hero__deco::after {
  content: '';
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(38px);
  pointer-events: none;
}
.page-hero__deco::before { width: 260px; height: 260px; left: -20px; top: -10px; background: var(--blue); opacity: 0.42; animation: float-a 15s ease-in-out infinite; }
.page-hero__deco::after { width: 230px; height: 230px; right: -20px; bottom: -30px; background: var(--amber); opacity: 0.32; animation: float-b 17s ease-in-out infinite; }
.deco-sub {
  margin-top: -28px;
  margin-left: 16px;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(242, 237, 227, 0.28);
  background: rgba(242, 237, 227, 0.1);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  color: var(--paper-text);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .deco-sub { background: rgba(42, 42, 52, 0.92); }
}
@media (prefers-reduced-motion: reduce) {
  .page-hero__deco::before, .page-hero__deco::after { animation: none; }
}

/* ---------- Menu "Servizi" ---------- */
.nav-item { display: flex; align-items: center; gap: 2px; }
.nav-item__chev {
  width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer;
}
.nav-item__chev svg { transition: transform 260ms var(--ease); }
.nav-item.is-open .nav-item__chev svg { transform: rotate(180deg); }

.mega {
  position: absolute; left: 0; right: 0; top: var(--bar-h, var(--header-h)); z-index: 5;
  /* vetro: grigio-viola più chiaro del nero della testata, sfocato, con bordo luminoso e ombra che lo staccano dalla pagina sotto */
  background: rgba(44, 44, 58, 0.74);
  -webkit-backdrop-filter: blur(32px) saturate(170%);
  backdrop-filter: blur(32px) saturate(170%);
  border-top: 1px solid rgba(242, 237, 227, 0.12);
  border-bottom: 1px solid rgba(242, 237, 227, 0.28);
  box-shadow: 0 50px 90px -10px rgba(0, 0, 0, 0.85), 0 14px 28px rgba(0, 0, 0, 0.5);
  opacity: 0; visibility: hidden; transform: translateY(-10px);
  transition: opacity 220ms var(--ease), transform 280ms var(--ease), visibility 0s linear 280ms;
}
.nav-item.is-open .mega { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.mega__inner { padding-top: 44px; padding-bottom: 40px; }
.mega__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
.mega__col, .mega__foot {
  opacity: 0; transform: translateY(14px);
  transition: opacity 360ms var(--ease), transform 360ms var(--ease);
}
.nav-item.is-open .mega__col,
.nav-item.is-open .mega__foot { opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 60ms + 60ms); }

.mega__goal {
  display: flex; align-items: baseline; gap: 12px;
  margin: 0 0 14px; padding-bottom: 16px;
  border-bottom: 1px solid rgba(242, 237, 227, 0.18);
  font-weight: 600; font-size: 22px; letter-spacing: -0.02em; line-height: 1.2;
}
.mega__num { font-size: 15px; letter-spacing: 0.06em; color: var(--amber); }
.mega__list { margin: 0; padding: 0; list-style: none; }
.mega .mega__list a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; font-weight: 500; font-size: 19px; line-height: 1.25;
  text-decoration: none;
}
.mega .mega__list a .arrow { flex: none; opacity: 0; transform: translateX(-8px); transition: opacity 200ms var(--ease), transform 260ms var(--ease); }
.mega .mega__list a[aria-current="page"] { color: #E8777C; text-decoration: none; }

.mega__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
  margin-top: 28px; padding: 20px 28px;
  border-radius: var(--radius); background: var(--red);
}
.mega__foot p { margin: 0; font-weight: 500; font-size: 20px; letter-spacing: -0.01em; line-height: 1.3; }
.mega__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.mega .mega__all { font-weight: 500; font-size: 17px; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1.5px; }
.mega .mega__cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; border-radius: 999px;
  background: var(--paper-text); color: var(--ink);
  font-weight: 600; font-size: 17px; text-decoration: none;
  transition: background-color 160ms var(--ease), transform 160ms var(--ease);
}
.mega .mega__cta .arrow { transition: transform 260ms var(--ease); }
.mega .mega__cta--soon { cursor: default; }


@media (hover: hover) and (pointer: fine) {
  .mega .mega__list a:hover .arrow,
  .mega .mega__list a:focus-visible .arrow { opacity: 1; transform: none; }
  .mega a.mega__cta:hover { background: #FFFFFF; color: var(--ink); }
  .mega a.mega__cta:hover .arrow { transform: translateX(4px); }
  .nav-item__chev:hover { background: rgba(242, 237, 227, 0.1); }
}

/* ---------- Elenco servizi nel menu per il telefono ---------- */
.mm-group__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mm-group__btn {
  flex: none; width: 48px; height: 48px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(242, 237, 227, 0.3); border-radius: var(--radius);
  background: transparent; color: var(--paper-text); cursor: pointer;
  opacity: 0; transform: translateY(16px);
  transition: opacity 420ms var(--ease), transform 420ms var(--ease), border-color 160ms var(--ease);
}
.mobile-menu.is-open .mm-group__btn { opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 55ms + 80ms); }
.mm-group__btn svg { transition: transform 260ms var(--ease); }
.mm-group__btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.mm-sub {
  display: grid; grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows 340ms var(--ease), visibility 0s linear 340ms;
}
.mm-sub.is-open { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; }
.mm-sub__inner { min-height: 0; overflow: hidden; }
.mm-sub__goal { padding: 18px 0 4px; }
.mm-sub__goal p { margin: 0 0 6px; font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); }
.mm-sub__goal ul { margin: 0; padding: 0; list-style: none; }
.mobile-menu__list .mm-sub a { padding: 7px 0; font-weight: 500; font-size: clamp(22px, 6vw, 28px); line-height: 1.2; letter-spacing: -0.02em; }
.mm-sub__soon { display: block; padding: 7px 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(22px, 6vw, 28px); line-height: 1.2; letter-spacing: -0.02em; cursor: default; }
.mm-sub__goal--cta { padding-bottom: 12px; border-top: 1px solid rgba(242, 237, 227, 0.18); margin-top: 18px; }

@media (prefers-reduced-motion: reduce) {
  .mega, .mega__col, .mega__foot, .mega .mega__list a .arrow, .nav-item__chev svg,
  .mm-sub, .mm-group__btn, .mm-group__btn svg { transition: none; }
}


/* ---------- Intestazione fissa: si nasconde scendendo, ricompare (animata) risalendo ---------- */
html { scroll-padding-top: 72px; }
.site-header {
  position: sticky; top: 0;
  height: var(--header-h);
  background: transparent;
  pointer-events: none;           /* sotto la barra, quando è più bassa, si può cliccare la pagina */
  --bar-h: var(--header-h);
  /* ricompare con una piccola oscillazione finale */
  transition: transform 640ms cubic-bezier(0.22, 1.25, 0.36, 1);
}
.site-header > * { pointer-events: auto; }
.site-header::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; z-index: -1;
  height: var(--bar-h);
  background: var(--ink);
  border-bottom: 1px solid transparent;
  pointer-events: none;
  transition: height 380ms var(--ease), background-color 300ms var(--ease), border-color 300ms var(--ease), box-shadow 300ms var(--ease);
}
.site-header__bar { height: var(--bar-h); transition: height 380ms var(--ease); }
.site-logo img { transition: height 380ms var(--ease); }

/* dopo i primi pixel di scroll: barra più bassa, vetro scuro, linea e ombra */
.site-header.is-stuck { --bar-h: 64px; }
.site-header.is-stuck::before {
  background: rgba(20, 20, 26, 0.8);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: rgba(242, 237, 227, 0.16);
  box-shadow: 0 16px 38px -14px rgba(0, 0, 0, 0.7);
}
.site-header.is-stuck .site-logo img { height: 44px; }

/* scorrendo verso il basso la barra esce dallo schermo */
.site-header.is-hidden {
  transform: translateY(-115%);
  visibility: hidden;
  transition: transform 420ms cubic-bezier(0.5, 0, 0.75, 0), visibility 0s linear 420ms;
}

/* quando ricompare, logo, voci di menu e pulsante entrano uno dopo l'altro */
.site-header.is-reveal .site-logo,
.site-header.is-reveal .site-nav > *,
.site-header.is-reveal .header-cta,
.site-header.is-reveal .site-header .nav-toggle,
.site-header.is-reveal .nav-toggle { animation: hdrin 640ms var(--ease) both; animation-delay: calc(var(--d, 0) * 60ms + 120ms); }
.site-header.is-reveal .site-nav > :nth-child(1) { --d: 1; }
.site-header.is-reveal .site-nav > :nth-child(2) { --d: 2; }
.site-header.is-reveal .site-nav > :nth-child(3) { --d: 3; }
.site-header.is-reveal .site-nav > :nth-child(4) { --d: 4; }
.site-header.is-reveal .site-nav > :nth-child(5) { --d: 5; }
.site-header.is-reveal .site-nav > :nth-child(6) { --d: 6; }
.site-header.is-reveal .header-cta,
.site-header.is-reveal .nav-toggle { --d: 7; }
.site-header.is-reveal .header-cta { animation: hdrin 640ms var(--ease) both, ctaglow 1000ms ease-out 760ms; animation-delay: calc(var(--d, 0) * 60ms + 120ms), 760ms; }
@keyframes hdrin { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@keyframes ctaglow { from { box-shadow: 0 0 0 0 rgba(193, 32, 38, 0.65); } to { box-shadow: 0 0 0 18px rgba(193, 32, 38, 0); } }

@media (max-width: 640px) {
  .site-header.is-stuck { --bar-h: 60px; }
  .site-header.is-stuck .site-logo img { height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header, .site-header::before, .site-header__bar, .site-logo img { transition: none; }
  .site-header.is-reveal .site-logo, .site-header.is-reveal .site-nav > *, .site-header.is-reveal .header-cta,
  .site-header.is-reveal .nav-toggle { animation: none; }
}

/* Dietro la barra, in cima alla pagina, c'è sempre una fascia nera alta quanto la barra:
   la barra fissa lascia libero il suo posto e, senza questa fascia, il vetro mostrava lo sfondo chiaro della pagina. */
body:not(.page-home)::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 0; z-index: -1;
  height: var(--header-h);
  background: var(--ink);
  pointer-events: none;
}

/* ---------- Scorrimento morbido verso le sezioni (pulsanti e link con #ancora) ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
