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

body {
    background-color: #0d0d0d;
    color: #f3f3f3;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
    letter-spacing: -0.02em;
    cursor: url('images/cursor1.png'), auto;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 60px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(13, 13, 13, 0.95), transparent);
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-links a {
    color: #f3f3f3;
    text-decoration: none;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 1.2rem;
    transition: opacity 0.3s, color 0.3s;
    border-radius: 4px;
}

.nav-links a:hover,
.nav-links a.active {
    opacity: 1;
    color: #fff;
}

.nav-links a.active {
    border-bottom: 2px solid #f3f3f3;
}

/* Pages */
.page {
    min-height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

#home.page {
    padding-top: 0;
    height: 100vh;
    min-height: 100vh;
}

#services.page,
#about.page,
#customers.page,
#contact.page {
    padding-top: 100px;
}

#contact.page {
    display: flex;
    flex-direction: column;
}

.page-header {
    padding: 40px 10% 20px;
}

.page-header h2 {
    font-size: 5vw;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1;
}

.page-subtitle {
    margin-top: 16px;
    color: #888;
    font-size: 1.1rem;
}

/* Home / Slideshow */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slideshow-container,
.slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.slideshow {
    overflow: hidden;
    background: #1a1a1a;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 1s ease-in-out, transform 1.2s ease;
}

.slide.active {
    opacity: 1;
    transform: scale(1);
}

/* 5. Posiziona i pallini di navigazione sopra le immagini in basso */
.slideshow-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: 10px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #444;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.dot.active {
    background: #f3f3f3;
    transform: scale(1.2);
}

.dot:hover {
    background: #888;
}

/* 4. Porta il testo in primo piano sopra le immagini a tutto schermo */
.hero-text {
    position: relative;
    z-index: 2; /* Superiore a quello dello slideshow */
    text-align: center;
    color: #000000; /* Colore bianco per contrastare lo sfondo */
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.6); /* Un'ombra leggera per rendere il testo sempre leggibile */
    padding: 0 20px;
}

.hero-text h1 {
    font-size: 5vw;
    line-height: 0.9;
    font-weight: 900;
    color: #04f741;
    text-transform: uppercase;
}

.subtext {
    margin-top: 30px;
    font-size: 1.2rem;
    color: #888;
    line-height: 1.6;
}

.hero-text2 {
    margin-top: 30px;
    font-size: 2rem;
    color: #ffffff;
    line-height: 1.6;
}
/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    padding: 40px 10% 100px;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    aspect-ratio: 1;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    border-color: #444;
    background: #222;
}

.service-card.expanded {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: auto;
    min-height: 320px;
    background: #1e1e1e;
    border-color: #555;
    cursor: default;
    z-index: 10;
}

.service-icon {
    width: 80px;
    height: 80px;
    transition: transform 0.5s ease, opacity 0.4s ease;
}

.service-icon svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Analysis – growing bars + trend line */
.service-icon svg * {
    transform-box: fill-box;
    transform-origin: center;
}

.icon-analysis .bar {
    transform-origin: center bottom;
    animation: growBar 2s ease-in-out infinite;
}

.icon-analysis .bar-1 { animation-delay: 0s; }
.icon-analysis .bar-2 { animation-delay: 0.2s; }
.icon-analysis .bar-3 { animation-delay: 0.4s; }

.icon-analysis .trend-line {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: drawLine 2.5s ease-in-out infinite;
}

.icon-analysis .trend-dot {
    transform-origin: center;
    animation: pulseDot 2s ease-in-out infinite;
}

/* Programming – brackets pulse + blinking cursor */
.icon-programming .bracket-left {
    animation: bracketPulseLeft 2s ease-in-out infinite;
}

.icon-programming .bracket-right {
    animation: bracketPulseRight 2s ease-in-out infinite;
}

.icon-programming .code-slash {
    animation: slashGlow 2s ease-in-out infinite;
}

.icon-programming .code-cursor {
    animation: blinkCursor 1s step-end infinite;
}

/* AI – rotating ring + pulsing nodes */
.icon-ai .ai-ring {
    transform-origin: center;
    animation: spinRing 8s linear infinite;
}

.icon-ai .ai-core {
    animation: pulseCore 2s ease-in-out infinite;
}

.icon-ai .ai-node {
    animation: pulseNode 2s ease-in-out infinite;
}

.icon-ai .ai-node-1 { animation-delay: 0s; }
.icon-ai .ai-node-2 { animation-delay: 0.3s; }
.icon-ai .ai-node-3 { animation-delay: 0.6s; }
.icon-ai .ai-node-4 { animation-delay: 0.9s; }

