/* =========================================
   1. RESET & SETUP
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

@font-face {
    font-family: akzidenz;
    src: url('fonts/AkzidenzGroteskPro-Md.otf') format('opentype');
}

@font-face {
    font-family: 'Alliance';
    src: url('fonts/Alliance-TextRegular.otf') format('opentype');
    font-style: normal;
}

body {
    color: #161616;
    background-color: #dedede;
    overflow-x: hidden;
    font-family: 'akzidenz', sans-serif;
    font-size: 1.5rem;
    line-height: 1.5;
    padding: 0 3rem;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

img,
video {
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

/* Layout Utilities (Full Width Sections) */
.projects-list,
.section-white,
.section-blue {
    width: calc(100vw + 6rem);
    margin-left: -3rem;
    margin-right: -3rem;
}

.projects-list,
.section-white {
    padding: 0;
}

.section-blue {
    background-color: #0D42CD;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6rem;
    padding-top: 3rem;
}

.section-blue video,
.project-content,
.section-white>img,
.section-white .img-row,
.section-white .col {
    padding-left: 3rem;
    padding-right: 3rem;
}

/* =========================================
   2. TYPOGRAPHY & LINKS
   ========================================= */
h1,
h2,
h3,
h4,
h5,
h6,
p,
address {
    font-weight: normal;
    padding: 0;
    z-index: 1;
}

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

.selectable {
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}

/* Spaziatura Verticale */
.content-media,
.content-text,
.img-row,
.next-project-wrapper,
.carousel-wrapper,
.two-columns {
    margin-bottom: 4rem;
}

.two-columns>.col {
    margin-bottom: 0;
}

/* =========================================
   3. HEADER
   ========================================= */

#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    z-index: 1000;

    /* Gestione visibilità */
    opacity: 0;
    pointer-events: none;
    transform: translateY(0);
    transition: opacity .5s ease, transform .4s cubic-bezier(0.25, 0.46, 0.45, 0.94), background .3s ease;

    /* --- BLUR ATTIVO --- */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    /* --- BACKGROUND --- */
    /* Un bianco leggero che copre tutta l'altezza, la sfumatura la fa la maschera */
    background: rgba(222, 222, 222, 0.5);

    /* --- MASCHERA MAGICA (Il segreto) --- */
    /* Rende l'header solido fino al 50% dell'altezza, poi lo fa sparire dolcemente */
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
}

#main-header.scroll-hide {
    transform: translateY(-100%);
    opacity: 0 !important;
}

#main-header.visible {
    opacity: 1;
    pointer-events: auto;
}

#main-header * {
    pointer-events: auto;
}

#main-header a {
    font-size: 1.1rem;
    margin-left: 2rem;
    transition: opacity .2s ease;
}

#main-header .logo {
    font-weight: 500;
    margin-left: 0;
    font-size: 1.2rem;
}

#main-header a:hover {
    opacity: 0.6;
}

/* =========================================
   4. HOME PAGE
   ========================================= */
.hero {
    height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10vh;
}

.hero h1 {
    padding: 0 3rem;
    font-size: 1.5rem;
    letter-spacing: 0.05rem;
}

#main-title {
    /* Rimuovi mix-blend-mode per togliere l'effetto "negativo" duro */
    /* mix-blend-mode: difference;  <-- RIMUOVI QUESTO */

    position: relative;
    z-index: 10;
    font-size: clamp(1.7rem, 8vw, 3rem);
    line-height: 4rem;
    letter-spacing: 0.02em;

    /* --- NUOVO STILE PROFONDITÀ --- */
    /* 1. Colore: Non bianco pieno, ma leggermente trasparente per far "respirare" il fondo */
    color: rgba(22, 22, 22, 0.85);

    /* 2. Sfumatura di profondità (Text Shadow morbido) */
    /* Crea l'illusione che il testo galleggi sopra lo sfondo */
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);

    /* OPZIONALE: Se vuoi che il testo sfumi verso il basso come l'header */
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

.intro-wrapper {
    min-height: auto;
    padding: 12rem 0 8rem;
    max-width: 1400px;
}

#desc {
    max-width: 70ch;
    line-height: 1.35;
    color: #161616;
    margin-bottom: 0;
}

