* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

html {
    overflow-x: clip;
    max-width: 100%;
    scroll-snap-type: y mandatory;
}

body {
    background-color: var(--public-dark);
    color: var(--public-on-dark);
    font-family: var(--public-font-body);
    line-height: 1.6;
    overflow-x: clip;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

@supports not (overflow: clip) {
    html {
        overflow-x: hidden;
    }

    body {
        overflow-x: hidden;
    }
}

section {
    max-width: 100vw;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--public-font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

body > header {
    position: fixed;
    top: 0;
    z-index: 1000;
    width: 100%;
    max-width: 100vw;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    overflow: hidden;
}

body > header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(var(--public-orange-rgb), 0.5) 50%,
        transparent 100%
    );
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 48px;
}

.logo,
.footer-logo {
    display: flex;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo:hover,
.footer-logo:hover {
    transform: scale(1.02);
}

.logo img,
.footer-logo img {
    display: block;
    height: 34px;
    transition: opacity 0.3s ease;
}

.logo:hover img,
.footer-logo:hover img {
    opacity: 0.9;
}

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

.nav-links li {
    position: relative;
}

.nav-toggle {
    display: none;
    padding: 6px 4px;
    border: none;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
}

.nav-toggle-line {
    display: block;
    width: 24px;
    height: 2px;
    margin: 0;
    background: var(--public-on-dark-82);
    transition: opacity 0.2s ease;
}

.nav-links a:not(.public-button) {
    padding: 8px 0;
    color: var(--public-on-dark-muted);
    font-size: 0.98rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:not(.public-button)::after {
    content: "";
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 0;
    height: 1.5px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--public-orange) 0%, rgba(var(--public-orange-rgb), 0.6) 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:not(.public-button):hover,
.nav-links a.is-active:not(.public-button) {
    color: var(--public-on-dark);
}

.nav-links a:not(.public-button):hover::after,
.nav-links a.is-active:not(.public-button)::after {
    width: 100%;
}

/* La CTA "Contattaci" della navbar usa il sistema .public-button--primary
   (vedi public-layout.css). L'override compatto per la navbar è in
   public-site-shell.css (.nav-links .public-button). */

.site-footer {
    background: #050505;
    border-top: 1px solid var(--public-on-dark-10);
    padding: 0;
    text-align: left;
}

.footer-container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 48px 24px;
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 48px;
}

.footer-nav a {
    color: var(--public-on-dark-muted);
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.3s ease;
}

.footer-nav a:hover,
.footer-nav a.is-active {
    color: var(--public-on-dark);
}

.footer-bottom {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.footer-logo { grid-column: 1; grid-row: 1; }
.footer-nav { grid-column: 2; grid-row: 1; justify-self: center; }
.footer-contacts { grid-column: 3; grid-row: 1; }

.footer-legal {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-legal a,
.footer-legal__button {
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    color: var(--public-on-dark-50);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 300;
    line-height: inherit;
    cursor: pointer;
    transition: color 0.3s ease;
}

.footer-legal a:hover {
    color: var(--public-on-dark-muted);
}

.footer-legal span {
    color: var(--public-on-dark-32);
    font-size: 0.75rem;
}

.footer-copyright {
    margin: 0;
    color: var(--public-on-dark-40);
    font-size: 0.75rem;
    font-weight: 300;
    text-align: center;
}

.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 600px;
    height: 600px;
    border-radius: var(--public-radius-circle);
    background: radial-gradient(circle, rgba(255, 80, 0, 0.15), transparent 70%);
    pointer-events: none;
    transform: translate(-300px, -300px);
    mix-blend-mode: screen;
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        gap: 0;
        padding: 16px 20px;
    }

    .nav-links {
        display: none;
        width: 100%;
        margin: 12px 0 0;
        padding: 12px 0 0;
        gap: 12px;
        flex-direction: column;
        border-top: 1px solid var(--public-on-dark-08);
    }

    .nav-links.is-open {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        padding: 8px 0;
        text-align: center;
    }

    .nav-links .public-button {
        align-self: center;
        width: auto;
        justify-content: center;
    }

    .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
    }

    .logo img {
        height: 28px;
    }

    .site-footer {
        text-align: center;
    }

    .footer-container {
        gap: 20px;
        padding: 32px 20px 24px;
    }

    .footer-nav,
    .footer-legal {
        flex-direction: column;
    }

    .footer-nav {
        gap: 16px;
    }

    .footer-legal {
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-snap-type: none;
    }

    .fade-in,
    .fade-in-left,
    .fade-in-right {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