.icon-ai .ai-link {
    animation: linkFade 2s ease-in-out infinite;
}

/* Management – floating people + check draw */
.icon-management .person {
    animation: floatPerson 3s ease-in-out infinite;
}

.icon-management .person-1 { animation-delay: 0s; }
.icon-management .person-2 { animation-delay: 0.4s; }
.icon-management .person-3 { animation-delay: 0.8s; }

.icon-management .briefcase-body {
    animation: briefcaseBob 3s ease-in-out infinite;
}

.icon-management .mgmt-check {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: drawCheck 2.5s ease-in-out infinite;
}

/* Systems – blinking LEDs + data flow */
.icon-systems .server {
    animation: serverGlow 3s ease-in-out infinite;
}

.icon-systems .server-1 { animation-delay: 0s; }
.icon-systems .server-2 { animation-delay: 0.3s; }
.icon-systems .server-3 { animation-delay: 0.6s; }

.icon-systems .srv-led {
    animation: blinkLed 1.5s step-end infinite;
}

.icon-systems .led-1 { animation-delay: 0s; }
.icon-systems .led-2 { animation-delay: 0.4s; }
.icon-systems .led-3 { animation-delay: 0.8s; }

.icon-systems .data-flow {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    animation: dataStream 2s ease-in-out infinite;
}

.icon-systems .flow-1 { animation-delay: 0s; }
.icon-systems .flow-2 { animation-delay: 0.3s; }
.icon-systems .flow-3 { animation-delay: 0.6s; }

.icon-systems .data-pulse {
    animation: pulseNode 2s ease-in-out infinite;
}

.icon-systems .pulse-1 { animation-delay: 0s; }
.icon-systems .pulse-2 { animation-delay: 0.3s; }
.icon-systems .pulse-3 { animation-delay: 0.6s; }

/* Teach – open book + floating sparks */
.icon-teach .book-left {
    animation: pageLeft 3s ease-in-out infinite;
}

.icon-teach .book-right {
    animation: pageRight 3s ease-in-out infinite;
}

.icon-teach .book-line {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    animation: drawLine 2.5s ease-in-out infinite;
}

.icon-teach .line-1 { animation-delay: 0s; }
.icon-teach .line-2 { animation-delay: 0.2s; }
.icon-teach .line-3 { animation-delay: 0.4s; }
.icon-teach .line-4 { animation-delay: 0.6s; }

.icon-teach .grad-cap {
    animation: capFloat 3s ease-in-out infinite;
}

.icon-teach .teach-spark {
    animation: sparkTwinkle 2s ease-in-out infinite;
}

.icon-teach .spark-1 { animation-delay: 0s; }
.icon-teach .spark-2 { animation-delay: 0.5s; }
.icon-teach .spark-3 { animation-delay: 1s; }

.service-card:hover .service-icon {
    transform: scale(1.1);
}

@keyframes growBar {
    0%, 100% { transform: scaleY(0.6); opacity: 0.7; }
    50% { transform: scaleY(1); opacity: 1; }
}

