/* ===== FONT FACE ===== */
@font-face {
    font-family: 'NeutraText';
    src: url('fonts/NeutraText-Book.woff2') format('woff2'),
         url('fonts/NeutraText-Book.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'NeutraText';
    src: url('fonts/NeutraText-Alt.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'NeutraText', Arial, sans-serif;
    font-weight: 400;
    overflow: hidden;
}

/* ===== CONTENITORE IMMAGINI SOVRAPPOSTE ===== */
.image-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.bg-image.original {
    background-image: 
        url("https://residenzamontegaggio.ch/assets/Residenza_Monte_Gaggio.avif"),
        url("https://residenzamontegaggio.ch/assets/Residenza_Monte_Gaggio.webp"),
        url("https://residenzamontegaggio.ch/assets/Residenza_Monte_Gaggio.jpg");
    opacity: 0;
    animation: zoomOutFadeIn 1.5s ease-out forwards;
}

.bg-image.blocco-b {
    background-image: 
        url("https://residenzamontegaggio.ch/assets/Residenza_Monte_Gaggio_B.avif"),
        url("https://residenzamontegaggio.ch/assets/Residenza_Monte_Gaggio_B.webp"),
        url("https://residenzamontegaggio.ch/assets/Residenza_Monte_Gaggio_B.jpg");
}

.bg-image.blocco-a {
    background-image: 
        url("https://residenzamontegaggio.ch/assets/Residenza_Monte_Gaggio_A.avif"),
        url("https://residenzamontegaggio.ch/assets/Residenza_Monte_Gaggio_A.webp"),
        url("https://residenzamontegaggio.ch/assets/Residenza_Monte_Gaggio_A.jpg");
}

.bg-image.active {
    opacity: 1;
}

/* ===== INTRO ===== */
#intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 90px;
    opacity: 0;
}

#intro.ready {
    opacity: 1;
    transition: opacity 0.8s ease;
}

/* ===== LOGO ===== */
.logo {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11;
    text-align: center;
    opacity: 0;
    animation: logoFadeIn 1.2s ease forwards;
    animation-delay: 1.2s;
    width: 400px;
}

.logo img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    transition: opacity 0.5s ease;
}

.logo-default {
    opacity: 1;
}

.logo-white {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    filter: brightness(0) invert(1);
}

.logo.hover-left .logo-default,
.logo.hover-right .logo-default {
    opacity: 0;
}

.logo.hover-left .logo-white,
.logo.hover-right .logo-white {
    opacity: 1;
}

.logo-address {
    margin-top: 22px;
    font-family: 'NeutraText', sans-serif;
    font-weight: 500;
    font-size: 1.2rem;
    letter-spacing: 1.5px;
    color: #5d6b49;
    opacity: 0;
    animation: fadeInAddress 1s ease forwards;
    animation-delay: 2.4s;
    transition: color 0.5s ease;
}

.logo-address br {
    display: none;
}

.logo.hover-left .logo-address,
.logo.hover-right .logo-address {
    color: #ffffff;
}

/* ===== LINK AREA ===== */
.link-area {
    position: absolute;
    top: 0;
    height: 100%;
    z-index: 12;
    background: transparent;
    cursor: pointer;
}

.link-area.left {
    left: 0;
    width: 40%;
}

.link-area.right {
    right: 0;
    width: 40%;
    cursor: auto!important;
}

/* ===== BOX (BLOCCHI) ===== */
.box {
    position: absolute; 
    bottom: 130px;
    font-family: 'NeutraText', sans-serif;
    font-weight: 500;
    font-size: 2.4rem;
    letter-spacing: 1px;
    color: #fff;
    z-index: 11;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

#intro.ready .box {
    animation: fadeInScale 1.2s ease forwards;
    animation-delay: 1.8s;
}

.box.left {
    left: 68px;
    text-align: left;
}

.box.right {
    right: 68px;
    text-align: right;
}

.box.active {
    opacity: 1 !important;
    transform: translateY(-5px) scale(1.05) !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease !important;
}

