/* Mostra i filtri solo in constellation view */
.linear-view #filter-group {
    display: none !important;
}

#filter-group {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

:root {
    /* Award-Ready Color System */
    --primary-deep: #0B0C10;
    --primary-light: #F5F7FA;
    --neutral-mid: #1F2937;
    --neutral-line: #E5E7EB;

    /* Category Accent Colors */
    --accent-servizi: #10B981;
    --accent-progetti: #FBBF24;
    --accent-partner: #3B82F6;
    --accent-contrast: #EC4899;

    /* Legacy Support */
    --accent-gold: var(--accent-progetti);
    --accent-blue: var(--accent-partner);
    --accent-emerald: var(--accent-servizi);
    --accent-orange: #FF6B35;

    /* Semantic UI Colors - Dark Theme */
    --ui-background: var(--primary-deep);
    --ui-surface: rgba(255, 255, 255, 0.06);
    --ui-border: rgba(255, 255, 255, 0.18);
    --ui-text-primary: #FFFFFF;
    --ui-text-secondary: #E5E7EB;
    --ui-text-muted: #9CA3AF;

    /* Node States */
    --node-default-bg: var(--neutral-mid);
    --node-hover-bg: #FFFFFF;
    --node-active-bg: #FFFFFF;
    --node-inactive-bg: rgba(31, 41, 55, 0.4);
    --node-hover-text: var(--neutral-mid);
    --node-inactive-text: #6B7280;
    --node-default-text: #FFFFFF;
    /* Text on colored nodes always white for contrast */

    /* Glass Morphism System */
    --glass-bg-dark: rgba(255, 255, 255, 0.06);
    --glass-border-dark: rgba(255, 255, 255, 0.18);
    --glass-bg-light: rgba(0, 0, 0, 0.04);
    --glass-border-light: rgba(0, 0, 0, 0.12);
    --glass-shadow-dark: 0 8px 32px rgba(0, 0, 0, 0.12);
    --glass-shadow-light: 0 8px 32px rgba(0, 0, 0, 0.08);
    --glass-backdrop: blur(16px) saturate(180%);

    /* Award-Ready Gradients */
    --gradient-primary: linear-gradient(135deg, var(--accent-partner), var(--accent-servizi));
    --gradient-secondary: linear-gradient(135deg, var(--accent-contrast), var(--accent-progetti));
    --gradient-mesh-dark:
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(251, 191, 36, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 60% 40%, rgba(236, 72, 153, 0.03) 0%, transparent 50%);
    --gradient-mesh-light:
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.025) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(251, 191, 36, 0.02) 0%, transparent 50%);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.3);

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light Theme Override */
:root.light-theme {
    /* Semantic UI Colors - Light Theme */
    --ui-background: var(--primary-light);
    --ui-surface: var(--glass-bg-light);
    --ui-border: var(--glass-border-light);
    --ui-text-primary: var(--neutral-mid);
    --ui-text-secondary: #6B7280;
    --ui-text-muted: #9CA3AF;

    /* Node States - Light */
    --node-default-bg: #FFFFFF;
    --node-hover-bg: var(--neutral-mid);
    --node-active-bg: var(--neutral-mid);
    --node-inactive-bg: rgba(156, 163, 175, 0.3);
    --node-hover-text: #FFFFFF;
    --node-inactive-text: #9CA3AF;
    --node-default-text: #FFFFFF;
    /* Text on colored nodes stays white for readability */

    /* Background mesh for light theme */
    --current-mesh: var(--gradient-mesh-light);
}

/* Dark Theme (Default) */
:root:not(.light-theme) {
    --current-mesh: var(--gradient-mesh-dark);
}

/* Global Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-primary);
    background: var(--ui-background);
    color: var(--ui-text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--transition-normal), color var(--transition-normal);
    position: relative;
    overflow: hidden;
}

/* Award-Ready Background System */
.background-layers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.mesh-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--current-mesh);
    animation: mesh-flow 60s ease-in-out infinite;
    opacity: 1;
    transition: background var(--transition-normal);
}

.particle-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: particle-float 8s ease-in-out infinite;
}

/* Mesh Animation */
@keyframes mesh-flow {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
        filter: hue-rotate(0deg);
    }

    25% {
        transform: rotate(90deg) scale(1.1);
        filter: hue-rotate(45deg);
    }

    50% {
        transform: rotate(180deg) scale(1.05);
        filter: hue-rotate(90deg);
    }

    75% {
        transform: rotate(270deg) scale(1.1);
        filter: hue-rotate(135deg);
    }
}