@keyframes drawLine {
    0%, 100% { stroke-dashoffset: 60; opacity: 0.5; }
    50% { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes pulseDot {
    0%, 100% { transform: scale(0.7); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 1; }
}

@keyframes bracketPulseLeft {
    0%, 100% { transform: translateX(0); opacity: 0.8; }
    50% { transform: translateX(-3px); opacity: 1; }
}

@keyframes bracketPulseRight {
    0%, 100% { transform: translateX(0); opacity: 0.8; }
    50% { transform: translateX(3px); opacity: 1; }
}

@keyframes slashGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; filter: drop-shadow(0 0 4px #a3e635); }
}

@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes spinRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulseCore {
    0%, 100% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

@keyframes pulseNode {
    0%, 100% { transform: scale(0.8); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
}

@keyframes linkFade {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

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

@keyframes briefcaseBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(2px); }
}

@keyframes drawCheck {
    0%, 100% { stroke-dashoffset: 40; opacity: 0.5; }
    50% { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes serverGlow {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; filter: drop-shadow(0 0 4px #38bdf8); }
}

@keyframes blinkLed {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

@keyframes dataStream {
    0%, 100% { stroke-dashoffset: 20; opacity: 0.4; }
    50% { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes pageLeft {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-2deg); }
}

@keyframes pageRight {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(2deg); }
}

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

@keyframes sparkTwinkle {
    0%, 100% { transform: scale(0.6); opacity: 0.4; }
    50% { transform: scale(1.2); opacity: 1; }
}

.service-card h3 {
    margin-top: 20px;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    transition: opacity 0.4s ease;
}

.service-detail {
    display: none;
    text-align: center;
    padding: 20px;
    animation: fadeIn 0.5s ease;
}

.service-card.expanded .service-detail {
    display: block;
}

.service-card.expanded .service-icon {
    transform: scale(0.6);
    opacity: 0.5;
}

.service-card.expanded h3 {
    font-size: 1.8rem;
    margin-top: 0;
}

.service-detail p {
    font-size: 1.4rem;
    color: #ccc;
    line-height: 1.6;
    margin-top: 16px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

a, button, .service-card, .dot {
    cursor: url('images/cursor2.png'), pointer;
}

/* About */
.about-content {
    display: flex;
    gap: 60px;
    padding: 40px 10% 100px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.about-photo {
    flex: 0 0 320px;
    max-width: 100%;
}

.about-photo img {
    width: 100%;
    border-radius: 8px;
    object-fit: cover;
    aspect-ratio: 3 / 4;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.about-text-container {
    flex: 1;
    min-width: 280px;
}

.about-text {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 40px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #ccc;
    transition: max-height 0.5s ease;
}

.about-text.collapsed {
    max-height: 200px;
    overflow: hidden;
    position: relative;
}

.about-text.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(transparent, #1a1a1a);
    pointer-events: none;
}

.about-text.expanded {
    max-height: none;
    overflow: visible;
}

.about-text.expanded::after {
    display: none;
}

.expand-btn {
    margin-top: 16px;
    background: transparent;
    border: 1px solid #555;
    color: #f3f3f3;
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.3s, border-color 0.3s;
}

.expand-btn:hover {
    background: #222;
    border-color: #888;
}

/* Customers */
.customers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
    padding: 40px 10% 100px;
}

.customer-card {
    aspect-ratio: 1;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s ease, border-color 0.3s, box-shadow 0.4s ease;
}

.customer-card:hover {
    transform: scale(1.03);
    border-color: #444;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.customer-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loading-text,
.empty-text {
    grid-column: 1 / -1;
    text-align: center;
    color: #888;
    padding: 40px;
}

/* Contact */
.contact-content {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    padding: 60px 10%;
}

.company-info {
    text-align: center;
    padding: 20px 10% 40px;
    color: #888;
    font-size: 0.85rem;
    line-height: 1.7;
}

.company-info a {
    color: #888;
    text-decoration: none;
    transition: color 0.3s;
}

.company-info a:hover {
    color: #0455f7;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 18px 48px;
    background: #ffffff;
    border: 2px solid #0455f7;
    color: #0455f7;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

.contact-btn-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.contact-btn:hover {
    background: #0455f7;
    color: #0d0d0d;
    box-shadow: 0 0 30px rgba(4, 247, 65, 0.3);
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 40px;
    animation: fadeIn 0.3s ease;
}

.lightbox[hidden] {
    display: none;
}

.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    background: transparent;
    border: none;
    color: #f3f3f3;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.lightbox-close:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links a {
        margin-left: 0;
        font-size: 0.9rem;
        padding: 6px 12px;
    }

    .hero {
        flex-direction: column;
        padding-top: 20px;
    }

    .hero-text h1 {
        font-size: 10vw;
    }

    .service-card.expanded {
        grid-column: span 1;
        grid-row: span 1;
    }

    .about-content {
        flex-direction: column;
    }

    .about-photo {
        flex: none;
        width: 100%;
    }
}
/* ==========================================================================
   GESTIONE MULTILINGUA (Language Selector)
   ========================================================================== */
/* Contenitore delle bandiere allineato nella navbar */
.lang-selector {
    display: inline-flex;
    align-items: center;
    gap: 30px;
    margin-left: 20px;
    vertical-align: middle;
    position: relative; /* Forza il contesto di posizionamento */
    z-index: 110;       /* Superiore a quello standard della navbar (100) */
}

/* Stile base dei bottoni lingua */
.lang-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: url('images/cursor2.png'), pointer !important; /* Forza il cursore pointer */
    opacity: 0.4;
    transition: opacity 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    pointer-events: auto; /* Garantisce che l'elemento risponda ai click */
}

.lang-btn img {
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    display: block;
}

/* Effetto hover e stato attivo */
.lang-btn:hover,
.lang-btn.active {
    opacity: 1;
}

.lang-btn.active img {
    outline: 2px solid #04f741;
    outline-offset: 2px;
}

/* Logica di switch dei testi tramite classe sul body */
body.lang-en .lang-it {
    display: none !important;
}

body.lang-it .lang-en {
    display: none !important;
}