/* ============================================================
   MRG srl — Design System
   Off-white dominante · Blu istituzionale (struttura) · Arancione (accento)
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Colori brand (derivati dalla livrea) */
  --blu: #0A4A87;          /* blu istituzionale */
  --blu-ink: #0B2540;      /* blu profondo (testo forte / footer) */
  --blu-soft: #1E6FB8;     /* blu chiaro per link/hover */
  --arancio: #EA580C;      /* accento / CTA */
  --arancio-dark: #C2410C; /* hover CTA */

  /* Neutri (off-white dominante) */
  --bg: #F6F5F1;           /* base pagina */
  --bg-2: #FFFFFF;         /* superfici/card leggermente più chiare */
  --bg-3: #EFEDE7;         /* fasce alternate */
  --cemento: #5B6672;      /* testo secondario */
  --linea: #E4E2DB;        /* bordi / divisori */
  --linea-2: #D6D3CA;

  /* Testo */
  --ink: #142433;          /* titoli */
  --testo: #3A4653;        /* corpo */

  /* Tipografia */
  --font-display: 'Stack Sans Notch', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Scala tipografica fluida */
  --fs-xs: 0.78rem;
  --fs-sm: 0.9rem;
  --fs-base: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  --fs-lg: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
  --fs-xl: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem);
  --fs-2xl: clamp(2.1rem, 1.5rem + 3vw, 3.6rem);
  --fs-3xl: clamp(2.6rem, 1.6rem + 4.6vw, 5rem);

  /* Spaziatura (scala 8pt) */
  --sp-1: 0.5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2rem;
  --sp-5: 3rem;
  --sp-6: 4.5rem;
  --sp-7: 7rem;

  /* Layout */
  --container: 1240px;
  --container-pad: clamp(1.15rem, 4vw, 2.5rem);
  --radius: 10px;
  --radius-lg: 16px;

  /* Ombre discrete */
  --shadow-sm: 0 1px 2px rgba(11, 37, 64, 0.05), 0 2px 8px rgba(11, 37, 64, 0.04);
  --shadow-md: 0 4px 16px rgba(11, 37, 64, 0.08), 0 12px 32px rgba(11, 37, 64, 0.06);
  --shadow-lg: 0 12px 40px rgba(11, 37, 64, 0.12);

  /* Raccordo hero -> prima sezione.
     --fade-mid e' l'off-white della pagina velato di blu (bg + 5.5% di --blu-ink):
     la hero ci arriva sfumando, la sezione riparte da li'. Nessuno scalino. */
  --fade-mid: 233, 234, 231;
  --hero-fade: clamp(7rem, 18vh, 12rem);
  --sez-fade: clamp(8rem, 22vh, 15rem);

  /* Header */
  --header-h: 76px;

  /* Z-index */
  --z-header: 100;
  --z-overlay: 200;
  --z-menu: 300;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
}
html.lenis, html.lenis body { height: auto; }

/* Scorrimento morbido nativo solo come ripiego, quando Lenis non e' attivo
   (niente JS, o preferenza di movimento ridotto).
   Con Lenis in funzione deve restare 'auto': scroll-behavior:smooth rende
   asincroni gli scrollTo programmatici, e ScrollTrigger misura le posizioni
   della hero mentre la pagina non si e' ancora spostata. Ne uscivano start/end
   negativi e il parallasse restava incollato allo stato di fine corsa. */
@media (prefers-reduced-motion: no-preference) {
  html:not(.lenis) { scroll-behavior: smooth; }
}
html.lenis { scroll-behavior: auto !important; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--testo);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, picture, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.015em;
}

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

