/* ======================================================
   BASE & SFONDO
====================================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #111;
    line-height: 1.6;
    position: relative;
    min-height: 100vh;

    /* Animazione ingresso pagina */
    opacity: 0;
    transform: translateY(10px);
    animation: pageFadeIn 0.7s ease-out forwards;

    background-color: #5A7FA3;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;

    background-image: url("img/cover.jpg");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}



/* Sfondo a tutto schermo, fisso – DESKTOP */
/* Velo chiaro sopra lo sfondo */
/* Layout generale */
.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ======================================================
   HEADER & NAV CON MENU A TENDINA
====================================================== */

.site-header {
    background: #46698A;
    color: #fff;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.site-header .brand {
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 14px;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-nav {
    display: flex;
    align-items: center;
}

.site-nav a {
    color: #ddd;
    text-decoration: none;
    margin-left: 16px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: relative;
    overflow: hidden;
}

/* Sottolineatura animata "liquida" */
.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #f3e3c4, #c9a36b);
    transition: width 0.25s ease;
}

.site-nav a:hover::after,
.site-nav a.active::after {
    width: 100%;
}

.site-nav a:hover {
    color: #fff;
}

.site-nav a.active {
    color: #fff;
}

/* Bottone hamburger per mobile */
.menu-toggle {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    display: none; /* mostrato solo su mobile */
}

.menu-toggle:focus-visible {
    outline: 2px solid rgba(255,255,255,0.8);
    outline-offset: 2px;
}

/* ======================================================
   HERO – liquid glass stile Apple
====================================================== */

.hero {
    position: relative;
    min-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 0;
}

.hero-inner {
    position: relative;
    z-index: 1;

    width: 85%;
    max-width: 980px;
    padding: 120px 40px 100px;

    /* Liquid Glass stile Apple */
    background:
        radial-gradient(
            at 0% 0%,
            rgba(255, 255, 255, 0.50),
            rgba(255, 255, 255, 0.15) 60%
        ),
        radial-gradient(
            at 100% 100%,
            rgba(255, 255, 255, 0.35),
            rgba(255, 255, 255, 0.10) 60%
        ),
        rgba(255, 255, 255, 0.18);

    backdrop-filter: blur(38px);
    -webkit-backdrop-filter: blur(38px);

    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.38),
        0 25px 60px rgba(0, 0, 0, 0.28),
        inset 0 0 80px rgba(255, 255, 255, 0.12);

    opacity: 0;
    transform: translateY(24px) scale(0.98);
    animation: heroUp 0.9s ease-out 0.1s forwards;
}

/* Testi hero */
.hero-kicker {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 12px;
    margin-bottom: 12px;
    color: #555;
    animation: kickerFloat 3s ease-in-out infinite;
}

.hero-title {
    font-size: 42px;
    letter-spacing: 0.04em;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.hero-subtitle {
    max-width: 700px;
    margin: 0 auto 28px;
    font-size: 18px;
    color: #333;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ======================================================
   BUTTONS
====================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.08em;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #f3e3c4, #d7b575);
    color: #111;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 9px 18px rgba(0, 0, 0, 0.18);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #f6e9d3, #e0c18a);
    border-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.14);
    color: #111;
    border-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

/* ======================================================
   SEZIONI & CARD
====================================================== */

.section {
    padding: 72px 0;
}

.section > .container {
    background:
        radial-gradient(
            circle at 20% 0%,
            rgba(255, 255, 255, 0.35),
            transparent 55%
        ),
        rgba(255, 255, 255, 0.22);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(255, 255, 255, 0.4);
    padding: 40px 24px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    opacity: 0;
    transform: translateY(20px);
    animation: sectionUp 0.8s ease-out 0.3s forwards;
}

.section-title {
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-bottom: 10px;
}

.section-subtitle {
    max-width: 680px;
    color: #555;
    margin-bottom: 32px;
}

/* Griglie */
.card-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.card-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

/* CARD */
.card {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease,
        border-color 0.25s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.25);
    background: rgba(255, 255, 255, 0.26);
    border-color: rgba(255, 255, 255, 0.9);
}

.card-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.card-kicker {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #777;
    margin-bottom: 4px;
}

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

.site-footer {
    background: #46698A;
    color: #eee;
    padding: 32px 0 16px;
    font-size: 13px;
    margin-top: 40px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer a {
    color: #ddd;
    text-decoration: none;
}

.site-footer a:hover {
    color: #fff;
}

.footer-top {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.footer-brand {
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 13px;
    margin-bottom: 6px;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 10px;
    font-size: 12px;
    color: #777;
}

/* ======================================================
   EFFETTO GOCCIA / ONDA SU TUTTA LA PAGINA
====================================================== */

.ripple-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
}

.water-ripple {
    position: absolute;
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.48);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    filter: blur(7px);
    opacity: 0.9;
    mix-blend-mode: screen;
    animation: rippleAnimation 0.85s ease-out forwards;
}

