/* ==========================================================================
   Denis Manutenzione del Verde — Landing page
   Struttura: 1. Font · 2. Variabili · 3. Base · 4. Utility · 5. Loader
              6. Header/Nav · 7. Sezioni · 8. Footer · 9. Lightbox
              10. Animazioni · 11. Media query
   Mobile-first: gli stili base sono per smartphone, i breakpoint
   (480 / 768 / 1024 / 1440 / 1680) aggiungono il layout desktop di Figma.
   ========================================================================== */

/* 1. FONT (self-hosted, subset latino) ------------------------------------ */
@font-face {
  font-family: "Bevellier";
  src: url("assets/fonts/bevellier-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bevellier";
  src: url("assets/fonts/bevellier-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bevellier";
  src: url("assets/fonts/bevellier-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("assets/fonts/poppins-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("assets/fonts/poppins-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* 2. VARIABILI ------------------------------------------------------------ */
:root {
  /* Palette (tavola colori Figma) */
  --kale: #283c23;        /* verde scuro — testi, card */
  --forest: #202e13;      /* verde quasi nero — footer, bottoni, titoli servizi */
  --spinach: #657007;     /* verde oliva */
  --endive: #b6bd77;      /* verde salvia */
  --mint: #e0eee9;        /* verde acqua chiarissimo — sfondi sezioni */
  --radicchio: #c2512f;   /* rosso mattone — accento */
  --turmeric: #fa9401;    /* arancio (in palette, per futuri accenti) */
  --bean: #f9f8f4;        /* bianco caldo — header, testi su scuro */
  --white: #ffffff;
  --ink: #1d1d1b;         /* colore del logotipo */

  /* Tipografia */
  --font-display: "Bevellier", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-h1: clamp(2.25rem, 1.2rem + 3.9vw, 4.6875rem);        /* 75px @1440 */
  --fs-h2: clamp(2.25rem, 1rem + 3.3vw, 4rem);                /* 64px */
  --fs-service: clamp(2rem, 0.9rem + 3.4vw, 4rem);            /* 64px */
  --fs-lead: clamp(1.0625rem, 0.8rem + 0.8vw, 1.5rem);        /* 24px */
  --fs-card-title: clamp(1.625rem, 1rem + 1.4vw, 2.25rem);    /* 36px */
  --fs-card-text: clamp(1rem, 0.85rem + 0.45vw, 1.25rem);     /* 20px */
  --fs-btn: clamp(1rem, 0.9rem + 0.3vw, 1.25rem);             /* 20px */
  --fs-caption: clamp(1.75rem, 0.6rem + 4.7vw, 4.875rem);     /* 78px */
  --fs-label: clamp(1.0625rem, 0.95rem + 0.3vw, 1.3125rem);   /* 21px */

  /* Layout */
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 76px;
  --header-h-compact: 68px;
  --section-space: clamp(56px, 7vw, 110px);

  /* Forme ed effetti */
  --radius-btn: 14px;
  --shadow-card: 12px 10px 22.3px -12px rgba(0, 0, 0, 0.53);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3. BASE ----------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h-compact);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--kale);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

h1, h2, h3, p, ul, figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

address {
  font-style: normal;
}

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

/* 4. UTILITY / COMPONENTI COMUNI ------------------------------------------ */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 2000;
  padding: 10px 16px;
  background: var(--forest);
  color: var(--white);
  border-radius: 8px;
}
.skip-link:focus {
  top: 16px;
}

.br-desktop {
  display: none;
}
/* a capo voluto solo su smartphone (vedi bottone hero) */
.br-mobile {
  display: inline;
}
@media (min-width: 560px) {
  .br-mobile { display: none; }
}

.nowrap {
  white-space: nowrap;
}

.link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Bottoni (43px di altezza, raggio 14 come in Figma) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 43px;
  padding: 10px 25px 10px 24px;
  border: 0;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--fs-btn);
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--white);
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.45);
  filter: brightness(1.06);
}
.btn:active {
  transform: translateY(0);
}
.btn--endive { background: var(--endive); }
.btn--radicchio { background: var(--radicchio); color: var(--bean); }
.btn--spinach { background: var(--spinach); color: var(--bean); }
.btn--forest { background: var(--forest); }
.btn--icon img {
  width: 26px;
  height: 26px;
}

