/* ===========================
   TOKENS / VARIABILI DI STILE
   =========================== */
@font-face {
    font-family: "Instrument Sans";
    src: url("../fonts/InstrumentSans-VariableFont_wdth,wght.ttf") format("truetype-variations");
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Instrument Sans";
    src: url("../fonts/InstrumentSans-Italic-VariableFont_wdth,wght.ttf") format("truetype-variations");
    font-weight: 400 800;
    font-style: italic;
    font-display: swap;
}

:root {
    --font-family-base: "Instrument Sans";

    /* Spessori */
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Letter-spacing per gli header */
    --heading-letter-spacing: -0.05em;

    /* Palette colori */
    --color-bg: #ffffff;
    --color_EVOG: rgb(118, 181, 129);
    --color_EVOB: #252525;
    --color-text: var(--color_EVOB);
    --color-muted: #666666;
    --color-border: #e5e5e5;
    --color-link: var(--color_EVOB);

    /* Superfici */
    --color-surface: #ffffff;
    --color-surface-alt: #f5f5f5;

    /* Ombre */
    --shadow-card: 0 10px 25px rgba(0, 0, 0, 0.08);

    /* Hero */
    --hero-image-opacity: 0.4;

    /* Tipografia */
    --font-size-base: 16px;
    --font-size-sm: 0.875rem;
    --font-size-heading-sm: 1rem;
    --font-size-heading: 1.8rem;
    --font-size-heading-lg: 2.5rem;
    --font-size-heading-xl: 5.5rem;
    --font-size-heading-footer: clamp(3rem, 9vw, 12rem);

    /* Layout */
    --container-max-width: 2800px;
    --header-height: 70px;

    /* Spaziatura */
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3.5rem;
    --space-16: 5rem;
    --space-20: 8rem;
}

/* ===========================
   RESET BASE / GLOBAL
   =========================== */

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

html {
    font-size: 100%;
}

body {
    margin: 0;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::selection {
    background: var(--color_EVOG);
    color: var(--color_EVOB);
}

::-moz-selection {
    background: var(--color_EVOG);
    color: var(--color_EVOB);
}


/* CORREZIONE CRITICA: Blocco Scroll */
.menu-open {
    overflow: hidden;
    height: 100vh;
}

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

/* Link base */
a {
    color: var(--color-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Contenitore centrale */
.page {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding-inline: var(--space-20);
}

/* Testo body */
.body-text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
}

.body-text--muted {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-muted);
}

/* Heading generico */
.heading {
    margin: 0;
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--heading-letter-spacing);
}

/* Heading dimensioni */
.heading--xl {
    font-size: var(--font-size-heading-xl);
    line-height: 0.9;
}

.heading--xl--sub {
    font-size: var(--font-size-heading);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: var(--space-4);
    color: var(--color_EVOG);
}

.heading--lg {
    font-size: var(--font-size-heading-lg);
    line-height: 1.1;
}

.heading--lg--green {
    font-size: var(--font-size-heading-lg);
    line-height: 1.1;
    color: var(--color_EVOG);
}

.heading--sm {
    font-size: var(--font-size-heading-sm);
}

/* Heading footer enorme */
.heading--footer {
    font-size: var(--font-size-heading-footer);
    text-transform: uppercase;
}

/* Sezioni verticali */
.section {
    padding-block: var(--space-12);
}

/* Contenitore con bordo per i contenuti principali */
/*.section-box {
     eventualmente riattivabile 
}*/
.divider-img {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin-top: 0;
    margin-bottom: var(--space-4);
}

.divider {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-6);
    margin-bottom: var(--space-6);
}

/* Header sezione */
.section__header {
    margin-bottom: var(--space-16);
    text-align: center;
}

.text-center {
    text-align: center;
}

.section__header .heading {
    position: relative;
    display: inline-block;
}

.section__header .heading::after {
    content: "";
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--color_EVOG);
}

.section--dark-header .heading::after {
    background-color: var(--color_EVOB);
}

/* Variante senza linea */
.heading--no-line::after {
    display: none !important;
}

/* MODERN SECTION HEADERS */
.section-header-modern {
    margin-bottom: var(--space-8);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    text-align: left;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text);
    width: fit-content;
    background-color: none;
    /*var(--color-surface);*/
}

.section-label svg,
.section-label img {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--color_EVOG);
    color: var(--color_EVOG);
}