/* Particle Animation */
@keyframes particle-float {

    0%,
    100% {
        transform: translateY(0) translateX(0);
        opacity: 0.1;
    }

    25% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.4;
    }

    50% {
        transform: translateY(-10px) translateX(-5px);
        opacity: 0.2;
    }

    75% {
        transform: translateY(-30px) translateX(15px);
        opacity: 0.3;
    }
}

/* Award-Ready Accessibility & Motion Control */
@media (prefers-reduced-motion: reduce) {

    /* Disable all animations for users who prefer reduced motion */
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .mesh-gradient {
        animation: none;
        filter: none;
    }

    .particle {
        animation: none;
        opacity: 0.05;
    }



    /* Static alternatives for interactive feedback */
    .filter-btn:hover,
    .view-toggle:hover,
    .control-btn:hover {
        transform: none !important;
        border-width: 2px !important;
        /* Visual emphasis instead of motion */
    }
}

/* Focus Management for Accessibility */
:focus {
    outline: 2px solid var(--accent-partner) !important;
    outline-offset: 2px !important;
    border-radius: var(--radius-sm) !important;
}

/* Skip Link for Screen Readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--accent-partner);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--radius-sm);
    z-index: 10000;
    font-weight: 600;
}

.skip-link:focus {
    top: 6px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --glass-bg-dark: rgba(0, 0, 0, 0.9);
        --glass-bg-light: rgba(255, 255, 255, 0.9);
        --glass-border-dark: rgba(255, 255, 255, 0.8);
        --glass-border-light: rgba(0, 0, 0, 0.8);
    }

    .mesh-gradient {
        opacity: 0.1;
    }
}

/* Non-Color Indicators for Interactive States */
.filter-btn.active::before {
    content: '●';
    margin-right: 4px;
    font-size: 8px;
    vertical-align: middle;
}

.filter-btn:not(.active)::before {
    content: '○';
    margin-right: 4px;
    font-size: 8px;
    vertical-align: middle;
    opacity: 0.5;
}

/* Screen Reader Only Text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Floating Navigation */
.floating-nav {
    position: fixed;
    top: var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;

    display: flex;
    align-items: center;
    gap: var(--space-lg);

    background: var(--glass-bg-dark);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border-dark);
    border-radius: var(--radius-lg);
    padding: var(--space-sm) var(--space-lg);

    box-shadow: var(--glass-shadow-dark);

    animation: float-in 0.8s var(--transition-slow) both;
}