/* Fascia colorata con titolo di sezione (137px su desktop) */
.band {
  padding: clamp(14px, 2vw, 28px) var(--gutter);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h2);
  line-height: normal;
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--white);
}
.band--radicchio { background: var(--radicchio); }
.band--spinach { background: var(--spinach); }

.section__cta {
  display: flex;
  justify-content: center;
  margin-top: clamp(40px, 6vw, 72px);
}

/* 5. LOADER --------------------------------------------------------------- */
.loader {
  display: none;
}

.js .loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--bean);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s var(--ease), visibility 0s linear 0.7s;
}

/* Visibile solo mentre <html> ha .is-loading (impostata nell'<head>) */
.js.is-loading .loader {
  opacity: 1;
  visibility: visible;
  transition: none;
}
.js.is-loading body {
  overflow: hidden;
}

.loader__logo {
  display: flex;
  align-items: center;
  gap: 2%;
  width: min(86vw, 640px);
  transition: transform 0.7s var(--ease);
}
.js:not(.is-loading) .loader__logo {
  transform: scale(0.96);
}

.loader__tree {
  flex: 0 0 24%;
  width: 24%;
  transform-origin: 50% 64%; /* linea del terreno dell'albero */
  opacity: 0;
}

.logo-draw {
  flex: 1 1 auto;
  width: 72%;
  overflow: visible;
}

/* Ogni tracciato del logotipo: prima si disegna il contorno, poi si riempie.
   --len e --d vengono impostati da script.js (lunghezza e ritardo). */
.logo-draw path {
  fill: transparent;
  stroke: var(--ink);
  stroke-width: 0.9;
  stroke-linejoin: round;
  stroke-dasharray: var(--len, 1000);
  stroke-dashoffset: var(--len, 1000);
}

.loader.is-animating .loader__tree {
  animation: tree-grow 1.1s var(--ease-out) forwards;
}
.loader.is-animating .logo-draw path {
  animation:
    logo-draw 1.1s var(--ease) var(--d, 0s) forwards,
    logo-fill 0.6s ease calc(var(--d, 0s) + 0.8s) forwards;
}

@keyframes tree-grow {
  0% {
    opacity: 0;
    transform: scale(0.82);
    clip-path: inset(100% 0 0 0);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: scale(1);
    clip-path: inset(0 0 0 0);
  }
}
@keyframes logo-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes logo-fill {
  to { fill: var(--ink); stroke-width: 0; }
}

/* 6. HEADER E NAVIGAZIONE ------------------------------------------------- */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  background: var(--bean);
  transition: height 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.header.is-scrolled {
  height: var(--header-h-compact);
  box-shadow: 0 6px 24px -14px rgba(32, 46, 19, 0.45);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
}
.brand__tree {
  width: auto;
  height: 56px;
  transition: height 0.35s var(--ease);
}
.brand__text {
  width: auto;
  height: 38px;
  transition: height 0.35s var(--ease);
}
.header.is-scrolled .brand__tree { height: 50px; }
.header.is-scrolled .brand__text { height: 34px; }

/* Hamburger (solo < 1024px) */
.nav-toggle {
  position: relative;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.nav-toggle__bar {
  display: block;
  width: 26px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--kale);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* Menu mobile: pannello che scende sotto l'header */
.nav {
  position: fixed;
  inset: var(--header-h) 0 auto;
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  padding: 12px var(--gutter) 32px;
  background: var(--bean);
  box-shadow: 0 18px 30px -20px rgba(32, 46, 19, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0s linear 0.3s;
}
.header.is-scrolled .nav {
  top: var(--header-h-compact);
}
.nav.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.nav__link {
  position: relative;
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid rgba(40, 60, 35, 0.12);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1.1;
  color: var(--kale);
  transition: color 0.2s;
}
.nav__link:hover,
.nav__link.is-active {
  color: var(--spinach);
}

/* 7. SEZIONI -------------------------------------------------------------- */

/* --- Hero --- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  margin-top: var(--header-h);
  min-height: clamp(480px, 72svh, 620px);
  color: var(--bean);
  text-align: center;
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(64px, 13.9vw, 200px);
  padding-bottom: 120px; /* spazio per le card che si sovrappongono */
}
.hero__title {
  max-width: 24ch;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 1.1rem + 2.9vw, 3.75rem);
  line-height: 1.06;
  text-wrap: balance;
}
.hero__tagline {
  margin-top: clamp(12px, 1.4vw, 20px);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.375rem, 1rem + 1.2vw, 2.25rem);
  line-height: 1.2;
  color: var(--endive);
}
.hero .btn {
  margin-top: clamp(24px, 2.8vw, 39px);
}
/* Su smartphone il testo va su due righe spezzate in modo pulito */
@media (max-width: 559px) {
  .btn--hero {
    padding: 12px 28px;
    line-height: 1.3;
    border-radius: 16px;
  }
}

