/* ============================================
   IMPRESA EDILE OSMANI LEONARD & C. S.A.S.
   Foglio di stile principale
   --------------------------------------------
   Tema chiaro: bianco + blu del logo (#434A9A)
   Tipografia: Barlow Condensed (titoli) + Barlow (testo)

   INDICE
   1. Variabili
   2. Reset e base
   3. Tipografia e utility
   4. Bottoni
   5. Header e navigazione
   6. Hero
   7. Punti di forza
   8. Chi siamo
   9. Servizi
   10. Lavori recenti
   11. Metodo
   12. Contatti e form
   13. Footer
   14. Pagina progetti (filtri, gallery, lightbox)
   15. Animazioni
   16. Responsive
   ============================================ */

/* 1. VARIABILI ============================== */
:root {
    /* Brand */
    --blue: #434a9a;            /* Blu logo */
    --blue-600: #363d86;        /* Hover */
    --blue-800: #1f2560;        /* Sezioni scure */
    --blue-900: #151a45;        /* Footer */
    --blue-50: #eef0fa;         /* Tinta chiara */
    --blue-100: #dde1f4;

    /* Accento cantiere (ocra dei ponteggi e delle facciate).
       Solo come segno grafico o su fondo blu scuro: su bianco non ha contrasto da testo. */
    --ochre: #e2a72e;

    /* Neutri */
    --ink: #161a2c;             /* Testo principale */
    --ink-soft: #4d5468;        /* Testo secondario */
    --muted: #7a8094;
    --line: #e2e5ee;
    --bg: #ffffff;
    --bg-alt: #f5f6f9;

    /* Tipografia */
    --font-heading: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --font-body: 'Barlow', 'Helvetica Neue', Arial, sans-serif;

    /* Layout */
    --container: 1200px;
    --gutter: 1.25rem;
    --header-h: 76px;
    --radius: 3px;
    --radius-lg: 4px;
    --section-y: clamp(4rem, 8vw, 6.5rem);

    --shadow-sm: 0 1px 2px rgba(22, 26, 44, 0.06);
    --shadow-md: 0 10px 30px -12px rgba(22, 26, 44, 0.22);
    --shadow-lg: 0 30px 60px -25px rgba(22, 26, 44, 0.35);

    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* 2. RESET E BASE =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
address { font-style: normal; }
strong { font-weight: 600; }

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

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.skip-link {
    position: absolute; top: -100px; left: 1rem; z-index: 2000;
    background: var(--blue); color: #fff; padding: .6rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* 3. TIPOGRAFIA ============================= */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.005em;
    color: var(--ink);
}

.section-label {
    display: inline-flex; align-items: center; gap: .6rem;
    font-size: .8125rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--blue);
    margin-bottom: .9rem;
}
.section-label::before {
    content: ''; width: 10px; height: 10px; background: var(--ochre);
}
.section-label--light { color: #b9c0f0; }

.section-title {
    font-size: clamp(2.1rem, 4.2vw, 3.1rem);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.section-header { max-width: 680px; margin-bottom: 3rem; }
.section-header--split {
    max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap;
}
.section-header--split .section-title { margin-bottom: 0; }
.section-header--split .section-description { max-width: 26rem; }
.section-description { color: var(--ink-soft); font-size: 1.125rem; }

.link-arrow {
    font-weight: 600; color: var(--blue);
    display: inline-flex; gap: .4rem; align-items: center;
    border-bottom: 2px solid var(--blue-100); padding-bottom: 2px;
    transition: border-color .2s;
}
.link-arrow:hover { border-color: var(--blue); }
.link-arrow span { transition: transform .2s var(--ease); }
.link-arrow:hover span { transform: translateX(4px); }

/* 4. BOTTONI ================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: var(--font-body); font-weight: 600; font-size: 1rem;
    padding: .85rem 1.5rem;
    border-radius: var(--radius);
    border: 2px solid transparent;
    transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover, .btn--primary:focus-visible { background: var(--blue-600); box-shadow: 0 8px 20px -8px rgba(67, 74, 154, .7); }

.btn--outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--outline:hover, .btn--outline:focus-visible { background: var(--ink); color: #fff; }

.btn--small { padding: .6rem 1.1rem; font-size: .9375rem; }
.btn--large { padding: 1rem 1.75rem; font-size: 1.0625rem; }
.btn--full { width: 100%; }

/* 5. HEADER ================================= */
.header {
    position: sticky; top: 0; z-index: 1000;
    background: #fff;
    border-bottom: 1px solid transparent;
    transition: border-color .2s, box-shadow .2s;
}
.header--scrolled { border-color: var(--line); box-shadow: var(--shadow-sm); }

.header__container {
    height: var(--header-h);
    display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}

.header__brand { flex-shrink: 0; display: flex; align-items: center; }
.header__logo { height: 50px; width: auto; }

.nav { display: flex; align-items: center; }
.nav__menu { display: flex; gap: 2rem; }
.nav__link {
    position: relative; font-weight: 500; color: var(--ink-soft);
    padding: .4rem 0; transition: color .2s;
}
.nav__link::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
    background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease);
}
.nav__link:hover, .nav__link--active { color: var(--ink); }
.nav__link:hover::after, .nav__link--active::after { transform: scaleX(1); }

