/* Reset e stili di base */
body, h1, h2, h3, h4, p, ul, ol, li, blockquote {
    margin: 0;
    padding: 0;
    list-style: none;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f8;
    --bg-card: rgba(0, 0, 0, 0.02);
    --text-primary: #1a1a2e;
    --text-secondary: #5a5a7a;
    --accent-1: #6a5acd;
    --accent-2: #ff7f50;
    --accent-gradient: linear-gradient(135deg, #6a5acd, #ff7f50);
    --glow-color: rgba(106, 90, 205, 0.12);
    --border-subtle: rgba(0, 0, 0, 0.08);
    --shadow-light: rgba(0, 0, 0, 0.06);
    --shadow-medium: rgba(0, 0, 0, 0.1);
}

/* Dark Theme */
html.dark-theme {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --text-primary: #e8e8ef;
    --text-secondary: #8888a0;
    --glow-color: rgba(106, 90, 205, 0.2);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --shadow-light: rgba(0, 0, 0, 0.2);
    --shadow-medium: rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.4s ease, color 0.4s ease;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}
body.scroll-locked {
    overflow: hidden;
}
img {
    max-width: 100%;
    height: auto;
}
/* Il cursore di sistema viene nascosto solo quando quello personalizzato è attivo */
html.has-cursor,
html.has-cursor * {
    cursor: none !important;
}

.container {
    box-sizing: border-box;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}
.containerLarge {
    max-width: 100%;
    width: 100%;
}

/* ===================== */
/*    CUSTOM CURSOR       */
/* ===================== */
.cursor-dot {
    width: 10px;
    height: 10px;
    background: var(--accent-2);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 2147483647; /* sopra tutto, anche a banner e widget di Cookiebot */
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
    box-shadow: 0 0 8px rgba(255, 127, 80, 0.5);
}
.cursor-ring {
    width: 38px;
    height: 38px;
    border: 2px solid var(--accent-2);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 2147483646;
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease, background 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}
html.has-cursor .cursor-dot { opacity: 1; }
html.has-cursor .cursor-ring { opacity: 0.7; }
html.has-cursor .cursor-ring.hover {
    width: 56px;
    height: 56px;
    border-color: var(--accent-1);
    background: rgba(106, 90, 205, 0.12);
    opacity: 1;
}

@media (hover: none) {
    .cursor-dot, .cursor-ring { display: none; }
}

/* ===================== */
/*    HEADER              */
/* ===================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 20px 0;
    background: transparent;
    transition: padding 0.3s ease, background 0.3s ease, backdrop-filter 0.3s ease;
}
header.scrolled {
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 2px 20px var(--shadow-light);
}
html.dark-theme header.scrolled {
    background: rgba(10, 10, 15, 0.95);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-subtle);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    -webkit-text-fill-color: var(--text-primary);
}
.theme-toggle:hover {
    border-color: var(--accent-1);
    background: rgba(106, 90, 205, 0.1);
    color: var(--accent-1);
    -webkit-text-fill-color: var(--accent-1);
    transform: rotate(15deg);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

/* Logo */
.logo-container {
    display: inline-block;
    position: relative;
}
.logo-text {
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: 1.5px;
    display: inline-block;
    position: relative;
    text-transform: uppercase;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
/* Logo Glitch Effect */
.logo-glitch {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0;
}
.logo-glitch:nth-child(2) {
    animation: logoGlitch1 5s infinite;
    color: var(--accent-1);
    -webkit-text-fill-color: var(--accent-1);
}
.logo-glitch:nth-child(3) {
    animation: logoGlitch2 5s infinite;
    color: var(--accent-2);
    -webkit-text-fill-color: var(--accent-2);
}
@keyframes logoGlitch1 {
    0%, 92%, 100% { opacity: 0; transform: translate(0); }
    93% { opacity: 0.6; transform: translate(-3px, -1px); }
    94% { opacity: 0; transform: translate(0); }
    95.5% { opacity: 0.4; transform: translate(2px, 1px); }
    96.5% { opacity: 0; transform: translate(0); }
}
@keyframes logoGlitch2 {
    0%, 92%, 100% { opacity: 0; transform: translate(0); }
    93.5% { opacity: 0.6; transform: translate(3px, 1px); }
    94.5% { opacity: 0; transform: translate(0); }
    95% { opacity: 0.4; transform: translate(-2px, -1px); }
    96% { opacity: 0; transform: translate(0); }
}

/* Logo hover: intensify glitch */
.logo-container:hover .logo-glitch:nth-child(2) {
    animation: logoGlitchHover1 0.3s steps(2) infinite;
}
.logo-container:hover .logo-glitch:nth-child(3) {
    animation: logoGlitchHover2 0.3s steps(2) infinite;
}
@keyframes logoGlitchHover1 {
    0% { opacity: 0.8; transform: translate(-3px, -1px); }
    50% { opacity: 0; transform: translate(2px, 1px); }
    100% { opacity: 0.6; transform: translate(-1px, 2px); }
}
@keyframes logoGlitchHover2 {
    0% { opacity: 0.6; transform: translate(3px, 1px); }
    50% { opacity: 0; transform: translate(-2px, -1px); }
    100% { opacity: 0.8; transform: translate(1px, -2px); }
}

/* Footer logo (no glitch) */
.footer-logo-text {
    font-size: 1.6em;
}

/* Hamburger menu */
.hamburger-menu {
    cursor: pointer;
    background: none;
    border: none;
    display: block;
    margin-left: auto;
    padding: 8px;
}
.hamburger-menu .bar {
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    margin: 6px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Nav Menu Laterale */
.nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: min(320px, 85vw);
    transform: translateX(105%);
    visibility: hidden;
    height: 100%;
    background-color: var(--bg-secondary);
    padding-top: 80px;
    flex-direction: column;
    align-items: flex-start;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
    overflow-y: auto;
    box-shadow: -5px 0 30px var(--shadow-medium);
    z-index: 101;
    display: flex;
    border-left: 1px solid var(--border-subtle);
}
html.dark-theme .nav-menu {
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
}
.nav-menu.open {
    transform: translateX(0);
    visibility: visible;
}
.nav-main-items {
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
}
.nav-secondary-items {
    display: flex;
    flex-direction: column;
    padding-top: 20px;
}
.nav-separator {
    width: 80%;
    height: 1px;
    background-color: var(--border-subtle);
    margin: 10px auto;
}
.nav-menu a {
    margin: 12px 20px;
    margin-left: 40px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1em;
    transition: color 0.3s ease;
}
.nav-menu a:hover {
    color: var(--accent-2);
}
.secondary-link {
    font-size: 0.9em !important;
    opacity: 0.6;
}

/* Close button */
.close-menu {
    position: absolute;
    top: 20px;
    left: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
    z-index: 10;
}
.close-menu:hover {
    background: rgba(106, 90, 205, 0.1);
}
.close-menu .bar {
    width: 22px;
    height: 2px;
    background-color: var(--text-primary);
    position: absolute;
    border-radius: 2px;
    margin: 0;
    transition: background-color 0.3s ease;
}
.close-menu .bar:first-child {
    transform: rotate(45deg);
}
.close-menu .bar:last-child {
    transform: rotate(-45deg);
}
.close-menu:hover .bar {
    background-color: var(--accent-2);
}

/* Language Switcher */
.language-switcher {
    margin: 10px 20px;
    margin-left: 40px;
}
.language-flags {
    display: flex;
}
.flag-link {
    display: inline-block;
    margin-right: 8px;
    cursor: pointer;
}
.flag {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-size: cover;
    transition: filter 0.3s ease;
    border-radius: 2px;
}
.flag.it { background-image: url('images/flags/it.png'); }
.flag.en { background-image: url('images/flags/en.png'); }
.flag.jp { background-image: url('images/flags/jp.png'); }
.flag-link:not(.active) .flag {
    filter: grayscale(1);
    opacity: 0.5;
}

/* ===================== */
/*    HERO SECTION        */
/* ===================== */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
}

.mesh-gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}
.mesh-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}
html.dark-theme .mesh-blob {
    opacity: 0.35;
}
.mesh-blob:nth-child(1) {
    width: 600px;
    height: 600px;
    background: var(--accent-1);
    top: -15%;
    left: -10%;
    animation: meshFloat1 10s ease-in-out infinite alternate;
}
.mesh-blob:nth-child(2) {
    width: 500px;
    height: 500px;
    background: var(--accent-2);
    bottom: -15%;
    right: -10%;
    animation: meshFloat2 12s ease-in-out infinite alternate;
}
.mesh-blob:nth-child(3) {
    width: 400px;
    height: 400px;
    background: var(--accent-2);
    top: 40%;
    left: 35%;
    animation: meshFloat3 8s ease-in-out infinite alternate;
}

@keyframes meshFloat1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, -40px) scale(1.15); }
}
@keyframes meshFloat2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-50px, 30px) scale(1.1); }
}
@keyframes meshFloat3 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, -50px) scale(1.2); }
}

/* Effetto Glitter */
#hero .glitter-container,
.e404 .glitter-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
#hero .glitter-dot,
.e404 .glitter-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    opacity: 0.6;
    animation: glitterMove 5s linear infinite, glitterColor 10s linear infinite;
    background-size: 300%;
    background-image: linear-gradient(to right, red, green, blue, red);
}
@keyframes glitterColor {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}
@keyframes glitterMove {
    0% { transform: translateX(0) translateY(0) scale(1) rotate(0deg); }
    20% { transform: translateX(15px) translateY(10px) scale(1.3) rotate(15deg); }
    40% { transform: translateX(-20px) translateY(-15px) scale(1) rotate(-10deg); }
    60% { transform: translateX(5px) translateY(20px) scale(1.4) rotate(5deg); }
    80% { transform: translateX(-10px) translateY(5px) scale(1.1) rotate(20deg); }
    100% { transform: translateX(0) translateY(0) scale(1) rotate(0deg); }
}

#hero .container {
    z-index: 2;
    position: relative;
}

#hero h2 {
    font: 800 clamp(2.8rem, 6vw, 5.5rem) / 1.05 'Inter', sans-serif;
    color: var(--text-primary);
    max-width: 850px;
    text-align: center;
    display: inline-table;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

#hero p {
    font-size: 1.2em;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Gradient text */