@keyframes float-in {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.logo-mark {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.segmento-icon {
    width: 28px;
    height: 28px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 12px;
}

/* Logo Image Styles */
.logo-image {
    height: 32px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    transition: all var(--transition-fast);
}

.logo-image:hover {
    transform: scale(1.05);
}

/* Logo color inversion for light theme */
.light-theme .logo-image {
    filter: invert(1) brightness(0) saturate(100%);
    transition: filter var(--transition-fast), transform var(--transition-fast);
}

.wordmark {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.02em;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.filter-btn,
.view-toggle {
    background: transparent;
    border: 1px solid var(--glass-border-dark);
    color: var(--ui-text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.filter-btn:hover,
.view-toggle:hover {
    background: var(--glass-bg-dark);
    border-color: var(--accent-partner);
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.filter-btn.active {
    background: var(--accent-partner);
    border-color: var(--accent-partner);
    color: white;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.control-separator {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 8px;
}

.control-btn {
    background: transparent;
    border: 1px solid var(--glass-border-dark);
    color: var(--ui-text-primary);
    padding: 6px;
    border-radius: var(--radius-md);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.control-btn:hover {
    background: var(--glass-bg-dark);
    border-color: var(--accent-partner);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Hide fit button in linear view */
.linear-view #resetView {
    display: none;
}

.linear-view .control-separator:last-of-type {
    display: none;
}

/* Light Theme Automatic Adaptations */
:root.light-theme .filter-btn,
:root.light-theme .view-toggle,
:root.light-theme .control-btn {
    border-color: var(--glass-border-light);
}

:root.light-theme .filter-btn:hover,
:root.light-theme .view-toggle:hover,
:root.light-theme .control-btn:hover {
    background: var(--glass-bg-light);
    border-color: var(--accent-partner);
}

:root.light-theme .floating-nav {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
    box-shadow: var(--glass-shadow-light);
}

.light-theme .filter-btn.active {
    background: var(--accent-blue) !important;
    color: white !important;
}

.light-theme .control-separator {
    background: rgba(0, 0, 0, 0.2) !important;
}

/* Light Theme Info Panel - Glass Style come Header */
.light-theme .info-panel {
    background: rgba(248, 250, 252, 0.08) !important;
    /* Stesso glass dell'header */
    backdrop-filter: blur(20px) !important;
    /* Stesso blur dell'header */
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    /* Stesso bordo glass */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    /* Ombra più leggera */
    color: var(--primary-dark) !important;
}

.light-theme .info-panel h3 {
    color: var(--primary-dark) !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5) !important;
    /* Leggera ombra bianca */
    font-weight: 700 !important;
}

.light-theme .info-panel p {
    color: rgba(26, 32, 44, 0.9) !important;
    /* Più scuro per contrasto su glass */
    opacity: 1 !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3) !important;
}

.light-theme .info-panel h4 {
    color: rgba(26, 32, 44, 0.7) !important;
    opacity: 1 !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3) !important;
}

.light-theme .info-panel span {
    background: rgba(26, 32, 44, 0.1) !important;
    /* Sfondo scuro su glass */
    color: var(--primary-dark) !important;
    border: 1px solid rgba(26, 32, 44, 0.2) !important;
    backdrop-filter: blur(10px) !important;
    /* Mini glass effect per i tag */
}

.light-theme .close-button {
    color: var(--primary-dark) !important;
    background: rgba(255, 255, 255, 0.2) !important;
    /* Glass button */
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(10px) !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}

.light-theme .close-button:hover {
    background: rgba(255, 255, 255, 0.35) !important;
    color: var(--primary-dark) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.05) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Constellation Canvas */
.constellation-canvas {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.canvas-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.gradient-mesh {
    position: absolute;
    inset: 0;
    background: var(--gradient-mesh);
    opacity: 0.6;
    animation: mesh-flow 20s ease-in-out infinite;
}

@keyframes mesh-flow {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.1) rotate(0.5deg);
    }
}

.particle-field {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(0, 110, 255, 0.1), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(16, 185, 129, 0.1), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.05), transparent);
    background-repeat: repeat;
    background-size: 150px 100px;
    animation: particle-drift 30s linear infinite;
}

@keyframes particle-drift {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-150px, -100px);
    }
}

/* Network Container */
.network-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 10;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

#network-canvas {
    width: 100% !important;
    height: 100% !important;
}

/* UI Chrome */
.ui-chrome {
    position: absolute;
    inset: 0;
    z-index: 100;
    pointer-events: none;
}





/* Desktop Info Panel */
@media (min-width: 769px) {
    .info-panel {
        position: fixed;
        top: 76px;
        /* float directly under the header */
        right: var(--space-lg);
        width: 300px;
        max-height: calc(100vh - 160px);
        background: var(--glass-bg-dark);
        backdrop-filter: var(--glass-backdrop);
        border: 1px solid var(--glass-border-dark);
        border-radius: var(--radius-lg);
        padding: var(--space-lg);
        box-shadow: var(--glass-shadow-dark);
        pointer-events: auto;
        z-index: 950;
        /* below header (1000) but above the network canvas */
        overflow-y: auto;

        /* Hide scrollbars for clean look */
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE and Edge */

        transform: translateX(350px);
        transition: transform var(--transition-normal);
    }

    /* Hide scrollbar for WebKit browsers (Chrome, Safari) */
    .info-panel::-webkit-scrollbar {
        display: none;
    }

    .info-panel.active {
        transform: translateX(0);
    }
}

.close-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-button:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

/* Premium Node Animations */
@keyframes nodeEnter {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(20px);
    }

    60% {
        opacity: 0.8;
        transform: scale(1.1) translateY(-5px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes connectionPulse {

    0%,
    100% {
        opacity: 0.6;
        stroke-width: 1.5;
    }

    50% {
        opacity: 1;
        stroke-width: 2.5;
    }
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 110, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 30px rgba(0, 110, 255, 0.6),
            0 0 40px rgba(0, 110, 255, 0.3);
    }
}

/* Connection Trail Effects */
.connection-trail {
    position: absolute;
    pointer-events: none;
    z-index: 5;
}

.trail-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-blue);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-blue);
    animation: trailMove 2s ease-in-out infinite;
}