.box.inactive {
    opacity: 0.3 !important;
    transform: scale(0.9) !important;
    filter: blur(5px);
    transition: all 1.2s ease !important;
}

/* Testo fisso per mobile sempre visibile */
.box.right .sold-mobile {
    display: block;
    font-weight: bold;    
    font-size: 1rem;      
    margin-top: 5px;      
    color: #fff;
}

/* Nascondi su desktop se vuoi continuare a usare ::after */
@media (min-width: 969px) {
    .box.right .sold-mobile {
        display: none;
    }
}

/* ===== SOTTOTITOLI BLOCCHI (solo desktop) ===== */
@media (min-width: 969px) {
    .box::after {
        content: '';
        position: absolute;
        left: 0;
        top: 100%;
        width: 100%;
        font-family: 'NeutraText', sans-serif;
        font-weight: 300;
        font-size: 1.2rem;
        letter-spacing: 0.5px;
        color: rgba(255, 255, 255, 0.9);
        opacity: 0;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        pointer-events: none;
        white-space: nowrap;
    }
    
    .box.left::after {
        content: 'App. 10 – 18';
        text-align: left;
    }
    
    .box.right::after {
        content: "Tutto venduto\A Grazie per la fiducia.";
        text-align: left;
        white-space: pre;
    }

    .box.active::after {
        opacity: 1;
        transform: translateY(8px);
    }

    .box.inactive::after {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ===== ENTER BUTTON ===== */
.enter-button {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.4rem;
    font-family: 'NeutraText', sans-serif;
    font-weight: 300;
    letter-spacing: 3px;
    color: #fff;
    text-transform: uppercase;
    z-index: 11;
    display: flex;
    align-items: center;
    gap: 25px;
    opacity: 0;
    animation: fadeInUp 1.2s forwards;
    animation-delay: 2.1s;
    cursor: default;
}

/* ===== FRECCE ===== */
.arrow {
    width: 150px;
    height: auto;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    animation-timing-function: ease-in-out;
}

.left-arrow { animation-name: arrowMoveLeft; }
.right-arrow { animation-name: arrowMoveRight; }

/* ===== ANIMAZIONI ===== */
@keyframes zoomOutFadeIn {
    from { opacity: 0; transform: scale(1.1); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 0.7; transform: scale(0.95); }
}

@keyframes logoFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeInAddress {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes arrowMoveLeft { from { transform: translateX(0); } to { transform: translateX(-12px); } }
@keyframes arrowMoveRight { from { transform: translateX(0); } to { transform: translateX(12px); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 968px) {
    #intro { padding: 0 20px; }
    .logo { top: 40px; width: 280px; }
    .logo-address { font-size: 1rem; margin-top: 15px; }

    /* Box statici su mobile: niente hover, opacity o scatto */
    #intro.ready .box {
        animation: none !important;
        opacity: 1 !important;
        transform: translateY(50%) scale(0.95) !important;
    }
    .box.active {
        transform: translateY(50%) scale(1.05) !important;
        opacity: 1 !important;
    }
    .box.inactive {
        transform: translateY(50%) scale(0.9) !important;
        opacity: 1 !important;
    }

    .box {
        font-size: 1.8rem;
        pointer-events: none !important;
        touch-action: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    .box.left { left: 30px; }
    .box.right { right: 30px; }

    /* Nascondi sottotitoli desktop */
    .box::after { display: none; }

    .link-area { z-index: 20; width: 50%; pointer-events: auto; touch-action: manipulation; }
    .enter-button { bottom: 40px; font-size: 1.8rem; gap: 15px; pointer-events: none; }
    .arrow { width: 100px; }
}

@media (max-width: 480px) {
    .logo { width: 200px; }
    .logo-address br { display: block; }
    .box { font-size: 1.4rem; }
    .box.left { left: 15px; }
    .box.right { right: 15px; }
    .enter-button { font-size: 1.2rem; gap: 10px; bottom: 30px; }
    .arrow { width: 80px; }
}

/* ===== UTILITY ===== */
.hidden { display: none !important; }
#main-content { padding: 3rem; min-height: 100vh; }