::selection { background: var(--arancio); color: #fff; }

/* ---------- Layout Helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--alt { background: var(--bg-3); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--arancio);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--arancio);
}



/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  will-change: transform;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn:active { transform: scale(0.97); }

.btn--primary { background: var(--arancio); color: #fff; box-shadow: 0 6px 18px rgba(234, 88, 12, 0.28); }
.btn--primary:hover { background: var(--arancio-dark); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(234, 88, 12, 0.34); }

.btn--dark { background: var(--blu-ink); color: #fff; }
.btn--dark:hover { background: var(--blu); transform: translateY(-2px); }



.btn--outline-light { border: 1.5px solid rgba(255,255,255,0.35); color: #fff; }
.btn--outline-light:hover { border-color: #fff; background: rgba(255,255,255,0.08); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--blu);
  font-size: var(--fs-sm);
}
.text-link svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.text-link:hover svg { transform: translateX(4px); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  background: rgba(246, 245, 241, 0.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.scrolled {
  background: rgba(246, 245, 241, 0.92);
  border-bottom-color: var(--linea);
  box-shadow: var(--shadow-sm);
}

/* Sopra la hero video: header trasparente con testo chiaro.
   Il logo resta invariato: il riempimento azzurro è già leggibile su fondo scuro. */
.site-header--over-hero:not(.scrolled) {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: transparent;
  box-shadow: none;
}
.site-header--over-hero:not(.scrolled) .nav a { color: rgba(255,255,255,0.9); }
/* ---------- Scorrimento sul dito ----------
   Un header fisso a tutta larghezza con backdrop-filter costringe il browser
   a ricalcolare la sfocatura di cio' che gli passa sotto a OGNI frame dello
   scorrimento: su mobile e' una delle cause piu' comuni di scatti. Sul touch
   la sfocatura sparisce e il fondo diventa quasi opaco: stessa leggibilita',
   costo di composizione azzerato. Sopra la hero l'header resta trasparente,
   perche' quella regola vince per specificita'. */
@media (hover: none) and (pointer: coarse) {
  .site-header {
    background: rgba(246, 245, 241, 0.95);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .site-header.scrolled { background: rgba(246, 245, 241, 0.98); }
}

/* Sopra la hero il pulsante-telefono diventa vetro chiaro: il bordo grigio
   e il fondo bianco si staccherebbero dal video. */
.site-header--over-hero:not(.scrolled) .header-phone {
  color: #fff;
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.12);
}
.site-header--over-hero:not(.scrolled) .header-phone:hover {
  border-color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.22);
}
.site-header--over-hero:not(.scrolled) .nav a:hover,
.site-header--over-hero:not(.scrolled) .nav a[aria-current="page"] { color: #fff; }
.site-header--over-hero:not(.scrolled) .brand__tag {
  color: rgba(255,255,255,0.75);
  border-left-color: rgba(255,255,255,0.3);
}
.site-header--over-hero:not(.scrolled) .nav-toggle {
  background: rgba(11,37,64,0.35);
  border-color: rgba(255,255,255,0.3);
}
.site-header--over-hero:not(.scrolled) .nav-toggle span,
.site-header--over-hero:not(.scrolled) .nav-toggle span::before,
.site-header--over-hero:not(.scrolled) .nav-toggle span::after { background: #fff; }
.site-header--over-hero:not(.scrolled) .nav-toggle[aria-expanded="true"] span { background: transparent; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }

.brand { display: flex; align-items: center; gap: 0.8rem; }
.brand__logo {
  height: 38px;
  width: auto;
  display: block;
  transition: transform 0.25s ease;
}
.brand:hover .brand__logo { transform: translateY(-1px); }
.brand__tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cemento);
  padding-left: 0.8rem;
  border-left: 1px solid var(--linea-2);
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: 0.35rem; }
.nav a {
  position: relative;
  padding: 0.55rem 0.9rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--testo);
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0.9rem; right: 0.9rem; bottom: 0.35rem;
  height: 2px;
  background: var(--arancio);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--blu); font-weight: 600; }
.nav a[aria-current="page"]::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 0.75rem; }
/* Solo icona: il numero per esteso vive nel footer, nel menu mobile e nelle
   CTA "Chiama". Qui conta il gesto, non la lettura del numero: il nome
   accessibile lo porta l'aria-label. */
.header-phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 10px;
  border: 1px solid var(--linea-2);
  background: var(--bg-2);
  color: var(--arancio);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.header-phone svg { width: 18px; height: 18px; color: currentColor; }
