/* =========================================================
   Versione "Discesa" — si aggiunge a site.css.
   La home scende dalla superficie al substrato: ogni sezione ha il colore di uno strato.
   Carattere: IBM Plex Sans. Peso e spaziatura dei titoli in --h-weight / --h-track.
   ========================================================= */
:root {
  --f-display: 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif;
  --f-body: 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif;
  --f-serif: 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif;
  --h-weight: 600;
  --h-track: -.02em;
  --h-stretch: normal;
  --l1: #efe6cf;  /* sabbie */
  --l2: #d9c7a4;  /* limi */
  --l3: #6f6455;  /* argille */
  --l4: #3d5864;  /* falda */
  --l5: #22292e;  /* substrato */
}
h1, h2, h3, h4 { font-stretch: var(--h-stretch); font-weight: var(--h-weight); letter-spacing: var(--h-track); }
.btn { border-radius: 999px; font-family: var(--f-body); font-weight: 700; }
.link-arrow { font-family: var(--f-body); font-weight: 700; }

/* Intestazione trasparente sopra l'apertura */
.is-home .hdr { position: fixed; left: 0; right: 0; top: 0; background: transparent; border-bottom-color: transparent; transition: background-color .3s; }
.is-home .hdr:not(.is-solid) .logo__dark { display: none; }
.is-home .hdr:not(.is-solid) .logo__light { display: block; }
.is-home .hdr:not(.is-solid) .hdr__nav a, .is-home .hdr:not(.is-solid) .hdr__phone { color: var(--white); }
.is-home .hdr:not(.is-solid) .hdr__toggle { background: transparent; color: var(--white); border-color: rgba(255,255,255,.5); }
.is-home .hdr.is-solid { background: rgba(255,255,255,.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom-color: var(--line); }
.is-home .hdr.menu-is-open { background: var(--white); }
.is-home .hdr.menu-is-open .logo__dark { display: block; } .is-home .hdr.menu-is-open .logo__light { display: none; }
.is-home .hdr.menu-is-open .hdr__toggle { color: var(--ink); border-color: var(--line); }

/* Apertura */
.e-hero { position: relative; isolation: isolate; min-height: 100svh; display: grid; align-items: end; color: var(--white); background: var(--ink); }
.e-hero__media { position: absolute; inset: 0; z-index: -1; }
.e-hero__media .ph { width: 100%; height: 100%; }
.e-hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,24,27,.45) 0%, rgba(20,24,27,.1) 40%, rgba(20,24,27,.7) 85%, var(--l1) 100%); }
.e-hero__inner { padding-block: calc(var(--hdr-h) + var(--sp-6)) var(--sp-7); display: grid; gap: var(--sp-4); }
.e-hero__title { font-size: clamp(3rem, 1.4rem + 7vw, 8rem); line-height: .95; letter-spacing: -.03em; font-weight: 700; font-stretch: var(--h-stretch); color: var(--white); max-width: 11ch; margin: 0; }
.e-hero__foot { display: grid; gap: var(--sp-3); align-items: end; }
@media (min-width: 960px) { .e-hero__foot { grid-template-columns: 1fr auto; } }
.e-hero__lead { font-size: var(--t-md); line-height: 1.5; color: #eef0ee; max-width: 46ch; margin: 0; }
.e-hero .hero__actions { margin: 0; }
.e-down { transform: rotate(90deg); }

/* Strati */
.e-layer { padding-block: var(--sp-7); }
.e-layer--1 { background: var(--l1); color: var(--ink); }
.e-layer--2 { background: linear-gradient(180deg, var(--l1) 0, var(--l2) 10rem); color: var(--ink); }
.e-layer--3 { background: linear-gradient(180deg, var(--l2) 0, var(--l3) 12rem); color: var(--white); }
.e-layer--4 { background: linear-gradient(180deg, var(--l3) 0, var(--l4) 12rem); color: var(--white); }
.e-layer--5 { background: linear-gradient(180deg, var(--l4) 0, var(--l5) 12rem); color: var(--white); }
.e-layer--5 + .cta-band { border-top: 0; background: var(--l5); }
.e-title { font-size: clamp(2.6rem, 1.5rem + 4.5vw, 5.6rem); line-height: 1; letter-spacing: var(--h-track); font-weight: var(--h-weight); font-stretch: var(--h-stretch); color: inherit; margin-bottom: var(--sp-5); }
.e-label { font-family: var(--f-body); font-size: 1rem; font-weight: 700; letter-spacing: 0; color: #f3c9a1; margin-bottom: var(--sp-3); }

/* L'impresa */
.e-split { display: grid; gap: var(--sp-3); }
@media (min-width: 960px) { .e-split { grid-template-columns: 1fr 2fr; gap: var(--sp-6); } }
.e-big { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.5rem); line-height: 1.2; letter-spacing: -.01em; max-width: 26ch; }
.e-principles { list-style: none; display: grid; gap: var(--sp-3); margin: var(--sp-5) 0; padding: 0; }
@media (min-width: 860px) { .e-principles { grid-template-columns: repeat(3, 1fr); } }
.e-principles li { border-top: 2px solid var(--ink); padding-top: var(--sp-2); }
.e-principles h3 { font-size: 1.25rem; margin-bottom: .35rem; }
.e-principles p { font-size: 1rem; color: #4b4a42; }

/* Lavorazioni: scorrimento orizzontale guidato dallo scorrimento verticale (desktop) */
.e-hscroll { padding-block: var(--sp-7) var(--sp-6); }
.e-hscroll__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--sp-2); }
.e-hscroll__head .e-title { margin-bottom: var(--sp-4); }
.e-hscroll__hint { font-weight: 600; margin-bottom: var(--sp-4); }
.e-hscroll__viewport { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.e-hscroll__viewport::-webkit-scrollbar { display: none; }
.e-hscroll__track { list-style: none; display: flex; gap: var(--sp-3); padding: 0 max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))) var(--sp-2); width: max-content; }
.e-card { width: min(82vw, 30rem); scroll-snap-align: center; }
.e-card__link { display: grid; gap: .6rem; text-decoration: none; color: var(--ink); }
.e-card__media { display: block; border-radius: 18px; overflow: hidden; border-bottom: 8px solid var(--stratum); }
.e-card__media .ph { transition: transform .6s; }
.e-card__link:hover .e-card__media .ph { transform: scale(1.04); }
.e-card__name { font-family: var(--f-display); font-weight: var(--h-weight); font-stretch: var(--h-stretch); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.3rem); letter-spacing: var(--h-track); line-height: 1.05; margin-top: .4rem; }
.e-card__sum { color: #4b4a42; max-width: 36ch; }
.e-card__go { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; }
.e-hscroll.is-pinned { padding-block: 0; }
.e-hscroll.is-pinned .e-hscroll__sticky { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.e-hscroll.is-pinned .e-hscroll__viewport { overflow: visible; }
.e-hscroll.is-pinned .e-hscroll__track { will-change: transform; }

/* Cantieri: la foto si apre mentre la sezione scorre */
.e-reveal { margin: 0 auto var(--sp-5); max-width: 100%; overflow: hidden; }
.e-reveal .ph { width: 100%; max-height: 80vh; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .e-reveal { animation: e-open linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
  }
}
@keyframes e-open { from { clip-path: inset(0 22% round 24px); } to { clip-path: inset(0 0 round 0); } }
.e-sectors ul { list-style: none; display: grid; gap: var(--sp-4); padding: 0; margin: 0 0 var(--sp-5); }
@media (min-width: 760px) { .e-sectors ul { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .e-sectors ul { grid-template-columns: repeat(4, 1fr); } }
.e-sectors li { border-top: 2px solid rgba(255,255,255,.5); padding-top: var(--sp-2); }
.e-sectors h3 { font-size: 1.25rem; color: var(--white); }
.e-sectors p { color: #e4ded4; font-size: 1rem; }

/* Visione */
.e-vision { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.8rem, 1.2rem + 2.6vw, 3.6rem); line-height: 1.12; letter-spacing: -.015em; max-width: 24ch; margin: 0; }

/* Qualificazioni */
.e-certs { list-style: none; display: grid; gap: var(--sp-3); padding: 0; margin: 0 0 var(--sp-4); }
@media (min-width: 760px) { .e-certs { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .e-certs { grid-template-columns: repeat(4, 1fr); } }
.e-certs li { display: grid; gap: .3rem; padding: var(--sp-3); border: 1px solid rgba(255,255,255,.18); border-radius: 18px; }
.e-certs strong { font-family: var(--f-display); font-size: 1.6rem; letter-spacing: var(--h-track); font-stretch: var(--h-stretch); }
.e-certs span { color: #c3cbce; font-size: 1rem; }

/* Indicatore degli strati (desktop) */
.e-depth { position: fixed; z-index: 30; left: max(14px, env(safe-area-inset-left, 0px)); top: 50%; translate: 0 -50%; display: none; }
@media (min-width: 1280px) { .e-depth { display: block; } }
.e-depth ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; position: relative; }
.e-depth ol::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 1px; background: currentColor; opacity: .3; }
.e-depth a { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; text-decoration: none; color: inherit; font-size: .8125rem; font-weight: 600; }
.e-depth__dot { width: 13px; height: 13px; border-radius: 50%; border: 2px solid currentColor; background: transparent; flex: none; position: relative; z-index: 1; transition: background-color .2s, transform .2s; }
.e-depth__name { opacity: 0; translate: -4px 0; transition: opacity .2s, translate .2s; white-space: nowrap; }
.e-depth:hover .e-depth__name, .e-depth a[aria-current="true"] .e-depth__name, .e-depth a:focus-visible .e-depth__name { opacity: 1; translate: 0 0; }
.e-depth a[aria-current="true"] .e-depth__dot { background: var(--accent); border-color: var(--accent); transform: scale(1.15); }
.e-depth.on-dark { color: var(--white); }
.e-depth.on-light { color: var(--ink); }

/* Pagine interne */
.phead__title { font-weight: var(--h-weight); letter-spacing: var(--h-track); font-stretch: var(--h-stretch); line-height: 1; }
.phead--photo .phead__title { font-size: clamp(2.6rem, 1.4rem + 4.4vw, 5.2rem); }
.contact__big, .form, .split__media, .svc__media, .gal__item, .mosaic__item { border-radius: 18px; overflow: hidden; }
.sec--paper { background: var(--l1); }
.cta-band { border-top: 0; background: var(--l5); }
.hdr__phone { display: none; }
@media (min-width: 1500px) { .hdr__phone { display: inline-flex; } }
/* Sotto i 1500 px restano solo i punti, il nome compare al passaggio del mouse o con il focus */
@media (max-width: 1499px) { .e-depth a[aria-current="true"] .e-depth__name { opacity: 0; } .e-depth:hover a .e-depth__name, .e-depth a:focus-visible .e-depth__name { opacity: 1; } }
.e-depth:hover { background: rgba(255,255,255,.0); }

/* Smartphone e tablet: le schede delle lavorazioni si impilano una sopra l'altra mentre si scorre */
@media (max-width: 959px) {
  .e-hscroll__viewport { overflow: visible; scroll-snap-type: none; }
  .e-hscroll__track { flex-direction: column; width: auto; gap: 1.25rem; padding: 0 var(--gutter) var(--sp-4); }
  .e-card { width: auto; position: sticky; top: calc(var(--hdr-h) + .75rem + var(--i) * .85rem); }
  .e-card__link { background: #f7f0e1; border-radius: 22px; padding: .75rem .75rem 1.25rem; border-top: 6px solid var(--stratum); box-shadow: 0 -10px 28px rgba(60, 45, 20, .16); }
  .e-card__media { border-bottom: 0; border-radius: 14px; }
  .e-card__name, .e-card__sum, .e-card__go { padding-inline: .35rem; }
  .e-hscroll__hint { margin-bottom: var(--sp-3); }
  /* la scheda coperta si rimpicciolisce e si scurisce leggermente (valore --k calcolato dallo script) */
  .e-card__link { transform: scale(calc(1 - var(--k, 0) * .08)); filter: brightness(calc(1 - var(--k, 0) * .14)); transform-origin: 50% 0; }
}

/* Di che cosa avete bisogno: ingresso dal problema, in linguaggio semplice */
.e-needs { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.e-needs__link { display: grid; grid-template-columns: 1fr auto; gap: .35rem var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid rgba(29,37,43,.18); text-decoration: none; color: var(--ink); }
@media (min-width: 960px) { .e-needs__link { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; align-items: baseline; gap: var(--sp-5); } }
.e-needs__q { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.3rem, 1.1rem + .8vw, 1.75rem); line-height: 1.15; letter-spacing: -.02em; }
.e-needs__a { color: #4b4a42; grid-column: 1; }
@media (min-width: 960px) { .e-needs__a { grid-column: auto; } }
.e-needs__go { grid-row: 1; grid-column: 2; align-self: center; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1.5px solid var(--ink); transition: background-color .2s, color .2s; }
@media (min-width: 960px) { .e-needs__go { grid-column: 3; } }
.e-needs__link:hover .e-needs__go, .e-needs__link:focus-visible .e-needs__go { background: var(--ink); color: var(--white); }
.e-needs__link:hover .e-needs__q { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .15em; }
.e-needs__help { margin-top: var(--sp-4); font-weight: 600; }

/* L'impresa su fondo scuro (strato "falda") */
.e-layer--4 .e-principles li { border-top-color: rgba(255,255,255,.5); }
.e-layer--4 .e-principles h3 { color: var(--white); }
.e-layer--4 .e-principles p { color: #d6e0e4; }
.e-split .e-vision { font-family: var(--f-body); font-weight: 400; font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); line-height: 1.5; letter-spacing: 0; max-width: 52ch; margin: 0 0 var(--sp-4); color: #eef3f5; }
.e-split .e-vision .e-label { display: block; margin-bottom: .35rem; }
.e-sectors .e-label { margin-bottom: var(--sp-3); }
.e-sectors h4 { font-size: 1.25rem; color: var(--white); margin-bottom: .35rem; }
.e-sectors__lead { font-size: var(--t-md); color: #ece6dc; max-width: 46ch; margin-bottom: var(--sp-3); }

/* "Lavora con noi" nel menu: visibile da 1280 px, sotto resta nel menu mobile e nel piè di pagina */
.hdr__nav .nav-xl { display: none; }
@media (min-width: 1280px) { .hdr__nav .nav-xl { display: block; } }

/* Certificazioni: indice a pulsanti e schede con documento scaricabile */
.certx-intro { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-5); }
@media (min-width: 960px) { .certx-intro { grid-template-columns: 3fr 2fr; align-items: end; gap: var(--sp-6); } }
.certx-intro .sec__lead { margin: 0; }
.certx-index { position: sticky; top: calc(var(--hdr-h) + .5rem); z-index: 5; margin-bottom: var(--sp-5); }
.certx-index ul { list-style: none; margin: 0; padding: .5rem; display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 999px; width: max-content; max-width: 100%; }
.certx-index ul::-webkit-scrollbar { display: none; }
.certx-index a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .4rem 1.1rem; border-radius: 999px; white-space: nowrap; text-decoration: none; font-weight: 700; color: var(--ink); background: var(--l1); }
.certx-index a:hover, .certx-index a:focus-visible { background: var(--ink); color: var(--white); }
.certx-list { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.certx { display: grid; gap: var(--sp-3); padding: var(--sp-4); border-radius: 18px; background: var(--white); border: 1px solid var(--line); scroll-margin-top: calc(var(--hdr-h) + 5rem); }
.certx:nth-child(1) { border-top: 8px solid var(--l2); }
.certx:nth-child(2) { border-top: 8px solid var(--l3); }
.certx:nth-child(3) { border-top: 8px solid var(--l4); }
.certx:nth-child(4) { border-top: 8px solid var(--l5); }
@media (min-width: 960px) { .certx { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--sp-6); padding: var(--sp-5); } }
.certx__code { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3rem); line-height: 1.05; margin: 0; }
.certx__name { font-weight: 600; color: var(--steel); margin: 0 0 .5rem; }
.certx__body > p { margin-top: 0; max-width: 62ch; }
.certx__pts { list-style: none; padding: 0; margin: var(--sp-2) 0; display: grid; gap: .45rem; }
.certx__pts li { position: relative; padding-left: 1.6rem; }
.certx__pts li::before { content: ""; position: absolute; left: 0; top: .55em; width: .75rem; height: .75rem; border-radius: 3px; background: var(--accent); }
.certx__dl { display: inline-flex; align-items: center; gap: .75rem; margin-top: var(--sp-2); padding: .7rem 1.3rem .7rem 1rem; min-height: 3rem; border-radius: 999px; background: var(--ink); color: var(--white); text-decoration: none; font-weight: 700; }
.certx__dl small { font-weight: 600; opacity: .7; margin-left: .25rem; }
.certx__dl:hover { background: #000; }
.certx__dl:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Lavora con noi */
.jobs-label { font-weight: 700; color: var(--accent-ink, #a24c00); margin: 0; }
.jobs-intro .e-big { margin-top: 0; }
.jobs-why { list-style: none; padding: 0; margin: var(--sp-4) 0 0; display: grid; gap: var(--sp-3); }
@media (min-width: 760px) { .jobs-why { grid-template-columns: repeat(3, 1fr); } }
.jobs-why li { display: grid; gap: .3rem; border-top: 2px solid var(--ink); padding-top: var(--sp-2); }
.jobs-why strong { font-size: 1.15rem; }
.jobs-why span { color: var(--steel); }
.jobs-roles { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-3); }
@media (min-width: 760px) { .jobs-roles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .jobs-roles { grid-template-columns: repeat(3, 1fr); } }
.jobs-roles li { padding: var(--sp-3); background: var(--white); border-radius: 18px; border-top: 6px solid var(--l3); }
.jobs-roles li:nth-child(even) { border-top-color: var(--l4); }
.jobs-roles h3 { font-size: 1.25rem; margin-bottom: .35rem; }
.jobs-roles p { margin: 0; color: var(--steel); }
.jobs-form-wrap { display: grid; gap: var(--sp-5); }
@media (min-width: 1000px) { .jobs-form-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); align-items: start; } .jobs-aside { position: sticky; top: calc(var(--hdr-h) + var(--sp-3)); } }
.jobs-aside { display: grid; gap: var(--sp-3); }
.jobs-aside .h2, .jobs-aside p { margin: 0; }
.field input[type="file"] { padding: .6rem; background: var(--paper); cursor: pointer; }
.jobs-aside .contact__big span { font-size: clamp(1rem, .95rem + .4vw, 1.2rem); overflow-wrap: anywhere; }
/* Voci del menu sempre su una riga */
.hdr__nav ul { flex-wrap: nowrap; }
.hdr__nav a { white-space: nowrap; }
@media (min-width: 1280px) and (max-width: 1439px) { .hdr__nav a { padding-inline: .6rem; } }
.hdr__phone { white-space: nowrap; }
.hdr__phone { display: none !important; }

/* Azienda: cinque convinzioni e missione */
@media (min-width: 860px) { .principles--5 { grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); gap: var(--sp-4); } }
.mission__grid { display: grid; gap: var(--sp-3); }
@media (min-width: 960px) { .mission__grid { grid-template-columns: 5fr 7fr; gap: var(--sp-6); } }
.mission__text { display: grid; gap: var(--sp-2); justify-items: start; }
.mission__text p { margin: 0; max-width: 62ch; }
.mission__text .statement { margin: 0; }
.mission__close { font-weight: 700; }
.motto { font-weight: 700; color: var(--white); margin-top: var(--sp-2); }