.header__actions { display: flex; align-items: center; gap: 1.25rem; }
.header__phone {
    display: inline-flex; align-items: center; gap: .45rem;
    font-weight: 600; color: var(--ink);
}
.header__phone svg { color: var(--blue); }
.header__phone:hover { color: var(--blue); }

/* Elementi solo mobile */
.nav__toggle, .nav__close, .nav__mobile-logo, .nav__mobile-cta, .nav__mobile-contact, .nav__mobile-overlay { display: none; }

/* 6. HERO =================================== */
.hero {
    position: relative;
    padding: clamp(2rem, 4.5vw, 3.75rem) 0 clamp(3rem, 5vw, 4.5rem);
    background: var(--bg);
    overflow: hidden;
}

.hero__container {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}

.hero__eyebrow {
    display: inline-flex; align-items: center; gap: .6rem;
    font-size: .8125rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 1.25rem;
}
.hero__eyebrow::before { content: ''; width: 28px; height: 2px; background: currentColor; }

.hero__title {
    font-size: clamp(2.6rem, 4.9vw, 4.4rem);
    line-height: .95;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin-bottom: 1.5rem;
}
.hero__title span { display: block; color: var(--blue); }

.hero__subtitle {
    font-size: 1.1875rem;
    color: var(--ink-soft);
    max-width: 34rem;
    margin-bottom: 1.75rem;
}

.hero__cta-buttons { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 2rem; }

.hero__facts {
    display: flex; flex-wrap: wrap; gap: .5rem 1.75rem;
    padding-top: 1.5rem; border-top: 1px solid var(--line);
    font-size: .9375rem; color: var(--ink-soft);
}
.hero__facts li::before {
    content: ''; display: inline-block; width: 8px; height: 8px; background: var(--blue); margin-right: .55rem; vertical-align: 1px;
}
.hero__facts strong { color: var(--ink); }

/* Composizione foto */
.hero__media {
    position: relative;
    padding: 0 0 3rem 3rem;
}
.hero__media::before {
    content: ''; position: absolute; z-index: 0;
    top: -1.5rem; right: -1.5rem; width: 70%; height: 75%;
    background: var(--blue-50);
    border-radius: var(--radius-lg);
}
.hero__photo { position: relative; z-index: 1; margin: 0; overflow: hidden; border-radius: var(--radius-lg); background: var(--blue-50); }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; }
.hero__photo--main {
    aspect-ratio: 5 / 4.6;
    box-shadow: var(--shadow-lg);
}
.hero__photo--main img { object-position: 30% center; }
.hero__photo--secondary {
    position: absolute; z-index: 2; left: 0; bottom: 0;
    width: 40%; aspect-ratio: 3 / 4;
    border: 6px solid #fff;
    box-shadow: var(--shadow-md);
}
.hero__badge {
    position: absolute; z-index: 3; top: 1.5rem; right: -0.75rem;
    display: flex; align-items: center; gap: .8rem;
    background: var(--blue); color: #fff;
    padding: .7rem 1.1rem;
    font-family: var(--font-heading); font-weight: 700; font-size: 1.15rem;
    letter-spacing: .08em; text-transform: uppercase;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}