.gradient {
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    -webkit-animation: gradientAnimation 3s ease-in-out infinite alternate;
    animation: gradientAnimation 3s ease-in-out infinite alternate;
    background: -webkit-radial-gradient(circle, #0021b1 0, #3cff52 100%);
    background: radial-gradient(circle, #0021b1 0, #3cff52 100%);
    background-clip: text;
    background-size: 200%;
}
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}
.gradient-button {
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    -webkit-animation: gradientAnimation 3s ease-in-out infinite alternate;
    animation: gradientAnimation 3s ease-in-out infinite alternate;
    background: -webkit-radial-gradient(circle, #ffb400 0, #c30000 100%);
    background: radial-gradient(circle, #ffb400 0, #c30000 100%);
    background-clip: text;
    background-size: 200%;
}

/* Slide animations */
.slide-text-reveal {
    clip-path: inset(0 100% 0 0);
    animation: textReveal 1s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}
@keyframes textReveal {
    to { clip-path: inset(0 0% 0 0); }
}

/* ===================== */
/*    SLIDER              */
/* ===================== */
.slider {
    position: relative;
    overflow: hidden;
    width: 100%;
}
.slide-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Slide Button Container */
.slide-button-container {
    margin-top: 30px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.slide.active .slide-button-container {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Button */
.button-hero {
    background-color: transparent;
    color: var(--accent-2);
    padding: 12px 25px;
    border: 2px solid var(--accent-2);
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    z-index: 1;
}
.button-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--accent-2);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}
.button-hero:hover::before {
    transform: scaleX(1);
}
.button-hero:hover {
    color: var(--bg-primary);
    -webkit-text-fill-color: var(--bg-primary);
    transform: translateY(-2px);
}

/* Slider Dots */
.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    z-index: 3;
}
.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.15);
    margin: 0 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.slider-dot.active {
    background-color: var(--accent-1);
    transform: scale(1.3);
}

/* ===================== */
/*    SECTION DIVIDERS    */
/* ===================== */
.section-divider {
    margin-top: -1px;
    line-height: 0;
    position: relative;
    z-index: 1;
}
.section-divider svg {
    width: 100%;
    height: 80px;
    display: block;
}

/* ===================== */
/*    CHI SIAMO           */
/* ===================== */
#chi-siamo {
    padding: 100px 0;
    background-color: var(--bg-secondary);
}
#chi-siamo .container {
    max-width: 1200px;
}
#chi-siamo h2 {
    text-align: left;
    margin-bottom: 20px;
    padding: 0;
}
#chi-siamo p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
}
.about-section {
    margin-bottom: 60px;
}
.about-section .image-content {
    flex: 1;
    text-align: center;
    padding: 20px;
}
.about-section .image-content img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 16px;
    object-fit: cover;
    transition: filter 0.5s ease;
    animation: hueAnimation 10s linear infinite alternate;
}
@keyframes hueAnimation {
    0% { filter: hue-rotate(0deg) brightness(0.9); }
    100% { filter: hue-rotate(60deg) brightness(1); }
}
.about-section .text-content {
    flex: 1;
    padding: 20px;
    text-align: left;
}

/* Mission */
.mission-section .content-wrapper {
    display: flex;
    align-items: center;
}
.mission-title {
    text-align: center;
    margin: 0 auto 20px;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* Story */
.story-section {
    display: flex;
    align-items: flex-start;
}
.story-section .text-col {
    flex: 1;
}
.story-section .text-col .text-content {
    text-align: left;
    padding-top: 0;
}
.story-title {
    text-align: left;
    margin-bottom: 10px;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.story-section .image-content {
    order: 1;
    flex: 1;
    text-align: center;
}

/* ===================== */
/*    STATS SECTION       */
/* ===================== */
.stats-section {
    padding: 100px 0;
    background: var(--bg-primary);
    position: relative;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    text-align: center;
}
.stat-item {
    padding: 20px;
}
.stat-number {
    font-size: clamp(3rem, 5vw, 4.5rem);
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline;
}
.stat-suffix {
    font-size: clamp(1.5rem, 2.5vw, 2.5rem);
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label {
    color: var(--text-secondary);
    margin-top: 12px;
    font-size: 1rem;
    font-weight: 500;
}

/* ===================== */
/*    SERVIZI             */
/* ===================== */
#servizi {
    background-color: var(--bg-secondary);
    padding: 100px 0;
}
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 50px;
}
.service {
    padding: 40px 30px;
    border-radius: 16px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    text-align: center;
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.service:hover {
    transform: translateY(-8px);
    border-color: rgba(106, 90, 205, 0.3);
    box-shadow: 0 20px 40px var(--shadow-medium), 0 0 30px var(--glow-color);
}
.service i {
    font-size: 2.5em;
    margin-bottom: 20px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}
.service h3 {
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 1.3em;
    color: var(--text-primary);
}
.service p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===================== */
/*    PORTFOLIO           */
/* ===================== */
#portfolio {
    background-color: var(--bg-primary);
    padding: 100px 0;
}
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}
.portfolio-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.portfolio-item:hover {
    transform: translateY(-8px);
    border-color: rgba(106, 90, 205, 0.25);
    box-shadow: 0 20px 40px var(--shadow-medium), 0 0 30px var(--glow-color);
}

.portfolio-item h3 {
    margin-top: 10px;
    margin-bottom: 5px;
    color: var(--text-primary);
    font-weight: 700;
}
.portfolio-item p {
    margin-bottom: 14px;
    color: var(--text-secondary);
}
.portfolio-item-details {
    padding: 20px;
}
.portfolio-cliente {
    display: block;
    font-style: italic;
    margin-bottom: 5px;
    color: var(--text-secondary);
}
.portfolio-tipologia {
    display: block;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: var(--accent-2);
}
.project-tag {
    display: inline-block;
    background: rgba(106, 90, 205, 0.1);
    padding: 5px 10px;
    border-radius: 6px;
    margin-right: 5px;
    margin-bottom: 5px;
    font-size: 0.8em;
    color: var(--accent-1);
    border: 1px solid rgba(106, 90, 205, 0.2);
}
/* View More Button */
.portfolio-load-more {
    display: block;
    margin: 40px auto 0;
    padding: 14px 36px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.4s ease;
}
.portfolio-load-more:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(106, 90, 205, 0.3);
}
.portfolio-load-more[hidden] {
    display: none;
}
.portfolio-item.portfolio-hidden {
    display: none;
}

#portfolio .portfolio-cta {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
}
#portfolio .portfolio-cta p {
    font-size: 1.2em;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
#portfolio .portfolio-cta a {
    display: inline-block;
}

/* ===================== */
/*    COLLABORAZIONI      */
/* ===================== */
#collaborazioni {
    padding: 80px 0;
    background-color: var(--bg-secondary);
}
#collaborazioni h2 {
    text-align: center;
    margin-bottom: 50px;
}
.logo-slider {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 10px 0;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}
.logo-track {
    display: flex;
    width: max-content;
    animation: slideLogos 45s linear infinite;
}
.logo-slider:hover .logo-track {
    animation-play-state: paused;
}
.logo-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    min-width: 180px;
}
.logo-slide img {
    max-width: 150px;
    max-height: 50px;
    opacity: 0.6;
    transition: opacity 0.3s ease, filter 0.3s ease;
    display: block;
}
html.dark-theme .logo-slide img {
    filter: brightness(0) invert(1);
}
.logo-slide:hover img {
    opacity: 1;
}
.logo-box {
    width: 200px;
    height: 65px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    text-align: center;
    background: var(--bg-card);
    transition: all 0.3s ease, border-color 0.3s ease;
}
.logo-box:hover {
    border-color: rgba(106, 90, 205, 0.25);
}
@keyframes slideLogos {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ===================== */
/*    CONTATTI            */
/* ===================== */
#contatti {
    background-color: var(--bg-primary);
    padding: 100px 0;
}
#contatti .contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Contact boxes */
#contatti .contact-boxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
#contatti .contact-box {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-radius: 16px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
#contatti .contact-box:hover {
    transform: translateY(-5px);
    border-color: rgba(106, 90, 205, 0.3);
    box-shadow: 0 15px 30px var(--shadow-medium), 0 0 20px var(--glow-color);
}
#contatti .contact-box i {
    font-size: 2em;
    margin-bottom: 12px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}
#contatti .contact-box h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
}
#contatti .contact-box p,
#contatti .contact-box a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}
#contatti .contact-box a:hover {
    color: var(--accent-2);
}
#contatti .social-links {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}
#contatti .social-links a {
    font-size: 1.3em;
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    -webkit-text-fill-color: initial;
}
#contatti .social-links a:hover {
    color: var(--accent-2);
}

/* Contact Form */
.contact-form-wrapper {
    padding: 40px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
}
.contact-form-wrapper h3 {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 30px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-group {
    position: relative;
    margin-bottom: 24px;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 18px 16px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
    box-sizing: border-box;
}
.form-group textarea {
    resize: vertical;
    min-height: 120px;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 20px var(--glow-color);
}
.form-group label {
    position: absolute;
    left: 16px;
    top: 16px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    pointer-events: none;
}
.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: 4px;
    font-size: 0.72rem;
    color: var(--accent-2);
}
.submit-btn {
    background: var(--accent-gradient);
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
    font-family: 'Inter', sans-serif;
}
.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(106, 90, 205, 0.3);
}

/* ===================== */
/*    BUTTONS             */
/* ===================== */
.button {
    background: var(--accent-gradient);
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(106, 90, 205, 0.3);
}

/* ===================== */
/*    FOOTER              */
/* ===================== */
footer {
    background: var(--bg-secondary);
    padding: 80px 0 0;
    border-top: 1px solid var(--border-subtle);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding: 0 20px;
}
.footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-col h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.1em;
    font-weight: 700;
}
.footer-col a,
.footer-col p {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
    line-height: 1.6;
}
.footer-col a:hover {
    color: var(--accent-2);
}
.footer-col i {
    margin-right: 8px;
    color: var(--text-secondary);
}
.footer-brand .logo-text {
    font-size: 1.6em;
}
.footer-brand p {
    max-width: 280px;
    line-height: 1.7;
    margin-top: 4px;
}
.footer-socials {
    display: flex;
    gap: 14px;
    margin-top: 8px;
}
.footer-socials a {
    font-size: 1.2em;
    color: var(--text-secondary);
    transition: color 0.3s;
}
.footer-socials a:hover {
    color: var(--accent-2);
}
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 20px;
    margin-top: 60px;
    border-top: 1px solid var(--border-subtle);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.footer-bottom p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.footer-legal {
    display: flex;
    gap: 20px;
}
.footer-legal a {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.3s;
}
.footer-legal a:hover {
    color: var(--accent-2);
}