.section-header-modern--light .section-label {
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    background-color: transparent;
}

.section-header-modern--light .section-label svg {
    stroke: #ffffff;
    color: #ffffff;
}

/* Modificatore per centrare */
.section-header-modern.text-center {
    align-items: center;
    text-align: center;
}

.section-header-modern.text-center .section-title-wrapper {
    flex-direction: column;
    align-items: center;
}

.section-header-modern.text-center .section-claim {
    text-align: center;
}

.section-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

@media (min-width: 768px) {
    .section-title-wrapper {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        flex-wrap: wrap;
    }
}

.section-header-modern .heading {
    position: static;
    display: block;
    max-width: 600px;
}

.section-header-modern .heading::after {
    display: none;
}

.section-header-modern--light .heading {
    color: #ffffff;
}

.section-claim {
    font-size: 1.1rem;
    color: var(--color-muted);
    max-width: 450px;
    margin: 0;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .section-claim {
        text-align: right;
        margin-bottom: 0.5rem;
    }
}

.section-header-modern--light .section-claim {
    color: rgba(255, 255, 255, 0.9);
}

/* UTILITY CLASSES */
.text-white {
    color: #ffffff !important;
}

/* BACKGROUND SPLIT FOR SERVICES */
.split-bg-dark-light {
    position: relative;
    background-color: transparent !important;
    z-index: 1;
}

.split-bg-dark-light::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 55%;
    background-color: var(--color_EVOB);
    z-index: -1;
}

.split-bg-dark-light::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45%;
    background-color: var(--color-surface-alt);
    z-index: -1;
}

@media (max-width: 767px) {
    .split-bg-dark-light::before {
        height: 60%;
    }

    .split-bg-dark-light::after {
        height: 40%;
    }
}


/* ===========================
   HERO
   =========================== */

.hero {
    position: relative;
    height: 100vh;
    min-height: 500px;
    box-sizing: border-box;
    padding-top: var(--header-height);
    display: flex;
    align-items: center;
    overflow: hidden;
    --hero-bg-offset: 0px;
    background-color: var(--color_EVOB);
    /* Sfondo scuro di base unificato */
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.8;
    /* Immagine ben visibile, leggermente opaca */
    z-index: 0;
    transform: translateY(var(--hero-bg-offset));
    will-change: transform;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    /* Layer scuro per far risaltare benissimo il logo e il testo, contrastando perfettamente col verde */
    background: rgba(37, 37, 37, 0.68);
    pointer-events: none;
    z-index: 1;
}

/* Testi unificati per Dark Mode in tutte le Hero */
.hero .hero__subtitle {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero .heading--xl {
    color: #ffffff !important;
    /* Rende il titolo (es. I NOSTRI LAVORI) bianco */
}



/* =========================================================
   OVERRIDE SPECIFICI PER LE SINGOLE PAGINE
   Cambia qui l'immagine se vuoi differenziarle in futuro
   ========================================================= */

.hero--home::before {
    background-image: url("../assets/hero_home.webp");
    /* background-position: center; */
}

.hero--lavori::before {
    /* Momentaneamente usa la stessa immagine della home, ma puoi cambiarla qui */
    background-image: url("../assets/hero_home.webp");
    /* background-position: right center; */
    /* Opzionale */
}

.hero--prototipazione::before {
    background-image: url("../assets/prototipo.webp");
}

.hero--omologazioni::before {
    background-image: url("../assets/omologazione.webp");
}

.hero--formazione::before {
    background-image: url("../assets/formazione.webp");
}

.hero--brand::before {
    background-image: url("../assets/brand.webp");
}

.two-columns-text {
    column-count: 2;
    column-gap: var(--space-8);
}

@media (max-width: 768px) {
    .two-columns-text {
        column-count: 1;
    }
}

.hero__inner {
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero__content {
    max-width: 50rem;
    margin: 0 auto;
    text-align: center;
    opacity: 0;
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
    animation: hero-fade-in 1.5s ease-out 0.2s forwards;
}

.hero--lavori .hero__content {
    margin: 0 auto;
    text-align: center;
}

.hero__subtitle {
    margin: var(--space-8) auto 0;
    font-size: 1.15rem;
    color: var(--color-muted);
    max-width: 35rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.5;
    text-align: center;
}

@keyframes hero-fade-in {
    from {
        opacity: 0;
        /* transform: translateY(-16px); */
    }

    to {
        opacity: 1;
        /* transform: translateY(0); */
    }
}

/* ===========================
   LAYOUT BASE / HEADER
   =========================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding-block: var(--space-4);
    /* Spostato background e backdrop-filter su pseudo-elemento 
       per evitare che l'header faccia da "containing block" per il menu fixed */
}

.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.9);
    /* Leggera trasparenza per l'effetto blur */
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
    z-index: -1;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.brand__mark {
    height: 40px;
    width: auto;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.main-nav__link {
    font-size: 0.95rem;
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    position: relative;
}

.main-nav__link:hover,
.main-nav__link:focus,
.main-nav__link:active {
    text-decoration: none;
}

.main-nav__link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.3rem;
    width: 0;
    height: 2px;
    background-color: var(--color_EVOG);
    transition: width 0.2s ease-out;
}