@keyframes trailMove {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    10% {
        opacity: 1;
        transform: scale(1);
    }

    90% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* Linear View Styles */
.linear-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 90px 0 2rem 0;
    z-index: 20;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.linear-hero {
    text-align: center;
    padding: 3rem 1.2rem;
    margin-bottom: 2rem;

}

/* Mobile: riduci ancora la distanza */
@media (max-width: 600px) {
    .linear-container {
        padding-top: 32px;
    }

    .linear-hero {
        padding-top: 0.5rem;
        padding-bottom: 0.7rem;
        margin-bottom: 0.7rem;
    }
}

.linear-hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--ui-text-primary);
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--ui-text-secondary);
    font-weight: 300;

    padding: 0 2rem;           
    max-width: 1000px;          
    margin-left: auto;
    margin-right: auto;        
    text-align: center;
}

/* View Transition Classes */
.view-transitioning-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.view-transitioning-in {
    opacity: 0;
    transform: scale(1.05);
}

.view-visible {
    opacity: 1;
    transform: scale(1);
}

/* Disabled button state during transitions */
.view-toggle:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.linear-section {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.linear-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--ui-text-primary);
    position: relative;
}

.linear-section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.linear-nodes-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.linear-node {
    background: var(--glass-bg-dark);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border-dark);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.linear-node::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-servizi);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    pointer-events: none;
    z-index: 2;
}

.linear-node.service-node::before {
    background: var(--accent-servizi);
}

.linear-node.project-node::before {
    background: var(--accent-progetti);
}

.linear-node.partner-node::before {
    background: var(--accent-partner);
}

.linear-node:hover {
    transform: translateY(-8px);
    box-shadow: var(--glass-shadow-dark), 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Supporto per hover simulato via classe (utile per touch/pointer management) */
.linear-node.hover {
    transform: translateY(-8px);
    box-shadow: var(--glass-shadow-dark), 0 20px 40px rgba(0, 0, 0, 0.3);
}

.linear-node:hover::before {
    transform: scaleX(1);
}

.linear-node-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ui-text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.linear-node-content p {
    font-size: 0.9rem;
    color: var(--ui-text-secondary);
    line-height: 1.5;
}

/* Expanded Linear Node Styles */
.linear-node.expanded {
    grid-column: 1 / -1;
    transform: translateY(-4px);
    box-shadow: var(--glass-shadow-dark), 0 15px 35px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-servizi);
}

.linear-node.expanded.service-node {
    border-color: var(--accent-servizi);
}

.linear-node.expanded.project-node {
    border-color: var(--accent-progetti);
}

.linear-node.expanded.partner-node {
    border-color: var(--accent-partner);
}

.expanded-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s ease-in-out;
    margin-top: 0;
}

.linear-node.expanded .expanded-content {
    max-height: 520px;
    /* increased to fit description + CTA on most viewports */
    opacity: 1;
    margin-top: 1.25rem;
    padding-bottom: 0.5rem;
    /* Slower, smoother transitions to match mobile feel */
    transition: max-height 520ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 420ms ease, margin 420ms ease;
    overflow: hidden;
}

.expanded-description {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ui-text-secondary);
}

.expanded-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--accent-servizi), var(--accent-contrast));
    color: white;
    padding: 0.55rem 0.9rem;
    /* reduced padding to fit inside boxes */
    border-radius: 12px;
    /* less pill-like */
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    transition: transform .16s cubic-bezier(.2, .8, .2, 1), box-shadow .24s ease, opacity .18s ease;
    /* Softer base shadow: more blur, less opacity */
    box-shadow: 0 10px 30px rgba(6, 182, 212, 0.06), 0 2px 6px rgba(0, 0, 0, 0.06);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    justify-content: center;
}

.expanded-cta:hover {
    transform: translateY(-2px);
    /* Even softer, diffused shadow to avoid harsh edges */
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.07), 0 4px 12px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: white;
}