/* ======================================================
   ANIMAZIONI (keyframes)
====================================================== */

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

@keyframes heroUp {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes kickerFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes rippleAnimation {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.7;
    }
    60% {
        opacity: 0.4;
    }
    100% {
        transform: translate(-50%, -50%) scale(15);
        opacity: 0;
    }
}

/* ======================================================
   RESPONSIVE + MENU MOBILE LIQUID
====================================================== */

@media (max-width: 900px) {
    .site-header-inner {
        position: relative;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    .site-nav {
        position: absolute;
        top: 100%;
        right: 0;
        background: #46698A;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        padding: 12px 18px;
        border-radius: 0 0 20px 20px;
        min-width: 190px;
        box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
        z-index: 1200;

        display: flex;
        flex-direction: column;
        gap: 8px;

        /* Effetto fluido */
        transform-origin: top right;
        transform: scaleY(0.3);
        opacity: 0;
        pointer-events: none;

        transition:
            transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
            opacity 0.3s ease-out,
            border-radius 0.45s ease-out;
    }

    .site-nav.open {
        transform: scaleY(1);
        opacity: 1;
        pointer-events: auto;
        border-radius: 0 0 26px 26px;
    }

    .site-nav a {
        margin: 0;
        font-size: 14px;
        transform: translateY(8px);
        opacity: 0;
        transition:
            transform 0.3s ease-out,
            opacity 0.3s ease-out;
    }

    .site-nav.open a {
        transform: translateY(0);
        opacity: 1;
    }

    /* Effetto cascade sui link */
    .site-nav.open a:nth-child(1) { transition-delay: 0.05s; }
    .site-nav.open a:nth-child(2) { transition-delay: 0.08s; }
    .site-nav.open a:nth-child(3) { transition-delay: 0.11s; }
    .site-nav.open a:nth-child(4) { transition-delay: 0.14s; }
    .site-nav.open a:nth-child(5) { transition-delay: 0.17s; }
    .site-nav.open a:nth-child(6) { transition-delay: 0.20s; }
    .site-nav.open a:nth-child(7) { transition-delay: 0.23s; }
    .site-nav.open a:nth-child(8) { transition-delay: 0.26s; }
}

@media (max-width: 768px) {
    .hero {
        min-height: 80vh;
        padding: 32px 0;
    }

    .hero-inner {
        width: 92%;
        padding: 80px 20px 60px;
        border-radius: 26px;
        box-shadow: 0 14px 30px rgba(0,0,0,0.18);
    }

    .hero-title {
        font-size: 30px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

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

    .section > .container {
        padding: 28px 18px;
        border-radius: 20px;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 78vh;
    }

    .hero-title {
        font-size: 24px;
    }

    .hero-inner {
        width: 94%;
        padding: 50px 16px 32px;
    }

    .card-grid-3,
    .card-grid-4 {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ======================================================
   PROGETTI – GRIGLIA COPERTINE
====================================================== */

.project-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.project-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.project-title {
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* CARD CON IMMAGINE PER PAGINA MATERIALI */
.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.card-image {
    width: 100%;
    height: 160px;
    border-radius: 16px 16px 0 0;
    background-size: cover;
    background-position: center;
    margin-bottom: 14px;
}
.card-link p {
    padding-bottom: 18px;
    padding-left: 20px;
    padding-right: 20px;
}


/* ======================================================
   MATERIALI – OTTIMIZZAZIONE MOBILE
   Migliora la resa delle griglie materiali su tablet e smartphone
====================================================== */

@media (max-width: 900px) {
    .materials-table {
        display: block;
        width: 100%;
    }
    .materials-table tr {
        display: flex;
        flex-wrap: wrap;
    }
    .materials-table td {
        width: 50%;
    }
}

@media (max-width: 540px) {
    .materials-table tr {
        display: block;
    }
    .materials-table td {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
}


/* ======================================================
   SFONDO MOBILE – FIX background-attachment
   Evita problemi su iOS/Android con gli sfondi fissi
====================================================== */
@media (max-width: 900px) {
    body {
        background-attachment: scroll;
        background-position: center top;
        background-size: cover;
    }
}

/* ======================================================
   PAGINA DOWNLOAD – SFONDO FISSO E LAYOUT MINIMO
====================================================== */

.download-page {
    min-height: 100vh;
}

.download-main {
    min-height: calc(100vh - 180px); /* header + footer approssimati */
}

/* Leggera ottimizzazione per schermi piccoli */
@media (max-width: 768px) {
    .download-main {
        min-height: calc(100vh - 160px);
    }
}

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

.hero-download {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-download .hero-inner {
    max-width: 720px;
}

.download-btn {
    margin-top: 18px;
    font-size: 16px;
    gap: 8px;
}