/* ===================== */
/*    SECTION HEADINGS    */
/* ===================== */
#chi-siamo h2,
#servizi h2,
#portfolio h2,
#contatti h2,
#metodo h2,
#collaborazioni h2 {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 20px;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    position: relative;
    padding-bottom: 16px;
}
#chi-siamo h2::after,
#servizi h2::after,
#portfolio h2::after,
#contatti h2::after,
#metodo h2::after,
#collaborazioni h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 3px;
}

/* ===================== */
/*    DARK THEME TWEAKS   */
/* ===================== */
html.dark-theme .slider-dot {
    background-color: rgba(255, 255, 255, 0.2);
}
/* Light theme: subtler glitter */
.glitter-dot {
    opacity: 0.4 !important;
}
html.dark-theme .glitter-dot {
    opacity: 0.6 !important;
}

/* ===================== */
/*    SCROLL REVEAL       */
/* ===================== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}
.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}
.stagger-children .reveal:nth-child(1) { transition-delay: 0s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.15s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.2s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.25s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.3s; }

/* ===================== */
/*    PRIVACY POPUP       */
/* ===================== */
.privacy-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.privacy-popup.open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}
.privacy-popup-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background-color: var(--bg-primary);
    width: 90%;
    max-width: 780px;
    max-height: 85vh;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.privacy-popup.open .popup-content {
    transform: translate(-50%, -50%) scale(1);
}
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
    flex-shrink: 0;
}
.popup-header h2 {
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.3em;
    letter-spacing: -0.02em;
    margin: 0;
    padding: 0;
}
.popup-header h2::after {
    display: none;
}
.close-popup {
    background: none;
    border: 2px solid var(--border-subtle);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1em;
    color: var(--text-secondary);
    -webkit-text-fill-color: var(--text-secondary);
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.close-popup:hover {
    background: var(--accent-2);
    border-color: var(--accent-2);
    color: #fff;
    -webkit-text-fill-color: #fff;
    transform: rotate(90deg);
}
.popup-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}
.popup-body .privacy-text {
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.popup-body .privacy-text h3 {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.15em;
    margin: 28px 0 12px;
    padding-left: 14px;
    position: relative;
}
.popup-body .privacy-text h3:first-child {
    margin-top: 0;
}
.popup-body .privacy-text h3::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 3px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: 3px;
}
.popup-body .privacy-text p {
    margin-bottom: 12px;
}
.popup-body .privacy-text ul {
    margin: 8px 0 16px 20px;
    list-style: none;
}
.popup-body .privacy-text ul li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 6px;
    line-height: 1.7;
}
.popup-body .privacy-text ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-gradient);
}
.popup-body .privacy-text .privacy-update {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.85em;
    opacity: 0.7;
}
@media (max-width: 768px) {
    .popup-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 16px;
    }
    .popup-header {
        padding: 18px 20px;
    }
    .popup-body {
        padding: 20px;
    }
}

/* ===================== */
/*    RESPONSIVE          */
/* ===================== */
@media (max-width: 768px) {
    header .container {
        flex-direction: row;
    }
    .hamburger-menu {
        position: relative;
        display: block;
    }
    #hero h2 {
        font-size: clamp(2.2rem, 8vw, 3.4rem);
    }
    .about-section,
    .mission-section .content-wrapper,
    .story-section {
        flex-direction: column;
    }
    #chi-siamo .text-content,
    #chi-siamo .image-content {
        padding: 10px 0;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    #contatti .contact-wrapper {
        grid-template-columns: 1fr;
    }
    #contatti .contact-boxes {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}
@media (max-width: 480px) {
    #hero h2 {
        font-size: clamp(1.8rem, 7vw, 2.8rem);
        line-height: 1.15;
    }
    .service-grid {
        grid-template-columns: 1fr;
    }
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================== */
/*    PROJECT MODAL       */
/* ===================== */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.project-modal.open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}
.project-modal-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.project-modal-close {
    position: fixed;
    top: 24px;
    right: 28px;
    z-index: 2010;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.2em;
    -webkit-text-fill-color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px var(--shadow-medium);
}
.project-modal-close:hover {
    background: var(--accent-2);
    color: #fff;
    -webkit-text-fill-color: #fff;
    transform: rotate(90deg);
}
.project-modal-content {
    position: relative;
    z-index: 2001;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Hero image */
.project-modal-hero {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 400px;
    overflow: hidden;
}
.project-modal-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 80px 60px 50px;
    background: linear-gradient(to top, rgba(10,10,20,0.92) 0%, rgba(10,10,20,0.75) 40%, rgba(10,10,20,0.25) 75%, transparent 100%);
    padding-top: 140px;
    box-sizing: border-box;
}
.project-modal-hero-overlay h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 12px;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}
.project-modal.open .project-modal-hero-overlay h2 {
    transform: translateY(0);
    opacity: 1;
}
.pm-subtitle {
    font-size: 1.15em;
    color: rgba(255,255,255,0.75);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.35s;
}
.project-modal.open .pm-subtitle {
    transform: translateY(0);
    opacity: 1;
}

/* Modal body */
.project-modal-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 30px 80px;
    background: var(--bg-primary);
}

/* Info cards grid */
.pm-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 60px;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
}
.project-modal.open .pm-info-grid {
    transform: translateY(0);
    opacity: 1;
}
.pm-info-card {
    text-align: center;
    padding: 28px 16px;
    border-radius: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.pm-info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px var(--shadow-light);
}
.pm-info-card i {
    font-size: 1.8em;
    margin-bottom: 12px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}
.pm-info-card h4 {
    color: var(--text-secondary);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    font-weight: 600;
}
.pm-info-card p {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.05em;
}

/* Sections */
.pm-section {
    margin-bottom: 50px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-modal.open .pm-section {
    transform: translateY(0);
    opacity: 1;
}
.project-modal.open .pm-section:nth-child(2) { transition-delay: 0.5s; }
.project-modal.open .pm-section:nth-child(3) { transition-delay: 0.6s; }
.project-modal.open .pm-section:nth-child(4) { transition-delay: 0.7s; }

.pm-section h3 {
    font-size: 1.6em;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
    position: relative;
    padding-left: 18px;
}
.pm-section h3::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    width: 4px;
    height: 28px;
    background: var(--accent-gradient);
    border-radius: 4px;
}
.pm-section p {
    color: var(--text-secondary);
    font-size: 1.05em;
    line-height: 1.9;
}

/* Tags */
.pm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 50px;
}
.pm-tags .project-tag {
    display: inline-block;
    background: rgba(106, 90, 205, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9em;
    color: var(--accent-1);
    border: 1px solid rgba(106, 90, 205, 0.2);
    font-weight: 500;
}

/* CTA */
.pm-cta {
    text-align: center;
    padding-top: 20px;
}
.pm-cta-btn {
    font-size: 1.05em;
    padding: 16px 36px;
}

/* Portfolio item clickable */
.portfolio-item {
    cursor: pointer;
}
.portfolio-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    border-radius: 16px;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.portfolio-item:hover::after {
    opacity: 0.06;
}

/* Responsive modal */
@media (max-width: 768px) {
    .project-modal-hero {
        height: 50vh;
        min-height: 280px;
    }
    .project-modal-hero-overlay {
        padding: 40px 24px 30px;
    }
    .pm-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .project-modal-body {
        padding: 40px 20px 60px;
    }
    .project-modal-close {
        top: 16px;
        right: 16px;
        width: 42px;
        height: 42px;
    }
}
@media (max-width: 480px) {
    .pm-info-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

/* ========================================================= */
/*    AGGIUNTE – versione PHP                                */
/* ========================================================= */

/* ---------- Utility & accessibilità ---------- */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 3000;
    padding: 10px 18px;
    border-radius: 8px;
    background: var(--accent-1);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform 0.2s ease;
}
.skip-link:focus {
    transform: translateY(0);
}
:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 3px;
    border-radius: 4px;
}
.hp-field {
    position: absolute !important;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
[hidden] {
    display: none !important;
}
section[id] {
    scroll-margin-top: 0; /* lo spazio sotto l'header lo gestisce scroll-padding-top su html */
}
/* Le animazioni laterali non devono allargare la pagina */
main {
    overflow-x: hidden;
    overflow-x: clip;
}

/* ---------- Barra di avanzamento ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gradient);
    transform-origin: 0 50%;
    transform: scaleX(0);
    z-index: 150;
    pointer-events: none;
}

/* ---------- Header ---------- */
.logo-container {
    text-decoration: none;
    line-height: 1;
}
.desktop-nav {
    display: none;
    gap: 6px;
    margin-left: auto;
    margin-right: 24px;
}
.desktop-nav a {
    position: relative;
    padding: 8px 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    opacity: 0.8;
    transition: opacity 0.3s ease, color 0.3s ease;
}
.desktop-nav a::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.desktop-nav a:hover,
.desktop-nav a.active {
    opacity: 1;
}
.desktop-nav a:hover::after,
.desktop-nav a.active::after {
    transform: scaleX(1);
}
.lang-switch {
    display: flex;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
}
.lang-switch .lang-btn {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease, background 0.3s ease;
}
.lang-switch .lang-btn:hover {
    color: var(--text-primary);
}
.lang-switch .lang-btn.active {
    background: var(--accent-gradient);
    color: #fff;
}
.hamburger-menu .bar {
    display: block;
}
@media (min-width: 1024px) {
    .desktop-nav { display: flex; }
    .hamburger-menu { display: none !important; }
}
@media (max-width: 600px) {
    header .container {
        width: 100%;
        padding: 0 14px;
        box-sizing: border-box;
    }
    .theme-toggle { width: 36px; height: 36px; }
    .hamburger-menu { padding: 6px 2px 6px 6px; }
}
@media (max-width: 340px) {
    .site-header .lang-switch { display: none; }
}
@media (max-width: 480px) {
    .lang-switch .lang-btn { padding: 5px 7px; }
    .header-actions { gap: 8px; }
    .logo-text { font-size: 1.25em; }
    .logo-glitch { font-size: 1.25em; }
}

/* ---------- Menu mobile ---------- */
.nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}
.nav-overlay.open {
    opacity: 1;
    visibility: visible;
}
.close-menu {
    background: none;
    border: none;
    padding: 0;
}
.language-flags {
    display: flex;
    gap: 6px;
    margin: 16px 0 0 40px;
}
.nav-menu .language-flags a {
    margin: 0;
}
.flag {
    width: 26px;
    height: 26px;
    border-radius: 50%;
}

