/* Color Variables */
:root {
    --primary-color: #214852; /* R: 0.129, G: 0.282, B: 0.322 -> rgb(33, 72, 82) */
    --primary-light: #3a6b78;
    --primary-dark: #152e35;
    --secondary-color: #E07A5F;
    --bg-color: #FDFBF7;
    --bg-light: #F4F9F6;
    --bg-dark: #152e35;
    --text-dark: #1a2a2f;
    --text-light: #5c6c73;
    --white: #ffffff;
    
    /* Typography - Apple Style Sans-Serif */
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* 3 Strict Font Sizes */
    --size-xl: 3.2rem; /* Titoli grandi (H1, H2) */
    --size-lg: 1.5rem; /* Sottotitoli, Nomi Card (H3) */
    --size-md: 1.05rem; /* Testo normale (P, span, input) */
    
    --transition: all 0.3s ease;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    font-size: var(--size-md);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Base Typographic Hierarchy */
h1, h2 {
    font-size: var(--size-xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h3, .logo {
    font-size: var(--size-lg);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

p, a, li, input, textarea, button {
    font-size: var(--size-md);
    font-weight: 400;
}

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

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

/* Utilities */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(42, 90, 63, 0.2);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.w-100 { width: 100%; }

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
    background: #f3f2f3;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.navbar.scrolled {
    background: rgba(243, 242, 243, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.6rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.logo img {
    height: 45px;
    width: auto;
}

.logo span {
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
}

.navbar .logo, .navbar .nav-links a {
    color: var(--primary-dark);
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: url('hero.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(21, 46, 53, 0.85), rgba(21, 46, 53, 0.65));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 2rem;
    color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-logo {
    max-width: 250px;
    height: auto;
    border-radius: 25px;
    margin-bottom: 2rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.hero h1 {
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero p {
    font-size: var(--size-lg); /* Eccezione per leggibilità */
    margin-bottom: 2.5rem;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Sections */
.section {
    padding: 6rem 0;
}

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

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h2 {
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
}

.about-text p {
    margin-bottom: 1.5rem;
}

.highlight-box {
    background-color: var(--primary-light);
    color: var(--white);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.highlight-box h3 { margin-bottom: 0.5rem; }
.highlight-box p { margin-bottom: 0; }

.bg-pattern, .about-img {
    width: 100%;
    height: 500px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.bg-pattern::after {
    content: '';
    position: absolute;
    width: 200%; height: 200%;
    top: -50%; left: -50%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 10%, transparent 10%) 0 0,
                radial-gradient(circle, rgba(255,255,255,0.1) 10%, transparent 10%) 20px 20px;
    background-size: 40px 40px;
    transform: rotate(30deg);
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--white);
    padding: 2.5rem 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    transition: var(--transition);
    border-top: 4px solid transparent;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    border-top-color: var(--primary-color);
}

.service-card .icon {
    font-size: var(--size-xl);
    margin-bottom: 1.5rem;
    display: block; /* fixes baseline alignment for emojis */
}

.service-card h3 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-light);
}

/* Team */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    justify-content: center;
}

.team-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.team-card h3 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.team-card .role {
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.team-card .desc {
    color: var(--text-light);
}

/* Contact */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h2 { margin-bottom: 1rem; }
.contact-info p { opacity: 0.9; margin-bottom: 2rem; }

.info-list { list-style: none; margin-bottom: 2rem; }
.info-list li { margin-bottom: 1rem; }

.phones {
    background: rgba(255,255,255,0.1);
    padding: 1.5rem;
    border-radius: 12px;
}

.phones p { margin-bottom: 0.5rem; }
.phones p:last-child { margin-bottom: 0; }

.contact-form {
    background: var(--white);
    padding: 3rem;
    border-radius: 16px;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--font-sans);
    transition: var(--transition);
}

.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 122, 87, 0.1);
}

/* Footer */
footer {
    background: var(--primary-color);
    color: #fff;
    padding: 3rem 0;
    text-align: center;
}

.footer-logo { margin-bottom: 1rem; }
.social-links { margin-bottom: 1.5rem; }
.social-links a {
    display: inline-block;
    margin: 0 1rem;
    color: var(--secondary-color);
    transition: var(--transition);
}

.social-links a:hover { color: var(--white); }
footer p { opacity: 0.5; }

/* Responsive Settings */
@media (max-width: 992px) {
    .about-grid, .contact-grid { grid-template-columns: 1fr; }
    .nav-links, .nav-btn { display: none; }
    .navbar { 
        padding: 0.8rem 0; 
        background: transparent; 
        box-shadow: none;
    }
    .navbar.scrolled {
        background: rgba(243, 242, 243, 0.95);
        box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    }
    .navbar.scrolled .logo {
        display: flex; /* Mostra il logo solo quando si scende */
    }
    .nav-container { justify-content: center; }
    .logo { display: none; } /* Nasconde il logo originale all'inizio */
}

@media (max-width: 768px) {
    :root {
        /* Cambio dinamico delle sole 3 misure su mobile */
        --size-xl: 2.2rem;
        --size-lg: 1.3rem;
        --size-md: 1rem;
    }
    
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        visibility: visible !important;
    }

    .section { padding: 2.5rem 0; }
    .contact-section { padding-bottom: 0 !important; }
    .about-grid, .contact-grid { gap: 2rem; }
    .hero-buttons { flex-direction: column; }
    
    .contact-form { padding: 1.5rem; margin-bottom: 2rem; }
    .service-card { padding: 1.5rem 1.2rem; }
    .service-card .icon { margin-bottom: 1rem; }
}
