/* Rigolab – foglio di stile principale */

/* Font ospitati sul sito (nessuna richiesta a server esterni) – licenza SIL OFL */
@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-latin-wght.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Outfit";
    src: url("../fonts/outfit-latin-wght.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --orange: #F39200;
    --orange-600: #D97F00;
    --orange-50: #FFF4E3;
    --ink: #14212B;
    --ink-2: #1E2F3B;
    --text: #2B3A45;
    --muted: #5F6E79;
    --line: #E3E6E9;
    --bg: #FFFFFF;
    --tint: #F5F4F1;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow: 0 1px 2px rgba(20, 33, 43, .06), 0 8px 24px rgba(20, 33, 43, .08);
    --shadow-lg: 0 20px 50px rgba(20, 33, 43, .18);
    --font-head: "Outfit", system-ui, sans-serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --header-h: 76px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.15; margin: 0 0 .6em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
:where(ul[role="list"], ol) { list-style: none; padding: 0; margin: 0; }
button { font: inherit; cursor: pointer; }

.ico { width: 1.15em; height: 1.15em; flex: none; }

.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }

.skip {
    position: absolute; left: 16px; top: -60px; z-index: 200;
    background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip:focus { top: 12px; }

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

/* ---------- Tipografia ---------- */
.eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--font-head); font-weight: 600; font-size: 13px;
    letter-spacing: .14em; text-transform: uppercase; color: var(--orange-600);
    margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; }
.eyebrow--light { color: var(--orange); }

.h2 { font-size: clamp(28px, 3.4vw, 42px); font-weight: 600; }
.h3 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 600; }
.lead { font-size: 18px; color: var(--muted); }
.accent { color: var(--orange); }