/* CTA variants for different categories */
.expanded-cta.project-cta {
    background: linear-gradient(135deg, var(--accent-progetti), #2e7d32);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.expanded-cta.project-cta:hover {
    box-shadow: 0 12px 30px rgba(76, 175, 80, 0.08), 0 4px 10px rgba(0, 0, 0, 0.06);
}

.expanded-cta.partner-cta {
    background: linear-gradient(135deg, var(--accent-partner), #e65100);
    box-shadow: 0 8px 20px rgba(255, 152, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.expanded-cta.partner-cta:hover {
    box-shadow: 0 12px 30px rgba(255, 152, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.06);
}

.expanded-cta i {
    font-size: 0.8rem;
}

/* Make CTAs full-width on small screens to avoid clipping */
@media (max-width: 768px) {
    .expanded-cta {
        display: block;
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        border-radius: 10px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    }

    .expanded-cta.project-cta,
    .expanded-cta.partner-cta {
        display: block;
        width: 100%;
    }
}

/* Light theme expanded styles */
.light-theme .expanded-description {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Partner shapes in linear view */
.partner-shape {
    width: 40px;
    height: 40px;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.partner-shape.triangle {
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 35px solid var(--accent-partner);
}

.partner-shape.square {
    background: var(--accent-partner);
    border-radius: 4px;
}

.partner-shape.circle {
    background: var(--accent-partner);
    border-radius: 50%;
}

.partner-shape.semicircle {
    background: var(--accent-partner);
    border-radius: 40px 40px 0 0;
}

.partner-shape.droplet {
    background: var(--accent-partner);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
}

/* Light theme linear view */
.light-theme .linear-node {
    background: var(--glass-bg-light);
    border: 1px solid var(--glass-border-light);
    box-shadow: var(--glass-shadow-light);
}

.light-theme .linear-node:hover {
    box-shadow: var(--glass-shadow-light), 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Mobile linear view */
@media (max-width: 768px) {
    .linear-hero h1 {
        font-size: 2.5rem;
    }

    .linear-section {
        padding: 2rem 1rem;
    }

    .linear-section h2 {
        font-size: 2rem;
    }

    .linear-nodes-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .linear-node {
        padding: 1.5rem;
    }
}

/* iOS/mobile: quando siamo nella linear view permettiamo lo scroll nativo */
body.linear-view {
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
}

#linear-content.linear-container {
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    height: 100dvh;
    /* più affidabile su mobile rispetto a 100% */
}

/* Assicura spazio extra in coda per poter raggiungere l'ultima tab su mobile */
@media (max-width: 768px) {
    #linear-content.linear-container {
        /* Manteniamo padding-bottom per spazio aggiuntivo sicuro (safe-area) */
        padding-bottom: calc(env(safe-area-inset-bottom) + 6rem);
        /* Rimuoviamo min-height ingombrante e usiamo un pseudo-footer per spazio extra */
        min-height: auto;
    }

    /* Pseudo-footer che aggiunge spazio solo alla fine del contenuto linear view */
    #linear-content.linear-container::after {
        content: "";
        display: block;
        width: 100%;
        height: calc(env(safe-area-inset-bottom) + 8rem);
        /* spazio extra per raggiungere l'ultima tab */
        pointer-events: none;
    }

    /* Se necessario, riduci o aumenta questi valori in base al testing su dispositivi reali */
}

/* Contact Footer Section */
.contact-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--glass-bg-dark);
    backdrop-filter: var(--glass-backdrop);
    border-top: 1px solid var(--glass-border-dark);
    padding: 1rem 2rem;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform var(--transition-normal);
}

.contact-footer.active {
    transform: translateY(0);
}

.contact-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
}

.contact-cta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-cta h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ui-text-primary);
    margin: 0;
}

.contact-cta p {
    font-size: 0.9rem;
    color: var(--ui-text-secondary);
    margin: 0;
}