.main-nav__link:hover::after {
    width: 100%;
}

/* Bottone hamburger (mobile) */
.nav-toggle {
    display: none;
    background: none;
    border: 0;
    padding: 0.5rem;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 40;
    position: relative;
}

.nav-toggle__line {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 999px;
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}

.nav-toggle__line+.nav-toggle__line {
    margin-top: 4px;
}

#about {
    /* Imposta un margine di scorrimento (scroll-margin) 
    pari all'altezza dell'header fisso per evitare che venga coperto. */
    scroll-margin-top: 50px;
}

/* ===========================
   SEZIONE WORK / PROJECTS GRID
   =========================== */

.section--work {
    background-color: var(--color_EVOG);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
}

.card-wrapper {
    height: 100%;
}

/* Card base */
.project-card {
    height: 100%;
    /* Assicura che la card riempia il wrapper/cella */
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background-color: var(--color-surface);
    /* border: 1px solid var(--color-border); */
    border-radius: 12px;
    overflow: hidden;
    transform: translateY(0);
    transition:
        transform 0.2s ease-out,
        box-shadow 0.2s ease-out;
    text-align: center;
    /* Added for centering content */
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.project-card__media {
    position: relative;
    background-color: var(--color-surface-alt);
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* padding rimosso per permettere all'immagine di riempire il contenitore */
    overflow: hidden;
}

.project-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Riempie il contenitore tagliando gli eccessi */
}

/* Contenuto card */
.project-card__content {
    padding: var(--space-4);
}

/* Tag e Pill */
.tag-pill {
    display: inline-block;
    padding: 0.2em 0.8em;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color_EVOG);
    border: 1px solid var(--color_EVOG);
    /* Ghost style: solo bordo */
    background-color: transparent;
    margin-bottom: var(--space-4);
    transition: all 0.3s ease;
    white-space: normal;
    max-width: 100%;
    width: fit-content;
    text-align: center;
}

.tag-pill:hover {
    background-color: var(--color_EVOG);
    color: var(--color_EVOB);
}



.project-card__tag {
    margin-bottom: var(--space-4);
}

.project-card__title {
    margin-bottom: var(--space-2);
}

.project-card__link {
    display: inline-block;
    margin-top: var(--space-2);
    font-size: var(--font-size-sm);
}

/* ===========================
   STATS SECTION
   =========================== */

/*.section.section--stats {
     fondo opzionale 
}*/

.section--stats__inner {
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: var(--space-12);
    padding: var(--space-8);
}

.section--stats__intro {
    max-width: 28rem;
}

.stats-grid {
    display: grid;
    grid-auto-rows: auto;
    gap: var(--space-8);
    border-top: 1px solid var(--color-border);
}

.stat {
    padding-top: var(--space-4);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.stat__value {
    margin-bottom: var(--space-2);
}

.stat__label {
    max-width: 22rem;
}

/* ===========================
   ABOUT SECTION
   =========================== */

.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-12);
}

.about-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-6);
    text-align: left;
    padding-block: var(--space-4);
    /* Diamo un po' di respiro */
}

.about-visual {
    position: relative;
    width: 100%;
}

.about-visual__img {
    width: 100%;
    height: auto;
    object-fit: contain;
    /*border-radius: 8px;*/
    filter: drop-shadow(0 8px 16px rgba(1, 1, 1, 0.5));
}

/* ===========================
   CLIENTS SECTION
   =========================== */

.section--clients {
    background-color: var(--color-bg);
}