/* CTA Scroll */
#scroll-cta {
    align-self: center;
    margin: 4rem 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    border: 1px solid rgba(22, 22, 22, 0.3);
    border-radius: 50px;
    padding: 10px 24px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateY(20px);
    transition: all .4s cubic-bezier(0.23, 1, 0.32, 1);
    animation: floating 2.5s ease-in-out infinite 1s;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#scroll-cta.visible {
    opacity: 1;
}

#scroll-cta:hover {
    border-color: #161616;
    background-color: rgba(22, 22, 22, 0.05);
}

@keyframes floating {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(6px);
    }
}

/* Lista Progetti */
.projects-list {
    padding-bottom: 10vh;
}

.project-item {
    position: relative;
    width: 100%;
    height: 100px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    will-change: height;
    transition: height 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.project-item video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin-left: -3rem;
    margin-right: -3rem;
    object-fit: cover;
    z-index: 0;
    opacity: 0;
    transition: opacity .4s ease;
    pointer-events: none;
}

.project-item.darken video {
    filter: brightness(0.7);
}

.project-item:hover video {
    opacity: 1;
}

.project-content {
    position: relative;
    z-index: 2;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    transform: translateY(0);
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.project-content h2 {
    font-size: 1.5rem;
    margin: 0;
    color: #161616;
    transition: color .3s ease;
}

.project-item:hover h2 {
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.project-content h2 span {
    color: rgba(107, 107, 107, 0.5);
    font-weight: normal;
    margin-left: 1rem;
}

.project-item:hover h2 span {
    color: rgba(255, 255, 255, 0.7);
}

.project-item:hover .project-content,
.project-item.active .project-content {
    /* Il testo scivola su leggermente per "fare spazio" */
    transform: translateY(-10px);
}

/* Tags */
.tags {
    display: flex;
    gap: 10px;
    opacity: 0;
    transform: translateY(10px);
    max-height: 0;
    transition: all .4s ease;
}

.project-item:hover .tags {
    opacity: 1;
    transform: translateY(0);
    margin-top: 0.5rem;
    max-height: 200px;
}

.tags span,
.hero-tags span {
    font-family: 'akzidenz';
    font-size: 0.9rem;

    /* --- NUOVO STILE VETRO (Come l'Header) --- */
    background: rgba(222, 222, 222, 0.4);
    /* Base lattiginosa semitrasparente */
    backdrop-filter: blur(10px);
    /* Stesso blur potente dell'header */
    -webkit-backdrop-filter: blur(10px);

    /* Dettagli di profondità */
    color: rgba(22, 22, 22, 0.8);
    /* Testo non nero pieno, ma grigio scuro profondo */
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* Un filo di luce sul bordo */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    /* Ombra leggerissima per staccarli dal fondo */

    border-radius: 50px;
    padding: 4px 16px;
    /* Leggermente più arioso */
    transition: all 0.3s ease;
}

.project-item:hover .tags span {
    background: rgba(255, 255, 255, 0.6);
    color: #000;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* =========================================
   5. PROJECT PAGES (CINEMA MODE)
   ========================================= */
body.cinema-mode {
    background-color: #0a0a0a;
    color: #f0f0f0;
}

body.cinema-mode .caption {
    color: rgba(255, 255, 255, 0.5);
}

body.cinema-mode #main-header a {
    color: #fff;
}

body.cinema-mode #main-header {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
}

body.cinema-mode #main-header.solid-bg {
    background-color: transparent;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
}

/* Hero Progetto */
.immersive-hero {
    position: relative;
    height: 85vh;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    margin-bottom: 13rem;
}

.hero-bg-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    object-fit: cover;
    z-index: 0;
    opacity: 0.8;
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: left;
    width: 100%;
}

.project-logo {
    display: block;
    height: auto;
    max-width: 30rem;
}

.hero-tags {
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-tags span {
    font-size: 0.9rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 16px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Corpo Progetto */
.project-body {
    width: 100%;
}

.content-media img,
.content-media video {
    width: 100%;
    height: auto;
    display: block;
}

.content-text {
    max-width: 75%;
}

.content-text h3 {
    color: #fff;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.content-text p {
    color: #ccc;
    font-size: 1.5rem;
    line-height: 1.6;
}

/* Meta Data */
.project-meta {
    display: flex;
    gap: 3rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    font-family: 'akzidenz', sans-serif;
    line-height: 1.5;
}

.meta-item {
    display: flex;
    gap: 0.5rem;
}

.meta-label {
    color: #666;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding-top: 2px;
}

.meta-value {
    color: #fff;
}

/* Two Columns & White Section */
.two-columns {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4rem;
    width: 100%;
}

.col {
    flex: 1;
    min-width: 300px;
}

.col img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 1px;
}

.section-white {
    background-color: #fdfdf5;
    color: #161616;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    width: auto;
    padding-top: 3rem;
}

.img-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 4rem;
    width: 100%;
    height: auto;
    align-items: center;
}