.contact-form-inline {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.contact-form-inline input {
    padding: 0.75rem 1rem;
    background: var(--glass-bg-dark);
    border: 1px solid var(--glass-border-dark);
    border-radius: var(--radius-sm);
    color: var(--ui-text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    min-width: 200px;
    transition: all var(--transition-fast);
}

.contact-form-inline input::placeholder {
    color: var(--ui-text-muted);
}

.contact-form-inline input:focus {
    outline: none;
    border-color: var(--accent-partner);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.contact-btn {
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.contact-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    z-index: 1100;
}

.contact-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

.contact-toggle.active {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

/* Close button inside footer - same style as info panel */
.contact-close {
    position: absolute;
    top: 1rem;
    right: 2rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
}

.contact-footer.active .contact-close {
    opacity: 1;
    visibility: visible;
}

.contact-close:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

/* Light theme support for contact close button */
.light-theme .contact-close {
    color: rgba(0, 0, 0, 0.6);
}

.light-theme .contact-close:hover {
    color: rgba(0, 0, 0, 0.9);
    background: rgba(0, 0, 0, 0.1);
}

/* Light theme contact footer */
.light-theme .contact-footer {
    background: var(--glass-bg-light);
    border-top: 1px solid var(--glass-border-light);
}

.light-theme .contact-form-inline input {
    background: var(--glass-bg-light);
    border: 1px solid var(--glass-border-light);
}

/* Mobile contact footer */
@media (max-width: 768px) {
    .contact-footer {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        min-height: 100dvh;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--glass-bg-dark);
        border: none;
        padding: 0;
        z-index: 2000;
        transform: translateY(100%);
        transition: transform var(--transition-normal);
    }

    .contact-footer.active {
        transform: translateY(0);
    }

    .contact-content {
        width: 95vw;
        max-width: 420px;
        margin: 0 auto;
        background: var(--glass-bg-dark);
        border-radius: 18px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
        padding: 2.2rem 1.2rem 1.5rem 1.2rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.2rem;
        text-align: center;
    }

    .contact-cta h3 {
        font-size: 1.1rem;
    }

    .contact-cta p {
        font-size: 0.85rem;
    }

    .contact-form-inline {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    .contact-form-inline input {
        min-width: unset;
        width: 100%;
        padding: 0.8rem;
    }

    .contact-btn {
        padding: 0.8rem 1.5rem;
        width: 100%;
    }

    .contact-toggle {
        width: 50px;
        height: 50px;
        bottom: 1rem;
        right: 1rem;
        font-size: 1.2rem;
    }

    .contact-close {
        top: 0.75rem;
        right: 1rem;
        font-size: 16px;
        padding: 6px;
    }
}

/* Magnetic Cursor Effect */
.cursor-magnetic {
    position: fixed;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, var(--accent-blue), transparent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.15s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {

    /* Header Navigation - Desktop Style for Mobile */
    .floating-nav {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        padding: var(--space-sm) var(--space-md) !important;
        gap: var(--space-md) !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        background: var(--glass-bg-dark) !important;
        backdrop-filter: var(--glass-backdrop) !important;
        border: 1px solid var(--glass-border-dark) !important;
        border-left: none !important;
        border-right: none !important;
        border-top: none !important;
        border-radius: 0 !important;
        box-shadow: var(--glass-shadow-dark) !important;
        z-index: 1000 !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }

    .logo-mark {
        display: flex;
        align-items: center;
        gap: var(--space-sm);
    }

    /* Mobile Logo Styles - Desktop Size */
    .logo-image {
        height: 32px;
        max-width: 150px;
    }

    /* Mobile light theme logo inversion */
    .light-theme .logo-image {
        filter: invert(1) brightness(0) saturate(100%);
    }

    .nav-actions {
        display: flex;
        align-items: center;
        gap: var(--space-sm);
        flex-wrap: wrap;
    }

    .filter-btn,
    .view-toggle {
        padding: var(--space-xs) var(--space-sm);
        font-size: 11px;
        min-width: 70px;
        flex: 1;
        max-width: 90px;
    }

    .control-btn {
        width: 32px;
        height: 32px;
        padding: 6px;
        font-size: 12px;
    }

    .control-separator {
        height: 16px;
        margin: 0 4px;
    }

    .filter-btn span {
        font-size: 10px;
    }

    /* Network Canvas - Mobile Centered */
    .constellation-canvas {
        margin-top: 120px;
        /* Space for fixed header */
        height: calc(100vh - 120px);
        width: 100vw;
        position: relative;
        overflow: hidden;
    }

    #network-canvas {
        width: 100% !important;
        height: 100% !important;
        touch-action: manipulation;
        /* Enable touch gestures */
    }



    /* Mobile Info Panel - Same glassmorphism style as desktop */
    .info-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        width: 90%;
        max-width: 400px;
        max-height: 70vh;
        background: var(--glass-bg-dark);
        backdrop-filter: var(--glass-backdrop);
        border: 1px solid var(--glass-border-dark);
        border-radius: var(--radius-lg);
        padding: var(--space-lg);
        box-shadow: var(--glass-shadow-dark);
        color: var(--ui-text-primary);
        pointer-events: auto;
        z-index: 950;
        /* below header but above canvas */
        overflow-y: auto;

        /* Hide scrollbars for clean mobile look */
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE and Edge */

        transform: translate(-50%, -50%) scale(0.9);
        transition: transform var(--transition-normal), opacity var(--transition-normal);
        opacity: 0;
        visibility: hidden;
    }

    /* Hide scrollbar for WebKit browsers (Chrome, Safari) on mobile */
    .info-panel::-webkit-scrollbar {
        display: none;
    }

    /* Light theme mobile support */
    .light-theme .info-panel {
        background: var(--glass-bg-light);
        border: 1px solid var(--glass-border-light);
        box-shadow: var(--glass-shadow-light);
        color: var(--ui-text-primary);
    }

    .info-panel.active {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        visibility: visible;
    }

    /* Mobile touch scroll improvements */
    .info-panel {
        -webkit-overflow-scrolling: touch;
        /* Smooth momentum scrolling on iOS */
        overscroll-behavior: contain;
        /* Prevent scroll chaining */
    }

    /* Mobile backdrop overlay */
    .info-panel.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.7);
        transform: translate(50%, 50%);
        z-index: -1;
    }

    .info-panel h2 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .info-panel p {
        font-size: 13px;
        line-height: 1.4;
    }

}

/* Extra Small Mobile (phones < 480px) */
@media (max-width: 480px) {
    .floating-nav {
        padding: var(--space-xs) var(--space-sm) !important;
        gap: var(--space-xs) !important;
    }

    .nav-actions {
        gap: var(--space-xs);
        flex-wrap: wrap;
    }

    .filter-btn,
    .view-toggle {
        padding: var(--space-xs);
        font-size: 0.75rem;
        min-width: auto;
    }

    .logo-image {
        height: 28px;
        max-width: 120px;
    }

    .control-btn {
        width: 28px;
        height: 28px;
        padding: 4px;
        font-size: 10px;
    }

    .control-separator {
        height: 14px;
        margin: 0 2px;
    }

    .filter-btn i {
        font-size: 12px;
    }

    .constellation-canvas {
        margin-top: 100px;
        height: calc(100vh - 100px);
    }



    .info-panel {
        width: 95%;
        max-height: 60vh;
        padding: 16px;
    }

    .info-panel h2 {
        font-size: 16px;
    }

    .info-panel p {
        font-size: 12px;
    }

    .close-button {
        min-width: 44px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1) !important;
    }

    .close-button:hover {
        background: rgba(255, 255, 255, 0.2) !important;
        color: rgba(255, 255, 255, 0.9) !important;
    }
}