/* --- Elementi di fiducia (card sovrapposte alla hero) --- */
.trust {
  position: relative;
  z-index: 1;
  margin-top: -84px;
}
.trust__grid {
  display: grid;
  gap: 20px;
  max-width: calc(520px + var(--gutter) * 2);
}
.trust-card {
  padding: 28px 28px 32px;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  color: var(--white);
}
.trust-card--endive { background: var(--endive); }
.trust-card--spinach { background: var(--spinach); }
.trust-card--kale { background: var(--kale); }

.trust-card__icon {
  display: grid;
  place-items: center;
  width: clamp(60px, 5.2vw, 74px);
  aspect-ratio: 1;
  border-radius: 13px;
  background: var(--radicchio);
}
.trust-card__icon img {
  width: 62%;
  height: auto;
}
.trust-card__title {
  margin-top: clamp(20px, 2.6vw, 37px);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-card-title);
  line-height: normal;
}
.trust-card__text {
  margin-top: clamp(12px, 1.6vw, 24px);
  max-width: 280px;
  font-size: var(--fs-card-text);
  line-height: 1.25;
}

/* --- Intro (chi siamo) --- */
.intro {
  padding-top: clamp(48px, 6vw, 88px);
}
.intro__inner {
  max-width: calc(860px + var(--gutter) * 2);
  text-align: center;
  font-size: clamp(1.0625rem, 0.9rem + 0.5vw, 1.3125rem);
  line-height: 1.6;
  color: var(--kale);
}
.intro__inner p + p {
  margin-top: 0.8em;
}
.intro__inner p:first-child {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35em;
  line-height: 1.3;
  color: var(--forest);
}

/* --- I nostri servizi (elenco interattivo) ---
   Mobile/tablet: fisarmonica (un servizio aperto alla volta).
   Desktop ≥1024px: lista a sinistra, foto + descrizione a destra.
   Gli stati "chiuso" valgono solo con JS attivo (.js). */
.services {
  margin-top: clamp(56px, 3.1vw, 77px);
  padding-bottom: var(--section-space);
  background: var(--mint);
}
.services__list {
  padding-top: clamp(40px, 5.8vw, 83px);
}
.service {
  border-bottom: 1px solid rgba(32, 46, 19, 0.16);
}
.service:first-child {
  border-top: 1px solid rgba(32, 46, 19, 0.16);
}
.service__toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 0;
  border: 0;
  background: none;
  text-align: left;
  color: var(--forest);
  cursor: pointer;
}
.service__num {
  flex-shrink: 0;
  min-width: 2ch;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.06em;
  color: var(--radicchio);
}
.service__title {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.375rem);
  line-height: 1.1;
  transition: color 0.25s, transform 0.35s var(--ease);
}
/* Freccia: "+" che ruota in "×" su mobile, "→" su desktop */
.service__arrow {
  position: relative;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  transition: transform 0.35s var(--ease);
}
.service__arrow::before,
.service__arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.service__arrow::after {
  transform: translate(-50%, -50%) rotate(90deg);
}
.service.is-active .service__arrow {
  transform: rotate(45deg);
}
.service__toggle:hover .service__title,
.service.is-active .service__title {
  color: var(--spinach);
}

.service__panel {
  padding-bottom: 24px;
}
.js .service:not(.is-active) .service__panel {
  display: none;
}
.service.is-active .service__panel {
  animation: panel-in 0.45s var(--ease-out);
}
.service__media {
  aspect-ratio: 16 / 10;
  border-radius: clamp(16px, 1.8vw, 25px);
  overflow: hidden;
}
.service__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
}
.service__text {
  margin-top: 16px;
  max-width: 62ch;
  font-size: clamp(1rem, 0.9rem + 0.3vw, 1.125rem);
  line-height: 1.6;
  color: var(--kale);
}
.service__text p + p {
  margin-top: 0.7em;
}
.service__text p:first-child {
  font-weight: 600;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* --- I nostri lavori (galleria) ---
   Griglia a mosaico: il motivo si ripete ogni 5 foto (1 grande + 4 piccole),
   alternando la foto grande a sinistra e a destra. Con un numero di foto
   multiplo di 5 la griglia è sempre piena. */
.works {
  padding-bottom: var(--section-space);
  background: var(--white);
}
.works__gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: clamp(140px, 38vw, 200px);
  grid-auto-flow: dense;
  gap: 12px;
  padding-top: clamp(40px, 5.5vw, 79px);
}
.work {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--mint);
  cursor: zoom-in;
}
.work:nth-child(5n + 1) { grid-column: span 2; grid-row: span 2; }
.work img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
  transition: transform 0.8s var(--ease);
}
.work:hover img {
  transform: scale(1.04);
}

