:root {
    --bg-dark: #0f172a;
    --bg-lighter: #1e293b;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

/* Previene distorsione su tutte le immagini con width/height HTML */
img {
    height: auto;
    max-width: 100%;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
}

h1, h2, h3, h4, .logo {
    font-family: 'Outfit', sans-serif;
}

/* Navbar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
    box-sizing: border-box;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.links {
    display: flex;
    gap: 2rem;
}

.links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.lang-switch {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-lighter);
    padding: 0.25rem;
    border-radius: 2rem;
}

.lang-btn {
    background: transparent;
    border: none;
    color: #cbd5e1; /* migliorato da #94a3b8 per contrasto WCAG AA */
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.lang-btn.active {
    background: var(--primary-hover);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 8rem 5% 4rem;
    position: relative;
    overflow: hidden;
    gap: 4rem;
    max-width: 1800px;
    margin: 0 auto;
}

.hero-content {
    flex: 1;
    max-width: 800px;
    z-index: 2;
}

.hero-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    animation: float 6s ease-in-out infinite;
}

.hero-img {
    max-width: 100%;
    max-height: 600px;
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
}

.punct {
    color: var(--primary);
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInUp 1s ease;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    animation: fadeInUp 1s ease 0.2s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 3rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.6);
}

.btn-donate {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    box-shadow: 0 10px 25px rgba(238, 90, 36, 0.4);
}

.btn-donate:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(238, 90, 36, 0.6);
}

/* Background Gradients */
.bg-gradient-1, .bg-gradient-2 {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    opacity: 0.4;
    pointer-events: none;
}

.bg-gradient-1 {
    top: -5%;
    left: 0;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}

.bg-gradient-2 {
    bottom: -5%;
    right: 0;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

/* Features */
.features-section {
    padding: 6rem 5%;
    background: linear-gradient(to bottom, var(--bg-dark), var(--bg-lighter));
    position: relative;
    z-index: 2;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem;
    color: #fff;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.feature-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 1.5rem;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.feature-card .icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.feature-card p {
    color: var(--text-muted);
}

/* Apps Section */
.apps-section {
    padding: 6rem 5%;
    position: relative;
    z-index: 2;
}

.app-showcase {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1600px;
    margin: 0 auto 8rem;
    gap: 4rem;
}

.app-showcase.reverse {
    flex-direction: row-reverse;
}

.app-info {
    flex: 1;
}

.app-info h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: #fff;
}

.app-info p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.app-image {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.app-mockup {
    max-width: 100%;
    max-height: 600px;
    border-radius: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease;
}

.app-mockup:hover {
    transform: translateY(-10px);
}

/* Placeholder for images until user provides them */
.img-placeholder {
    width: 300px;
    height: 600px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
    border: 1px solid var(--glass-border);
    border-radius: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.img-placeholder::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    animation: shimmer 2s infinite;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 5%;
    background: var(--bg-dark);
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
}

.legal-text {
    font-size: 0.8rem;
    margin-top: 1rem;
    color: #8899aa; /* colore esplicito invece di opacity: migliore contrasto WCAG */
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

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

@keyframes shimmer {
    100% {
        left: 200%;
    }
}

/* ======================
    ABOUT ME SECTION 
   ====================== */
.about-section {
    padding: 6rem 8%;
    background: var(--bg-lighter);
    position: relative;
    z-index: 2;
}

.about-split {
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 1600px;
    margin: 0 auto;
}

.about-image {
    flex: 0 0 500px;
    position: relative;
}

.about-photo {
    width: 100%;
    border-radius: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border: 2px solid rgba(255,255,255,0.05);
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.about-photo:hover {
    transform: translateY(-10px) rotate(1deg);
    border-color: rgba(59, 130, 246, 0.3);
}

.about-text {
    flex: 1;
}

.about-subtitle {
    font-size: 1.25rem;
    color: #60a5fa; /* Migliorato contrasto dal vecchio var(--primary) */
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.about-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.about-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ======================
    RESPONSIVE DESIGN 
   ====================== */
@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 8rem;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
    
    .app-showcase, .app-showcase.reverse {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
        margin-bottom: 4rem;
    }
}

@media (max-width: 600px) {
    nav {
        padding: 0.9rem 4%;
        gap: 0.5rem;
    }
    .logo {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-shrink: 1;
        min-width: 0;
    }
    .lang-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    .lang-switch {
        gap: 0.15rem;
        flex-shrink: 0;
        padding: 0.2rem;
    }
}

@media (max-width: 380px) {
    nav {
        padding: 0.8rem 3%;
    }
    .logo {
        font-size: 0.9rem;
    }
    .lang-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* ── Nav-right wrapper ── */
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ── Hamburger button ── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s;
}
.hamburger:hover { background: rgba(255,255,255,0.08); }

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animated X when open */
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
    .hamburger { display: flex; }

    .links {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.97);
        backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 1.5rem 5%;
        gap: 0;
        border-bottom: 1px solid var(--glass-border);
        z-index: 999;
        box-sizing: border-box;
    }

    .links.mobile-open {
        display: flex;
    }

    .links a {
        padding: 0.85rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        font-size: 1rem;
    }

    .links a:last-child { border-bottom: none; }
}


/* ── Mobile Typography - Global ── */
@media (max-width: 768px) {
    .hero h1 { font-size: clamp(1.9rem, 7vw, 2.8rem); }
    .hero p  { font-size: 1rem; }
    h1 { font-size: clamp(1.7rem, 6vw, 2.5rem); }
    h2 { font-size: clamp(1.3rem, 5vw, 2rem); }
    h3 { font-size: clamp(1.1rem, 4vw, 1.5rem); }
    .hub-intro h2 { font-size: clamp(1.4rem, 5vw, 2rem); }
    .hub-intro p  { font-size: .95rem; }
    .section-title { font-size: clamp(1.3rem, 5vw, 2rem) !important; }
    .content-section { padding: 3.5rem 5%; }
}
