body {
    margin: 0;
    background-color: black;
    color: white;
    font-family: "Century Gothic", sans-serif;
    font-weight: 300;
    letter-spacing: 1px;
    overflow-x: hidden;
    overflow-y: auto;
}

#background {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
    filter: brightness(0.85) contrast(1.1) saturate(2.5);
}

.contatti_page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    overflow: visible;
}

body.is-leaving .contatti_page {
    opacity: 0;
    transition: opacity 0.45s ease;
}

body.is-leaving .header-nav {
    transform: translateY(-100%);
    transition: transform 0.45s ease;
}

.header-nav {
    position: relative;
    z-index: 20;
    background-color: rgba(255, 255, 255, 0.482);
    backdrop-filter: blur(3px);
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 0 30px;
    box-sizing: border-box;
    animation: slideDown 0.8s ease-out;
}

#logo_header {
    display: block;
    width: 200px;
    height: auto;
    border-radius: 20px;
    margin-left: 100px;
    flex-shrink: 0;
}

.header-nav nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
    align-items: center;
}

.header-nav nav li {
    margin: 0;
}

.inactiveLink {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.services-menu {
    position: relative;
}

.services-submenu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 10;
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 2px;
    width: min(360px, calc(100vw - 32px));
        margin: 0;
        min-height: 225px;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid rgb(0, 0, 39);
    border-radius: 12px;
    background-color: rgb(0, 0, 39);
    backdrop-filter: blur(8px);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.services-menu:hover .services-submenu,
.services-menu:focus-within .services-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.services-submenu li {
    margin: 0 !important;
}

.header-nav nav .services-submenu a {
    display: block;
    color: lightskyblue;
    padding: 15px 5px;
    border-radius: 7px;
    font-size: 0.86rem;
    line-height: 0.3;
    text-align: center;
    margin-bottom: -30px;
}

.header-nav nav .services-submenu a:hover,
.header-nav nav .services-submenu a:focus-visible {
    background: rgba(184, 228, 231, 0.16);
    opacity: 1;
    transform: none;
}

.services-submenu li:last-child a {
    margin-bottom: 0;
}

@media (max-width: 800px) {
    .services-menu {
        position: static;
    }

    .services-submenu {
        top: 100%;
        left: 50%;
        right: auto;
        grid-template-columns: 1fr;
        width: min(340px, calc(100vw - 32px));
        transform: translate(-50%, -8px);
    }

    .services-menu:hover .services-submenu,
    .services-menu:focus-within .services-submenu {
        transform: translate(-50%, 0);
    }
}

.header-nav nav a {
    text-decoration: none;
    color: white;
    font-size: 1rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: block;
}

.header-nav nav a:hover {
    opacity: 0.7;
    transform: scale(1.05);
}

.nav {
    display: flex;
    align-items: center;
    margin-right: 50px;
}

.content {
    position: relative;
    min-height: calc(100vh - 150px);
    padding: 44px 30px 60px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    text-align: justify;
    justify-content: center;
    animation: fadeIn 1s ease-out 0.3s both;
}

.contact-layout {
    width: min(1180px, 100%);
    min-height: 440px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
    align-items: center;
    gap: 70px;
}

#telefono {
    width: 100%;
    border-radius: 20px;
}

.contact-panel {
    width: 100%;
    padding: 34px 38px 38px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 18px;
    background: rgba(12, 24, 35, 0.72);
    backdrop-filter: blur(8px);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}

.eyebrow {
    margin: 0 0 12px;
    color: #b8e4e7;
    font-size: 0.78rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.contact-panel h1 {
    margin: 0 0 16px;
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: 0;
    text-align: left;
}

.contact-intro {
    margin: 0 0 32px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.6;
    letter-spacing: 0.5px;
    text-align: left;
}

.contact-details {
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.contact-label {
    margin: 0 0 8px;
    color: #b8e4e7;
    font-size: 0.78rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.contact-details > .contact-label:first-child {
    margin-bottom: 0;
}

.contact-details > .contact-label:first-child + p {
    margin-top: 0;
}

.contact-details a {
    color: white;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: color 0.2s ease;
}

.contact-details a:hover {
    color: #b8e4e7;
}

#spacing {
    margin-top: 18px;
}

@media (max-width: 800px) {
    body {
        overflow-y: auto;
    }

    .contatti_page {
        overflow: visible;
    }

    .header-nav {
        height: auto;
        min-height: 120px;
        flex-direction: column;
        justify-content: center;
        padding: 20px;
    }

    #logo_header {
        width: min(180px, 70vw);
        margin-left: 0;
    }

    .nav {
        margin-right: 0;
    }

    .header-nav nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px 18px;
    }

    .content {
        min-height: auto;
        padding: 30px 16px 45px;
        text-align: justify;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .contact-image-space {
        min-height: 120px;
    }
}

@media (max-width: 560px) {
    .contact-panel {
        padding: 26px 20px 28px;
    }

    .contact-image-space {
        min-height: 80px;
    }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