.hero__badge-sep { width: 1px; height: 1em; background: rgba(255, 255, 255, .45); }

/* 7-8. CHI SIAMO ============================ */
.why-us { padding: var(--section-y) 0; }
.why-us__container {
    display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center;
}
.why-us__media {
    display: grid; grid-template-columns: 1.15fr 1fr; grid-template-rows: 1fr 1fr; gap: .75rem;
}
.why-us__photo { margin: 0; overflow: hidden; border-radius: var(--radius-lg); background: var(--blue-50); }
.why-us__photo img { width: 100%; height: 100%; object-fit: cover; }
.why-us__photo--main { grid-row: span 2; aspect-ratio: 3 / 4; }
.why-us__photo--main img { object-position: center 30%; }
.why-us__caption { grid-column: 1 / -1; margin-top: .25rem; }
.why-us__actions { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.why-us__cna { font-size: .9375rem; color: var(--ink-soft); }
.why-us__cna strong { color: var(--ink); }
.photo-caption {
    margin-top: .75rem; padding-left: .85rem; border-left: 3px solid var(--ochre);
    font-size: .875rem; color: var(--muted);
}

.why-us__text { color: var(--ink-soft); margin-bottom: 1.75rem; }
.why-us__text strong { color: var(--ink); }
.why-us__features { display: grid; margin-bottom: 2rem; border-top: 1px solid var(--line); }
.why-us__feature {
    position: relative; padding: .8rem 0 .8rem 1.75rem; border-bottom: 1px solid var(--line);
}
.why-us__feature::before {
    content: ''; position: absolute; left: 0; top: 1.35rem; width: 12px; height: 3px; background: var(--blue);
}

/* 9. SERVIZI ================================ */
.services-detailed { padding: var(--section-y) 0; background: var(--bg-alt); }
.services-detailed__grid {
    display: grid; grid-template-columns: repeat(2, 1fr); column-gap: clamp(2rem, 5vw, 4rem);
    border-top: 2px solid var(--ink);
}
.service-detail-card {
    display: grid; grid-template-columns: 120px 1fr; gap: 1.4rem; align-items: start;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--line);
}
.service-detail-card__img {
    width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius);
    filter: saturate(.9);
    transition: filter .3s, transform .4s var(--ease);
}
.service-detail-card:hover .service-detail-card__img { filter: saturate(1.1); transform: scale(1.03); }
.service-detail-card__num {
    display: block; font-family: var(--font-heading); font-weight: 600; font-size: .95rem;
    color: var(--muted); letter-spacing: .08em; margin-bottom: .2rem;
}
.service-detail-card__title { font-size: 1.55rem; margin-bottom: .35rem; }
.service-detail-card__text { color: var(--ink-soft); font-size: .975rem; }

/* 9a. PRIMA E DOPO + VIDEO ================= */
.before-after { padding: var(--section-y) 0; }
.before-after__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); }
.ba-card__pair { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.ba-card__img { position: relative; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-lg); background: var(--blue-50); }
.ba-card__img img { width: 100%; height: 100%; object-fit: cover; }
.ba-card__tag {
    position: absolute; left: .6rem; top: .6rem;
    padding: .25rem .6rem;
    font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
    background: var(--blue-900); color: #fff;
}
.ba-card__tag--after { background: var(--ochre); color: var(--blue-900); }
.ba-card__title { font-size: 1.45rem; margin-bottom: .3rem; }
.ba-card__text { color: var(--ink-soft); font-size: .975rem; }