/* Testo introduttivo sotto le fasce di sezione */
.section__intro {
  max-width: calc(860px + var(--gutter) * 2);
  padding-top: clamp(40px, 5.5vw, 72px);
  text-align: center;
  font-size: clamp(1rem, 0.9rem + 0.35vw, 1.1875rem);
  line-height: 1.6;
  color: var(--kale);
}
.section__intro p + p {
  margin-top: 0.7em;
}
.section__intro p:first-child {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5em;
  line-height: 1.25;
  color: var(--forest);
}
.section__intro + .works__gallery {
  padding-top: clamp(32px, 4vw, 56px);
}

/* --- Zone servite --- */
.zones {
  padding-block: var(--section-space);
  background: var(--bean);
}
.zones__inner {
  display: grid;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.zones__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 1.1rem + 2.6vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: 0.02em;
  color: var(--kale);
  text-wrap: balance;
}
.zones__text p {
  margin-top: 16px;
  max-width: 52ch;
  font-size: clamp(1rem, 0.9rem + 0.35vw, 1.1875rem);
  line-height: 1.6;
}
.zones__text .btn {
  margin-top: 28px;
}
.zones__places {
  padding: clamp(24px, 3vw, 40px);
  border-radius: clamp(18px, 2vw, 28px);
  background: var(--kale);
  color: var(--bean);
}
.zones__lead {
  font-weight: 600;
  font-size: clamp(1rem, 0.9rem + 0.3vw, 1.125rem);
}
.zones__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.zones__place {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(249, 248, 244, 0.08);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.375rem, 1.1rem + 0.8vw, 1.875rem);
  line-height: 1.1;
}
.zones__place img {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}
.zones__place small {
  display: block;
  margin-top: 4px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--endive);
}
.zones__place--main {
  grid-column: 1 / -1;
  background: var(--spinach);
}
.zones__place--more {
  justify-content: center;
  text-align: center;
  background: none;
  border: 1px dashed rgba(249, 248, 244, 0.35);
  font-family: var(--font-body);
  font-size: 1rem;
  color: rgba(249, 248, 244, 0.8);
}

/* --- Il nostro metodo + foto --- */
.method__intro {
  padding-block: clamp(56px, 6vw, 87px) clamp(48px, 6.9vw, 99px);
  background: var(--radicchio);
  color: var(--white);
}
.method__inner {
  display: grid;
  gap: 20px;
}
.method__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h2);
  line-height: 1.4;
  letter-spacing: 0.04em;
}
.method__text {
  max-width: 648px;
  font-weight: 600;
  font-size: var(--fs-lead);
  line-height: 1.5;
}
.method__text p + p {
  margin-top: 0.6em;
}

.method__showcase {
  position: relative;
  padding-bottom: clamp(56px, 6.3vw, 90px);
}
/* Il fondo rosso prosegue dietro il primo 30% della foto */
.method__showcase::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: calc((100% - clamp(56px, 6.3vw, 90px)) * 0.3);
  background: var(--radicchio);
}
.showcase {
  position: relative;
}
.showcase img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: clamp(18px, 2.1vw, 30px);
}
.showcase::after {
  content: "";
  position: absolute;
  inset: 0 var(--gutter);
  border-radius: clamp(18px, 2.1vw, 30px);
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.showcase__caption {
  position: absolute;
  left: calc(var(--gutter) + clamp(20px, 2.9vw, 41px));
  right: calc(var(--gutter) + 20px);
  bottom: clamp(20px, 2.5vw, 36px);
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-caption);
  line-height: normal;
  color: var(--white);
}