/* Mobile Light Theme Override */
@media (max-width: 768px) {
    .light-theme .floating-nav {
        background: var(--glass-bg-light) !important;
        border: 1px solid var(--glass-border-light) !important;
        border-left: none !important;
        border-right: none !important;
        border-top: none !important;
        box-shadow: var(--glass-shadow-light) !important;
        color: var(--primary-dark) !important;
    }

    .light-theme .filter-btn,
    .light-theme .view-toggle,
    .light-theme .control-btn {
        color: var(--primary-dark) !important;
        border-color: rgba(0, 0, 0, 0.2) !important;
    }

    .light-theme .filter-btn:hover,
    .light-theme .view-toggle:hover,
    .light-theme .control-btn:hover {
        background: rgba(0, 0, 0, 0.1) !important;
        color: var(--primary-dark) !important;
    }

    .light-theme .control-separator {
        background: rgba(0, 0, 0, 0.2) !important;
    }

    .light-theme .filter-btn.active {
        background: var(--accent-blue) !important;
        color: white !important;
    }

    /* 
             * Nota: Gli stili per .light-theme .info-panel sono definiti globalmente 
             * prima della sezione mobile e si applicano automaticamente anche al mobile.
             * Rimuoviamo i duplicati per evitare conflitti.
             */
}


/* === FINAL POLISH (UX/UI) === */
:root {
    --ui-background: #0B0C10;
    --accent-partner: #3B82F6;
}

.cta-primary {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .9rem 1.2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366F1, #06B6D4);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    transform: translateZ(0);
    transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}

.cta-primary:hover,
.cta-primary:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .45);
    outline: none;
}