.video-feature {
    margin-top: clamp(2.5rem, 6vw, 4rem);
    display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center;
    background: var(--blue-800); color: #fff;
    border-radius: var(--radius-lg);
    padding: clamp(1.25rem, 4vw, 2.5rem);
}
.video-feature__media { border-left: 6px solid var(--ochre); }
.video-feature__video { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; background: #000; object-fit: cover; }
.video-feature__title { color: #fff; font-size: clamp(1.8rem, 3.5vw, 2.6rem); text-transform: uppercase; margin-bottom: .75rem; }
.video-feature__text { color: #c4c9ea; font-size: 1.0625rem; max-width: 32rem; margin-bottom: .75rem; }
.video-feature__meta { color: #9fa6d6; font-size: .8125rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1.5rem; }
.video-feature .btn--primary { background: #fff; color: var(--blue-800); white-space: normal; }
.video-feature .btn--primary:hover { background: var(--blue-50); }

/* 9b. UN CANTIERE DA VICINO =============== */
.case { padding: var(--section-y) 0; background: var(--bg-alt); }
.case__steps {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem;
    counter-reset: none;
}
.case-step { position: relative; }
.case-step__media { margin: 0 0 1rem; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-lg); background: var(--blue-50); }
.case-step__media img { width: 100%; height: 100%; object-fit: cover; }
.case-step__num {
    position: absolute; top: .75rem; left: .75rem;
    display: grid; place-items: center; width: 34px; height: 34px;
    background: var(--ochre); color: var(--blue-900);
    font-family: var(--font-heading); font-weight: 700; font-size: 1.15rem;
}
.case-step__title { font-size: 1.4rem; margin-bottom: .3rem; }
.case-step__text { color: var(--ink-soft); font-size: .975rem; }

/* 10. LAVORI RECENTI ======================== */
.works { padding: var(--section-y) 0; }
.works__grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    grid-template-rows: repeat(2, minmax(200px, 260px));
    gap: 1rem;
}
.work-tile {
    position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--blue-50);
}
.work-tile--tall { grid-row: span 2; }
.work-tile img {
    width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease);
}
.work-tile::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(12, 15, 38, .7) 0%, rgba(12, 15, 38, 0) 40%);
}
.work-tile:hover img { transform: scale(1.04); }
.work-tile__label {
    position: absolute; left: 1.1rem; bottom: 1rem; z-index: 1;
    color: #fff; font-family: var(--font-heading); font-weight: 700; font-size: 1.4rem;
    letter-spacing: .01em;
}

/* 11. METODO ================================ */
.process { padding: var(--section-y) 0; background: var(--bg-alt); }
.process__steps {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem;
    counter-reset: step;
}
.process__steps { position: relative; }
.process__steps::before {
    content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: var(--blue-100);
}
.process-step { position: relative; padding-top: 2rem; }
.process-step::before {
    content: ''; position: absolute; top: 0; left: 0; width: 14px; height: 14px;
    background: var(--ochre); box-shadow: 0 0 0 5px var(--bg-alt);
}
.process-step__number {
    font-family: var(--font-heading); font-weight: 700; font-size: 1rem; letter-spacing: .1em;
    color: var(--blue); margin-bottom: .4rem;
}
.process-step__title { font-size: 1.45rem; margin-bottom: .4rem; }
.process-step__text { color: var(--ink-soft); font-size: .975rem; }