/* --- FAQ (details/summary nativi, nessun JS) --- */
.faq {
  padding-bottom: var(--section-space);
  background: var(--white);
}
.faq__inner {
  display: grid;
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}
.faq__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 1.1rem + 2.6vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: 0.02em;
  color: var(--kale);
  text-wrap: balance;
}
.faq__intro p {
  margin-top: 16px;
  max-width: 40ch;
  line-height: 1.6;
}
.faq__intro .btn {
  margin-top: 24px;
}
.faq__item {
  border-bottom: 1px solid rgba(32, 46, 19, 0.16);
}
.faq__item:first-child {
  border-top: 1px solid rgba(32, 46, 19, 0.16);
}
.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
}
.faq__q::-webkit-details-marker {
  display: none;
}
.faq__q h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 1rem + 0.8vw, 1.75rem);
  line-height: 1.2;
  color: var(--forest);
  transition: color 0.25s;
}
.faq__q:hover h3,
.faq__item[open] .faq__q h3 {
  color: var(--spinach);
}
/* icona + / × */
.faq__icon {
  position: relative;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--forest);
  transition: transform 0.35s var(--ease), background-color 0.25s;
}
.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.faq__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}
.faq__item[open] .faq__icon {
  transform: rotate(45deg);
  background: var(--endive);
}
.faq__a {
  padding: 0 52px 22px 0;
  max-width: 70ch;
  line-height: 1.65;
  color: var(--kale);
}
.faq__item[open] .faq__a {
  animation: panel-in 0.4s var(--ease-out);
}

/* --- Contatti (form) --- */
.contact {
  padding-block: clamp(48px, 5.1vw, 74px) clamp(48px, 5.2vw, 75px);
  background: var(--mint);
  color: var(--forest);
}
.contact__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 1.1rem + 2.6vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--kale);
  text-wrap: balance;
}
.contact__text {
  margin-top: 16px;
  max-width: 70ch;
  font-size: clamp(1rem, 0.9rem + 0.35vw, 1.1875rem);
  line-height: 1.6;
}
.contact__text p + p {
  margin-top: 0.5em;
}

.form {
  display: grid;
  gap: 19px;
  margin-top: clamp(24px, 2.9vw, 42px);
}
.form__field {
  display: grid;
  gap: 12px;
}
.form__label {
  font-weight: 600;
  font-size: var(--fs-label);
  line-height: 24px;
  color: var(--forest);
}
.form__input {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border: 1px solid var(--forest);
  border-radius: var(--radius-btn);
  background: transparent;
  font-size: 1.0625rem;
  color: var(--forest);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.form__input--area {
  height: auto;
  min-height: 117px;
  padding-block: 14px;
  resize: vertical;
}
.form__input:hover {
  background: rgba(255, 255, 255, 0.35);
}
.form__input:focus {
  outline: none;
  border-color: var(--spinach);
  box-shadow: 0 0 0 3px rgba(101, 112, 7, 0.25);
  background: rgba(255, 255, 255, 0.5);
}
.form__input[aria-invalid="true"] {
  border-color: var(--radicchio);
}
.form__error {
  min-height: 0;
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--radicchio);
}
.form__error:empty {
  display: none;
}

.form__field--check {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 4px 12px;
  font-size: 0.875rem;
  line-height: 1.45;
}
.form__field--check .form__error {
  grid-column: 1 / -1;
}
.form__check {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--forest);
}

/* Campo trappola anti-spam: fuori schermo */
.form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 13px;
}
.form__actions .btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.form__status {
  font-size: 0.9375rem;
}
/* reCAPTCHA v3: badge nascosto */
.grecaptcha-badge {
  visibility: hidden;
}

.form__status.is-success { color: var(--spinach); }
.form__status.is-error { color: var(--radicchio); }

/* --- Per maggiori informazioni --- */
.info {
  background: var(--endive);
}
.info__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  padding-block: clamp(32px, 2.4vw, 35px);
  min-height: clamp(0px, 15vw, 217px);
}
.info__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h2);
  line-height: 1.16;
  letter-spacing: 0.04em;
  color: var(--kale);
}