.header-phone:hover { border-color: var(--arancio); background: #fff; }
.header-phone:active { transform: scale(0.94); }

.nav-toggle {
  display: none;
  width: 46px; height: 46px;
  border-radius: 10px;
  border: 1px solid var(--linea-2);
  background: var(--bg-2);
  align-items: center; justify-content: center;
}
.nav-toggle span { position: relative; width: 20px; height: 2px; background: var(--ink); transition: background 0.2s; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: var(--ink); transition: transform 0.25s ease; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Mobile menu ---------- */
.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: var(--z-menu);
  background: var(--bg);
  padding: 2rem clamp(1.15rem, 4vw, 2.5rem) 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--linea);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-menu a[aria-current="page"] { color: var(--arancio); }
.mobile-menu .btn { margin-top: 1.75rem; justify-content: center; }
.mobile-menu__contact { margin-top: auto; padding-top: 2rem; color: var(--cemento); font-size: var(--fs-sm); }
.mobile-menu__contact a { font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 600; color: var(--blu); border: none; padding: 0; display: inline; }

body.menu-open { overflow: hidden; }

/* ============================================================
   HERO
   ============================================================ */
/* ---------- Hero cinematografica (video full-bleed) ---------- */
.hero--video {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: flex-end;
  padding-top: calc(var(--header-h) + 3rem);
  padding-bottom: calc(var(--hero-fade) + 1.5rem);
  overflow: hidden;
  background: var(--blu-ink);   /* evita il lampo bianco prima del poster */
  isolation: isolate;
}

/* Sfondo: poster + video sovrapposti */
.hero__bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero__poster,
.hero__videos video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  will-change: transform;
}
.hero__videos video {
  opacity: 0;
  transition: opacity 0.9s ease;
}
.hero__videos video.is-active { opacity: 1; }

/* "Ken Burns": lentissimo respiro dell'immagine */
.hero__bg { --kb: 1; }
.hero__poster, .hero__videos video { transform: scale(var(--kb)); }
.hero--video.is-ready .hero__bg {
  --kb: 1;
  animation: kenburns 26s ease-in-out infinite alternate;
}
@keyframes kenburns { from { --kb: 1; } to { --kb: 1.07; } }
@property --kb { syntax: '<number>'; inherits: true; initial-value: 1; }

/* Scrim: gradiente nei colori del brand, non nero piatto */
.hero__scrim {
  position: absolute; inset: 0; z-index: 1;
  /* Densità dove serve (testo in basso a sinistra, header in alto),
     trasparenza sull'impianto: l'immagine resta protagonista. */
  background:
    linear-gradient(to top,
      rgba(11,37,64,0.94) 0%,
      rgba(11,37,64,0.74) 22%,
      rgba(11,37,64,0.34) 50%,
      rgba(11,37,64,0.26) 70%,
      rgba(11,37,64,0.62) 100%),
    linear-gradient(to right,
      rgba(11,37,64,0.52) 0%,
      rgba(11,37,64,0.20) 46%,
      rgba(11,37,64,0) 70%);
  transition: opacity 1.2s ease;
}

.hero__inner { position: relative; z-index: 3; width: 100%; }

/* Raccordo con la sezione successiva: la hero non finisce, si dissolve.
   Le tappe seguono una curva ease-in-out: un gradiente a due stop lascerebbe
   vedere la riga in cui la sfumatura comincia. */
.hero--video::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--hero-fade);
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(var(--fade-mid), 0)     0%,
    rgba(var(--fade-mid), 0.026) 12.4%,
    rgba(var(--fade-mid), 0.096) 23.2%,
    rgba(var(--fade-mid), 0.2)   32.6%,
    rgba(var(--fade-mid), 0.331) 40.8%,
    rgba(var(--fade-mid), 0.48)  48%,
    rgba(var(--fade-mid), 0.638) 54.4%,
    rgba(var(--fade-mid), 0.796) 60.2%,
    rgba(var(--fade-mid), 0.924) 66%,
    rgba(var(--fade-mid), 0.98)  72%,
    rgba(var(--fade-mid), 1)     80%);
}

/* Secondo tempo del raccordo: la sezione nasce nel colore in cui la hero
   si e' dissolta e rientra nell'off-white. Insieme alla banda sopra fanno
   una rampa unica che attraversa il confine tra i due blocchi. */