/* ---------- Hero ---------- */
.slider-dot {
    border: none;
    padding: 0;
}
.scroll-hint {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}
.scroll-hint:hover {
    opacity: 1;
}
.scroll-hint-mouse {
    display: block;
    width: 24px;
    height: 38px;
    border: 2px solid var(--text-secondary);
    border-radius: 14px;
    position: relative;
}
.scroll-hint-wheel {
    position: absolute;
    top: 7px;
    left: 50%;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    border-radius: 2px;
    background: var(--accent-2);
    animation: scrollWheel 1.8s ease-in-out infinite;
}
@keyframes scrollWheel {
    0% { opacity: 0; transform: translateY(0); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translateY(12px); }
}
@media (max-height: 640px) {
    .scroll-hint { display: none; }
}

/* ---------- Intro di sezione ---------- */
.section-intro {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 620px;
    margin: 0 auto;
}

/* ---------- Tecnologie ---------- */
.tech-label {
    margin-top: 60px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.tech-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}
.tech-strip li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: border-color 0.3s ease, transform 0.3s ease;
}
.tech-strip li:hover {
    border-color: var(--accent-1);
    transform: translateY(-2px);
}
.tech-strip i {
    color: var(--accent-1);
}

/* ---------- Metodo ---------- */
#metodo {
    padding: 100px 0;
    background: var(--bg-primary);
}
.process-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 50px;
    counter-reset: step;
    position: relative;
}
.process-step {
    position: relative;
    padding: 30px 24px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    text-align: center;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}
.process-step:hover {
    transform: translateY(-6px);
    border-color: rgba(106, 90, 205, 0.3);
    box-shadow: 0 20px 40px var(--shadow-medium), 0 0 30px var(--glow-color);
}
.process-num {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.25;
}
.process-step i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 1.4rem;
    box-shadow: 0 10px 25px rgba(106, 90, 205, 0.3);
    position: relative;
}
.process-step h3 {
    font-size: 1.15em;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.process-step p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}
@media (max-width: 1024px) {
    .process-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .process-grid { grid-template-columns: 1fr; }
}

/* ---------- Portfolio ---------- */
.portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.portfolio-item {
    display: flex;
    flex-direction: column;
}
.portfolio-item:focus-visible {
    outline-offset: 4px;
    border-radius: 16px;
}
.portfolio-item-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 24px;
}
.portfolio-item h3 {
    margin-top: 0;
}
.portfolio-tipologia {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 14px;
}
.project-tag {
    margin: 0;
}
.pf-more {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--accent-1);
}
.pf-more i {
    transition: transform 0.3s ease;
}
.portfolio-item:hover .pf-more i,
.portfolio-item:focus-visible .pf-more i {
    transform: translateX(5px);
}
.pf-badge {
    align-self: flex-start;
    margin-bottom: 10px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Copertine */
.pf-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-secondary);
}
.pf-cover > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.portfolio-item:hover .pf-cover > img {
    transform: scale(1.04);
}
.pf-cover--logo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px 28px;
    padding: 30px;
    box-sizing: border-box;
    background:
        radial-gradient(circle at 20% 20%, rgba(106, 90, 205, 0.18), transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(255, 127, 80, 0.18), transparent 55%),
        #ffffff;
}
.pf-cover--logo > img {
    width: auto;
    height: auto;
    max-width: 70%;
    max-height: 45%;
    object-fit: contain;
}
.pf-cover--duo > img {
    max-width: 42%;
}
html.dark-theme .pf-cover--logo {
    background:
        radial-gradient(circle at 20% 20%, rgba(106, 90, 205, 0.35), transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(255, 127, 80, 0.25), transparent 55%),
        #f4f4f8;
}

.pf-badge--soon {
    background: #1f2937;
}
html.dark-theme .pf-badge--soon {
    background: #e8e8ef;
    color: #0a0a0f;
}

/* Card in evidenza (progetto più recente) */
@media (min-width: 900px) {
    .portfolio-item--featured {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1.3fr 1fr;
    }
    .portfolio-item--featured .pf-cover {
        aspect-ratio: auto;
        min-height: 360px;
    }
    .portfolio-item--featured .portfolio-item-details {
        padding: 44px;
        justify-content: center;
    }
    .portfolio-item--featured h3 {
        font-size: 1.8em;
        line-height: 1.2;
        margin-bottom: 8px;
    }
    .portfolio-item--featured p {
        font-size: 1.05rem;
        line-height: 1.7;
    }
    .portfolio-item--featured .pf-more {
        margin-top: 10px;
    }
    .portfolio-item--reverse {
        grid-template-columns: 1fr 1.3fr;
    }
    .portfolio-item--reverse .pf-cover {
        order: 2;
    }
}

.portfolio-cta p {
    margin-bottom: 18px !important;
}

/* ---------- Scheda progetto ---------- */
.pm-hero-media {
    position: absolute;
    inset: 0;
}
.pm-hero-media .pf-cover {
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
}
.pm-hero-media .pf-cover > img {
    transform: scale(1.06);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-modal.open .pm-hero-media .pf-cover > img {
    transform: scale(1);
}
.pm-hero-media .pf-cover--logo > img {
    max-height: 30%;
    max-width: 40%;
}
.pm-info-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.pm-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}
.button-outline {
    background: transparent;
    color: var(--accent-1);
    box-shadow: inset 0 0 0 2px var(--accent-1);
}
.button-outline:hover {
    background: rgba(106, 90, 205, 0.08);
}
.button i {
    margin: 0 2px;
}

/* ---------- Contatti ---------- */
.contact-form-wrapper h3 {
    margin-bottom: 26px;
}
#contatti .contact-wrapper {
    margin-top: 40px;
}
#contatti .contact-boxes {
    align-content: start;
}
.form-group input.invalid,
.form-group textarea.invalid {
    border-color: #e5484d;
}
.form-consent {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: -4px 0 22px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-secondary);
}
.form-consent input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--accent-1);
}
.form-consent a {
    color: var(--accent-1);
}
.submit-btn:disabled {
    opacity: 0.7;
    transform: none;
}
.form-status {
    margin-top: 16px;
    font-size: 0.95rem;
    font-weight: 500;
    min-height: 1.5em;
}
.form-status.is-success { color: #1f9d55; }
.form-status.is-error { color: #e5484d; }
html.dark-theme .form-status.is-success { color: #4ade80; }
html.dark-theme .form-status.is-error { color: #ff7b7f; }

/* ---------- Footer ---------- */
.footer-col a i,
.footer-col p i {
    width: 16px;
}
.footer-socials a {
    margin: 0;
}

/* ---------- Torna su ---------- */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 90;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(106, 90, 205, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    transform: translateY(-3px);
}

/* ---------- Popup privacy ---------- */
.popup-body .privacy-text a {
    color: var(--accent-1);
}

/* ========================================================= */
/*    PAGINA 404                                             */
/* ========================================================= */
.page-404 .site-header .desktop-nav a.active::after {
    transform: scaleX(0);
}
.e404 {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 130px 0 80px;
    box-sizing: border-box;
}
.e404 .mesh-gradient-bg {
    position: absolute;
    inset: 0;
}
.e404 .glitter-container {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}
.e404-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 860px;
}
.e404-terminal {
    display: inline-block;
    margin-bottom: 10px;
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    text-align: left;
    color: var(--text-secondary);
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}
.e404-prompt { color: var(--accent-1); }
.e404-path { color: var(--text-primary); }
.e404-response { color: var(--accent-2); font-weight: 700; }
.e404-caret {
    display: inline-block;
    width: 8px;
    height: 1em;
    margin-left: 4px;
    vertical-align: -2px;
    background: var(--accent-2);
    animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink {
    50% { opacity: 0; }
}

.e404-code {
    position: relative;
    display: block;
    width: fit-content;
    margin-left: auto !important;
    margin-right: auto !important;
    font-size: clamp(7rem, 26vw, 16rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.06em;
    margin: 10px 0 16px;
    user-select: none;
}
.e404-digits {
    display: block;
    background: linear-gradient(120deg, #6a5acd, #ff7f50, #6a5acd);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: e404Shine 6s ease-in-out infinite alternate, e404Float 5s ease-in-out infinite;
    filter: drop-shadow(0 20px 40px rgba(106, 90, 205, 0.25));
}
.e404-glitch {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}
.e404-glitch:nth-child(2) {
    color: #6a5acd;
    clip-path: inset(10% 0 55% 0);
    animation: e404Glitch1 3.2s infinite steps(1);
}
.e404-glitch:nth-child(3) {
    color: #ff7f50;
    clip-path: inset(60% 0 8% 0);
    animation: e404Glitch2 3.2s infinite steps(1);
}
@keyframes e404Shine {
    to { background-position: 100% 0; }
}
@keyframes e404Float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes e404Glitch1 {
    0%, 86%, 100% { opacity: 0; transform: none; }
    87% { opacity: 0.85; transform: translate(-8px, -2px); clip-path: inset(12% 0 60% 0); }
    89% { opacity: 0.85; transform: translate(6px, 1px); clip-path: inset(40% 0 35% 0); }
    91% { opacity: 0; }
    94% { opacity: 0.7; transform: translate(-4px, 0); clip-path: inset(70% 0 5% 0); }
    95% { opacity: 0; }
}
@keyframes e404Glitch2 {
    0%, 87%, 100% { opacity: 0; transform: none; }
    88% { opacity: 0.85; transform: translate(8px, 2px); clip-path: inset(62% 0 10% 0); }
    90% { opacity: 0.85; transform: translate(-6px, -1px); clip-path: inset(20% 0 55% 0); }
    92% { opacity: 0; }
    95% { opacity: 0.7; transform: translate(5px, 0); clip-path: inset(5% 0 80% 0); }
    96% { opacity: 0; }
}
.e404-title {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.e404-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 560px;
    margin: 0 auto 30px;
}
.e404-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-bottom: 60px;
}

/* Minigioco */
.game-card {
    text-align: left;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 20px 50px var(--shadow-light);
}
.game-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px 20px;
    margin-bottom: 14px;
    padding: 0 4px;
}
.game-title {
    font-weight: 700;
    color: var(--text-primary);
}
.game-scores {
    display: flex;
    gap: 18px;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.game-scores strong {
    color: var(--text-primary);
}
.game {
    position: relative;
    height: 220px;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(106, 90, 205, 0.06), rgba(255, 127, 80, 0.06)), var(--bg-primary);
    border: 1px solid var(--border-subtle);
    touch-action: manipulation;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}
.game-ground {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 24px;
    border-top: 2px solid var(--text-secondary);
    opacity: 0.5;
    background-image: repeating-linear-gradient(90deg, var(--text-secondary) 0 6px, transparent 6px 34px);
    background-size: 68px 2px;
    background-repeat: repeat-x;
    background-position: 0 10px;
}
.game.running .game-ground {
    animation: groundMove 0.5s linear infinite;
}
@keyframes groundMove {
    to { background-position: -68px 10px; }
}
.game-clouds i {
    position: absolute;
    color: var(--text-secondary);
    opacity: 0.15;
    font-size: 2rem;
    animation: cloudMove 22s linear infinite;
    animation-play-state: paused;
}
.game.running .game-clouds i {
    animation-play-state: running;
}
.game-clouds i:nth-child(1) { top: 24px; left: 70%; }
.game-clouds i:nth-child(2) { top: 60px; left: 30%; font-size: 1.4rem; animation-duration: 30s; }
.game-clouds i:nth-child(3) { top: 36px; left: 100%; font-size: 1.7rem; animation-duration: 26s; }
@keyframes cloudMove {
    to { translate: -120vw 0; }
}
.dino {
    position: absolute;
    left: 48px;
    bottom: 24px;
    width: 44px;
    height: 42px;
    background: url('images/dino.png') center / contain no-repeat;
    z-index: 2;
}
.dino.run-left { background-image: url('images/dino_run_left.png'); }
.dino.run-right { background-image: url('images/dino_run_right.png'); }
.dino.dead { filter: grayscale(1) opacity(0.7); }
html.dark-theme .dino,
html.dark-theme .obstacle {
    filter: invert(1) brightness(0.9);
}
.obstacle {
    position: absolute;
    left: 0;
    bottom: 24px;
    background: url('images/cactus.png') bottom center / contain no-repeat;
    will-change: transform;
}
.obstacle--double {
    background-repeat: repeat-x;
    background-size: 26px 100%;
}
.game-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: opacity 0.25s ease, visibility 0.25s;
}
html.dark-theme .game-overlay {
    background: rgba(10, 10, 15, 0.45);
}
.game-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}
.game-overlay-title {
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--text-primary);
}
.game-overlay-title:empty {
    display: none;
}
.game-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ========================================================= */
/*    RIDUZIONE MOVIMENTO                                    */
/* ========================================================= */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .logo-track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
    .reveal, .reveal-left, .reveal-right { opacity: 1; transform: none; }
}