/* 12. CONTATTI E FORM ======================= */
.cta-contact {
    position: relative; overflow: hidden;
    padding: var(--section-y) 0;
    background: var(--blue-800);
    color: #fff;
}
.cta-contact > .container { position: relative; z-index: 1; }
/* Le linee del ponteggio prese dal logo */
.cta-contact__lines {
    position: absolute; z-index: 0; left: -6%; bottom: -12%;
    width: min(70vw, 760px); height: auto;
    color: rgba(255, 255, 255, .09);
}
.cta-contact .section-title::after {
    content: ''; display: block; width: 56px; height: 4px; background: var(--ochre); margin-top: 1rem;
}
.cta-contact__grid {
    display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(2rem, 6vw, 5rem); align-items: start;
}
.cta-contact .section-title { color: #fff; }
.cta-contact__text { color: #c4c9ea; font-size: 1.125rem; margin-bottom: 2.25rem; max-width: 30rem; }
.cta-contact__text strong { color: #fff; }

.cta-contact__info { display: grid; gap: 1.25rem; }
.contact-item { display: flex; gap: 1rem; align-items: center; }
.contact-item__icon {
    flex-shrink: 0; width: 46px; height: 46px; border-radius: var(--radius);
    display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: #c9cff5;
}
.contact-item__icon svg { width: 22px; height: 22px; }
.contact-item__icon--wa { color: #7fe0a5; }
.contact-item__label {
    display: block; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: #9fa6d6;
}
.contact-item__value { font-size: 1.125rem; font-weight: 500; color: #fff; }
.contact-item__value--link:hover { text-decoration: underline; text-underline-offset: 3px; }

.cta-contact__form-wrapper {
    background: #fff; color: var(--ink);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: var(--shadow-lg);
}
.contact-form__title { font-size: 1.75rem; margin-bottom: 1.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .4rem; color: var(--ink); }
.form-input, .form-select, .form-textarea {
    width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
    padding: .75rem .9rem;
    background: var(--bg-alt);
    border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(67, 74, 154, .15);
}
.form-textarea { resize: vertical; min-height: 110px; }
.form-select {
    appearance: none; -webkit-appearance: none; padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23434a9a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 1rem center;
}
.form-group--checkbox { display: flex; gap: .6rem; align-items: flex-start; }
.form-checkbox { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--blue); flex-shrink: 0; }
.form-label--checkbox { font-weight: 400; color: var(--ink-soft); margin: 0; }
.form-label--checkbox a { color: var(--blue); text-decoration: underline; }
.contact-form__note { margin-top: .9rem; font-size: .8125rem; color: var(--muted); }

/* 13. FOOTER ================================ */
.footer { background: var(--blue-900); color: #b6bbdc; padding: 4rem 0 0; font-size: .9375rem; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; padding-bottom: 3rem; }
.footer__logo { width: 170px; height: auto; margin-bottom: 1.25rem; }
.footer__tagline { max-width: 20rem; }
.footer__title {
    color: #fff; font-size: 1.05rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 1rem;
}
.footer__list { display: grid; gap: .5rem; }
.footer__list a:hover, .footer__address a:hover, .footer__link:hover { color: #fff; }
.footer__address p, .footer__section > p { margin-bottom: .35rem; }
.footer strong { color: #fff; }
.footer__note { color: #8d93bf; font-size: .875rem; margin-top: .5rem; }
.footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding: 1.4rem 0;
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    font-size: .8125rem; color: #8d93bf;
}
.footer__links { display: flex; gap: 1.5rem; }

/* 14. PAGINA PROGETTI ======================= */
.projects-hero {
    padding: clamp(3rem, 7vw, 5rem) 0 2.5rem;
    background-color: var(--bg-alt);
    background-image:
        linear-gradient(rgba(67, 74, 154, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(67, 74, 154, .06) 1px, transparent 1px);
    background-size: 32px 32px;
    border-bottom: 1px solid var(--line);
}
.projects-hero__content { max-width: 720px; }
.projects-hero__title {
    font-size: clamp(2.8rem, 6vw, 4.5rem); text-transform: uppercase; line-height: .95; margin-bottom: 1rem;
}
.projects-hero__subtitle { color: var(--ink-soft); font-size: 1.125rem; }

.gallery-filters {
    position: sticky; top: var(--header-h); z-index: 50;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding: .9rem 0;
}
.gallery-filters__wrapper { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 900px) { .gallery-filters__wrapper { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } }
.gallery-filters__wrapper::-webkit-scrollbar { display: none; }
.filter-btn {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: .5rem;
    padding: .5rem .95rem; border-radius: 999px;
    border: 1px solid var(--line); background: #fff;
    font-weight: 500; font-size: .9375rem; color: var(--ink-soft);
    transition: all .2s;
}
.filter-btn:hover { border-color: var(--blue); color: var(--blue); }
.filter-btn--active, .filter-btn--active:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.filter-btn__count {
    font-size: .75rem; font-weight: 600; min-width: 1.5rem; text-align: center;
    padding: .05rem .4rem; border-radius: 999px; background: var(--bg-alt); color: var(--ink-soft);
}
.filter-btn--active .filter-btn__count { background: rgba(255, 255, 255, .2); color: #fff; }

.gallery { padding: 2.5rem 0 var(--section-y); }
.gallery__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

.gallery-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
    overflow: hidden; cursor: pointer;
    transition: box-shadow .25s, transform .25s var(--ease), border-color .25s;
}
.gallery-card:hover, .gallery-card:focus-visible { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: transparent; }
.gallery-card__image-wrapper { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--blue-50); }
.gallery-card__image { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), opacity .4s; opacity: 0; }
.gallery-card__image.loaded { opacity: 1; }
.gallery-card:hover .gallery-card__image { transform: scale(1.04); }
.gallery-card__overlay {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: rgba(21, 26, 69, .35); opacity: 0; transition: opacity .25s;
}
.gallery-card:hover .gallery-card__overlay { opacity: 1; }
.gallery-card__zoom {
    width: 48px; height: 48px; border-radius: 50%; background: #fff; color: var(--blue);
    display: grid; place-items: center;
}
.gallery-card__zoom svg { width: 22px; height: 22px; }
.gallery-card__content { padding: 1.1rem 1.25rem 1.3rem; }
.gallery-card__category {
    display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
    color: var(--blue); margin-bottom: .4rem;
}
.gallery-card__title { font-size: 1.3rem; text-transform: uppercase; line-height: 1.1; margin-bottom: .4rem; }
.gallery-card__description { display: none; }
.gallery-card__caption { color: var(--ink-soft); font-size: .9375rem; }

.gallery__loading, .gallery__empty, .gallery__error {
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
    padding: 4rem 1rem; color: var(--muted); text-align: center; grid-column: 1 / -1;
}
.gallery__empty[hidden] { display: none; }
.gallery__spinner {
    width: 36px; height: 36px; border-radius: 50%;
    border: 3px solid var(--blue-100); border-top-color: var(--blue);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.projects-cta { padding: var(--section-y) 0; background: var(--blue-800); color: #fff; text-align: center; }
.projects-cta__content { max-width: 640px; margin: 0 auto; }
.projects-cta__title { color: #fff; font-size: clamp(2rem, 4vw, 3rem); text-transform: uppercase; margin-bottom: 1rem; }
.projects-cta__text { color: #c4c9ea; margin-bottom: 2rem; font-size: 1.125rem; }
.projects-cta__buttons { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.projects-cta .btn--primary { background: #fff; color: var(--blue-800); }
.projects-cta .btn--primary:hover { background: var(--blue-50); }
.projects-cta .btn--outline { border-color: rgba(255, 255, 255, .5); color: #fff; }
.projects-cta .btn--outline:hover { background: #fff; color: var(--blue-800); border-color: #fff; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .3s; }
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lightbox__overlay { position: absolute; inset: 0; background: rgba(12, 15, 38, .94); }
.lightbox__container { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 4rem 5rem; }
.lightbox__content { display: flex; flex-direction: column; align-items: center; max-width: 1100px; width: 100%; max-height: 100%; }
.lightbox__image { max-width: 100%; max-height: calc(100vh - 14rem); object-fit: contain; border-radius: var(--radius); transition: opacity .25s; }
.lightbox__image.loading { opacity: .3; }
.lightbox__caption { margin-top: 1.25rem; text-align: center; color: #d6d9f0; max-width: 680px; display: flex; flex-direction: column; gap: .25rem; }
.lightbox__category { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: #9fa6d6; }
.lightbox__title { font-family: var(--font-heading); font-size: 1.5rem; text-transform: uppercase; color: #fff; }
.lightbox__description { font-size: .9375rem; color: #aeb3d6; }
.lightbox__caption-text { display: none; }
.lightbox__close, .lightbox__nav {
    position: absolute; z-index: 2; width: 48px; height: 48px; border-radius: 50%;
    display: grid; place-items: center; color: #fff;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18);
    transition: background-color .2s, color .2s;
}
.lightbox__close:hover, .lightbox__nav:hover { background: #fff; color: var(--blue-800); }
.lightbox__close svg, .lightbox__nav svg { width: 22px; height: 22px; }
.lightbox__close { top: 1.25rem; right: 1.25rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 1.25rem; }
.lightbox__nav--next { right: 1.25rem; }
.lightbox__counter { position: absolute; top: 1.6rem; left: 1.5rem; color: #9fa6d6; font-size: .875rem; letter-spacing: .08em; }

/* WhatsApp flottante */
.wa-float {
    position: fixed; z-index: 900; right: 1.25rem; bottom: 1.25rem;
    display: inline-flex; align-items: center; gap: .55rem;
    padding: .75rem 1.1rem .75rem .9rem;
    background: #1f9d55; color: #fff; font-weight: 600;
    border-radius: 999px;
    box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .45);
    transition: background-color .2s, transform .2s var(--ease);
}
.wa-float:hover { background: #188547; transform: translateY(-2px); }
.wa-float svg { width: 22px; height: 22px; }

/* 15. ANIMAZIONI ============================ */
.animate-fade-up, .animate-fade-up-stagger, .animate-scale-up, .animate-fade-in {
    opacity: 0; transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.animate-fade-up, .animate-fade-up-stagger { transform: translateY(18px); }
.animate-scale-up { transform: translateY(12px); }
.animate-visible { opacity: 1; transform: none; }

.hero__content > *, .hero__media { animation: rise .8s var(--ease) both; }
.hero__content > :nth-child(2) { animation-delay: .06s; }
.hero__content > :nth-child(3) { animation-delay: .12s; }
.hero__content > :nth-child(4) { animation-delay: .18s; }
.hero__content > :nth-child(5) { animation-delay: .24s; }
.hero__media { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .animate-fade-up, .animate-fade-up-stagger, .animate-scale-up, .animate-fade-in { opacity: 1; transform: none; }
}

/* 16. RESPONSIVE ============================ */
@media (max-width: 1100px) {
    .header__phone span { display: none; }
    .nav__menu { gap: 1.4rem; }
    .process__steps { grid-template-columns: repeat(3, 1fr); row-gap: 2.5rem; }
    .case__steps { grid-template-columns: repeat(2, 1fr); row-gap: 2rem; }
    .before-after__grid { grid-template-columns: 1fr; }
    .process__steps::before { display: none; }
    .process-step { border-top: 2px solid var(--blue-100); }
    .process-step::before { top: -8px; }
    .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    :root { --header-h: 68px; }
    .header__logo { height: 42px; }

    /* Menu mobile off-canvas */
    .nav { order: 3; }
    .nav__toggle {
        display: flex; flex-direction: column; justify-content: center; gap: 5px;
        width: 44px; height: 44px; padding: 10px;
    }
    .nav__toggle-bar { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
    .nav__menu-wrapper {
        position: fixed; top: 0; right: 0; bottom: 0; z-index: 1100;
        width: min(86vw, 360px);
        background: #fff; padding: 1.5rem 1.5rem 2rem;
        display: flex; flex-direction: column; gap: 1.5rem;
        transform: translateX(100%); visibility: hidden;
        transition: transform .35s var(--ease), visibility 0s linear .35s;
        overflow-y: auto;
    }
    .nav__menu-wrapper.is-open { transform: none; visibility: visible; box-shadow: var(--shadow-lg); transition: transform .35s var(--ease); }
    .nav__mobile-overlay {
        display: block; position: fixed; inset: 0; z-index: 1050;
        background: rgba(21, 26, 69, .45); opacity: 0; pointer-events: none; transition: opacity .3s;
    }
    .nav__mobile-overlay.is-open { opacity: 1; pointer-events: auto; }
    .nav__close { display: grid; place-items: center; width: 40px; height: 40px; align-self: flex-end; }
    .nav__close svg { width: 24px; height: 24px; }
    .nav__mobile-logo { display: block; }
    .nav__mobile-logo img { width: 140px; }
    .nav__menu { flex-direction: column; gap: 0; }
    .nav__link {
        display: block; padding: .9rem 0; border-bottom: 1px solid var(--line);
        font-family: var(--font-heading); font-weight: 700; font-size: 1.5rem; text-transform: uppercase; color: var(--ink);
    }
    .nav__link::after { display: none; }
    .nav__link--active { color: var(--blue); }
    .nav__mobile-cta { display: inline-flex; }
    .nav__mobile-contact { display: block; }
    .nav__mobile-phone { display: inline-flex; gap: .5rem; align-items: center; font-weight: 600; color: var(--blue); }

    .header__actions { margin-left: auto; }

    .hero__container { grid-template-columns: 1fr; }
    .hero__media { padding: 0 0 2.5rem 2rem; max-width: 560px; }
    .hero__photo--main { aspect-ratio: 4 / 3; }

    .services-detailed__grid { grid-template-columns: 1fr; }
    .why-us__media { order: 2; }

    .why-us__container, .cta-contact__grid { grid-template-columns: 1fr; }
    .why-us__media { margin-bottom: .5rem; }

    .works__grid { grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-auto-rows: 200px; }
    .work-tile--tall { grid-row: span 2; }

    .gallery__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    body { font-size: 1rem; }
    .header__actions .btn { display: none; }
    .header__phone {
        width: 42px; height: 42px; justify-content: center; border-radius: 50%; background: var(--blue-50);
    }
    .hero__cta-buttons .btn { flex: 1 1 100%; }
    .hero__media { padding-left: 1.25rem; }
    .hero__photo--secondary { width: 42%; border-width: 4px; }
    .hero__badge { right: .5rem; top: .75rem; font-size: 1rem; padding: .55rem .85rem; }

    .service-detail-card { grid-template-columns: 84px 1fr; gap: 1rem; }
    .case__steps { grid-template-columns: 1fr; }
    .video-feature { grid-template-columns: 1fr; }
    .video-feature__media { max-width: 340px; }
    .case-step { display: grid; grid-template-columns: 120px 1fr; column-gap: 1rem; }
    .case-step__media { grid-row: span 2; margin: 0; }
    .case-step__num { width: 28px; height: 28px; font-size: 1rem; top: .4rem; left: .4rem; }
    .service-detail-card__img { width: 84px; height: 84px; }
    .service-detail-card__title { font-size: 1.35rem; }

    .wa-float { right: 1rem; bottom: 1rem; padding: .85rem; }
    .wa-float span { display: none; }
    .wa-float svg { width: 26px; height: 26px; }
    .process__steps { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; gap: 0; }

    .works__grid { grid-template-columns: 1fr; grid-auto-rows: 220px; }
    .work-tile--tall { grid-row: span 1; }

    .gallery__grid { grid-template-columns: 1fr; }
    .lightbox__container { padding: 4.5rem 1rem 2rem; }
    .lightbox__nav { top: auto; bottom: 1.25rem; transform: none; }

    .footer__grid { grid-template-columns: 1fr; gap: 2rem; }
}