.clients-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-8);
    /* max-width: 1000px; */
    margin: 0 auto;
}

.client-logo-item {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-4);
    height: 100px;
    width: 200px;
    /* Assicura che l'item abbia una larghezza definita per gli SVG */
    transition: transform 0.3s ease;
}

.client-logo-item:hover {
    transform: scale(1.1);
}

.client-logo {
    max-width: 180px;
    max-height: 80px;
    width: 100%;
    /* Forza il riempimento della larghezza disponibile */
    height: auto;
    object-fit: contain;
    /* Mantiene le proporzioni */
    /*filter: grayscale(100%);
    opacity: 1;
    transition: all 0.4s ease;*/
    filter: grayscale(100%) saturate(0) brightness(0.65) contrast(1);
    opacity: 0.9;
    transition: filter 0.4s ease, opacity 0.4s ease;
}

.client-logo-item:hover .client-logo {
    filter: none;
    /*filter: grayscale(0%);*/
    opacity: 1;
}

/* ===========================
   CTA SECTION
   =========================== */
.section--cta {
    background-color: var(--color_EVOG);
    color: var(--color_EVOB);
}

.section--cta .section__header {
    margin-bottom: var(--space-4);
    /* Ridotto lo spazio tra titolo e testo */
}

.section--cta .body-text--muted {
    color: rgba(37, 37, 37, 0.82);
    font-size: 1.25rem;
    /* Testo più grande e leggibile */
    max-width: 700px;
    margin: 0 auto;
}

/* ===========================
   CONTACT / FOOTER ALTO
   =========================== */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1.2fr;
    gap: var(--space-12);
    padding-top: var(--space-6);
    color: #ffffff;
}

.contact-grid__col {
    display: flex;
    flex-direction: column;
}

.contact-grid__col--logo {
    align-self: flex-start;
}

.contact-logo {
    height: 80px;
    width: auto;
}

.contact-heading {
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0;
}

.social-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.social-list__link {
    display: block;
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-2);
    color: #ffffff;
}

/* ===========================
   FOOTER UNICO
   =========================== */

.site-footer {
    padding-block: var(--space-8);
    background-color: var(--color_EVOB);
    color: #ffffff;
}

.site-footer a {
    color: #ffffff;
}