/* Titolo scheda progetto leggibile anche sopra screenshot con testo */
.project-modal-hero-overlay {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    -webkit-mask-image: linear-gradient(to top, #000 65%, transparent 100%);
    mask-image: linear-gradient(to top, #000 65%, transparent 100%);
}

/* ========================================================= */
/*    COPERTINE ILLUSTRATE DEL PORTFOLIO (includes/covers.php) */
/* ========================================================= */
.pf-art {
    container-type: inline-size;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    grid-template-rows: 1fr auto auto 1fr;
    column-gap: 6%;
    padding: 7% 8%;
    box-sizing: border-box;
    align-items: center;
    isolation: isolate;
    --t: 7cqi;
}
.pf-art::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}
.art-kicker {
    grid-column: 1;
    grid-row: 2;
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.5rem, 1.9cqi, 0.72rem);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.art-title {
    grid-column: 1;
    grid-row: 3;
    margin-top: 0.35em;
    font-size: clamp(1.1rem, var(--t), 3.6rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    hyphens: manual;
}
.art-title em {
    font-style: normal;
}
.art-object {
    grid-column: 2;
    grid-row: 1 / -1;
    justify-self: center;
    align-self: center;
    position: relative;
    display: flex;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: clamp(6px, 2.65cqi, 16px);
    transform: rotate(4deg);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.portfolio-item:hover .art-object,
.portfolio-item:focus-visible .art-object {
    transform: rotate(0deg) translateY(-4px);
}
.art-object img {
    display: block;
}
.art-object .dot {
    display: inline-block;
    width: 0.6em;
    height: 0.6em;
    border-radius: 50%;
    background: currentColor;
    animation: artPulse 1.6s ease-in-out infinite;
}
@keyframes artPulse {
    50% { opacity: 0.3; }
}

/* Scheda progetto: copertina più grande, contenuto sopra il titolo */
.pm-hero-media .pf-art {
    padding: 40px 10% 210px;
}
.pm-hero-media .art-title {
    font-size: clamp(1.4rem, calc(var(--t) * 0.8), 5rem);
}
.pm-hero-media .art-kicker {
    font-size: clamp(0.6rem, 1.1cqi, 0.9rem);
}
.pm-hero-media .art-object {
    font-size: clamp(8px, min(1.25cqi, 2.3vh), 18px);
}
/* Su mobile la scheda mostra solo l'oggetto: il titolo è già nella fascia in basso */
@media (max-width: 700px) {
    .pm-hero-media .pf-art {
        grid-template-columns: 1fr;
        padding: 24px 8% 150px;
    }
    .pm-hero-media .art-kicker,
    .pm-hero-media .art-title {
        display: none;
    }
    .pm-hero-media .art-object {
        grid-column: 1;
        font-size: clamp(8px, 2.6vw, 12px);
    }
}

/* ---- Ilaria Fisicaro: carta, oro, serif ---- */
.pf-art--ilaria {
    --t: 8.4cqi;
    background:
        radial-gradient(ellipse at 70% 40%, rgba(255, 255, 255, 0.7), transparent 60%),
        linear-gradient(135deg, #efe8dc, #e6dccb);
    color: #1f1b16;
}
.pf-art--ilaria::before {
    background: repeating-linear-gradient(115deg, transparent 0 38px, rgba(150, 120, 80, 0.07) 38px 39px);
}
.pf-art--ilaria .art-kicker { color: #9a8360; }
.pf-art--ilaria .art-title {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-weight: 500;
    line-height: 0.95;
    letter-spacing: 0;
}
.pf-art--ilaria .art-title em { font-style: italic; color: #a07c45; }
.art-book {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
    width: 12em;
    aspect-ratio: 2 / 3;
    padding: 2.4em 1em;
    box-sizing: border-box;
    background: linear-gradient(160deg, #fbf8f2, #efe9df);
    box-shadow: -0.8em 1.2em 2.4em rgba(70, 50, 20, 0.25), inset 0.25em 0 0 rgba(0, 0, 0, 0.05);
    text-align: center;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.15em;
    line-height: 1.05;
    color: #1f1b16;
}
.art-book small { font-size: 0.65em; color: #6a5a45; }

/* ---- Klin: menta e ardesia, app di prenotazione ---- */
.pf-art--klin {
    --t: 6.6cqi;
    background:
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.9), transparent 45%),
        linear-gradient(135deg, #f4faf7, #d6ede3);
    color: #2d3748;
}
.pf-art--klin::before {
    background: radial-gradient(circle at 10% 110%, rgba(255, 196, 160, 0.35), transparent 45%);
}
.pf-art--klin .art-kicker { color: #5e9f86; }
.pf-art--klin .art-title em { color: #6fb39a; }
.art-phone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7em;
    width: 11em;
    padding: 1.6em 1em 1.4em;
    box-sizing: border-box;
    border: 0.45em solid #2d3748;
    border-radius: 1.8em;
    background: #fff;
    box-shadow: 0 1.4em 2.8em rgba(45, 55, 72, 0.25);
}
.phone-notch {
    position: absolute;
    top: 0.45em;
    width: 3.2em;
    height: 0.5em;
    border-radius: 1em;
    background: #2d3748;
}
.phone-logo { width: 2.8em; height: 2.8em; border-radius: 50%; margin-top: 0.4em; }
.phone-line { width: 85%; height: 0.55em; border-radius: 1em; background: #2d3748; opacity: 0.85; }
.phone-line.short { width: 60%; opacity: 0.25; }
.phone-toggle {
    display: flex;
    padding: 0.25em;
    border-radius: 2em;
    background: #eef2f5;
    font-size: 0.62em;
    font-weight: 600;
}
.phone-toggle b, .phone-toggle i { padding: 0.35em 0.9em; border-radius: 2em; font-style: normal; }
.phone-toggle b { background: #fff; color: #6fb39a; box-shadow: 0 0.1em 0.4em rgba(0, 0, 0, 0.08); }
.phone-toggle i { color: #4a5568; }
.phone-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.55em 0.9em;
    border: 1px solid #cbd5e0;
    border-radius: 2em;
    font-size: 0.7em;
    color: #718096;
}
.phone-btn {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6em;
    border-radius: 2em;
    background: #7fbfa5;
    color: #fff;
    font-size: 0.72em;
    font-weight: 700;
    text-align: center;
}
.phone-chip {
    position: absolute;
    left: -3.6em;
    bottom: -1.1em;
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.6em 0.9em;
    border-radius: 0.8em;
    background: #fff;
    box-shadow: 0 0.8em 1.8em rgba(45, 55, 72, 0.18);
    font-size: 0.6em;
    font-weight: 700;
    white-space: nowrap;
    color: #2d3748;
}
.phone-chip i { color: #6fb39a; }

/* ---- Gruppo Fabbri: navy e cielo, terminale del mail relay ---- */
.pf-art--fabbri {
    --t: 7cqi;
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.85), transparent 45%),
        linear-gradient(160deg, #eef6fd, #cde2f4);
    color: #13244f;
}
.pf-art--fabbri::before {
    background:
        radial-gradient(circle at 15% 120%, rgba(47, 134, 209, 0.25), transparent 50%),
        repeating-linear-gradient(0deg, transparent 0 26px, rgba(19, 36, 79, 0.04) 26px 27px);
}
.pf-art--fabbri .art-kicker { color: #2f86d1; }
.pf-art--fabbri .art-title em { color: #2f86d1; }
.art-term {
    display: flex;
    flex-direction: column;
    width: 15em;
    padding: 0.9em 1.1em 1.1em;
    box-sizing: border-box;
    border-radius: 0.9em;
    background: #0f1e3d;
    box-shadow: 0 1.4em 2.8em rgba(15, 30, 61, 0.35);
}
.term-bar { display: flex; gap: 0.4em; }
.term-bar i { width: 0.6em; height: 0.6em; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.art-term .term-logo {
    height: 1.5em;
    width: auto;
    margin: 0.8em 0 0.6em;
    padding: 0.35em 0.6em;
    border-radius: 0.4em;
    background: #fff;
    align-self: flex-start;
}
.art-term code {
    display: flex;
    justify-content: space-between;
    gap: 1em;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
    font-size: 0.72em;
    line-height: 2;
    color: #cfe3f4;
}
.art-term code b { color: #fff; }
.art-term .c-prompt { color: #7cc4ff; margin-right: 0.5em; }
.art-term .c-ok { color: #4ade80; }
.art-term .c-live { justify-content: flex-start; align-items: center; gap: 0.6em; margin-top: 0.3em; color: #4ade80; font-size: 0.64em; }

/* ---- NC3: notte, griglia, rosso e ciano ---- */
.pf-art--nc3 {
    --t: 6cqi;
    background:
        radial-gradient(circle at 80% 30%, rgba(0, 168, 240, 0.28), transparent 45%),
        radial-gradient(circle at 10% 100%, rgba(225, 29, 42, 0.3), transparent 45%),
        #070b18;
    color: #fff;
}
.pf-art--nc3::before {
    background:
        repeating-linear-gradient(0deg, rgba(0, 168, 240, 0.08) 0 1px, transparent 1px 24px),
        repeating-linear-gradient(90deg, rgba(0, 168, 240, 0.08) 0 1px, transparent 1px 24px);
}
.pf-art--nc3 .art-kicker { color: #ff5b6b; }
.pf-art--nc3 .art-title em { color: #22b8f5; }
.art-dash {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.8em;
    width: 15em;
    padding: 1em;
    box-sizing: border-box;
    border-radius: 1em;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 1.4em 2.8em rgba(0, 0, 0, 0.45);
}
.dash-head { align-self: flex-start; padding: 0.35em 0.6em; border-radius: 0.4em; background: #fff; }
.dash-head img { height: 1.5em; width: auto; }
.dash-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5em; }
.dash-kpis span { display: flex; flex-direction: column; gap: 0.35em; padding: 0.55em; border-radius: 0.5em; background: rgba(255, 255, 255, 0.08); }
.dash-kpis b { height: 0.7em; width: 70%; border-radius: 0.2em; background: #fff; }
.dash-kpis i { height: 0.25em; width: 100%; border-radius: 0.2em; background: #22b8f5; }
.dash-kpis span:nth-child(2) i { background: #ff5b6b; width: 60%; }
.dash-bars { display: flex; align-items: flex-end; gap: 0.35em; height: 5em; }
.dash-bars i { flex: 1; border-radius: 0.2em 0.2em 0 0; background: linear-gradient(#22b8f5, rgba(34, 184, 245, 0.25)); }
.dash-bars i:nth-child(1) { height: 35%; }
.dash-bars i:nth-child(2) { height: 55%; }
.dash-bars i:nth-child(3) { height: 42%; }
.dash-bars i:nth-child(4) { height: 80%; background: linear-gradient(#ff5b6b, rgba(255, 91, 107, 0.25)); }
.dash-bars i:nth-child(5) { height: 60%; }
.dash-bars i:nth-child(6) { height: 48%; }
.dash-bars i:nth-child(7) { height: 95%; background: linear-gradient(#ff5b6b, rgba(255, 91, 107, 0.25)); }
.dash-bars i:nth-child(8) { height: 66%; }
.dash-bars i:nth-child(9) { height: 50%; }
.dash-alert {
    position: absolute;
    top: 1.1em;
    right: 1em;
    display: flex;
    align-items: center;
    gap: 0.4em;
    font-size: 0.6em;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #ff5b6b;
}

/* ---- LesFrontaliers & DieGrenzgaenger: arancio e nero, due siti ---- */
.pf-art--frontaliers {
    --t: 5.6cqi;
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.9), transparent 45%),
        linear-gradient(135deg, #fff5ef, #ffdcc8);
    color: #151515;
}
.pf-art--frontaliers::before {
    background: repeating-linear-gradient(90deg, transparent 0 14px, rgba(240, 72, 0, 0.07) 14px 16px);
    -webkit-mask-image: linear-gradient(to right, transparent 40%, #000);
    mask-image: linear-gradient(to right, transparent 40%, #000);
}
.pf-art--frontaliers .art-kicker { color: #f04800; }
.pf-art--frontaliers .art-title em { color: #f04800; }
.art-windows { position: relative; width: 15em; height: 12.5em; }
.art-win {
    position: absolute;
    top: 0;
    left: 0;
    width: 12.5em;
    border-radius: 0.6em;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1em 2.2em rgba(120, 40, 0, 0.18);
}
.art-win + .art-win { top: 4em; left: 2.5em; }
.win-bar { display: flex; align-items: center; gap: 0.35em; height: 1.6em; padding: 0 0.6em; background: #f3f1ef; }
.win-bar i { width: 0.5em; height: 0.5em; border-radius: 50%; background: #d6d0cb; }
.win-bar em {
    margin-left: auto;
    padding: 0.1em 0.5em;
    border-radius: 0.3em;
    background: #f04800;
    color: #fff;
    font-size: 0.6em;
    font-style: normal;
    font-weight: 800;
}
.art-win img { height: 2.3em; width: auto; max-width: 85%; margin: 0.8em 0.9em 0.5em; }
.win-lines { display: flex; flex-direction: column; gap: 0.4em; padding: 0 0.9em 0.9em; }
.win-lines i { height: 0.45em; border-radius: 0.3em; background: #eee; }
.win-lines i:nth-child(1) { width: 92%; }
.win-lines i:nth-child(2) { width: 70%; }
.win-lines i:nth-child(3) { width: 82%; }

/* ---- CFA: bianco e nero, righe, serif ---- */
.pf-art--cfa {
    --t: 7.6cqi;
    background: #fff;
    color: #111;
}
.pf-art--cfa::before {
    background: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.07) 0 2px, transparent 2px 9px);
    -webkit-mask-image: linear-gradient(to right, transparent 45%, #000);
    mask-image: linear-gradient(to right, transparent 45%, #000);
}
.pf-art--cfa .art-kicker { color: #666; }
.pf-art--cfa .art-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 400;
    letter-spacing: -0.01em;
}
.pf-art--cfa .art-title em { font-style: italic; }
.art-mag {
    display: flex;
    flex-direction: column;
    width: 12em;
    aspect-ratio: 3 / 4;
    padding: 1em;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #111;
    box-shadow: 0.9em 0.9em 0 #111;
}
.mag-mast {
    font-size: 2.6em;
    font-weight: 900;
    line-height: 0.9;
    background: repeating-linear-gradient(135deg, #111 0 2px, transparent 2px 5px);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 1px #111;
}
.mag-photo {
    height: 5.5em;
    margin: 0.7em 0;
    background:
        radial-gradient(circle at 30% 40%, #d8d0c4, transparent 55%),
        linear-gradient(135deg, #b9aa98, #3b3530);
}
.mag-head { height: 0.7em; width: 95%; background: #111; margin-bottom: 0.35em; }
.mag-head.short { width: 60%; }
.mag-lines { display: flex; flex-direction: column; gap: 0.35em; margin-top: 0.4em; }
.mag-lines i { height: 0.3em; background: #c8c8c8; }
.mag-lines i:last-child { width: 70%; }

/* ---- Veterinario San Giorgio: verde salvia ---- */
.pf-art--vetsg {
    --t: 6cqi;
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.9), transparent 45%),
        linear-gradient(135deg, #f2f8f7, #d6e8e7);
    color: #2f4f4f;
}
.pf-art--vetsg::before {
    background: radial-gradient(circle at 5% 110%, rgba(120, 168, 168, 0.35), transparent 50%);
}
.pf-art--vetsg .art-kicker { color: #5f9696; }
.pf-art--vetsg .art-title em { color: #5f9696; }
.art-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9em;
    width: 13em;
    padding: 1.3em;
    box-sizing: border-box;
    border-radius: 1.2em;
    background: #fff;
    box-shadow: 0 1.2em 2.6em rgba(47, 79, 79, 0.2);
}
.art-card img { width: 100%; height: auto; }
.vet-paw {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.6em;
    height: 3.6em;
    border-radius: 50%;
    background: #78a8a8;
    color: #fff;
    font-size: 1em;
}
.vet-paw i { font-size: 1.6em; }
.vet-pin {
    padding: 0.4em 0.9em;
    border-radius: 2em;
    background: #eef5f5;
    color: #4f7f7f;
    font-size: 0.7em;
    font-weight: 600;
}
.vet-pin i { margin-right: 0.3em; }

/* ---- La Parapharmacia: verde e rosso, insegna ---- */
.pf-art--laparapharmacia {
    --t: 5.6cqi;
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.9), transparent 45%),
        linear-gradient(135deg, #f2fbf5, #d8f0e1);
    color: #0f3d25;
}
.pf-art--laparapharmacia::before {
    background: radial-gradient(circle at 5% 110%, rgba(0, 144, 72, 0.25), transparent 50%);
}
.pf-art--laparapharmacia .art-kicker { color: #009048; }
.pf-art--laparapharmacia .art-title em { color: #d81f26; }
.art-sign { border-top: 0.5em solid #009048; }
.sign-cross {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.4em;
    height: 3.4em;
    border-radius: 0.7em;
    background: #009048;
    color: #fff;
    box-shadow: 0 0.5em 1.2em rgba(0, 144, 72, 0.35);
}
.sign-cross i { font-size: 1.8em; }
.sign-place {
    font-size: 0.62em;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #555;
}

/* ---- NatureFresh: arancio e verde, etichetta compostabile ---- */
.pf-art--naturefresh {
    --t: 8cqi;
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.9), transparent 45%),
        linear-gradient(135deg, #fff3ea, #e2f1e5);
    color: #076633;
}
.pf-art--naturefresh::before {
    background:
        radial-gradient(circle at 5% 110%, rgba(242, 89, 0, 0.22), transparent 50%),
        repeating-linear-gradient(160deg, transparent 0 22px, rgba(7, 102, 51, 0.05) 22px 23px);
}
.pf-art--naturefresh .art-kicker { color: #f25900; }
.pf-art--naturefresh .art-title em { color: #f25900; }
.art-nf { position: relative; border-top: 0.5em solid #f25900; }
.nf-eu {
    position: absolute;
    top: 0.8em;
    right: 0.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.2em;
    height: 1.5em;
    border-radius: 0.2em;
    background: #003399;
    color: #ffcc00;
    font-size: 0.8em;
}
.nf-leaf {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.6em;
    height: 3.6em;
    border-radius: 50%;
    background: #076633;
    color: #fff;
    box-shadow: 0 0.5em 1.2em rgba(7, 102, 51, 0.3);
}
.nf-leaf i { font-size: 1.6em; }
.nf-claim {
    font-size: 0.95em;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    color: #076633;
}
.nf-langs { display: flex; gap: 0.3em; }
.nf-langs i {
    padding: 0.25em 0.45em;
    border-radius: 0.3em;
    background: #fff1e8;
    color: #f25900;
    font-size: 0.55em;
    font-style: normal;
    font-weight: 800;
}

/* Pulsanti della scheda progetto e della 404: testo e icona sempre centrati */
.pm-cta .button,
.e404-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    padding: 16px 32px;
    font-size: 1.05em;
    line-height: 1.2;
}
.pm-cta .button i,
.e404-actions .button i {
    margin: 0;
    font-size: 0.9em;
}

/* ========================================================= */
/*    CONTATTI – layout a colonna, stabile a ogni larghezza  */
/* ========================================================= */
#contatti .contact-wrapper {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}
#contatti .contact-boxes {
    grid-template-columns: 1fr;
    gap: 16px;
}
#contatti .contact-box {
    flex-direction: row;
    align-items: flex-start;
    gap: 18px;
    padding: 22px 24px;
}
#contatti .contact-box > .contact-icon {
    flex-shrink: 0;
    width: 1.25em;
    margin: 2px 0 0;
    font-size: 1.6em;
    text-align: center;
}
#contatti .contact-text {
    min-width: 0;
}
#contatti .contact-text h4 {
    margin-bottom: 8px;
}
#contatti .contact-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 0;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}
#contatti .contact-line i {
    flex-shrink: 0;
    width: 1.1em;
    margin: 0;
    font-size: 1em;
    background: none;
    -webkit-text-fill-color: var(--accent-1);
    color: var(--accent-1);
}
#contatti .contact-line:hover,
#contatti .contact-line:hover span {
    color: var(--accent-2);
}
.contact-form-wrapper {
    container-type: inline-size;
    padding: clamp(24px, 4vw, 40px);
    box-sizing: border-box;
}
.submit-btn {
    white-space: nowrap;
}
/* Nome ed Email affiancati solo se il form è abbastanza largo */
@container (max-width: 360px) {
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .submit-btn { width: 100%; justify-content: center; }
}
@media (max-width: 900px) {
    #contatti .contact-wrapper {
        grid-template-columns: 1fr;
        padding: 20px 0;
    }
    #contatti .contact-boxes {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* Footer: contatti come icone */
.footer-socials {
    gap: 10px;
    margin-top: 0;
}
.footer-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: var(--bg-primary);
    font-size: 1rem;
    transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.footer-socials a:hover {
    border-color: var(--accent-2);
    transform: translateY(-2px);
}
.footer-col .footer-socials a i {
    width: auto;
    margin: 0;
}
/* Spazio per il pulsante "torna su", che altrimenti copre i link legali */
.footer-bottom {
    padding-right: 84px;
    padding-left: 20px;
}
@media (max-width: 768px) {
    .footer-bottom { padding-bottom: 84px; padding-right: 20px; }
}

/* ========================================================= */
/*    FONDATORE (dentro "Chi Siamo")                         */
/* ========================================================= */
.founder {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
    margin-top: 40px;
    padding-top: 70px;
    border-top: 1px solid var(--border-subtle);
}
.founder-photo {
    position: relative;
}
.founder-photo::before {
    content: "";
    position: absolute;
    inset: -14px 14px 14px -14px;
    border-radius: 28px;
    background: var(--accent-gradient);
    opacity: 0.25;
    z-index: 0;
}
.founder-photo img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 24px;
    box-shadow: 0 30px 60px var(--shadow-medium);
    animation: none !important;
    filter: none !important;
}
.founder-badge {
    position: absolute;
    z-index: 2;
    left: 18px;
    bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #1a1a2e;
    font-size: 0.8rem;
    font-weight: 600;
}
.founder-badge i { color: var(--accent-2); }
.founder-kicker {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-2);
}
#chi-siamo .founder-name {
    margin: 10px 0 6px;
    font-size: clamp(2.2rem, 4.5vw, 3.4rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}
.gradient-brand {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
#chi-siamo .founder-role {
    margin-bottom: 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-1);
}
#chi-siamo .founder-text p:not(.founder-role) {
    margin-bottom: 14px;
}
.founder-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0 28px;
}
.founder-facts li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-primary);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}
.founder-facts i { color: var(--accent-1); }
.founder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.founder-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
@media (max-width: 860px) {
    .founder {
        grid-template-columns: 1fr;
        padding-top: 50px;
    }
    .founder-photo {
        max-width: 420px;
        margin: 0 auto;
        width: 100%;
    }
}

/* Fondatore: citazione e timeline */
.founder {
    align-items: start;
}
@media (min-width: 861px) {
    .founder-photo {
        position: sticky;
        top: 100px;
    }
}
.founder-quote {
    margin: 0 0 20px;
    padding: 4px 0 4px 18px;
    border-left: 3px solid var(--accent-2);
    font-size: 1.1rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--text-primary);
}
#chi-siamo .founder-exp-title {
    margin: 30px 0 16px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.founder-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 30px;
}
.founder-timeline::before {
    content: "";
    position: absolute;
    left: 23px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(var(--accent-1), var(--accent-2));
    opacity: 0.35;
}
.founder-timeline li {
    position: relative;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.tl-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 6px;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: #fff;
    box-shadow: 0 6px 16px var(--shadow-light);
}
.tl-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.tl-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.tl-years {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-2);
}
.tl-body strong {
    font-size: 1.02rem;
    color: var(--text-primary);
}
.tl-role {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent-1);
}
#chi-siamo .tl-body p {
    margin-top: 4px;
    font-size: 0.93rem;
    line-height: 1.6;
}

/* ========================================================= */
/*    COOKIEBOT – banner e widget nello stile del sito       */
/*    (i colori seguono il tema chiaro/scuro del sito)       */
/* ========================================================= */
#CybotCookiebotDialog,
#CybotCookiebotDialog *,
#CookiebotWidget,
#CookiebotWidget * {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    letter-spacing: normal !important;
}
#CybotCookiebotDialog {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 20px !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25), 0 0 40px var(--glow-color) !important;
    overflow: hidden !important;
}
#CybotCookiebotDialog::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
    z-index: 1;
}
#CybotCookiebotDialogBodyUnderlay {
    background: rgba(10, 10, 20, 0.45) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Titoli e testi */
#CybotCookiebotDialog h2,
#CybotCookiebotDialogBodyContentTitle,
#CybotCookiebotDialog .CybotCookiebotDialogDetailBodyContentCookieContainerButton,
#CybotCookiebotDialog .CybotCookiebotDialogDetailBodyContentIABv2Tab,
#CybotCookiebotDialog label {
    color: var(--text-primary) !important;
}
#CybotCookiebotDialog h2,
#CybotCookiebotDialogBodyContentTitle {
    font-weight: 800 !important;
    letter-spacing: -0.01em !important;
}
#CybotCookiebotDialog p,
#CybotCookiebotDialog .CybotCookiebotScrollContainer,
#CybotCookiebotDialogBodyContentText,
#CybotCookiebotDialog .CybotCookiebotDialogDetailBulkConsentCount,
#CybotCookiebotDialog .CybotCookiebotDialogDetailBodyContentCookieTypeIntro {
    color: var(--text-secondary) !important;
}
#CybotCookiebotDialog a:not(.CybotCookiebotDialogNavItemLink),
#CybotCookiebotDialog .CybotCookiebotDialogDetailBodyContentCookieLink {
    color: var(--accent-1) !important;
}
#CybotCookiebotDialog a:not(.CybotCookiebotDialogNavItemLink):hover {
    color: var(--accent-2) !important;
}

/* Schede (Consenso / Dettagli / Informazioni) */
#CybotCookiebotDialogNav {
    border-bottom-color: var(--border-subtle) !important;
}
#CybotCookiebotDialogNav .CybotCookiebotDialogNavItemLink {
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    border-bottom-width: 2px !important;
}
#CybotCookiebotDialogNav .CybotCookiebotDialogNavItemLink:hover,
#CybotCookiebotDialogNav .CybotCookiebotDialogNavItemLink.CybotCookiebotDialogActive {
    color: var(--accent-1) !important;
    border-bottom-color: var(--accent-1) !important;
}

/* Separatori e riquadri */
#CybotCookiebotDialog .CybotCookiebotScrollContainer,
#CybotCookiebotDialog .CybotCookiebotDialogBodyLevelButtonWrapper,
#CybotCookiebotDialog #CybotCookiebotDialogFooter,
#CybotCookiebotDialog .CybotCookiebotDialogDetailBodyContentCookieContainerTypes,
#CybotCookiebotDialog .CybotCookiebotDialogDetailBodyContentCookieProvider:not(.CybotCookiebotDialogDetailBodyContentCookieInfoCount),
#CybotCookiebotDialog .CybotCookiebotDialogDetailBodyContentCookieTypeTableContainer,
#CybotCookiebotDialog .CybotCookiebotDialogDetailBodyContentCookieInfoWrapper {
    border-color: var(--border-subtle) !important;
}
#CybotCookiebotDialog .CybotCookiebotDialogDetailBodyContentCookieTypeTableContainer,
#CybotCookiebotDialog .CybotCookiebotDialogDetailBodyContentCookieInfoWrapper,
#CybotCookiebotDialog .CybotCookiebotDialogDetailBodyContentCookieProvider {
    background: var(--bg-secondary) !important;
    border-radius: 12px !important;
}

/* Interruttori */
#CybotCookiebotDialog .CybotCookiebotDialogBodyLevelButtonSlider {
    background-color: var(--border-subtle) !important;
}
#CybotCookiebotDialog input:checked + .CybotCookiebotDialogBodyLevelButtonSlider {
    background: var(--accent-gradient) !important;
}
#CybotCookiebotDialog input:disabled + .CybotCookiebotDialogBodyLevelButtonSlider {
    opacity: 0.55;
}

/* Pulsanti: secondari con bordo, "Consenti tutti" con il gradiente del sito */
#CybotCookiebotDialog .CybotCookiebotDialogBodyButton,
#CybotCookiebotDialog #CybotCookiebotDialogBodyButtonDecline,
#CybotCookiebotDialog #CybotCookiebotDialogBodyLevelButtonLevelOptinAllowallSelection,
#CybotCookiebotDialog #CybotCookiebotDialogBodyButtonCustomize {
    background: transparent !important;
    color: var(--accent-1) !important;
    border: 2px solid var(--accent-1) !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease !important;
}
#CybotCookiebotDialog #CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll,
#CybotCookiebotDialog #CybotCookiebotDialogBodyButtonAccept {
    background: var(--accent-gradient) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 8px 22px rgba(106, 90, 205, 0.3) !important;
}
#CybotCookiebotDialog .CybotCookiebotDialogBodyButton:hover {
    transform: translateY(-2px);
    background: rgba(106, 90, 205, 0.08) !important;
}
#CybotCookiebotDialog #CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll:hover,
#CybotCookiebotDialog #CybotCookiebotDialogBodyButtonAccept:hover {
    background: var(--accent-gradient) !important;
    box-shadow: 0 12px 28px rgba(106, 90, 205, 0.4) !important;
}
#CybotCookiebotDialog button:focus-visible,
#CybotCookiebotDialog a:focus-visible {
    outline: 2px solid var(--accent-2) !important;
    outline-offset: 2px !important;
}

/* Icona "Powered by Cookiebot": più discreta */
#CybotCookiebotDialogPoweredbyCybot,
#CybotCookiebotDialogPoweredByText {
    opacity: 0.6;
}
html.dark-theme #CybotCookiebotDialogPoweredbyCybot svg,
html.dark-theme #CybotCookiebotDialogPoweredByText svg {
    filter: invert(1) brightness(1.4);
}