/* 8. FOOTER --------------------------------------------------------------- */
.footer {
  position: relative;
  overflow: hidden;
  background: var(--forest);
  color: var(--white);
}
.footer__inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 40px;
  padding-block: 56px 48px;
}
.footer__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 24px;
  letter-spacing: 0.11em;
}
.footer__list {
  display: grid;
  gap: 21px;
  margin-top: 21px;
}
.footer__list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: start;
  gap: 22px;
  line-height: 1.5;
}
.footer__list img {
  justify-self: center;
}
.footer__list a {
  overflow-wrap: anywhere; /* email lunga su schermi stretti */
}
.footer__list a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer__social {
  display: flex;
  gap: 32px;
  margin-top: 40px;
}
.social {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--white);
  transition: transform 0.25s var(--ease), background-color 0.25s;
}
.social:hover {
  transform: translateY(-3px);
  background: var(--endive);
}
.footer__monstera {
  position: absolute;
  right: -40px;
  bottom: -90px;
  z-index: -1;
  width: 200px;
  opacity: 0.12;
  pointer-events: none;
}
.footer__bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 18px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.7);
}

/* 9. LIGHTBOX (galleria scorrevole) --------------------------------------- */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(20, 28, 12, 0.97);
  color: var(--bean);
  overflow: hidden;
}
.lightbox::backdrop {
  background: transparent;
}
.lightbox[open] {
  display: grid;
  grid-template-rows: 1fr auto;
  animation: lightbox-in 0.35s var(--ease-out);
}
.lightbox__stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: clamp(76px, 8vw, 96px) clamp(16px, 8vw, 120px) 8px; /* spazio per X e frecce */
  touch-action: pan-y;
  user-select: none;
}
.lightbox__img {
  max-width: min(100%, 1400px);
  max-height: calc(100dvh - 190px); /* spazio per X, didascalia e contatore */
  width: auto;
  height: auto;
  border-radius: 12px;
  transition: opacity 0.25s ease;
}
.lightbox__img.is-changing {
  opacity: 0;
}
.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  font-size: 0.9375rem;
}
.lightbox__caption {
  max-width: 60ch;
  text-align: center;
  color: rgba(249, 248, 244, 0.85);
}
.lightbox__counter {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: rgba(249, 248, 244, 0.6);
}
.lightbox__btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(249, 248, 244, 0.14);
  color: var(--bean);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s;
}
.lightbox__btn:hover {
  background: rgba(249, 248, 244, 0.28);
}
.lightbox__close {
  position: absolute;
  top: clamp(16px, 3vw, 32px);
  right: clamp(16px, 3vw, 40px);
  z-index: 1;
}
.lightbox__prev,
.lightbox__next {
  position: absolute;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
}
.lightbox__prev { left: clamp(16px, 3vw, 40px); }
.lightbox__next { right: clamp(16px, 3vw, 40px); }
@keyframes lightbox-in {
  from { opacity: 0; }
}

/* 10. ANIMAZIONI DI INGRESSO ---------------------------------------------- */

/* Hero: entra in sequenza quando il loader ha finito (html.is-ready) */
.js [data-hero] {
  opacity: 0;
  transform: translateY(22px);
}
.js.is-ready [data-hero] {
  animation: fade-up 0.9s var(--ease-out) forwards;
}
.js.is-ready [data-hero]:nth-child(2) { animation-delay: 0.15s; }
.js.is-ready [data-hero]:nth-child(3) { animation-delay: 0.3s; }

.js .hero__media img {
  transform: scale(1.06);
}
.js.is-ready .hero__media img {
  transform: none;
  transition: transform 2.2s var(--ease-out);
}

@keyframes fade-up {
  to { opacity: 1; transform: none; }
}

/* Sezioni: fade-up all'entrata in viewport (IntersectionObserver in script.js) */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.8s var(--ease) var(--delay, 0ms),
    transform 0.8s var(--ease-out) var(--delay, 0ms);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* 11. MEDIA QUERY --------------------------------------------------------- */

/* ≥ 480px — smartphone grandi */
@media (min-width: 480px) {
  .works__gallery { gap: 14px; }
  .footer__monstera { width: 240px; }
}