.site-footer .page {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.site-footer__content {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.site-footer__header {
    margin-bottom: var(--space-4);
}

.site-footer__header p {
    margin-top: var(--space-2);
}

.footer-wordmark {
    display: block;
}

.site-footer__brand {
    margin-top: var(--space-4);
    text-align: center;
}

.site-footer__credit {
    margin-top: var(--space-4);
    font-size: var(--font-size-sm);
    text-align: center;
}

/* ===========================
   SCROLL ANIMATIONS
   =========================== */

.reveal-right {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 1s cubic-bezier(0.21, 0.6, 0.35, 1),
        transform 1s cubic-bezier(0.21, 0.6, 0.35, 1);
}

.reveal-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* ===========================
   RESPONSIVE
   =========================== */

/* Tablet / desktop medio: riduco il padding orizzontale della .page */
@media (max-width: 1200px) {
    .page {
        padding-inline: var(--space-12);
    }
}

/* Tablet stretto */
@media (max-width: 960px) {
    .page {
        padding-inline: var(--space-8);
    }

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

    .clients-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .section--stats__inner {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile - CORREZIONI COMPLETE */
@media (max-width: 720px) {
    .page {
        padding-inline: var(--space-4);
    }

    .hero {
        height: 100vh;
        min-height: 600px;
        padding-top: var(--header-height);
    }

    /* HERO UNIFICATA PER MOBILE (Dark Mode) */
    .hero::after {
        background: rgba(37, 37, 37, 0.92);
        /* Coprenza elevata per garantire lettura su piccoli schermi */
    }

    .hero::before {
        background-position: center;
        /* Su foto vera è meglio centrare */
        opacity: 0.9;
    }

    .heading--xl {
        font-size: 3rem;
        line-height: 1;
    }

    .heading--xl--sub {
        font-size: 1rem;
        margin-bottom: var(--space-3);
    }

    .hero__subtitle {
        margin-top: var(--space-3);
        font-size: 0.9rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .clients-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .site-header__inner {
        gap: var(--space-2);
    }

    /* CORREZIONE MENU HAMBURGER: Mostra e posiziona il menu mobile */
    .nav-toggle {
        display: inline-flex;
    }

    .main-nav {
        position: fixed;
        /* CORREZIONE CRITICA: Estende il menu fino in fondo allo schermo */
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        /* Lo fa scendere fino alla fine della viewport */

        padding: var(--space-4);
        padding-top: calc(var(--header-height) + var(--space-4));
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
        transform: translateY(-100%);
        transition: transform 0.3s ease-out;
        z-index: 30;
        border-bottom: 1px solid var(--color-border);
        overflow-y: auto;
        /* Permette lo scroll interno se necessario */
    }

    .main-nav.is-open {
        transform: translateY(0);
    }

    .main-nav__link {
        font-size: 1rem;
        padding: var(--space-2) 0;
    }

    .project-card__media {
        height: 180px;
    }

    /* CORREZIONE CRITICA: ANIMAZIONE HAMBURGER -> X (valori calcolati per allineamento perfetto) */
    .nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(1) {
        /* Linea 1: scende di 6px (altezza linea 2px + gap 4px) e ruota 45deg */
        transform: translateY(6px) rotate(45deg);
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(2) {
        /* Linea 2: sparisce */
        opacity: 0;
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(3) {
        /* Linea 3: sale di 6px e ruota -45deg */
        transform: translateY(-6px) rotate(-45deg);
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .about-text {
        text-align: center;
    }

    .about-visual {
        position: static;
        /* Rimuoviamo il relative per il mobile */
        width: 100%;
        min-height: auto;
        margin-bottom: var(--space-6);
    }

    .about-visual__img {
        position: static;
        /* Rimuoviamo l'absolute per il mobile */
        width: 100%;
        height: auto;
        max-width: 100%;
    }
}

/* Mobile molto piccolo */
@media (max-width: 480px) {
    .heading--xl {
        font-size: 2.5rem;
    }

    .heading--xl--sub {
        font-size: 0.9rem;
    }

    .hero {
        padding-block: var(--space-12);
        min-height: 50vh;
    }

    .hero__content {
        text-align: center;
    }

    .brand__mark {
        height: 32px;
    }
}

/* ===========================
   WORKS FILTER (CATEGORIE)
   =========================== */

.works-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-6);
    margin-bottom: var(--space-8);
    border-bottom: 1px solid var(--color-border);
}

.works-filter__btn {
    background: none;
    border: none;
    padding: 0 0 var(--space-2) 0;
    margin: 0;
    cursor: pointer;
    font-family: var(--font-family-base);
    font-size: 1.1rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-muted);
    position: relative;
    transition: color 0.3s ease;
}

.works-filter__btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0%;
    height: 3px;
    background-color: var(--color_EVOG);
    transition: width 0.3s ease;
}

.works-filter__btn:hover {
    color: var(--color-text);
}

.works-filter__btn:hover::after {
    width: 100%;
}

.works-filter__btn.is-active {
    color: var(--color_EVOG);
    font-weight: var(--font-weight-bold);
}

.works-filter__btn.is-active::after {
    width: 100%;
}

@media (max-width: 768px) {
    .works-filter {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: var(--space-2);
        margin-bottom: var(--space-6);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Firefox */
    }

    .works-filter::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari */
    }

    .works-filter__btn {
        white-space: nowrap;
        font-size: 1rem;
    }
}

/* ===========================
   WORKS LIST (EXPANDING ROWS)
   =========================== */

.works-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--color-border);
}

.work-item {
    position: relative;
    border-bottom: 1px solid var(--color-border);
    overflow: hidden;
    height: 140px;
    /* Altezza iniziale base aumentata per layout verticale */
    transition: height 0.5s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.3s ease;
    /*cursor: pointer;*/
}


.work-item.is-hidden,
.project-card.is-hidden {
    display: none !important;
}

/* Header: sempre visibile */
.work-item__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    height: 140px;
    /* Deve coincidere con l'altezza chiusa */
    padding-inline: var(--space-6);
    padding-right: 30%;
    /* Lascia spazio alla striscia immagine */
    position: relative;
    z-index: 2;
}

.work-item__title-group {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    width: 100%;
}

.work-item__cat {
    width: auto;
    margin-bottom: var(--space-2);
}

.work-item__title {
    font-size: var(--font-size-heading);
    margin: 0;
    flex-grow: 1;
}