.scroll-indicator {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    padding: .5rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .15);
    font: 600 14px/1 system-ui, -apple-system, Segoe UI, Roboto, Inter, sans-serif;
    backdrop-filter: blur(8px);
    z-index: 1200;
    opacity: .9;
    transition: opacity .3s ease, transform .3s ease;
}

@media (prefers-reduced-motion: no-preference) {
    .scroll-indicator {
        animation: floaty 1.8s ease-in-out infinite;
    }

    @keyframes floaty {
        0% {
            transform: translateX(-50%) translateY(0);
        }

        50% {
            transform: translateX(-50%) translateY(-6px);
        }

        100% {
            transform: translateX(-50%) translateY(0);
        }
    }
}

.scroll-indicator.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(8px);
}

#preloader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ui-background);
    z-index: 2000;
}

#preloader.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease;
}

.spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255, 255, 255, .18);
    border-top-color: var(--accent-partner);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

:focus-visible {
    outline: 2px solid #06B6D4;
    outline-offset: 2px;
}

@media (max-width: 768px) {

    header,
    .site-header,
    .topbar {
        min-height: 64px;
    }
}

:root.light-theme {
    --ui-text-secondary: #374151;
}

body.linear-view {
    overflow: auto;
}

.linear-container,
#linear-content.linear-container {
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    height: 100dvh;
}

body.constellation-view {
    overflow: hidden;
}

#constellation,
#constellation canvas,
#constellation .vis-network,
#constellation .scene,
#constellation .viewport {
    touch-action: none;
}


/* Footer regole css */
.bottom-section {
    margin-top: 100px;
    border-top: none;
    padding: 1.2rem 1rem;
    text-align: center;
    color: var(--ui-text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    line-height: 1.6;
    transition: all var(--transition-normal);
    z-index: 5;
  }
  
  .bottom-section a {
    color: var(--accent-partner);
    text-decoration: none;
    transition: color var(--transition-fast);
  }
  
  .bottom-section a:hover {
    color: var(--accent-servizi);
    text-decoration: underline;
  }
  
  .bottom-section img {
    display: inline-block;
    margin-top: 0.8rem;
    max-width: 140px;
    height: auto;
    transition: transform var(--transition-fast);
  }
  
  .bottom-section img:hover {
    transform: scale(1.05);
  }
  
  /* Dark mode default */
  .bottom-section .logo-light {
    display: none;
  }
  
  
  .light-theme .bottom-section a {
    color: var(--accent-blue);
  }
  
  .light-theme .bottom-section a:hover {
    color: var(--accent-contrast);
  }
  
  .light-theme .bottom-section .logo-dark {
    display: none;
  }
  
  .light-theme .bottom-section .logo-light {
    display: inline-block;
  }
  
  
  /* Sezione aggiuntiva a scomparsa */
  .hero-more {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.6s ease;
    color: var(--ui-text-secondary);
    line-height: 1.6;
    margin-top: 1rem;
    font-size: 1.2rem;
    color: var(--ui-text-secondary);
    font-weight: 300;
  
    padding: 0 2rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
  
  /* Quando attiva */
  .hero-more.active {
    max-height: 500px;
    /* spazio sufficiente per il testo */
    opacity: 1;
  }
  
  /* Pulsante toggle */
  .hero-toggle {
    margin-top: 1.5rem;
    background: linear-gradient(135deg, var(--accent-partner), var(--accent-servizi));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
  }
  
  .hero-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
  
  .light-theme .hero-toggle {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-progetti));
  }
  
  .hero-toggle:focus,
  .hero-toggle:focus-visible {
    outline: none !important;
    box-shadow: none !important;
  }
  
  .hero-more strong,
  .linear-hero strong {
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
  }
  
  /* Glow leggero per enfatizzare in dark mode */
  .hero-more strong:hover,
  .linear-hero strong:hover {
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.35);
  }
  
  
  .hero-section {
    color: var(--ui-text-secondary);
    line-height: 1.6;
    margin-top: 1rem;
    font-size: 1.2rem;
    color: var(--ui-text-secondary);
    font-weight: 300;
  
    padding: 0 2rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
  
  .hero-section strong,
  .linear-hero strong {
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
  }
  
  /* Glow leggero per enfatizzare in dark mode */
  .hero-section strong:hover,
  .linear-hero strong:hover {
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.35);
  }
  
  