.section--from-hero { position: relative; }
.section--from-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--sez-fade);
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(to bottom,
    rgba(var(--fade-mid), 1)     0%,
    rgba(var(--fade-mid), 0.98)  8%,
    rgba(var(--fade-mid), 0.924) 14%,
    rgba(var(--fade-mid), 0.796) 19.8%,
    rgba(var(--fade-mid), 0.638) 25.6%,
    rgba(var(--fade-mid), 0.48)  32%,
    rgba(var(--fade-mid), 0.331) 39.2%,
    rgba(var(--fade-mid), 0.2)   47.4%,
    rgba(var(--fade-mid), 0.096) 56.8%,
    rgba(var(--fade-mid), 0.026) 67.6%,
    rgba(var(--fade-mid), 0)     80%);
}
.section--from-hero > .container { position: relative; z-index: 1; }

.eyebrow--light { color: #ff9a63; text-shadow: 0 1px 12px rgba(11,37,64,0.6); }
.eyebrow--light::before { background: #ff9a63; }

.hero__title {
  font-size: var(--fs-3xl);
  color: #fff;
  margin: 1.15rem 0 1.35rem;
  max-width: 18ch;
  text-wrap: balance;
  text-shadow: 0 2px 30px rgba(11,37,64,0.45);
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.hero__title .line > span { display: block; }

.hero--video .hero__desc {
  font-size: var(--fs-lg);
  color: rgba(255,255,255,0.86);
  line-height: 1.55;
  max-width: 46ch;
  text-shadow: 0 1px 20px rgba(11,37,64,0.5);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2.25rem; }

/* Indicatore di scroll */
.hero__cue {
  position: absolute;
  left: 50%; bottom: 1.35rem;
  transform: translateX(-50%);
  z-index: 4;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cemento);
  transition: color 0.2s ease;
}
.hero__cue:hover { color: var(--blu); }
.hero__cue svg { width: 18px; height: 18px; animation: cueBob 2.2s ease-in-out infinite; }
@keyframes cueBob { 0%,100% { transform: translateY(0); opacity: .75; } 50% { transform: translateY(5px); opacity: 1; } }

/* Pausa/play — requisito WCAG per contenuti in movimento oltre 5s */
.hero__toggle {
  position: absolute;
  right: 1.5rem; bottom: 1.5rem;
  z-index: 4;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(11,37,64,0.45);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease, transform 0.2s ease;
}
.hero__toggle[hidden] { display: none; }   /* l'attributo hidden deve vincere sul display:flex */
.hero__toggle:hover { background: rgba(11,37,64,0.7); transform: scale(1.06); }
.hero__toggle svg { width: 17px; height: 17px; }
.hero__toggle .ico-play { display: none; }
.hero__toggle.is-paused .ico-pause { display: none; }
.hero__toggle.is-paused .ico-play { display: block; }

/* ============================================================
   CARDS / GRID
   ============================================================ */



/* Feature list */

/* Split media block */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
/* Alla colonna della foto un filo di larghezza in piu' che al testo, da
   qualunque lato si trovi: bastano pochi punti percentuali per darle peso
   senza farla debordare. */
.split:has(> .split__media:first-child) { grid-template-columns: 1.18fr 1fr; }
.split:has(> .split__media:last-child)  { grid-template-columns: 1fr 1.18fr; }
.split__media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  /* Cornice unica: le foto originali hanno formati diversi (alcune verticali,
     altre 16:9). Una cornice sola le allinea, il cover pensa al ritaglio. */
  aspect-ratio: 5 / 4;
}
.split__media img { width: 100%; height: 100%; object-fit: cover; }

/* Galleria: tre foto pari si leggono come miniature. Una foto guida grande
   piu' due di appoggio danno alla sequenza il peso di un servizio fotografico. */

.split__content h2 { font-size: var(--fs-2xl); margin-bottom: 1.15rem; }
.split__content > p { color: var(--cemento); font-size: var(--fs-base); margin-bottom: 1.5rem; }

/* Process timeline */

/* CTA band */

/* ============================================================
   PAGE HEADER (interne)
   ============================================================ */
.breadcrumb { display: flex; gap: 0.5rem; font-size: var(--fs-xs); color: var(--cemento); margin-bottom: 0.5rem; }
.breadcrumb a:hover { color: var(--blu); }
.breadcrumb span { color: var(--linea-2); }

/* ============================================================
   CERTIFICAZIONI — righe documento (PDF)
   ============================================================ */

/* ============================================================
   CERTIFICAZIONI
   ============================================================ */


/* ============================================================
   CONTATTI
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }


/* Form */
.form-card {
  background: var(--bg-2);
  border: 1px solid var(--linea);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 3vw, 2.75rem);
  box-shadow: var(--shadow-sm);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem; }