/* Widget per riaprire le preferenze (dopo il consenso, in basso a sinistra):
   da chiuso è un cerchio uguale al pulsante "torna su" */
#CookiebotWidget {
    left: 24px !important;
    bottom: 24px !important;
}
#CookiebotWidget:not(.CookiebotWidget-open) {
    width: 46px !important;
    height: 46px !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 50% !important;
    box-shadow: none !important;
}
#CookiebotWidget .CookiebotWidget-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 46px !important;
    height: 46px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: var(--accent-gradient) !important;
    box-shadow: 0 10px 25px rgba(106, 90, 205, 0.35) !important;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}
#CookiebotWidget .CookiebotWidget-logo:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(106, 90, 205, 0.45) !important;
}
#CookiebotWidget .CookiebotWidget-logo svg {
    width: 26px !important;
    height: 26px !important;
}
#CookiebotWidget .CookiebotWidget-logo svg circle {
    fill: transparent !important;
}
#CookiebotWidget .CookiebotWidget-logo svg path {
    fill: #fff !important;
}
/* Pannello aperto */
#CookiebotWidget.CookiebotWidget-open {
    background: var(--bg-primary) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 18px !important;
    box-shadow: 0 20px 50px var(--shadow-medium), 0 0 30px var(--glow-color) !important;
    color: var(--text-primary) !important;
}
#CookiebotWidget.CookiebotWidget-open .CookiebotWidget-logo {
    width: 40px !important;
    height: 40px !important;
    box-shadow: none !important;
}
#CookiebotWidget .CookiebotWidget-body .CookiebotWidget-consents-list li.CookiebotWidget-approved svg,
#CookiebotWidget .CookiebotWidget-body .CookiebotWidget-main-logo svg {
    fill: var(--accent-1) !important;
}
#CookiebotWidget #CookiebotWidget-buttons #CookiebotWidget-btn-change {
    background: var(--accent-gradient) !important;
    border-color: transparent !important;
    border-radius: 12px !important;
    color: #fff !important;
}
#CookiebotWidget #CookiebotWidget-buttons #CookiebotWidget-btn-withdraw {
    background: transparent !important;
    border-color: var(--accent-1) !important;
    border-radius: 12px !important;
    color: var(--accent-1) !important;
}
#CookiebotWidget a,
#CookiebotWidget .CookiebotWidget-consent-details button,
#CookiebotWidget .CookiebotWidget-show-consent-details,
#CookiebotWidget .CookiebotWidget-hide-consent-details {
    color: var(--accent-1) !important;
}
#CookiebotWidget .CookiebotWidget-consent-details button svg {
    fill: var(--accent-1) !important;
}
/* A fine pagina il cerchio non deve coprire il copyright */
.footer-bottom {
    padding-left: 84px;
}
@media (max-width: 768px) {
    .footer-bottom { padding-left: 20px; }
}