/* ---------- Pulsanti ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 22px; border-radius: 999px; border: 1.5px solid transparent;
    font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
    transition: background .25s, color .25s, border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.btn .ico { transition: transform .25s var(--ease); }
.btn:hover .ico { transform: translateX(3px); }
.btn--primary { background: var(--orange); color: #fff; box-shadow: 0 6px 18px rgba(243, 146, 0, .35); }
.btn--primary:hover { background: var(--orange-600); transform: translateY(-1px); }
.btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .55); backdrop-filter: blur(6px); background: rgba(255, 255, 255, .06); }
.btn--ghost:hover { background: #fff; color: var(--ink); border-color: #fff; }
.btn--lg { padding: 16px 28px; font-size: 16px; }
.btn--block { width: 100%; }

.link {
    display: inline-flex; align-items: center; gap: 8px; margin-top: auto;
    font-weight: 600; color: var(--orange-600); text-decoration: none;
}
.link .ico { transition: transform .25s var(--ease); }
.link:hover .ico { transform: translateX(4px); }

/* ---------- Header ---------- */
.header {
    position: fixed; inset: 0 0 auto; z-index: 100; height: var(--header-h);
    background: rgba(255, 255, 255, .0);
    transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.header__inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.header__logo img { width: 140px; height: auto; transition: filter .3s; filter: brightness(0) invert(1); }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a {
    position: relative; text-decoration: none; font-weight: 500; font-size: 15px; color: #fff;
    padding: 6px 0; transition: color .2s;
}
.nav a::after {
    content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px;
    background: var(--orange); transition: right .3s var(--ease);
}
.nav a:hover::after, .nav a.is-current::after { right: 0; }
.nav__cta-mobile { display: none; }
.header__phone {
    display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none;
    font-weight: 600; font-size: 15px;
}
.header__phone .ico { color: var(--orange); }

.header.is-solid {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 1px 0 var(--line), 0 6px 20px rgba(20, 33, 43, .06);
}
.header.is-solid .header__logo img { filter: none; }
.header.is-solid .nav a, .header.is-solid .header__phone { color: var(--ink); }

.burger {
    display: none; width: 44px; height: 44px; margin-left: auto; border: 0; background: transparent;
    flex-direction: column; justify-content: center; align-items: center; gap: 5px; border-radius: 10px;
}
.burger span { width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: transform .3s, opacity .3s, background .3s; }
.header.is-solid .burger span { background: var(--ink); }

/* ---------- Hero ---------- */
.hero {
    position: relative; min-height: min(100svh, 860px); display: flex; align-items: flex-end;
    color: #fff; overflow: hidden; background: var(--ink); isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -1; }
.hero__slide {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    opacity: 0; transform: scale(1.08); transition: opacity 1.2s ease, transform 8s linear;
}
.hero__slide.is-active { opacity: 1; transform: scale(1); }
.hero__media::after {
    content: ""; position: absolute; inset: 0;
    background:
        linear-gradient(90deg, rgba(14, 23, 30, .92) 0%, rgba(14, 23, 30, .72) 45%, rgba(14, 23, 30, .25) 100%),
        linear-gradient(0deg, rgba(14, 23, 30, .7) 0%, rgba(14, 23, 30, 0) 40%);
}
.hero__content { padding: calc(var(--header-h) + 60px) 0 56px; }
.hero__title {
    color: #fff; font-size: clamp(38px, 5.6vw, 72px); font-weight: 600; max-width: 15ch;
    letter-spacing: -.02em; line-height: 1.04; margin-bottom: 22px;
}
.hero__lead { font-size: clamp(16px, 1.5vw, 19px); max-width: 58ch; color: rgba(255, 255, 255, .82); margin-bottom: 34px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 56px; }
.hero__tabs { display: flex; flex-wrap: wrap; gap: 10px; border-top: 1px solid rgba(255, 255, 255, .18); padding-top: 28px; }
.hero__tab {
    display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .8);
    font-size: 14px; font-weight: 500; position: relative; overflow: hidden; transition: color .2s, border-color .2s;
}
.hero__tab .ico { color: var(--orange); }
.hero__tab::after {
    content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--orange);
}
.hero__tab.is-active { color: #fff; border-color: rgba(255, 255, 255, .5); }
.hero__tab.is-active::after { animation: progress var(--slide-ms, 7000ms) linear forwards; }
@keyframes progress { to { width: 100%; } }
.hero__slide--civili { object-position: 60% 40%; }
.hero__caption {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 16px 0 0;
    font-size: 15px; color: rgba(255, 255, 255, .8); min-height: 1.6em;
}
.hero__caption span { transition: opacity .3s; }
.hero__caption.is-changing span { opacity: 0; }
.hero__caption a {
    display: inline-flex; align-items: center; gap: 6px; color: var(--orange); font-weight: 600; text-decoration: none;
}
.hero__caption a .ico { transition: transform .25s var(--ease); }
.hero__caption a:hover .ico { transform: translateX(3px); }

/* ---------- Numeri ---------- */
.stats { background: var(--ink-2); color: #fff; }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 34px 28px; border-left: 1px solid rgba(255, 255, 255, .1); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat__num {
    font-family: var(--font-head); font-size: clamp(32px, 3.4vw, 46px); font-weight: 600;
    color: #fff; line-height: 1; margin-bottom: 10px; font-variant-numeric: tabular-nums;
}
.stat__num small { font-size: .45em; margin-left: 6px; color: var(--orange); font-weight: 500; }
.stat__label { color: rgba(255, 255, 255, .65); font-size: 14px; margin: 0; max-width: 24ch; }

/* ---------- Sezioni ---------- */
.section { padding: clamp(72px, 9vw, 120px) 0; }
.section--tight { padding: clamp(56px, 7vw, 88px) 0; }
.section--tint { background: var(--tint); }
.section--dark { background: var(--ink); color: rgba(255, 255, 255, .75); }
.section--dark h2, .section--dark h3 { color: #fff; }
.section--dark .lead { color: rgba(255, 255, 255, .7); }
.section__head { max-width: 680px; margin-bottom: 52px; }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head--center .eyebrow::before { display: none; }
.section__head--row { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.section__head--row .h2 { margin: 0; }

/* ---------- Chi siamo ---------- */
.about { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(36px, 6vw, 84px); align-items: center; }
.about__media { position: relative; }
.about__media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; height: auto; }
.about__media::before {
    content: ""; position: absolute; width: 46%; aspect-ratio: 1; left: -22px; top: -22px; z-index: -1;
    border: 3px solid var(--orange); border-radius: 6px;
}
.about__badge {
    position: absolute; right: -18px; bottom: -26px; display: flex; gap: 14px; align-items: center;
    background: #fff; padding: 16px 20px; border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.about__badge .ico { width: 34px; height: 34px; color: var(--orange); }
.about__badge strong { display: block; font-family: var(--font-head); color: var(--ink); font-size: 16px; }
.about__badge span { font-size: 13px; color: var(--muted); }
.checklist { list-style: none; padding: 0; margin: 26px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 500; color: var(--ink); line-height: 1.45; }
.checklist .ico {
    width: 22px; height: 22px; padding: 4px; border-radius: 50%; flex: none; margin-top: 1px;
    background: var(--orange-50); color: var(--orange-600);
}

/* ---------- Servizi ---------- */
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.service {
    display: flex; flex-direction: column; background: #fff; border-radius: var(--radius-lg);
    overflow: hidden; box-shadow: var(--shadow); transition: transform .35s var(--ease), box-shadow .35s;
}
.service:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.service__img { aspect-ratio: 4 / 3; overflow: hidden; }
.service__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.service:hover .service__img img { transform: scale(1.06); }
.service__body { position: relative; display: flex; flex-direction: column; flex: 1; padding: 40px 24px 26px; }
.service__icon {
    position: absolute; top: -28px; left: 24px; width: 56px; height: 56px; border-radius: 16px;
    display: grid; place-items: center; background: var(--orange); color: #fff;
    box-shadow: 0 8px 20px rgba(243, 146, 0, .4);
}
.service__icon .ico { width: 28px; height: 28px; }
.service h3 { font-size: 20px; font-weight: 600; }
.service p { font-size: 15px; color: var(--muted); }
.service ul { list-style: none; padding: 0; margin: 0 0 20px; font-size: 14px; color: var(--text); }
.service li { padding: 7px 0; border-top: 1px dashed var(--line); display: flex; gap: 8px; }
.service li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); margin-top: 9px; flex: none; }

.service__img { position: relative; }
.service--featured { outline: 2px solid var(--orange); outline-offset: -2px; }
.service__badge {
    position: absolute; top: 14px; left: 14px; padding: 5px 12px; border-radius: 999px;
    background: var(--orange); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}

/* ---------- Impianti civili ---------- */
.civil { position: relative; overflow: hidden; isolation: isolate; }
.civil::before {
    content: ""; position: absolute; right: -180px; top: 80px; width: 520px; aspect-ratio: 1;
    border: 3px solid var(--orange-50); transform: rotate(-14deg); z-index: -1;
}
.civil__grid { display: grid; grid-template-columns: 1.25fr .9fr; gap: clamp(36px, 6vw, 80px); align-items: stretch; }
.civil__features { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 28px; margin: 36px 0 40px; }
.civil__features li { display: flex; gap: 14px; align-items: flex-start; }
.civil__ico {
    width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none;
    background: var(--orange-50); color: var(--orange-600);
}
.civil__ico .ico { width: 24px; height: 24px; }
.civil__features h3 { font-size: 17px; margin: 2px 0 4px; }
.civil__features p { font-size: 14.5px; color: var(--muted); margin: 0; line-height: 1.55; }
.civil__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.civil__phone { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); text-decoration: none; }
.civil__phone .ico { color: var(--orange); }
.civil__phone:hover { color: var(--orange-600); }
/* La colonna della foto prende l'altezza del testo: la foto la riempie ritagliandosi */
.civil__aside { display: flex; flex-direction: column; }
.civil__media { position: relative; flex: 1; min-height: 340px; }
.civil__media img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%;
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.civil__stamp {
    position: absolute; left: -22px; bottom: 28px; display: flex; gap: 12px; align-items: center; max-width: 260px;
    background: var(--ink); color: #fff; padding: 14px 18px; border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.civil__stamp .ico { width: 30px; height: 30px; color: var(--orange); }
.civil__stamp strong { display: block; font-family: var(--font-head); font-size: 17px; }
.civil__stamp span { font-size: 13px; color: rgba(255, 255, 255, .7); line-height: 1.35; display: block; }
.civil__targets { margin-top: 26px; padding: 20px 22px; border-radius: var(--radius); background: var(--tint); }
.civil__targets p { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.civil__targets ul { display: flex; flex-wrap: wrap; gap: 8px; }
.civil__targets li {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
    background: #fff; font-size: 14px; font-weight: 500; color: var(--ink); border: 1px solid var(--line);
}
.civil__targets .ico { color: var(--orange-600); }

/* ---------- Metodo ---------- */
.method { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(40px, 6vw, 80px); align-items: start; }
.method__intro { position: sticky; top: calc(var(--header-h) + 32px); }
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.pills li {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); color: #fff; font-size: 14px; font-weight: 500;
}
.pills .ico { color: var(--orange); }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; counter-reset: none; }
.step {
    position: relative; padding: 30px 26px; border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
    border: 1px solid rgba(255, 255, 255, .1); transition: border-color .3s, transform .35s var(--ease);
}
.step:hover { border-color: rgba(243, 146, 0, .6); transform: translateY(-4px); }
.step:nth-child(even) { transform: translateY(36px); }
.step:nth-child(even):hover { transform: translateY(32px); }
.step__n { position: absolute; top: 22px; right: 24px; font-family: var(--font-head); font-size: 40px; font-weight: 600; color: rgba(255, 255, 255, .08); line-height: 1; }
.step__ico { width: 40px; height: 40px; color: var(--orange); margin-bottom: 18px; }
.step h3 { font-size: 20px; }
.step p { font-size: 15px; margin: 0; }