.field { margin-bottom: 1.15rem; }
.field label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); margin-bottom: 0.45rem; }
.field label .req { color: var(--arancio); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--linea-2);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input::placeholder, .field textarea::placeholder { color: #9aa4b0; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--blu);
  box-shadow: 0 0 0 3px rgba(10,74,135,0.12);
}
.field textarea { resize: vertical; min-height: 130px; }
.field__hint { font-size: var(--fs-xs); color: var(--cemento); margin-top: 0.4rem; }
.field__error { font-size: var(--fs-xs); color: #c62828; margin-top: 0.4rem; display: none; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: #c62828; }
.field.invalid .field__error { display: block; }

.form-consent { display: flex; gap: 0.65rem; align-items: flex-start; margin-bottom: 1.5rem; }
.form-consent input { width: 18px; height: 18px; margin-top: 3px; flex-shrink: 0; accent-color: var(--arancio); }
.form-consent label { font-size: var(--fs-xs); color: var(--cemento); line-height: 1.5; }
.form-consent a { color: var(--blu); font-weight: 600; }

.form-status { display: none; padding: 0.9rem 1.1rem; border-radius: var(--radius); font-size: var(--fs-sm); margin-top: 1rem; }
.form-status.success { display: block; background: rgba(46,125,50,0.1); color: #2e7d32; }
.form-status.error { display: block; background: rgba(198,40,40,0.1); color: #c62828; }

.map-embed { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--linea); box-shadow: var(--shadow-sm); }
.map-embed iframe { width: 100%; height: 100%; min-height: 340px; border: 0; display: block; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--blu-ink); color: #9fb0c2; padding-top: clamp(3.5rem, 6vw, 5rem); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 2.5rem; padding-bottom: 3rem; }
.footer-brand .brand__logo { height: 46px; width: auto; display: block; }
.footer-brand p { margin-top: 1.15rem; font-size: var(--fs-sm); line-height: 1.6; max-width: 34ch; }
.footer-col h3 { color: #fff; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1.15rem; }
.footer-col ul { display: flex; flex-direction: column; gap: 0.7rem; }
.footer-col a, .footer-col li { font-size: var(--fs-sm); transition: color 0.2s ease; }
.footer-col a:hover { color: #fff; }
.footer-contact li { display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 0.85rem; }
.footer-contact svg { width: 17px; height: 17px; color: #ff8b4d; flex-shrink: 0; margin-top: 3px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-block: 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: var(--fs-xs);
  flex-wrap: wrap;
}
.footer-bottom a:hover { color: #fff; }

/* ============================================================
   ANIMAZIONI (reveal)
   ============================================================ */
[data-reveal] { opacity: 0; transform: translateY(28px); }
/* will-change promuove ogni elemento a livello grafico a se'. Su una pagina
   come la Galleria sono decine di livelli tenuti insieme mentre si scorre:
   memoria video sprecata e scorrimento a scatti. Lo teniamo solo per
   mouse/trackpad e solo finche' l'elemento non e' comparso. */
@media (hover: hover) and (pointer: fine) {
  .reveal-ready [data-reveal]:not(.is-visible) { will-change: opacity, transform; }
}
[data-reveal].is-visible { opacity: 1; transform: none; transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
[data-reveal-delay="1"].is-visible { transition-delay: 0.08s; }
[data-reveal-delay="2"].is-visible { transition-delay: 0.16s; }
[data-reveal-delay="3"].is-visible { transition-delay: 0.24s; }
[data-reveal-delay="4"].is-visible { transition-delay: 0.32s; }

/* Se JS non parte, mostra tutto */
.no-js [data-reveal] { opacity: 1; transform: none; }

/* Apertura hero — CSS animation (a prova di rAF, gira anche senza JS) */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}
[data-hero] {
  opacity: 0;
  animation: heroIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.35s forwards;
}
.hero__desc[data-hero]  { animation-delay: 0.85s; }
.hero__cta[data-hero]   { animation-delay: 1.0s; }
.hero__cue[data-hero]   { animation-delay: 1.4s; }

/* Reveal del titolo riga per riga: ogni riga sale da dentro la sua maschera */
@keyframes lineUp {
  from { transform: translateY(105%); }
  to   { transform: none; }
}
[data-hero-line] {
  transform: translateY(105%);
  animation: lineUp 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero__title .line:nth-child(1) [data-hero-line] { animation-delay: 0.45s; }
.hero__title .line:nth-child(2) [data-hero-line] { animation-delay: 0.58s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* Header: libera spazio prima che il menu vada in overflow */
@media (max-width: 1200px) {
  .brand__tag { display: none; }
}
@media (max-width: 1080px) {
  .header-phone { display: none; }
  .nav a { padding-inline: 0.7rem; }
}

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem 2.5rem; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .nav, .header-phone { display: none; }
  .nav-toggle { display: flex; }
  .header-actions .btn--primary { display: none; }
  /* In colonna il rapporto di larghezza fra le due parti non serve piu' */
  .split,
  .split:has(> .split__media:first-child),
  .split:has(> .split__media:last-child) { grid-template-columns: 1fr; }
  /* Su una colonna sola la cornice si alza un po', nella stessa misura
     in cui su desktop si allarga: l'aumento resta uniforme. */
  .split > .split__media { aspect-ratio: 9 / 8; }
  /* Il mosaico diventa una foto guida sopra e due affiancate sotto.
     Niente altezza fissa: ogni foto tiene la sua cornice, cosi' la guida
     non si schiaccia in una fascia panoramica. */
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  :root {
    --header-h: 66px;
    /* In verticale c'e' meno aria: banda piu' corta, stessa curva */
    --hero-fade: clamp(5rem, 13vh, 8rem);
    --sez-fade: clamp(6rem, 16vh, 10rem);
  }
  /* svh: evita il salto quando la barra URL di Safari compare/scompare */
  .hero--video { min-height: 100svh; padding-bottom: calc(var(--hero-fade) + 1rem); }
  .hero__title { max-width: 100%; }
  /* In verticale l'inquadratura è una fetta stretta: serve più densità per la leggibilità */
  .hero__scrim {
    background:
      linear-gradient(to top,
        rgba(11,37,64,0.93) 0%,
        rgba(11,37,64,0.82) 34%,
        rgba(11,37,64,0.66) 60%,
        rgba(11,37,64,0.52) 80%,
        rgba(11,37,64,0.70) 100%);
  }
  .hero__cue { display: none; }
  .hero__toggle { right: 1rem; bottom: 1rem; }
  .brand__logo { height: 32px; }
  .brand__tag { font-size: 0.62rem; padding-left: 0.6rem; letter-spacing: 0.1em; }
  .footer-brand .brand__logo { height: 40px; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .btn { width: 100%; justify-content: center; }
  .hero__cta .btn { width: auto; }
  .hero__cta { flex-direction: column; }
  .hero__cta .btn { width: 100%; }
}

/* ============================================================
   PAGINE LEGALI (privacy / cookie policy)
   ============================================================ */
.legal { max-width: 72ch; }
.legal__meta {
  font-size: var(--fs-xs);
  color: var(--cemento);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 1.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--linea);
}
.legal h2 {
  font-size: var(--fs-xl);
  margin-top: 3rem;
  margin-bottom: 1rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.legal h3 { font-size: var(--fs-lg); margin-top: 2rem; margin-bottom: 0.75rem; }
.legal p { margin-bottom: 1.1rem; line-height: 1.75; }
.legal ul { margin: 0 0 1.5rem 1.2rem; display: flex; flex-direction: column; gap: 0.6rem; }
.legal li { list-style: disc; line-height: 1.7; padding-left: 0.3rem; }
.legal a { color: var(--blu); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.legal a:hover { color: var(--arancio); }
.legal code {
  font-size: 0.9em;
  background: var(--bg-3);
  border: 1px solid var(--linea);
  border-radius: 5px;
  padding: 0.1em 0.4em;
}

/* Le tabelle scorrono orizzontalmente sotto i 620px invece di rompere il layout */
.legal-table {
  width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 1.75rem;
  font-size: var(--fs-sm);
}
.legal-table th, .legal-table td {
  border: 1px solid var(--linea);
  padding: 0.8rem 0.9rem;
  text-align: left;
  vertical-align: top;
  line-height: 1.6;
}
.legal-table th { background: var(--bg-3); color: var(--ink); font-weight: 600; }

/* ============================================================
   CONSENSO — banner cookie e segnaposto dei contenuti bloccati
   ============================================================ */
.consent-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.35rem;
  min-height: 380px;
  padding: clamp(1.75rem, 5vw, 3rem);
  background: var(--bg-3);
}
.consent-placeholder__icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--linea);
  color: var(--arancio);
  margin-bottom: 0.5rem;
}
.consent-placeholder__icon svg { width: 22px; height: 22px; }
.consent-placeholder h3 { font-size: var(--fs-lg); }
.consent-placeholder p { max-width: 52ch; color: var(--cemento); font-size: var(--fs-sm); line-height: 1.6; }
.consent-placeholder__actions { margin-top: 0.9rem; }
.consent-placeholder__alt { margin-top: 0.75rem; font-size: var(--fs-xs); }
.consent-placeholder__alt a { color: var(--blu); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
/* L'attributo hidden deve vincere sui display espliciti qui sopra */
.consent-placeholder[hidden] { display: none; }
.map-embed iframe[hidden] { display: none; }

.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--z-menu);
  background: var(--bg-2);
  border-top: 3px solid var(--arancio);
  box-shadow: 0 -8px 40px rgba(11, 37, 64, 0.16);
  transform: translateY(110%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.cookie-banner.is-open { transform: translateY(0); }
.cookie-banner__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 4vw, 2.5rem);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}
.cookie-banner h2 { font-size: var(--fs-lg); margin-bottom: 0.4rem; }
.cookie-banner p { font-size: var(--fs-sm); color: var(--cemento); line-height: 1.6; max-width: 78ch; }
.cookie-banner p a { color: var(--blu); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cookie-banner__actions { display: flex; gap: 0.75rem; flex-shrink: 0; }
/* Accetta e Rifiuta hanno lo stesso peso visivo: nessuna scelta è privilegiata.
   Lo stile del rifiuto è definito qui e non affidato a una classe globale:
   il banner deve restare integro anche se il set di pulsanti del sito cambia. */
.cookie-banner__actions .btn { min-width: 150px; justify-content: center; }
.cookie-banner__actions .btn--ghost {
  background: var(--bg-2);
  color: var(--ink);
  border: 1.5px solid var(--linea-2);
}
.cookie-banner__actions .btn--ghost:hover { border-color: var(--ink); background: var(--bg-3); }

/* Link legali nella riga finale del footer */
.footer-legal { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.footer-legal__btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: color 0.2s ease;
}
.footer-legal__btn:hover { color: #fff; }
.no-js .footer-legal__btn { display: none; }

@media (max-width: 900px) {
  .cookie-banner__inner { grid-template-columns: 1fr; }
  .cookie-banner__actions .btn { flex: 1; }
}
@media (max-width: 620px) {
  .cookie-banner { max-height: 85vh; overflow-y: auto; }
  .cookie-banner__actions { flex-direction: column; }
  .cookie-banner__actions .btn { width: 100%; }
  .consent-placeholder { min-height: 320px; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  [data-hero] { opacity: 1 !important; animation: none !important; transform: none !important; }
  [data-hero-line] { transform: none !important; animation: none !important; }
  .hero--video.is-ready .hero__bg { animation: none !important; }
  .hero__cue svg { animation: none !important; }
  .cookie-banner { transition: none !important; }
}