/* ≥ 768px — tablet */
@media (min-width: 768px) {
  :root {
    --header-h: 96px;
    --header-h-compact: 76px;
  }

  .br-desktop { display: inline; }

  .brand__tree { height: 70px; }
  .brand__text { height: 48px; }
  .header.is-scrolled .brand__tree { height: 56px; }
  .header.is-scrolled .brand__text { height: 38px; }

  .hero { min-height: clamp(560px, 56vw, 805px); }
  .hero__content { padding-bottom: 200px; }

  .trust { margin-top: -150px; }
  .trust__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(16px, 5.1vw, 74px);
    max-width: calc(var(--container) + var(--gutter) * 2);
  }
  .trust-card {
    min-height: clamp(300px, 26.5vw, 381px);
    padding: clamp(24px, 3.2vw, 46px) clamp(18px, 2.7vw, 39px);
  }

  /* Galleria: 4 colonne */
  .works__gallery {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: clamp(160px, 17vw, 250px);
    gap: clamp(10px, 1.3vw, 16px);
  }
  .work { border-radius: clamp(14px, 1.4vw, 20px); }
  .work:nth-child(10n + 6) { grid-column: 3 / span 2; }

  .showcase img { aspect-ratio: 1201 / 592; }

  .footer__inner {
    grid-template-columns: minmax(0, 422px) minmax(0, 256px);
    column-gap: clamp(40px, 7vw, 101px);
    padding-block: 82px 64px;
  }
}

/* ≥ 1024px — desktop: menu orizzontale */
@media (min-width: 1024px) {

  /* Servizi: lista a sinistra (colonna 1), dettaglio a destra (colonna 2).
     Gli articoli usano display: contents così titoli e pannelli diventano
     celle della stessa griglia; i 7 pannelli occupano la stessa area. */
  .services__list {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: repeat(7, auto);
    column-gap: clamp(40px, 5vw, 88px);
    align-content: start;
  }
  .service { display: contents; }
  .service__heading {
    grid-column: 1;
    border-bottom: 1px solid rgba(32, 46, 19, 0.16);
  }
  .service:first-child .service__heading { border-top: 1px solid rgba(32, 46, 19, 0.16); }
  .service__toggle { height: 100%; padding: 16px 0; }
  .service__title { font-size: clamp(1.625rem, 0.9rem + 1.2vw, 2.125rem); }
  .service.is-active .service__title { transform: translateX(8px); }

  /* Su desktop la "+" diventa una freccia → visibile su hover e voce attiva */
  .service__arrow {
    opacity: 0;
    transition: opacity 0.25s, transform 0.35s var(--ease);
  }
  .service__arrow::before { width: 18px; }
  .service__arrow::after {
    left: auto;
    right: 1px;
    width: 9px;
    height: 9px;
    border-radius: 0;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    background: none;
    transform: translateY(-50%) rotate(45deg);
  }
  .service.is-active .service__arrow,
  .service__toggle:hover .service__arrow {
    opacity: 1;
    transform: translateX(4px);
  }

  .service__panel {
    grid-column: 2;
    grid-row: 1 / span 7;
    padding-bottom: 0;
  }
  .js .service:not(.is-active) .service__panel { display: block; visibility: hidden; opacity: 0; }
  .service__panel { transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s; }
  .service.is-active .service__panel { visibility: visible; opacity: 1; transition-delay: 0s; animation: none; }
  .service__media { aspect-ratio: 16 / 10; }

  :root {
    --header-h: 125px;
    --header-h-compact: 84px;
  }

  .brand { gap: 8px; }
  .brand__tree { height: 83px; }
  .brand__text { height: 58px; }
  .header.is-scrolled .brand__tree { height: 62px; }
  .header.is-scrolled .brand__text { height: 43px; }

  .nav-toggle { display: none; }

  .nav {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
    background: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }
  .nav__list {
    display: flex;
    gap: 26px;
  }
  .nav__link {
    padding: 6px 0;
    border: 0;
    font-size: 1.25rem;
  }
  /* Sottolineatura animata per voce attiva/hover */
  .nav__link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--ease);
  }
  .nav__link:hover::after,
  .nav__link.is-active::after {
    transform: scaleX(1);
  }

  .trust { margin-top: -191px; }

  .method__inner {
    grid-template-columns: 476fr 648fr;
    column-gap: clamp(40px, 5.2vw, 75px);
  }
  .method__text { padding-top: 10px; }

  .zones__inner { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .faq__inner { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
  .faq__intro { position: sticky; top: calc(var(--header-h-compact) + 32px); }

  .footer__monstera {
    top: 60px;
    bottom: auto;
    right: max(-60px, calc(50% - 697px));
    width: 279px;
    opacity: 0.2;
  }
}

/* ≥ 1440px — come da Figma; ≥ 1680px il contenuto si allarga leggermente */
@media (min-width: 1680px) {
  :root { --container: 1320px; }
}

/* Accessibilità: niente animazioni per chi le ha disattivate nel sistema */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .js .loader { display: none; }

  .js [data-hero],
  .js .reveal,
  .js .hero__media img {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
