/* --- Global Styles & Variables --- */
:root {
    --primary-color: #ffffff;
    --secondary-color: #1a73b9;
    --text-color: #333;
    --light-gray: #f4f4f4;
    --navbar-height: 80px; /* Adjust as needed */
}

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--primary-color);
    padding-top: var(--navbar-height); /* Prevent content from hiding behind sticky navbar */
}

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

h1, h2, h3 {
    font-weight: 600;
    margin-bottom: 0.75em;
}

h1 {
    font-size: 2.8rem;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 1.5em;
    color: var(--secondary-color);
}

p {
    margin-bottom: 1em;
    font-weight: 300;
}

img {
    max-width: 100%;
    display: block;
}

.section {
    padding: 60px 0;
}

.bg-light {
    background-color: var(--light-gray);
}

/* --- Navbar --- */
.navbar {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    height: var(--navbar-height);
    position: fixed; /* Sticky */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    align-items: center;
    height: 100%;
}

.navbar .logo {
    height: 400px; /* Adjust logo height */
    width: auto;
}

/* --- Hero Section --- */
#hero {
    /* background: url('img/hero-background.jpg') no-repeat center center/cover; */ /* Remove static background */
    /* background-color: #000c1a; */ /* Optional fallback color */
    height: calc(100vh - var(--navbar-height));
    color: var(--primary-color);
    position: relative; /* Needed for absolute positioning of overlay/content */
    background-image: url('img/bk-emmagini.jpg'); /* Set the background image */
    background-size: auto 100%; /* Height fills container, width is auto (allows horizontal overflow) */
    background-repeat: no-repeat;
    animation: scrollBackground 80s linear infinite; /* Apply animation - adjust duration (80s) for speed */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden; /* Hide anything drawn outside the hero bounds */
}

/* Removed .hero-overlay styles */

/* Remove #circuit-canvas styles */
/* #circuit-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block; /* Remove potential extra space below canvas */
/* } */

.hero-content {
    position: relative;
    z-index: 2; /* Ensure content is above canvas */
    max-width: 700px;
}

.hero-content h1 {
    margin-bottom: 0.5em;
}

.hero-content p {
    font-size: 1.2rem;
    font-weight: 300;
}

/* Re-enable or add hero-overlay styles */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 115, 185, 0.65); /* Blue overlay - adjust opacity (0.65) as needed */
    z-index: 1; /* Below content, above background image */
}

/* Define the scrolling animation */
@keyframes scrollBackground {
    0% { background-position: 100% 50%; } /* Start at right center */
    100% { background-position: 0% 50%; }  /* End at left center */
}

/* --- About Section --- */
#about .container {
    max-width: 800px;
    text-align: center;
}

/* --- Steps Section --- */
.steps-container {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    text-align: center;
}

.step-item {
    flex: 1;
    background: var(--primary-color);
    padding: 30px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: relative;
}

.step-item h3 {
    margin-top: 1em; /* Space below number */
    color: var(--secondary-color);
    font-size: 1.3rem;
}

.step-number {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 600;
    position: absolute;
    top: -20px; /* Position above the box */
    left: 50%;
    transform: translateX(-50%);
}


/* --- Clients Section (Logo Carousel) --- */
.logos-slider {
    overflow: hidden;
    position: relative;
    width: 100%;
    /* Optional: Add gradient mask for smoother edges */
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 90%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 90%, rgba(0,0,0,0) 100%);
}

.logos-slide {
    display: flex;
    align-items: center; /* Vertically align logos */
    /* Updated width: Assuming ~200px per logo+margin * 24 total logos */
    width: calc(200px * *24);
    /* Increased duration for more logos */
    animation: scroll 50s linear infinite;
}

.logos-slide img {
    height: 50px; /* Fixed height for logos */
    width: auto; /* Auto width */
    margin: 0 40px; /* Space between logos (80px total gap) */
    filter: grayscale(100%); /* Optional: make logos grayscale */
    opacity: 0.7;
    transition: filter 0.3s ease, opacity 0.3s ease;
    flex-shrink: 0; /* Prevent images from shrinking if container is too narrow */
}

.logos-slide:hover img {
     /* Optional: color on hover */
    /* filter: grayscale(0%);
    opacity: 1; */
}

/* Pause animation on hover */
.logos-slider:hover .logos-slide {
    animation-play-state: paused;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    /* Updated transform: Move by the width of the original 12 logos + margins */
    100% { transform: translateX(calc(-200px * 12)); }
}

/* --- Footer --- */
.footer {
    background-color: #333;
    color: var(--light-gray);
    text-align: center;
    padding: 20px 0;
    margin-top: 40px; /* Add some space before footer */
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* --- Responsiveness --- */
@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }
    h2 {
        font-size: 1.8rem;
    }
    .hero-content p {
        font-size: 1rem;
    }
    .steps-container {
        flex-direction: column;
        gap: 40px; /* Increased gap for vertical layout */
    }
    .step-item {
        padding-top: 40px; /* Adjust padding because number is positioned absolutely */
    }
    .step-number {
        top: -20px; /* Keep number position relative to the top */
    }

    #hero {
        height: 280px; /* Adjusted height for smaller screens */
        /* Keep default animation and background-size for portrait on smaller screens */
    }

}

@media (max-width: 480px) {
    :root {
        --navbar-height: 60px;
    }
    body {
        padding-top: var(--navbar-height);
    }
    .navbar .logo {
        height: 30px;
    }
    h1 {
        font-size: 1.8rem;
    }
    .hero-content p {
        font-size: 0.9rem;
    }
    .section {
        padding: 40px 0;
    }
    .logos-slide img {
        height: 40px;
        margin: 0 20px;
    }
    /* Adjust keyframes if logo size/margin changes significantly */

    /* Ensure hero height is appropriate for very small screens */
    #hero {
        height: 250px; /* Further adjust height if needed */
    }
}

/* Add this media query for landscape orientation */
@media (orientation: landscape) {
    #hero {
        background-size: cover; /* Make background cover the container */
        background-position: center center; /* Center the background image */
        animation: none; /* Disable the scrolling animation */
    }
}
}