/* ---- Menu fisso in testa ---- */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.main-nav .navbar li.active a {
    cursor: pointer; /* manina anche su About (Kube usa cursor:text per .active) */
}

/* Menu mobile: solo icona hamburger (niente "GPICCOLO") */
.navigation-toggle:after {
    display: none;
}
.navigation-toggle {
    margin-bottom: 0;
    transition: margin-bottom 0.22s ease;
}
.navigation-toggle span {
    padding: 10px 14px;
}
.navigation-toggle span .fa-bars {
    font-size: 1.4rem;
}

body {
    padding-top: 78px; /* compensa l'altezza del menu fisso */
}

/* offset per gli anchor: h1 e sezioni non finiscono sotto il menu + spazio extra */
html {
    scroll-padding-top: 102px; /* menu (~78px) + 24px di respiro */
}

.intro h1:before {
    /* Edit this with your name or anything else */
    content: 'GPICCOLO';
    margin-left: -115px;
}

/* ---- Portfolio / Progetti ---- */
.portfolio__intro {
    margin: -10px 0 28px 0;
    color: #8c8c8c;
    font-size: 0.95em;
}

.portfolio__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 10px;
    margin-bottom: 1.65em;
}

.portfolio__card {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
    animation: portfolioReveal 0.6s ease both;
}

.portfolio__card:nth-child(1) {
    animation-delay: 0.08s;
}

.portfolio__card:nth-child(2) {
    animation-delay: 0.18s;
}

.portfolio__card:nth-child(3) {
    animation-delay: 0.28s;
}

@keyframes portfolioReveal {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

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

.portfolio__card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.portfolio__img-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #e8e8e8;
    overflow: hidden;
}

.portfolio__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.portfolio__card:hover .portfolio__img-wrap img {
    transform: scale(1.06);
}

.portfolio__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.2) 45%, transparent 70%);
    opacity: 0;
    transition: opacity 0.35s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    pointer-events: none;
}

.portfolio__card:hover .portfolio__overlay {
    opacity: 1;
}

.portfolio__title {
    font-family: "Playfair Display SC", serif;
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 6px;
    transform: translateY(12px);
    transition: transform 0.35s ease;
}

.portfolio__card:hover .portfolio__title {
    transform: translateY(0);
}

.portfolio__cta {
    font-family: "Lato", Arial, sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(12px);
    transition: transform 0.35s ease;
}

.portfolio__card:hover .portfolio__cta {
    transform: translateY(0);
}

.portfolio__cta i {
    margin-left: 6px;
    font-size: 0.85em;
}

@media only screen and (max-width: 767px) {
    .main-nav {
        display: none;
    }
    body {
        padding-top: 0;
    }
    html {
        scroll-padding-top: 24px;
    }
    .intro {
        padding-top: 45px;
    }
}

@media (max-width: 640px) {
    .portfolio__overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 55%);
    }

    .portfolio__title,
    .portfolio__cta {
        transform: translateY(0);
    }
}

/* ---- Pulsante email fluttuante ---- */
.floating-email-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #0f0f0f 0%, #333 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 999;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                background 0.3s ease,
                color 0.3s ease;
    font-size: 1.5rem;
}

.floating-email-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
    background: #fff;
    color: #0f0f0f;
}

.floating-email-btn:active {
    transform: translateY(-2px) scale(1.02);
}

@media only screen and (max-width: 767px) {
    .floating-email-btn {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
        font-size: 1.35rem;
    }
}

/* ---- Pulsante torna su ---- */
.floating-back-to-top {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #0f0f0f 0%, #333 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 999;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                background 0.3s ease,
                color 0.3s ease,
                opacity 0.3s ease,
                visibility 0.3s ease;
    font-size: 1.5rem;
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
}

.floating-back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.floating-back-to-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
    background: #fff;
    color: #0f0f0f;
}

.floating-back-to-top:active {
    transform: translateY(-2px) scale(1.02);
}

@media only screen and (max-width: 767px) {
    .floating-back-to-top {
        bottom: 88px;
        right: 20px;
        width: 52px;
        height: 52px;
        font-size: 1.35rem;
    }
}