/* ---------- Progetti ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
    padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
    color: var(--text); font-size: 14px; font-weight: 500; transition: all .2s;
}
.filter:hover { border-color: var(--ink); }
.filter.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
/* Caso in evidenza (revamping) */
.case {
    display: grid; grid-template-columns: .95fr 1.05fr; gap: clamp(28px, 4vw, 56px); align-items: center;
    background: var(--ink); color: rgba(255, 255, 255, .75); border-radius: var(--radius-lg);
    padding: clamp(24px, 4vw, 48px); margin-bottom: clamp(56px, 7vw, 88px); position: relative; overflow: hidden; overflow: clip;
}
.case::before {
    content: ""; position: absolute; left: -90px; bottom: -90px; width: 260px; aspect-ratio: 1;
    border: 3px solid rgba(243, 146, 0, .25); transform: rotate(-14deg);
}
.case__text { position: relative; }
.case__label {
    display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
    color: var(--ink); background: var(--orange); padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}
.case h3 { color: #fff; font-size: clamp(24px, 2.6vw, 32px); font-weight: 600; margin-bottom: 16px; }
.case p { font-size: 16px; }
.case__list { display: grid; gap: 10px; margin: 20px 0 28px; }
.case__list li { display: flex; gap: 10px; align-items: flex-start; color: #fff; font-size: 15px; font-weight: 500; line-height: 1.45; }
.case__list .ico { width: 20px; height: 20px; color: var(--orange); margin-top: 1px; }
.case__photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; position: relative; }
.case__photos figure { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 4; }
.case__photos figure:nth-child(2) { transform: translateY(24px); }
.case__open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.case__photos img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.case__photos figure:hover img, .case__open:focus-visible img { transform: scale(1.05); }
.case__open:focus-visible { outline-offset: -3px; }
.case__photos figcaption {
    pointer-events: none;
    position: absolute; left: 10px; top: 10px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: rgba(14, 23, 30, .8); color: #fff; backdrop-filter: blur(4px);
}
.case__photos figcaption.is-after { background: var(--orange); }
.gallery-head { display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.gallery-head h3 { font-size: 22px; font-weight: 600; margin: 0; }

/* Galleria compatta: riquadri 4:3 con la didascalia sopra la foto */
.projects { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.project { position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--ink); }
.project.is-hidden { display: none; }
.project__open {
    position: relative; display: block; width: 100%; padding: 0; border: 0;
    aspect-ratio: 4 / 3; background: var(--tint); overflow: hidden;
}
.project__open img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.project__open::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(0deg, rgba(14, 23, 30, .9) 0%, rgba(14, 23, 30, .45) 38%, rgba(14, 23, 30, 0) 65%);
    transition: background .35s;
}
.project__zoom {
    position: absolute; right: 12px; top: 12px; z-index: 1; width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--ink);
    opacity: 0; transform: scale(.85); transition: opacity .3s, transform .3s var(--ease);
}
.project figcaption {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 14px 16px 15px;
    color: #fff; pointer-events: none;
}
.project .tag {
    display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--orange); margin-bottom: 4px;
}
.project h3 { font-size: 16px; line-height: 1.25; margin: 0; color: #fff; }
.project p {
    font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, .78); margin: 0;
    max-height: 0; opacity: 0; overflow: hidden; transition: max-height .4s var(--ease), opacity .3s, margin .3s;
}
.project:hover .project__open img, .project:focus-within .project__open img { transform: scale(1.06); }
.project:hover .project__open::after, .project:focus-within .project__open::after {
    background: linear-gradient(0deg, rgba(14, 23, 30, .92) 0%, rgba(14, 23, 30, .6) 50%, rgba(14, 23, 30, .1) 100%);
}
.project:hover .project__zoom, .project:focus-within .project__zoom { opacity: 1; transform: none; }
.project:hover p, .project:focus-within p { max-height: 4.5em; opacity: 1; margin-top: 6px; }
@media (hover: none) {
    .project__zoom { opacity: 1; transform: none; width: 32px; height: 32px; }
}