.work-item__arrow {
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.work-item.is-expanded .work-item__arrow {
    transform: rotate(90deg);
}

/* Body: contenuto extra */
.work-item__body {
    padding-inline: var(--space-4);
    padding-right: 45%;
    /* Lascia spazio all'immagine espansa */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
}

.work-item.is-expanded .work-item__body {
    opacity: 1;
    transform: translateY(0);
}

.work-item__content {
    max-width: 600px;
    margin-left: calc(1.5rem + var(--space-4));
    /* Allineato all'inizio del titolo (freccia + gap) */
    padding-top: var(--space-4);
}

/* Media: Immagine laterale */
.work-item__media {
    position: absolute;
    top: 0;
    right: 0;
    width: 25%;
    /* Striscia visibile inizialmente */
    height: 100%;
    transition: width 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1;
    overflow: hidden;
    /* Importante per il ritaglio */
}

.work-item.is-expanded .work-item__media {
    width: 50%;
    /* Si allarga quando espanso */
}

.work-item__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ritaglia per riempire */
    object-position: center;
    /*filter: grayscale(100%);*/
    transition: filter 0.5s ease, transform 0.5s ease;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .work-item {
        height: auto !important;
        /* Override JS su mobile */
        min-height: 100px;
        display: flex;
        flex-direction: column;
    }

    .work-item__header {
        padding-right: var(--space-4);
        height: auto;
        padding-block: var(--space-4);
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .work-item__cat {
        width: 100%;
        margin-bottom: var(--space-1);
        text-align: center;
    }

    .work-item__title {
        padding-left: 0;
        font-size: 1.2rem;
    }

    .work-item__arrow {
        display: none;
    }

    .work-item__media {
        position: relative;
        width: 100%;
        height: 200px;
        order: -1;
        display: block;
        margin-top: var(--space-4);
    }

    .work-item.is-expanded .work-item__media {
        width: 100%;
    }

    .work-item__body {
        position: static;
        opacity: 1;
        transform: none;
        padding-right: var(--space-4);
        padding-bottom: var(--space-4);
        display: block;
    }

    .work-item__content {
        margin-left: 0;
        max-width: 100%;
    }
}

/* ===========================
   TEAM SECTION
   =========================== */
.hero {
    position: relative;
    z-index: 10;
    /* Garantisce che l'header scuro tagli i laccetti */
}

#team-badges {
    position: relative;
    z-index: 5;
    padding-top: 0;
}

.team-badges-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 0;
    padding-bottom: var(--space-16);
    flex-wrap: nowrap;
    /* Sempre su una riga per dispositivi mobili */
    margin-top: -60px;
    /* Scivola sotto la hero per tagliare la clip */
}

.team-badge-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    justify-content: center;
    margin-inline: -12%;
    /* Sovrapposizione forte su mobile */
    padding: 0;
}

.team-badge {
    width: 600px;
    max-width: 160%;
    /* Permette ai badge di sormontare leggermente i margini */
    transform-origin: top center;
    animation: swing-badge 4s ease-in-out infinite alternate;
    filter: drop-shadow(15px 15px 25px rgba(0, 0, 0, 0.35));
}

/* Staggering altezze (Mobile prima) */
.team-badge-item:nth-child(1) {
    margin-top: 25px;
    z-index: 1;
}

.team-badge-item:nth-child(2) {
    margin-top: -15px;
    z-index: 3;
}

.team-badge-item:nth-child(3) {
    margin-top: 55px;
    z-index: 2;
}

@media (min-width: 768px) {
    .team-badges-container {
        margin-top: -120px;
    }

    .team-badge-item {
        margin-inline: -15px;
        /* Sovrapposizione minima desktop */
        flex: 0 1 auto;
    }

    .team-badge-item:nth-child(1) {
        margin-top: 50px;
    }

    .team-badge-item:nth-child(2) {
        margin-top: -30px;
    }

    .team-badge-item:nth-child(3) {
        margin-top: 100px;
    }

    .team-badge {
        width: 330px;
        max-width: none;
    }
}

.team-badge-item:nth-child(1) .team-badge {
    animation-delay: 0s;
}

.team-badge-item:nth-child(2) .team-badge {
    animation-delay: -1.3s;
}

.team-badge-item:nth-child(3) .team-badge {
    animation-delay: -2.6s;
}

@keyframes swing-badge {
    0% {
        transform: rotate(-6deg);
    }

    100% {
        transform: rotate(6deg);
    }
}