/* Tabella dei cookie di Cookiebot dentro la Cookie Policy del sito */
.cookiebot-declaration {
    margin-top: 16px;
    font-size: 0.85rem;
    overflow-x: auto;
}
.cookiebot-declaration table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 20px;
}
.cookiebot-declaration th,
.cookiebot-declaration td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
    vertical-align: top;
}
.cookiebot-declaration th {
    color: var(--text-primary);
    font-weight: 700;
    background: var(--bg-secondary);
}
.cookiebot-declaration a {
    color: var(--accent-1);
}

/* ========================================================= */
/*    ILLUSTRAZIONI "CHI SIAMO" (SVG inline)                 */
/* ========================================================= */
.illustration {
    display: block;
    width: 100%;
    max-width: 440px;
    height: auto;
    margin: 0 auto;
    overflow: visible;
}
.illustration .ill-card { fill: var(--bg-primary); stroke: var(--border-subtle); stroke-width: 1.5; }
.illustration .ill-soft { fill: var(--bg-secondary); }
html.dark-theme .illustration .ill-soft { fill: rgba(255, 255, 255, 0.06); }
.illustration .ill-text { fill: var(--text-primary); }
.illustration .ill-muted { fill: var(--text-secondary); }
.illustration .ill-line { stroke: var(--border-subtle); }
.illustration .ill-label { font: 700 14px 'Inter', sans-serif; }
.illustration .ill-badge { font: 900 19px 'Inter', sans-serif; }
#chi-siamo .illustration { filter: none; animation: none; }