/* ---------- Partner ---------- */
.partners { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.partners a {
    display: grid; place-items: center; height: 110px; padding: 18px 28px; background: #fff;
    border-radius: var(--radius); border: 1px solid var(--line); transition: box-shadow .3s, border-color .3s;
}
.partners img { max-height: 64px; width: auto; object-fit: contain; filter: grayscale(1); opacity: .7; transition: filter .3s, opacity .3s; }
.partners a:hover { box-shadow: var(--shadow); border-color: transparent; }
.partners a:hover img { filter: none; opacity: 1; }

/* ---------- Contatti ---------- */
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 5vw, 72px); align-items: start; }
.contact__list { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 30px 0; }
.contact__list li { display: flex; gap: 14px; align-items: flex-start; }
.contact__ico {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
    background: var(--orange-50); color: var(--orange-600);
}
.contact__list small { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.contact__list a, .contact__list span { color: var(--ink); font-weight: 500; text-decoration: none; font-size: 15px; line-height: 1.45; }
.contact__list a:hover { color: var(--orange-600); }
.contact__map { border-radius: var(--radius-lg); overflow: hidden; height: 260px; box-shadow: var(--shadow); background: var(--tint); }
.contact__map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(.4) contrast(1.05); }

.form {
    background: #fff; border-radius: var(--radius-lg); padding: clamp(26px, 4vw, 40px);
    box-shadow: var(--shadow-lg); border-top: 4px solid var(--orange);
    position: sticky; top: calc(var(--header-h) + 24px);
}
.form h3 { font-size: 24px; margin-bottom: 22px; }
.form__row { margin-bottom: 16px; }
.form__row--2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: block; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field input, .field select, .field textarea {
    width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--tint);
    border: 1.5px solid transparent; border-radius: 10px; padding: 12px 14px; transition: border-color .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--orange); background: #fff; }