.img-row img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-width: 100%;
}

/* =========================================
   6. NEXT PROJECT & CONTACTS (TEXT GRADIENT ONLY)
   ========================================= */

.next-project-wrapper {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    /* Allineato a destra */
    gap: 4rem;
    margin-top: 4rem;
    margin-bottom: 4rem;
}

/* --- CONTENITORE LINK (NESSUN BACKGROUND/BORDO) --- */
.next-project-link {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 1;
    width: fit-content;
    cursor: pointer;
}

.next-project-link:hover {
    opacity: 0.6;
}

.next-project-link:hover .np-arrow {
    transform: translateX(10px);
}

/* --- TESTO CON GRADIENTE --- */
.np-title {
    font-family: 'akzidenz', sans-serif;
    font-size: 1.75rem;
    line-height: 1.1;
    margin: 0;
    font-weight: normal;
    background: -webkit-linear-gradient(#161616 20%, #888 100%);
    background: linear-gradient(to bottom, #161616 20%, #888 100%);
    background: linear-gradient(to bottom, #161616 20%, #888 100%);
    transform: translateZ(0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Label piccola sopra */
.np-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    margin-bottom: 0.5rem;
    color: #666;
    /* Colore solido per la label piccola */
}

/* Contenitore riga titolo + freccia */
.np-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: none !important;
}

/* Freccia */
.np-arrow {
    font-size: 2rem;
    color: #161616;
    display: flex;
    align-items: center;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
    transform: translateZ(0);
}


/* --- VARIANTE SCURA (CINEMA MODE) --- */
/* Modifichiamo il gradiente per lo sfondo nero */

body.cinema-mode .np-title {
    background: -webkit-linear-gradient(#fff 20%, #888 100%);
    background: linear-gradient(to bottom, #fff 20%, #888 100%);
    opacity: 0.8;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.cinema-mode .np-label {
    color: #999;

}

body.cinema-mode .np-arrow {
    color: #fff;
}





.contact-link {
    font-family: 'akzidenz', sans-serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: #161616;
    text-decoration: none;
    display: inline-flex;
    align-items: baseline;
    gap: 2rem;
    border-bottom: none;
    padding-bottom: 4px;
    line-height: 1.2;
    transition: all .3s ease;
}

.contact-link .label {
    color: #999;
    cursor: default;
    flex-shrink: 0;
}

.contact-link .link-content {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid transparent;
    transition: border-bottom-color .3s ease;
    padding-bottom: 2px;
    cursor: pointer;
    color: #161616;
}

.contact-link:hover .link-content {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    text-decoration-color: rgba(22, 22, 22, 0.3);
    text-decoration-skip-ink: auto;
    text-decoration-color: #161616;
}

.contact-link .link-content svg {
    transition: transform .3s ease;
}

.contact-link:hover .link-content svg {
    transform: translate(3px, -3px);
}

/* =========================================
   7. COMPONENTS
   ========================================= */

/* Carousel */
.carousel-wrapper {
    display: grid;
    grid-template-areas: "stack";
    width: 100%;
    overflow: hidden;
}

.c-slide {
    grid-area: stack;
    width: 100%;
    height: auto;
    object-fit: cover;
    opacity: 0;
    z-index: 1;
}

.c-slide.active {
    opacity: 1;
    z-index: 2;
}

/* Comparison Slider */
.comparison-container {
    position: relative;
    width: 100%;
    line-height: 0;
    cursor: ew-resize;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.comparison-container img {
    pointer-events: none;
    -webkit-user-drag: none;
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.comparison-container .img-comp-base {
    width: 100%;
    height: auto;
}

.comparison-container .img-comp-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    border-right: 2px solid #fff;
    z-index: 2;
    will-change: width;
}

.comparison-container .img-comp-overlay img {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    max-width: none;
}

.comp-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: #fff;
    border-radius: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.comp-handle svg {
    width: 20px;
    height: 20px;
    color: #333;
}

/* WIP - Ghost Mode */
.project-item.wip {
    cursor: not-allowed;
}

.project-item.wip:hover video {
    opacity: 0.5 !important;
    filter: grayscale(100%);
}

.project-item.wip:hover h2 {
    color: #999;
    text-shadow: none;
}

.project-item.wip:hover h2 span {
    color: #666;
}

.project-item.wip:hover .tags .tag-original {
    display: none;
}

.tag-wip {
    display: none;
    background-color: #161616 !important;
    color: #fdfdf5 !important;
    border: none;
    font-size: 0.8rem;
    letter-spacing: 0.1rem;
    padding: 6px 16px;
    border-radius: 50px;
    text-transform: uppercase;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.project-item.wip:hover .tags .tag-wip {
    display: inline-block;
    animation: fadeIn .3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

/* Utils: Canvas & Reveal */
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   8. MOBILE ADAPTATION
   ========================================= */
@media (max-width: 768px) {

    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        font-size: 1.2rem;
    }

    /* Header & Hero */
    #main-header {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .hero h1 {
        padding: 0;
    }

    .hero div {
        padding-top: 1.5rem;
    }

    #main-title {
        font-size: 2.5rem;
        line-height: 1.1;
        word-wrap: break-word;
    }

    .intro-wrapper {
        padding-top: 6rem;
        padding-bottom: 4rem;
    }

    /* Layout Sections Reset */
    .projects-list,
    .section-white {
        width: 100vw;
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        padding-bottom: 5vh;
    }

    .section-white>img,
    .section-white .img-row {
        max-width: auto;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .content-text {
        max-width: 100%;
    }

    .two-columns {
        flex-direction: column;
        gap: 2rem;
    }

    /* Project Items */
    .project-item {
        padding: 1.5rem 0;
        overflow: hidden;
        min-height: 120px;
    }

    .project-content {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .project-item video {
        margin: 0;
        width: 100%;
    }

    .project-logo {
        width: 80%;
    }

    .project-content h2 {
        font-size: 1.8rem;
        line-height: 1.2;
        white-space: normal;
        padding: 0;
    }

    .project-content h2 span {
        display: block;
        margin-left: 0;
        margin-top: 0.3rem;
        font-size: 1rem;
        line-height: 1.4;
        color: #666;
        font-weight: normal;
    }

    .tags {
        flex-wrap: wrap;
        opacity: 0;
        transform: translateY(10px) !important;
        max-height: 0 !important;
        transition: all .4s ease;
        margin-top: 0;
    }

    .project-item.active .tags {
        opacity: 1;
        transform: translateY(0) !important;
        max-height: 100px !important;
        margin-top: 1rem;
    }

    /* Meta & Hero Tags */
    .hero-tags {
        gap: 0.5rem;
    }

    .hero-tags span {
        font-size: 0.8rem;
        padding: 4px 12px;
    }

    .project-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Contact Links */
    .contact-list {
        font-size: 1.2rem;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        /* Allinea tutto a sinistra */
        gap: 1.5rem;
        /* Spazio verticale tra un link e l'altro */

        /* 2. Rimuoviamo il corsivo automatico del tag <address> */
        font-style: normal !important;

        margin-top: 3rem;
    }

    .contact-link {
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
        display: inline-flex;
        align-items: baseline;
        gap: 2rem;
        /* Spazio tra la label grigia e il valore nero */
        text-decoration: none;
        font-style: normal
    }

    .contact-link .label {
        width: 100%;
        margin-bottom: 0;
        color: #999;
        font-size: 1rem;
    }

    .contact-link .link-content {
        max-width: 100%;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .contact-link .link-content .value {
        white-space: normal;
    }

    /* Cosmo Concept Fix */
    .concept-formula {
        flex-direction: column;
        align-items: center;
        gap: 3rem;
    }

    .concept-operator {
        transform: rotate(90deg);
        margin: 1rem 0;
    }

    .c-title {
        font-size: 2.5rem;
    }

    /* Navigation */
    .next-project-wrapper {
        justify-content: flex-start;
    }

    /* Images & Grids */
    .img-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        align-items: center;
    }

    .model-wrapper {
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .model-wrapper .caption {
        padding-top: 0;
    }
}

@media (max-width: 480px) {
    .img-row {
        grid-template-columns: repeat(1, 1fr);
    }
}


/* =========================================
   LENIS SMOOTH SCROLL SETUP
   ========================================= */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

html.lenis-scrolling model-viewer {
    pointer-events: none;
}


/* =========================================
   9. SWITCHER LINGUE (HEADER)
   ========================================= */
.lang-switcher {
    display: inline-flex;
    align-items: center;
    margin-left: 2rem;
    gap: 0.3rem;
    /* Spazio ridotto tra bottone e barra */
}

/* Stile base dei bottoni (resettiamo lo stile brutto di default) */
.lang-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: 'akzidenz', sans-serif;
    /* Mantiene il tuo font */
    font-size: 1.1rem;
    /* Stessa dimensione del menu */
    color: #161616;
    cursor: pointer;
    opacity: 0.5;
    /* Spento di default */
    transition: opacity 0.3s ease;
}

.lang-btn:hover {
    opacity: 1;
}

/* Lingua Attiva (Grassetto + Opacità piena) */
.lang-btn.active {
    opacity: 1;
    font-weight: 500;
}

/* La barra separatrice "/" */
.sep {
    font-size: 1.1rem;
    opacity: 0.3;
}

/* ADATTAMENTO DARK MODE (Per pagine progetto come BA2 o Sardegne) */
body.cinema-mode .lang-btn {
    color: #fff;
    /* Testo bianco su sfondo scuro */
}

body.cinema-mode .sep {
    color: rgba(255, 255, 255, 0.5);
}

/* =========================================
   10. ANTI-FOUC (EFFETTO SIPARIO)
   ========================================= */
/* Questo serve a nascondere il sito per 0.1s finché le traduzioni non sono cariche.
   Evita che l'utente veda "home.title" prima che diventi "Giacomo Cincotti".
*/

body.i18n-hidden {
    opacity: 0;
    overflow: hidden;
    /* Blocca lo scroll mentre carica */
    transition: opacity 0.5s ease-in-out;
    /* Apparizione dolce */
}

body.i18n-loaded {
    opacity: 1;
    overflow-x: hidden;
    overflow-y: auto;
}

/* =========================================
   LOGO EXPANSION ANIMATION
   ========================================= */

#main-header .logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-weight: 500;
    /* Assicura che il font sia quello giusto */
    font-family: 'akzidenz', sans-serif;
    color: inherit;
    cursor: pointer;
}

.logo-word {
    display: inline-flex;
    align-items: center;
}

.initial {
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.rest {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    font-weight: normal;
    margin-left: 0;
}

/* --- STATO HOVER --- */
#main-header .logo:hover .rest {
    max-width: 6rem;
    opacity: 1;
    margin-left: 0px;
    transition: all 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

#main-header .logo:hover .logo-word:first-child {
    margin-right: 0.4rem;
    transition: margin-right 0.5s ease;
}

#main-header .logo:hover .initial {
    transform: translateX(0);
}

/* evita espansione su schermi piccoli se ce poco spazio */
@media (max-width: 480px) {
    #main-header .logo:hover .rest {
        max-width: 0;
        opacity: 0;
    }

    #main-header .logo:hover .logo-word:first-child {
        margin-right: 0;
    }
}


/* =========================================
   FIX FORZATO CONTATTI
   ========================================= */

/* 1. Il contenitore principale della lista */
address.contact-list {
    display: flex !important;
    /* Attiva la modalità flessibile */
    flex-direction: column !important;
    /* Mette gli elementi uno sotto l'altro (Verticale) */
    align-items: flex-start !important;
    /* Allinea tutto a sinistra */
    gap: 1.5rem !important;
    /* Spazio tra le righe */

    font-style: normal !important;
    /* RIMUOVE IL CORSIVO */
    margin-top: 3rem !important;
}

/* 2. Il singolo link (riga) */
a.contact-link {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 3rem !important;
    /* Distanza tra la label (Email) e il valore */
    text-decoration: none !important;
    font-style: normal !important;
    /* Sicurezza extra contro il corsivo */
    width: auto !important;
}

/* 3. La label grigia (Email, LinkedIn...) */
a.contact-link .label {
    min-width: 100px;
    /* (Opzionale) Se vuoi che siano tutte allineate a colonna */
    color: #999;
}