.illustration .ill-float { animation: illFloat 6s ease-in-out infinite; }
.illustration .ill-pulse { animation: illPulse 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.illustration .ill-pulse-soft { animation: illPulseSoft 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.illustration .ill-spin { animation: illSpin 16s linear infinite; transform-box: fill-box; transform-origin: center; }
.illustration .ill-dash { stroke-dasharray: 6 9; animation: illDash 14s linear infinite; }
.illustration .d1 { animation-delay: -1.2s; }
.illustration .d2 { animation-delay: -2.4s; }
.illustration .d3 { animation-delay: -3.6s; }
@keyframes illFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes illPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.78); opacity: .6; } }
@keyframes illPulseSoft { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes illSpin { to { transform: rotate(360deg); } }
@keyframes illDash { to { stroke-dashoffset: -300; } }

/* Etichette dei campi a una riga: centrate in verticale, poi salgono quando si scrive */
.form-group input + label {
    top: 50%;
    transform: translateY(-50%);
}
.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label {
    top: 6px;
    transform: none;
}
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: 6px;
}

/* Avviso temporaneo (es. "Indirizzo email copiato") */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 3000;
    max-width: calc(100% - 40px);
    padding: 12px 20px;
    border-radius: 12px;
    background: var(--text-primary);
    color: var(--bg-primary);
    font-size: 0.92rem;
    font-weight: 600;
    box-shadow: 0 12px 30px var(--shadow-medium);
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Contatore caratteri del messaggio */
.char-counter {
    margin-top: 6px;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}
.char-counter.is-ok { color: var(--text-secondary); }
.char-counter.is-near { color: var(--accent-2); }
.char-counter.is-short { color: #e5484d; }
html.dark-theme .char-counter.is-short { color: #ff7b7f; }

/* ========================================================= */
/*    MOBILE: più compatto                                   */
/* ========================================================= */
@media (max-width: 768px) {
    #chi-siamo,
    #servizi,
    #metodo,
    #portfolio,
    #contatti,
    .stats-section {
        padding: 64px 0;
    }
    #collaborazioni {
        padding: 56px 0;
    }
    .about-section {
        margin-bottom: 36px;
    }
    #chi-siamo .image-content {
        padding: 4px 0 12px;
    }
    .illustration {
        max-width: 300px;
    }
    .founder {
        margin-top: 12px;
        padding-top: 44px;
    }
    .service-grid,
    .portfolio-grid,
    .process-grid {
        margin-top: 32px;
    }
    /* Pulsante "torna su" più discreto */
    .back-to-top {
        width: 40px;
        height: 40px;
        right: 14px;
        bottom: 14px;
        font-size: 0.9rem;
    }
    /* Su mobile il widget di Cookiebot non copre il testo: le preferenze
       si cambiano dal link "Preferenze cookie" nel footer */
    #CookiebotWidget {
        display: none !important;
    }
    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 18px;
    }
}
@media (max-width: 768px) {
    /* Fondatore: foto quadrata e timeline più compatta */
    .founder-photo {
        max-width: 340px;
    }
    .founder-photo img {
        aspect-ratio: 1 / 1;
        object-position: center 78%;
    }
    .founder-quote {
        font-size: 1rem;
    }
    .founder-timeline {
        gap: 14px;
    }
    #chi-siamo .tl-body p {
        font-size: 0.86rem;
        line-height: 1.5;
    }
    /* Footer: meno spazio */
    footer {
        padding-top: 52px;
    }
    .footer-bottom {
        margin-top: 36px;
    }
}
@media (max-width: 480px) {
    /* Footer su due colonne: marchio sopra, Navigazione e Servizi affiancate, contatti sotto */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px 20px;
    }
    .footer-brand,
    .footer-grid > .footer-col:last-child {
        grid-column: 1 / -1;
    }
    .footer-col a,
    .footer-col p {
        font-size: 0.92rem;
    }
}
@media (max-width: 768px) {
    /* Su mobile testo e illustrazioni occupano tutta la larghezza: le illustrazioni restano centrate */
    .story-section,
    .mission-section .content-wrapper {
        align-items: stretch;
    }
    .about-section .image-content {
        width: 100%;
        box-sizing: border-box;
    }
}