.field__err { display: none; font-style: normal; font-size: 13px; color: #C0392B; margin-top: 5px; }
.field.is-invalid input, .field.is-invalid textarea { border-color: #E57373; background: #FFF6F5; }
.field.is-invalid .field__err { display: block; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 6px 0 20px; line-height: 1.5; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--orange); flex: none; }
.check.is-invalid span { color: #C0392B; }
.check a { color: var(--orange-600); font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__status { margin: 14px 0 0; font-size: 14px; font-weight: 500; min-height: 1.4em; }
.form__status.is-ok { color: #1E8449; }
.form__status.is-err { color: #C0392B; }
.form.is-sending button[type="submit"] { opacity: .7; pointer-events: none; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: rgba(255, 255, 255, .62); padding: 72px 0 0; font-size: 15px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 52px; }
.footer__logo { width: 150px; height: auto; filter: brightness(0) invert(1); margin-bottom: 20px; }
.footer__brand p { max-width: 34ch; }
.footer h4 { color: #fff; font-size: 16px; font-weight: 600; margin-bottom: 18px; }
.footer li { margin-bottom: 10px; }
.footer a { text-decoration: none; transition: color .2s; }
.footer a:hover { color: var(--orange); }
.social {
    display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .2); color: #fff;
}
.social:hover { background: var(--orange); border-color: var(--orange); color: #fff !important; }
.footer__bottom {
    display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, .1); padding: 22px 0; font-size: 14px;
}
.footer__bottom p { margin: 0; }
.footer__top { display: inline-flex; align-items: center; gap: 8px; }
.footer__top .ico { transform: rotate(-90deg); }

/* ---------- Lightbox ---------- */
.lightbox {
    width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
    background: rgba(10, 16, 21, .94); color: #fff;
}
.lightbox[open] { display: grid; grid-template-columns: 72px 1fr 72px; align-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 12px; object-fit: contain; }
.lightbox figcaption { font-family: var(--font-head); font-size: 17px; text-align: center; }
.lightbox__btn {
    width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; justify-self: center;
    transition: background .2s;
}
.lightbox__btn:hover { background: var(--orange); border-color: var(--orange); }
.lightbox__btn .ico { width: 22px; height: 22px; }
.lightbox__close { position: absolute; top: 18px; right: 18px; }

.footer__legal { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer__legal a, .footer__legal button {
    background: none; border: 0; padding: 0; color: inherit; font: inherit; font-size: 14px; text-decoration: none; cursor: pointer;
}
.footer__legal a:hover, .footer__legal button:hover { color: var(--orange); }
.footer__company { font-size: 13px; color: rgba(255, 255, 255, .45); width: 100%; }

/* ---------- Mappa con consenso ---------- */
.map-consent {
    height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 12px;
    padding: 24px 28px; color: var(--text); font-size: 14px;
    background:
        linear-gradient(rgba(245, 244, 241, .9), rgba(245, 244, 241, .9)),
        repeating-linear-gradient(45deg, #e9e6df 0 2px, transparent 2px 16px);
}
.map-consent strong { font-family: var(--font-head); font-size: 17px; color: var(--ink); }
.map-consent p { margin: 0; max-width: 46ch; color: var(--muted); }
.map-consent__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.map-consent .btn { padding: 10px 18px; font-size: 14px; box-shadow: none; }
.map-consent a { color: var(--orange-600); font-weight: 600; font-size: 14px; }

/* ---------- Banner cookie ---------- */
.cookie {
    position: fixed; left: 20px; bottom: 20px; z-index: 150; width: min(440px, calc(100% - 40px));
    background: #fff; color: var(--text); border-radius: var(--radius-lg); box-shadow: 0 24px 60px rgba(20, 33, 43, .28);
    padding: 24px; font-size: 14px; line-height: 1.55; border-top: 4px solid var(--orange);
    transform: translateY(20px); opacity: 0; transition: transform .4s var(--ease), opacity .4s;
}
.cookie.is-visible { transform: none; opacity: 1; }
.cookie[hidden] { display: none; }
.cookie h2 { font-size: 18px; margin: 0 32px 8px 0; }
.cookie p { margin: 0 0 14px; color: var(--muted); }
.cookie a { color: var(--orange-600); font-weight: 600; }
.cookie__x {
    position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0;
    background: var(--tint); color: var(--ink); display: grid; place-items: center;
}
.cookie__x:hover { background: var(--line); }
.cookie__prefs { border-top: 1px solid var(--line); margin: 4px 0 16px; }
.cookie__prefs[hidden] { display: none; }
.cookie__opt { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cookie__opt strong { display: block; color: var(--ink); font-size: 14px; }
.cookie__opt span { font-size: 13px; color: var(--muted); }
.switch { position: relative; flex: none; width: 44px; height: 26px; margin-top: 2px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #C9CED3; transition: background .2s; }
.switch i::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--ease);
}
.switch input:checked + i { background: var(--orange); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:disabled + i { opacity: .55; }
.switch input:focus-visible + i { outline: 3px solid var(--orange); outline-offset: 2px; }
.cookie__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cookie__actions .btn { padding: 11px 16px; font-size: 14px; box-shadow: none; }
.cookie__actions .btn--wide { grid-column: 1 / -1; }
.btn--outline { border-color: var(--ink); color: var(--ink); background: #fff; }
.btn--outline:hover { background: var(--ink); color: #fff; }
.btn--text { color: var(--ink); background: transparent; text-decoration: underline; text-underline-offset: 3px; padding-block: 6px; }
.btn--text:hover { color: var(--orange-600); }

/* ---------- Pagine legali ---------- */
.legal-hero { background: var(--ink); color: rgba(255, 255, 255, .75); padding: calc(var(--header-h) + 56px) 0 52px; }
.legal-hero h1 { color: #fff; font-size: clamp(32px, 4.4vw, 52px); font-weight: 600; margin-bottom: 10px; }
.legal-hero p { margin: 0; }
.legal { padding: 56px 0 96px; }
.legal__grid { display: grid; grid-template-columns: 240px 1fr; gap: 56px; align-items: start; }
.legal__toc { position: sticky; top: calc(var(--header-h) + 24px); font-size: 14px; }
.legal__toc p { font-family: var(--font-head); font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.legal__toc a { display: block; padding: 6px 0 6px 14px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; }
.legal__toc a:hover { color: var(--orange-600); border-color: var(--orange); }
.legal article { max-width: 760px; }
.legal h2 { font-size: 24px; font-weight: 600; margin: 44px 0 14px; scroll-margin-top: calc(var(--header-h) + 20px); }
.legal h2:first-child { margin-top: 0; }
.legal h3 { font-size: 18px; margin: 24px 0 8px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--orange-600); }
.legal .box { background: var(--tint); border-radius: var(--radius); padding: 20px 24px; margin: 16px 0; line-height: 1.8; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.legal th { font-family: var(--font-head); color: var(--ink); background: var(--tint); font-weight: 600; }
.legal code { background: var(--tint); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.legal .table-wrap { overflow-x: auto; }

/* ---------- Animazioni in entrata ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .step.reveal:nth-child(even) { transform: translateY(60px); }
.js .step.reveal.is-visible:nth-child(even) { transform: translateY(36px); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .header__phone { display: none; }
    .services { grid-template-columns: repeat(2, 1fr); }
    .projects { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 920px) {
    :root { --header-h: 66px; }
    .burger { display: flex; }
    .header__cta { display: none; }
    .nav {
        position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; gap: 0;
        background: #fff; padding: 8px 20px 24px; box-shadow: 0 20px 40px rgba(20, 33, 43, .15);
        transform: translateY(-12px); opacity: 0; visibility: hidden; transition: all .3s var(--ease);
    }
    .nav a { color: var(--ink) !important; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
    .nav a::after { display: none; }
    .nav .nav__cta-mobile { display: block; color: var(--orange-600) !important; border: 0; font-weight: 600; }
    .header.is-open { background: #fff; }
    .header.is-open .header__logo img { filter: none; }
    .header.is-open .burger span { background: var(--ink); }
    .header.is-open .nav { transform: none; opacity: 1; visibility: visible; }
    .header.is-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .header.is-open .burger span:nth-child(2) { opacity: 0; }
    .header.is-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .stats__grid { grid-template-columns: 1fr 1fr; }
    .stat { padding: 26px 20px; }
    .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
    .stat:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .1); }

    .about, .method, .contact__grid, .civil__grid { grid-template-columns: 1fr; }
    .civil__aside { position: static; }
    .case { grid-template-columns: 1fr; }
    .case__photos figure:nth-child(2) { transform: none; }
    .civil::before { display: none; }
    .civil__media { flex: none; min-height: 0; }
    .civil__media img { position: static; height: auto; aspect-ratio: 4 / 3; }
    .civil__stamp { left: 12px; }
    .about__media::before { left: -10px; top: -10px; }
    .about__badge { right: 12px; }
    .method__intro, .form { position: static; }
    .step:nth-child(even), .js .step.reveal.is-visible:nth-child(even) { transform: none; }
    .partners { grid-template-columns: repeat(2, 1fr); }
    .footer__grid { grid-template-columns: 1fr 1fr; }
    .legal__grid { grid-template-columns: 1fr; gap: 32px; }
    .legal__toc { position: static; }
}

@media (max-width: 600px) {
    .wrap { width: calc(100% - 32px); }
    .hero__content { padding-bottom: 36px; }
    .hero__actions .btn { width: 100%; }
    .hero__actions { margin-bottom: 36px; }
    .hero__tab { font-size: 13px; padding: 8px 12px; }
    .services, .steps, .checklist, .contact__list, .form__row--2, .civil__features { grid-template-columns: 1fr; }
    .projects { gap: 10px; }
    .case__photos { gap: 8px; }
    .case .btn { width: 100%; white-space: normal; text-align: center; }
    .project figcaption { padding: 10px 11px 11px; }
    .project .tag, .project p { display: none; }
    .project h3 { font-size: 13.5px; }
    .project__zoom { top: 8px; right: 8px; }
    .civil__actions .btn { width: 100%; }
    .partners a { height: 90px; padding: 14px 18px; }
    .footer__grid { grid-template-columns: 1fr; gap: 30px; }
    .lightbox[open] { grid-template-columns: 52px 1fr 52px; }
    .lightbox__btn { width: 40px; height: 40px; }
    .cookie { left: 12px; bottom: 12px; width: calc(100% - 24px); padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
    .js .reveal { opacity: 1; transform: none; }
}
